Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
declare and define functions
function removeTodo(e) { if (e.target.parentElement.classList.contains('delete-item')) { e.target.parentElement.parentElement.classList.add('fadeOut'); setTimeout(() => { e.target.parentElement.parentElement.remove() }, 990); e.stopPropagation(); } else if (e.target.tagName = 'li') { e.target.classList.toggle('done'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Func_s() {\n}", "function FunctionUtils() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "defineFn(name, words) {this.fnDefs[name] = words;}", "function funcionPorDefinicion(){\n //Body\n }", "function miFuncion (){}", "function miFuncion(){\n\n}", "function functionDeclaration() {}", "FunctionDeclaration() {\n pushContext();\n }", "function __func(){}", "function fun() { }", "function fuctionPanier(){\n\n}", "function import_funcs(funcs) {\n \"use strict\";\n Dum_Dum_Boom_Boom.common.base.eachs(funcs, function (name, func) {\n window[name] = func;\n });\n }", "function fm(){}", "function Declare() {\r\n}", "function india() {\n console.log('warm');\n} //! Function declaration is defined during the parsing of the code", "function fuction() {\n\n}", "function ea(){}", "function _____SHARED_functions_____(){}", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "function fn() {\n\t\t }", "function DeclareFunction(node, print) {\n\t this.push(\"declare function \");\n\t print.plain(node.id);\n\t print.plain(node.id.typeAnnotation.typeAnnotation);\n\t this.semicolon();\n\t}", "function DeclareFunction(node, print) {\n\t this.push(\"declare function \");\n\t print.plain(node.id);\n\t print.plain(node.id.typeAnnotation.typeAnnotation);\n\t this.semicolon();\n\t}", "function Ha(){}", "function lalalala() {\n\n}", "function fn() {}", "function declaration() {\n console.log(\"Hi, I'm a function declaration!\");\n }", "function myFunction() {}", "function auto() {}", "function DeclareFunction(node, print) {\n this.push(\"declare function \");\n print.plain(node.id);\n print.plain(node.id.typeAnnotation.typeAnnotation);\n this.semicolon();\n}", "function declaration() {\n console.log('I am a function declaration.');\n}", "function myFunc1() {}", "function myFunction() {\r\n function display() {\r\n console.log('dddd');\r\n }\r\n // public functions\r\n return {\r\n add: function(a, b) {\r\n return a + b;\r\n },\r\n mult: function(a, b) {\r\n return a * b;\r\n }\r\n };\r\n}", "function func(){\r\n\r\n}", "function foo1() {\n function foo1a() {\n\n }\n\n function foo1b() {\n \n }\n}", "function abc() {\n\n}", "function someFunc() {}", "function da(){}", "function da(){}", "function da(){}", "function fCommonFunctionalities () {\n\n }", "function Basic1() {\n}", "function register(name, fn, checkArgs, returns) {\n\t MISC_FUNCTIONS[name] = {\n\t checkArguments: checkArgs,\n\t evaluatedArgs: true,\n\t evaluate: fn,\n\t type: returns\n\t };\n\t }", "function blabla() {\n\n}", "'ev'(env) {\n var args = this.args.map(function (a) {\n return a.ev(env);\n });\n\n for (var i = 0; i < args.length; i++) {\n if (args[i].is === 'undefined') {\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n }\n\n if (this.name in CartoCSS.Tree.functions) {\n if (CartoCSS.Tree.functions[this.name].length <= args.length) {\n var val = CartoCSS.Tree.functions[this.name].apply(CartoCSS.Tree.functions, args);\n if (val === null) {\n env.error({\n message: 'incorrect arguments given to ' + this.name + '()',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {is: 'undefined', value: 'undefined'};\n }\n return val;\n } else {\n env.error({\n message: 'incorrect number of arguments for ' + this.name +\n '(). ' + CartoCSS.Tree.functions[this.name].length + ' expected.',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n } else {\n var fn = CartoCSS.Tree.Reference.mapnikFunctions[this.name];\n if (fn === undefined) {\n var functions = toPairs(CartoCSS.Tree.Reference.mapnikFunctions);\n // cheap closest, needs improvement.\n var name = this.name;\n var mean = functions.map(function (f) {\n return [f[0], CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];\n }).sort(function (a, b) {\n return a[1] - b[1];\n });\n env.error({\n message: 'unknown function ' + this.name + '(), did you mean ' +\n mean[0][0] + '(' + mean[0][2] + ')',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n if (fn !== args.length &&\n // support variable-arg functions like `colorize-alpha`\n fn !== -1) {\n env.error({\n message: 'function ' + this.name + '() takes ' +\n fn + ' arguments and was given ' + args.length,\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n } else {\n // Save the evaluated versions of arguments\n this.args = args;\n return this;\n }\n }\n }", "function myFunction() { //declaring and initializing a function\n return 1+2; //as mentioned before, this function is now available anywhere \n}", "function wa(){}", "function exampleFunction1() {\n /* SOME CODE */\n }", "function newFunction(){ //function declaration\n console.log(\"hello world\");\n }", "function funcDeclare() {\n console.log(\"Function declared inside if\");\n }", "function test() {}", "function Utils() {}", "function Utils() {}", "function fun1( /*parametros opcionais*/ ){ /*retorno opcional*/ }", "function Xa(){}", "function Macex() {\r\n}", "function MyFunction(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "\"function name\"(){\n //do thing\n }", "function an(){}", "function InitFunction()\n{\n play = function(g) {\n alert(\"Error play function isn't override by a StepX.js file\");\n };\n\n ValidBtnClick = function () {\n alert(\"Error ValidBtnClick function isn't override by a StepX.js file\");\n }\n\n UseComboClick = function () {\n alert(\"Error UseComboClick function isn't override by a StepX.js file\");\n }\n\n RollDiceClick = function () {\n alert(\"Error RollDiceClick function isn't override by a StepX.js file\");\n }\n\n CancelBtnClick = function () {\n alert(\"Error CancelBtnClick function isn't override by a StepX.js file\");\n }\n}", "function customFunction() {\n //Statements\n }", "function declareMethods(...args) {\n args.forEach(f => declareMethod(f))\n}", "function a() {}", "function a() {}", "function a() {}", "function fun1(){}", "function fun1(){}", "function question4() {\n question2('functions in functions');\n}", "function declaredFunctionTwo(a, b) {\n return a * b;\n}", "function Xuice() {\r\n}", "function foo1() {\n function foo1a() {\n }\n function foo1b() {\n }\n}", "function sayHello(){\n console.log('Hello, from Declaration');\n}", "function myFunc() { \n\n}", "function myFunction() {\n}", "function Common() {\n\n}", "function func1() {}", "function foo() {...}", "function ExportedMethods () {\n}", "function ExportedMethods () {\n}", "function functionStructure(parameterOne, parameterTwo, parameterThree) { //function declaration syntax.\n //body of prescribed code here.\n}", "function myFunction() {\n \n}", "function fun1(){ }", "function fun1(){ }", "function sf(){}", "function fun1() {}", "function fun1() {}", "function exampleFunctionToRun(){\n\n }", "function defineFunctionBuilders({type, htmlBuilder, mathmlBuilder}) {\n defineFunction({type, names: [], props: {numArgs: 0},\n handler() { throw new Error('Should never be called.'); },htmlBuilder});\n}", "function one(){\n \n}", "function declaration() {\n console.log(\"I'm a function declaration!\");\n}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}" ]
[ "0.68294686", "0.6810166", "0.67522496", "0.67522496", "0.67522496", "0.6743535", "0.6648959", "0.66203225", "0.6489276", "0.63752633", "0.6362536", "0.6330183", "0.6318002", "0.6304405", "0.6297787", "0.6279943", "0.62477136", "0.6216903", "0.61897624", "0.6152347", "0.61447006", "0.6074278", "0.60537475", "0.60493916", "0.60493916", "0.60353994", "0.60350156", "0.6016434", "0.6000227", "0.59773", "0.59718335", "0.5961956", "0.59577", "0.5945674", "0.59453845", "0.59267676", "0.59251344", "0.5923887", "0.5918698", "0.59171534", "0.59171534", "0.59171534", "0.591592", "0.58998233", "0.5886575", "0.58828956", "0.58795595", "0.58768934", "0.5868008", "0.5866011", "0.58638054", "0.5860678", "0.5860018", "0.5855375", "0.5855375", "0.5853715", "0.58477116", "0.5847301", "0.58421785", "0.5841932", "0.5841932", "0.5841932", "0.5841932", "0.58363587", "0.5834275", "0.58264494", "0.58250535", "0.58235985", "0.5814956", "0.5814956", "0.5814956", "0.5812097", "0.5812097", "0.58073664", "0.5806532", "0.5804449", "0.58029646", "0.5802805", "0.5802536", "0.5798309", "0.5796877", "0.5794615", "0.5793394", "0.57901686", "0.57901686", "0.5789192", "0.57851666", "0.57845724", "0.57845724", "0.577921", "0.5777044", "0.5777044", "0.5775374", "0.57747173", "0.5772528", "0.5770402", "0.576745", "0.576745", "0.576745", "0.576745", "0.576745" ]
0.0
-1
method to sort elements in increasing order
function sort() { elementArray.sort(function (x, y) { return x.elem - y.elem; }); render(elementArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Sort() {}", "sort() {\n for (let i = 0; i < this.values.length - 1; i++) {\n let min = i;\n for (let j = i + 1; j < this.values.length; j++) {\n if (this.values[j] < this.values[min]) min = j;\n }\n\n this.swap(i, min);\n }\n }", "function inssort2(A) {\n var temp;\n for (var i = 1; i < A.length; i++) // Insert i'th record\n for (var j = i; (j > 0) && (A[j] < A[j - 1]); j--) {\n temp = A[j]; A[j] = A[j - 1]; A[j - 1] = temp;\n }\n}", "function sortAsc(arr) {\n let t = arr.length;\n var temp;\n\n for (var i = 0; i <= t; i++) {\n for (var j = 0; j < t; j++) {\n // compara se o elemento atual é maior que o seguinte\n if (arr[j] > arr[j+1]) {\n // armazena o elemento atual\n temp = arr[j];\n // substitui o elemento atual pelo seguinte\n arr[j] = arr[j+1];\n // recupera o valor atual e substitui no seguinte\n arr[j+1] = temp;\n }\n }\n }\n return arr;\n}", "sort() {\n let a = this.array;\n const step = 1;\n let compares = 0;\n for (let i = 0; i < a.length; i++) {\n let tmp = a[i];\n for (var j = i; j >= step; j -= step) {\n this.store(step, i, j, tmp, compares);\n compares++;\n if (a[j - step] > tmp) {\n a[j] = a[j - step];\n this.store(step, i, j, tmp, compares);\n } else {\n break;\n }\n }\n a[j] = tmp;\n this.store(step, i, j, tmp, compares);\n }\n this.array = a;\n }", "sort() {\n\t}", "sort() {\n\t}", "sort(){\n\n }", "Sort() {\n\n }", "static sortItems()\n {\n //bubble sort\n var length = Explorer.items.length;\n for (var i = 0; i < length; i++) {\n for (var j = 0; j < (length - i - 1); j++) {\n //sort by type, if same type sort by name\n if((Explorer.items[j].type > Explorer.items[j+1].type) ||\n (\n Explorer.items[j].type == Explorer.items[j+1].type &&\n Explorer.items[j].name > Explorer.items[j+1].name\n )\n ) {\n //Swap the numbers\n var tmp = Explorer.items[j]; //Temporary variable to hold the current number\n Explorer.items[j] = Explorer.items[j+1]; //Replace current number with adjacent number\n Explorer.items[j+1] = tmp; //Replace adjacent number with current number\n }\n }\n }\n }", "function ascSort(a,b){\n return a - b;\n }", "sorted(x) {\n super.sorted(0, x);\n }", "function arrangeElements( array ) {\r\n\tarray = array.sort();\r\n\treturn array;\r\n}", "function sortNumbersAscending(a, b) {\n\t return a - b;\n\t}", "function rendez(array) {\n for (var j = array.length - 1; j > 0; j--) {\n for (var i = array.length - 1 - j; i >= 0; i--) {\n if (array[i] > array[i + 1]) {\n var newelement = array[i];\n array[i] = array[i + 1];\n array[i + 1] = newelement;\n }\n }\n }\n}", "function sort_li(a, b) {\n return ($(b).data('seq')) < ($(a).data('seq')) ? 1 : -1;\n }", "function increasingOrder(key){\n\n }", "function sortAsc(a, b) {\n return a - b;\n }", "function ordena(v){\n //algoritmo do buble sort\n for(let i=0; i<v.length; i++){\n for(let j=0;j<v.length-1; j++){\n if(v[j]> v[j+1]){\n //troca\n let aux = v[j]\n v[j] = v[j+1]\n v[j+1] = aux\n }\n }\n }\n //return v\n}", "addAscending() {\n var main = this.head;\n var mainHead = null;\n while (main) {\n var n = new node(main.element);\n var flag = true;\n if (mainHead == null) {\n\n mainHead = n;\n this.head = mainHead;\n }\n else {\n var prev = mainHead, current = mainHead;\n if (current.next == null) {\n if (n.element < current.element) {\n n.next = current;\n mainHead = n;\n flag = false;\n }\n }\n while (current && flag) {\n if (n.element < current.element) {\n prev.next = n;\n n.next = current;\n flag = false;\n }\n prev = current;\n current = current.next;\n }\n if (flag) {\n prev.next = n;\n }\n }\n main = main.next;\n }\n return this.head = mainHead;\n }", "static sort(arr) {\n const n = arr.length;\n \n for (let i = 1; i < n; i++) {\n for (let j = i; j > 0 && less(arr[j], arr[j - 1]); j--) {\n swap(arr, j, j - 1);\n }\n }\n }", "function sortNumAsc() {\n let array = [9, 2, 0, 5, 3, 6, 1, 7, 8, 4];\n\n for (let i = array.length; i >= 0; i--) {\n for (let j = array.length - 1; j >= 0; j--) {\n if (array[i] > array[j]) {\n let tempNum = array[i];\n array[i] = array[j];\n array[j] = tempNum;\n }\n }\n }\n\n return array;\n}", "function numericalArraySortAscending(a, b)\n{\n return (a-b);\n}", "function numSort(a,b) { \n\t\t\t\treturn a - b; \n\t\t\t}", "function sortData(data)\n\t{\n\t\tfor (let i = 0; i < data.length; i++)\n \t{\n\t \tfor (let j = 0; j < data.length - i - 1; j++)\n\t \t{\n\t \t\tif (+data[j].subCount < +data[j + 1].subCount)\n\t \t\t{\n\t \t\t\tlet tmp = data[j];\n\t \t\t\tdata[j] = data[j + 1];\n\t \t\t\tdata[j + 1] = tmp;\n\t \t\t}\n\t \t}\n \t}\n \treturn data;\n\t}", "function sortdisheshightolow(o) {\r\n\tvar swapped=true;\r\n\twhile (swapped==true){\r\n\t\tswapped=false;\r\n\t\tfor (var i= 0; i<o.length-1; i++){\r\n\t\t\tif (o[i].price<o[i+1].price){\r\n\t\t\t\tvar temp = o[i];\r\n\t\t\t\to[i]=o[i+1];\r\n\t\t\t\to[i+1]=temp;\r\n\t\t\t\tswapped=true;\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t}\r\n\r\n return o;\r\n}", "_orderSort(l, r) {\n return l.order - r.order;\n }", "function newOrder(numeros) {\n\n numeros.sort(function(a,b) {\n return a -b ;\n });\n return console.log(numeros);\n}", "function start()\n{\n var a = [ 10, 1, 9, 2, 8, 3, 7, 4, 6, 5 ];\n\n outputArray( \"Data items in original order: \", a,\n document.getElementById( \"originalArray\" ) ); \n a.sort( compareIntegers ); // sort the array\n outputArray( \"Data items in ascending order: \", a,\n document.getElementById( \"sortedArray\" ) ); \n} // end function start", "function sortAsc(a, b) {\n return a[1] - b[1];\n }", "function Numsort(a,b) { return a - b; }", "function Sort(arr)\n{\n\n}", "function VardenSorter2018(){\n var list, i, sortera, b, borSortera;\n list = document.getElementById(\"varden\");\n sortera = true;\n while (sortera) {\n sortera = false;\n b = list.getElementsByTagName(\"LI\");\n for (i = 0; i < (b.length - 1); i++) {\n borSortera = false; \n if (Number(b[i].innerHTML) < Number(b[i + 1].innerHTML)) {\n borSortera = true;\n break;\n }\n }\n if (borSortera) {\n b[i].parentNode.insertBefore(b[i + 1], b[i]);\n sortera = true;\n }\n }\n}", "function compare_asc(a, b) {\n return a - b;\n}", "function rankitup(array) {\narray.sort(function(a, b){return a-b});\n}", "function sortItems(arr) {\r\n return arr.sort();\r\n}", "function sort(theArray){\n\n}", "function sortFunction(val){\n return val.sort();\n}", "function sort_ascending (a, b) \n {\n if (a < b) return -1;\n if (a > b) return 1;\n return 0;\n }", "function sorter(a,b) {\n return a - b;\n}", "function sort(arr){\n\t\n for(var i = 0; i < arr.length; i++){\n\n for(var j = 0; j < ( arr.length - i -1 ); j++){\n if(arr[j] < arr[j+1]){\n var temp = arr[j]\n arr[j] = arr[j + 1]\n arr[j+1] = temp\n }\n }\n }\n console.log(arr);\n }", "function sorted(arr){\n\t\tfor (let i=0; i< arr.length -1; i++){\n\t\t\tfor (let j=0; j< arr.length - i -1 ; j++){\n\n\t\t\t\tif (arr[j] > arr[j+1]){\n\t\t\t\t\tlet temp = arr[j]\n\t\t\t\t\tarr[j] = arr[j+1]\n\t\t\t\t\tarr[j+1] = temp\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn arr\n\n\t}", "function sort(){\n var toSort = S('#sched-list').children;\n toSort = Array.prototype.slice.call(toSort, 0);\n\n toSort.sort(function(a, b) {\n var a_ord = +a.id.split('e')[1]; //id tags of the schedule items are timeINT the INT = the numeric time\n var b_ord = +b.id.split('e')[1]; //splitting at 'e' and getting the element at index 1 gives use the numeric time\n\n return (a_ord > b_ord) ? 1 : -1;\n });\n\n var parent = S('#sched-list');\n parent.innerHTML = \"\";\n\n for(var i = 0, l = toSort.length; i < l; i++) {\n parent.appendChild(toSort[i]);\n }\n }", "function ascendingOrder(arr) {\n return arr.sort(function(a, b) {\n return a - b;\n });\n}", "function insertionSort10(arr) {\n let count = 0;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i + 1] < arr[i]) {\n [arr[i], arr[i + 1]] = [arr[i + 1], arr[i]];\n if (i > 1) {\n for (let j = i + 1; j <= 0; j--) {\n count++;\n if (arr[i] < arr[j]) {\n [arr[j], arr[i]] = [arr[i], arr[j]];\n }\n console.log(\"current array :\", arr);\n }\n }\n }\n }\n console.log(\"Count:\", count);\n return arr;\n}", "function sortingAscendingOrder(arr){\n return arr.sort((val1, val2) => val1 - val2);\n}", "function insertionSort(arr) {\n \n}", "function sort(argument) {\r\n return argument.sort();\r\n}", "function numsort(a, b) {return (a - b);}", "function increasing(array) {\n \n for(let i=0; i<array.length;i++) {\n for(let j=0; j<i;j++) {\n if (array[i] < array[j]) {\n let temp = array[i] \n array[i] = array[j];\n array[j] = temp;\n }\n }\n } return array;\n}", "_prioritySort(l, r) {\n return r.priority - l.priority;\n }", "function _insertionSort (arr) {\n var defer = new $.Deferred();\n\n for (var i = 1; i < arr.length; i++) {\n for (var j = i; j > 0; j--) {\n if (arr[j] < arr[j - 1]) {\n var temp = arr[j];\n arr[j] = arr[j - 1];\n arr[j - 1] = temp;\n }\n };\n // document.write(arr.toString() + '<br>');\n }\n\n defer.resolve(arr);\n return defer.promise();\n }", "function ascending(a, b) {\n return a - b;\n}", "function insertionSort(arr){\n for(let i = 1; i < arr.length; i++){\n for(let j = i + 1; j >= 0; j--){\n //compare each element with the previous ones\n if(arr[j] < arr[j - 1]){\n let temp = arr[j - 1];\n arr[j - 1] = arr[j];\n arr[j] = temp;\n }\n }\n }\n return arr;\n}", "function asc(arr) {\n\t arr.sort(function (a, b) {\n\t return a - b;\n\t });\n\t return arr;\n\t }", "function sortRows(){\n sortRowsAlphabeticallyUpwards();\n}", "function urutAscending(array) {\r\n array.sort((a, b) => {\r\n return a - b\r\n })\r\nreturn array;\r\n}", "function numsort(a, b) {\n return b - a;\n }", "sort() {\n var main = this.head;\n var mainHead = null;\n while (main) {\n var n = new node(main.element);\n var flag = true;\n if (mainHead == null) {\n mainHead = n;\n this.head = mainHead;\n } else {\n var pre = mainHead, curr = mainHead;\n if (curr.next == null) {\n if (n.element < curr.element) {\n n.next = curr;\n mainHead = n;\n flag = false;\n }\n }\n while (curr && flag) {\n if (n.element < curr.element) {\n pre.next = n;\n n.next = curr;\n flag = false;\n }\n pre = curr;\n curr = curr.next;\n }\n if (flag) {\n pre.next = n;\n }\n }\n main = main.next;\n }\n return this.head = mainHead;\n }", "function sortV(x_in) {\r\n var y = []; x = x_in;\r\n var lt=x.length;\r\n for (jgo = 1; jgo < lt; jgo++) {\r\n for (igo = 1; igo < lt; igo ++) {\r\n if (x[igo] < x[igo-1]) {\r\n tmp = x[igo];\r\n x[igo] = x[igo-1];\r\n x[igo-1] = tmp;\r\n }\r\n }\r\n }\r\n y = x;\r\n return y;\r\n }", "function sortByPages() {\n let nodes = document.querySelectorAll('.bookCard')\n let lengths = []\n nodes.forEach(node => lengths.push(library[node.dataset.index].numPages))\n lengths.sort((a, b) => a - b)\n console.log(lengths)\n let order\n nodes.forEach((node) => {\n console.log(node)\n order = lengths.findIndex(x => x === library[node.dataset.index].numPages)\n node.style.order = order\n })\n}", "function sortList( list ) {\n let switched = true;\n while( switched ) {\n switched = false;\n if ( list.childElementCount ) {\n // for ( let i = 0; i < list.childElementCount - 1; i++ ) {\n for ( let i = 0; i < list.childElementCount; i++ ) {\n let item = list.children[i];\n let idNumber = item.id.match( /\\d+/ )[0];\n let nextItem = list.children[i+1];\n let nextIdNumber = nextItem ? nextItem.id.match( /\\d+/ )[0] : null;\n if ( nextIdNumber && idNumber > nextIdNumber ) {\n // console.log('idNumber:', idNumber, 'nextIdNumber:', nextIdNumber);\n list.insertBefore( nextItem, item );\n switched = true;\n }\n }\n }\n }\n }", "function numsort(a, b) {\n return b - a;\n }", "function sortab(a,b){\n return a - b;\n }", "function sortArrayDesc(arr) {\n var num = 0;\n for (var i = 0;i<arr.length;i++){\n for (var j = 0;j<arr.length-i;j++){\n if (arr[j]<arr[j+1]){\n num=arr[j];\n arr[j]=arr[j+1];\n arr[j+1]=num;\n }\n }\n }\n return arr;\n}", "function sortdisheslowtohigh(o) {\r\n\tvar swapped=true;\r\n\twhile (swapped==true){\r\n\t\tswapped=false;\r\n\t\tfor (var i= 0; i<o.length-1; i++){\r\n\t\t\tif (o[i].price>o[i+1].price){\r\n\t\t\t\tvar temp = o[i];\r\n\t\t\t\to[i]=o[i+1];\r\n\t\t\t\to[i+1]=temp;\r\n\t\t\t\tswapped=true;\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t}\r\n // alert(\"You have to sort the dishes by price!\");\r\n return o;\r\n}", "function insertionSort(arr){\n let currentVal =0;\n for(let i =1; i<arr.length; i++){\n currentVal = arr[i];\n for(var j=i-1; j>=0&&currentVal<arr[j]; j--){\n arr[j+1] = arr[j]\n }\n arr[j+1] =currentVal;\n\n }\n\n\n return arr;\n}", "function sortArray(a) {\n // From start to \"this point\" | Controller\n for (var i = 0; i <= a.length; i++) {\n // Moving the elements to the next point \n for (var j = 0; j < a.length + i + 1; j++) {\n //Swap value\n if (a[j] > a[j + 1]) {var temp = a[j];\n a[j] = a[j + 1]; \n a[j + 1] = temp;}\n }\n }\n return a.pop();\n}", "function sortByPriority(arr) {\n clock = 0;\n arr.sort((a, b) =>{\n return b.priority - a.priority\n })\n}", "function increaseSubSort(iOrder) {\n\t\t\tfSubSort += 0.01;\n\t\t\treturn iOrder + fSubSort;\n\t\t}", "function _reorderElems() {\n\t\t\tchildren.detach().sort(function(a, b) {\n\t\t\t\treturn \toptions.order === 'asc' ?\n\t\t\t\t\t\t$(a).data('year') - $(b).data('year') :\n\t\t\t\t\t\t$(b).data('year') - $(a).data('year');\n\t\t\t});\n\n\t\t\t$el.append(children);\n\t\t}", "function sort(array) {\n var buf;\n\n for (var j = 0; j < array.length-1; j++)\n for (var i = 0; i < array.length-j; i++) {\n if (array[i] > array[i+1]) {\n buf = array[i];\n array[i] = array[i+1];\n array[i+1] = buf;\n }\n }\n\n return array;\n }", "function sortAscending(){\n \n var series = [1, 0, 0, 0, 1, 1,0];\n return series.sort()\n}", "function basicSort (first, second) {\r\n\treturn first - second;\r\n}", "function insertionSort(arr) {\n\tfor (let i = 1; i < arr.length; i++) {\n\t\tconst currentItem = arr[i];\n\n\t\tfor (var j = i; j >= 0 && currentItem > arr[j]; j--) {\n\t\t\tarr[j + 1] = arr[j];\n\t\t}\n\n\t\tarr[j] = currentItem;\n\t}\n\n\treturn arr;\n}", "function sortByAge(arr) {\n return arr.sort((a,b) => a.age - b.age); // increment\n}", "function sortNameUp(arr) {\n return arr.sort()\n }", "function sort(a, b) {\n return a - b;\n}", "function sortPlaylist() {\n playlistArr = Object.entries(livePlaylist);\n\n if (playlistArr.length > 2) {\n var sorted = false;\n while (!sorted) {\n sorted = true;\n for (var i = 1; i < playlistArr.length - 1; i++) {\n if ((playlistArr[i][1].upvote < playlistArr[i + 1][1].upvote)) {\n sorted = false;\n var temp = playlistArr[i];\n playlistArr[i] = playlistArr[i + 1];\n playlistArr[i + 1] = temp;\n // })\n }\n // playlistArr[i][1].index = i;\n }\n }\n }\n return playlistArr;\n}", "function sort_array_x(array){\n\tend = array.length - 1;\n\tfor(start = 0; start < array.length - 1; start++){\n\t\tstart_x = array[start].x;\n\t\tend_x = array[end].x;\n\t\tif(end_x < start_x){\n\t\t\tswap_start = array[start];\n\t\t\tarray[start] = array[end];\n\t\t\tarray[end] = swap_start;\n\t\t}\n\t}\n}", "function InsertionSort(arr){\nfor(let i = 1;i<arr.length;i++){\n\tlet current = arr[i];\n\tfor(var j = i-1;j >= 0 && arr[j] > current;j--){\n\t\tarr[j+1] = arr[j];\n\t}\n\tarr[j+1] = current;\n}\nreturn arr;\n}", "function inssortshift2(A) {\n for (var i = 1; i !== A.length; i++) { // Insert i'th record\n var j;\n var temp = A[i];\n for (j = i; (j !== 0) && (temp < A[j - 1]); j--)\n A[j] = A[j-1];\n A[j] = temp;\n }\n}", "function lis(a) {\n var p = a.slice();\n var result = [];\n result.push(0);\n var u;\n var v;\n for (var i = 0, il = a.length; i < il; ++i) {\n if (a[i] === -1) {\n continue;\n }\n var j = result[result.length - 1];\n if (a[j] < a[i]) {\n p[i] = j;\n result.push(i);\n continue;\n }\n u = 0;\n v = result.length - 1;\n while (u < v) {\n var c = (u + v) / 2 | 0;\n if (a[result[c]] < a[i]) {\n u = c + 1;\n } else {\n v = c;\n }\n }\n if (a[i] < a[result[u]]) {\n if (u > 0) {\n p[i] = result[u - 1];\n }\n result[u] = i;\n }\n }\n u = result.length;\n v = result[u - 1];\n while (u-- > 0) {\n result[u] = v;\n v = p[v];\n }\n return result;\n}", "function start() {\n\tvar a = [10, 1, 9, 2, 8, 3, 7, 4, 6, 5];\n\n\toutputArray(\"Data items in original order: \", a, document.getElementById('originalArray'));\n\ta.sort(compareIntegers); //sort the array\n\toutputArray(\"Data items in ascending order: \", a, document.getElementById('sortedArray'));\n} //end function start", "function compare(unorderedArray, i) {\n if (unorderedArray[i] >= unorderedArray[i + 1]) {\n swap(i, unorderedArray);\n }\n}", "function orderlyInsert(arr,ele){\n if(arr.length == 0){\n arr.push(ele);\n return 0;\n }\n if(arr[arr.length - 1] < ele){\n arr.push(ele);\n return arr.length - 1;\n }\n\n if(arr[0] > ele){\n arr.splice(0,0,ele);\n return 0;\n }\n\n // for(let i = 0;i<arr.length;i++){\n // if(ele<arr[i]){\n // arr.splice(i,0,ele);\n // return i;\n // }\n // }\n\n let left = 0,right = arr.length - 1;\n while(true){\n let mid = (left + right)//2;\n if(ele < arr[mid]){\n right = mid -1;\n continue;\n }\n else if(ele > arr[mid + 1]){\n left = mid + 2;\n }\n else{\n // console.log(mid);\n arr.splice(mid + 1,0,ele);\n return mid + 1;\n }\n }\n}", "function insertionSortC(arr){\n\n for(let i = 1; i < arr.length; i++){\n let currentVal = arr[i];\n for(var j = i - 1; j >= 0 && arr[j] > currentVal; j--){\n arr[j + 1] = arr[j];\n }\n arr[j + 1] = currentVal;\n }\n return arr;\n}", "function sortNumeric(val1, val2)\n{\n return val1 - val2;\n}", "function sortFunction ( a, b ) { \n\t\t if (a[0] - b[0] != 0) {\n\t\t return (a[0] - b[0]);\n\t\t } else if (a[1] - b[1] != 0) { \n\t\t return (a[1] - b[1]);\n\t\t } else { \n\t\t return (a[2] - b[2]);\n\t\t }\n\t\t }", "_siftUp() {\n var i;\n var parent;\n\n for (i = this.n;\n i > 1 && (parent = i >> 1) && this._comparator.greaterThan(\n this._elements[parent], this._elements[i]);\n i = parent) {\n this._swap(parent, i);\n }\n }", "function sortArr(a, b){\n return a - b ;\n }", "function sortNumericallyAscending() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utLinesUtility,\n }, function (up) {\n var keylines = up.inlines.map((function (line) {\n var match = line.match(/(\\d+)/);\n var key = match ? parseInt(match[0]) : 0;\n return [key, line];\n }));\n keylines.sort(function (a, b) { return a[0] - b[0]; });\n return keylines.map(function (keypair) { return keypair[1]; });\n });\n }", "function insertionSort(arr) {\n for(var i = 1; i < arr.length; i++) {\n var currentVal = arr[i];\n for(var j = i - 1; j >= 0 && arr[j] > currentVal; j--) {\n arr[j+1] = arr[j]\n }\n arr[j+1] = currentVal;\n console.log(arr);\n }\n return arr;\n}", "get sortingOrder() {}", "function asc(arr) {\n arr.sort(function (a, b) {\n return a - b;\n });\n return arr;\n}", "function orderSortingFunction(v1, v2)\r\n{\r\n return (v1[1] == v2[1] ? v1[2] - v2[2] : v1[1] - v2[1]);\r\n}", "sort() {\n for (let c = 0; c < this._unsorted.length; c++) {\n const el = this._unsorted[c];\n\n // element may not even be a LitXR Web Component, it could be\n // a normal div, button, etc - therefore recursion may be needed to find its surface\n const surface = el.surface ? el.surface : LitXR.findSurface(el);\n\n // can't depend on surface existing due to timing issues when the component is first starting up, so defer processing\n if (!surface) { return; } // TODO: don't return, manage the unsorted list better\n\n if (this._sorted.has(surface)) {\n this._sorted.get(surface).push(el);\n } else {\n this._sorted.set( surface, [el]);\n }\n }\n this._unsorted = [];\n }", "function alfa (arr){\n\tfor (var i = 0; i< arr.length;i++){\n\t\tarr[i].sort();\n\t}\n\treturn arr;\n}", "function sort( a , b){\n if(a > b) return -1;\n if(a < b) return 1;\n return 0;\n}", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }" ]
[ "0.7060759", "0.6896462", "0.68567777", "0.6790868", "0.6756659", "0.67541265", "0.67541265", "0.67174035", "0.66584164", "0.6652928", "0.6579025", "0.6575241", "0.6563861", "0.6518153", "0.6456966", "0.6426366", "0.6404954", "0.6399028", "0.63872916", "0.6385722", "0.6358717", "0.6336391", "0.6335624", "0.6324774", "0.6323066", "0.6317637", "0.6314461", "0.6309637", "0.63079965", "0.6299772", "0.6294837", "0.62884575", "0.62858427", "0.62745386", "0.626992", "0.6265856", "0.6256235", "0.62553567", "0.62552303", "0.62538654", "0.6251637", "0.62495035", "0.6248692", "0.62438846", "0.62397", "0.62368214", "0.62241775", "0.6221205", "0.6210756", "0.619823", "0.61876273", "0.6186273", "0.6182313", "0.61806536", "0.61757016", "0.61743057", "0.61733025", "0.6164566", "0.6159749", "0.61535597", "0.6148691", "0.61474913", "0.6142661", "0.61415637", "0.61209", "0.61168694", "0.61122966", "0.61099815", "0.6109595", "0.6103333", "0.61011356", "0.6097023", "0.6087837", "0.6086749", "0.60851175", "0.60736907", "0.6070502", "0.6063203", "0.6059109", "0.6051332", "0.6045959", "0.60390544", "0.60318846", "0.6027494", "0.6023962", "0.60234976", "0.6015984", "0.6006237", "0.59989256", "0.5990785", "0.59897107", "0.59887934", "0.59876716", "0.59868276", "0.5983308", "0.5982132", "0.59802145", "0.59784234", "0.5977685", "0.5975489" ]
0.6623251
10
function to display dynamically created elements
function render(elementArray) { document.getElementById('elements').innerHTML = ''; for(let i = 0; i < elementArray.length; i++) { let card = document.createElement("div"); let cardValue = document.createElement("div"); card.className = "col-md-4 col-sm-4 col-xs-12 card "+ elementArray[i].class; cardValue.className = "cardValue"; cardValue.innerHTML = elementArray[i].elem; card.appendChild(cardValue); document.getElementById("elements").appendChild(card); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayDOM(){\r\n\t\tvar str = '';\r\n\t\tcontainer.getChildren().each(function(item){\r\n\t\t\tstr += '<div style=\"' + item.style.cssText + '\">' + item.get('text') + '</div>\\n';\r\n\t\t});\r\n\t\tdocument.id('output').set('text', str);\r\n\t}", "function show(el){\r\n el = getList(el);\r\n\r\n for(var i = 0; i<el.length; i++){\r\n el[i].style.display = 'block';\r\n }\r\n return el;\r\n }", "function show(el){\r\n el = getList(el);\r\n\r\n for(var i = 0; i<el.length; i++){\r\n el[i].style.display = 'block';\r\n }\r\n return el;\r\n }", "display() {\n const contactsContainer = document.querySelector(\".contacts-container\");\n contactsContainer.innerHTML = \"\"; //remove the stuff already there\n for (let index in this.contacts) { //create an HTML element for each contact\n let el = document.createElement(\"div\");\n el.classList.add(\"contact-entry\");\n el.innerHTML = `\n ${this.contacts[index].displayHTML()}\n <button type=\"button\" i=\"${index}\" class=\"remove-btn\"><i class=\"material-icons\">delete</i></button>\n `;\n contactsContainer.append(el);\n }\n }", "function resultDisplay(d)\r\n\t {\r\n\t\tdocument.getElementById('dynamicContent').innerHTML = d;\r\n\t }", "function show(el){\n el = getList(el);\n\n for(var i = 0; i<el.length; i++){\n el[i].style.display = 'block';\n }\n return el;\n }", "function show(el){\n el = getList(el);\n\n for(var i = 0; i<el.length; i++){\n el[i].style.display = 'block';\n }\n return el;\n }", "function show(el){\n el = getList(el);\n\n for(var i = 0; i<el.length; i++){\n el[i].style.display = 'block';\n }\n return el;\n }", "function displayElements() {\n $(\"body\").append($(\"<button id='start'>Start</button>\"));\n $(\"#start\").click(function () {\n $(\"#start\").hide();\n $('header').css({ 'margin-top': '50px' });\n $(\".container\").show();\n initializeTimer();\n });\n }", "function displayButtons() {\n $(\".buttons-view\").empty();\n\n for (var i = 0; i < foodtopics.length; i++) {\n /*Do we want to put in a clear input field?\n anytime they look for a new food-that way they dont have to re-type this*/\n var showButton = $(\"<button>\");\n\n showButton.addClass(\"btnClass\");\n //added button animation (see eatin.css)\n showButton.addClass(\"animation-target\")\n\n showButton.attr(\"data-food\", foodtopics[i]);\n\n showButton.text(foodtopics[i]);\n\n $(\".buttons-view\").append(showButton);\n }\n }", "function displayEle() {\r\n //xhr request\r\n let xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", \"data/PeriodicTableJSON.json\", true);\r\n xhr.onload = function () {\r\n let data = JSON.parse(this.responseText);\r\n let eleData = data.elements;\r\n let html;\r\n let ele = document.getElementById(\"ele\");\r\n // displaying in ui\r\n eleData.forEach((element, index) => {\r\n html = `\r\n <h7 class=\"list-group-item list-group-item-action list-group-item-dark mt-2\" onclick='display(this.id)' id='${index}'>${index+1}. ${element.name} </h7>\r\n `;\r\n ele.innerHTML += html;\r\n });\r\n };\r\n xhr.send();\r\n}", "displayInfo() {\n clear(dogInfo())\n\n let image = document.createElement('img')\n image.src = this.image\n\n let h2 = document.createElement('h2')\n h2.innerText = this.name\n\n let button = document.createElement('button')\n button.innerText = this.buttonText()\n button.id = `toggle${this.id}`\n \n dogInfo().appendChild(image)\n dogInfo().appendChild(h2)\n dogInfo().appendChild(button)\n }", "function Display_showGameElements() {\n\tvar displayContent = document.getElementById(\"displayContent\");\n\n\tvar inputToCrib = document.createElementNS(this.xhtmlns, \"input\");\n\tinputToCrib.setAttribute(\"id\", \"inputToCrib\");\n\tinputToCrib.setAttribute(\"type\", \"button\");\n\tinputToCrib.setAttribute(\"value\", \"To Crib\");\n\tinputToCrib.setAttribute(\"onclick\", \"toCrib();\");\n\n\tvar inputPlay = document.createElementNS(this.xhtmlns, \"input\");\n\tinputPlay.setAttribute(\"id\", \"inputPlay\");\n\tinputPlay.setAttribute(\"type\", \"button\");\n\tinputPlay.setAttribute(\"value\", \"Play card\");\n\n\tdisplayContent.appendChild(inputToCrib);\n\tdisplayContent.appendChild(inputPlay);\n\n\t// Show deck and stack\n\tthis.createCard(null, 490, 10, 120, false);\n\tthis.createCard(null, 620, 10, 120, false);\n\n\t// Display count\n\tvar spanCountHeader = document.createElementNS(this.xhtmlns, \"span\");\n\tspanCountHeader.setAttribute(\"id\", \"spanCountHeader\");\n\tspanCountHeader.appendChild(document.createTextNode(\"Curent Play Count:\"));\n\n\tvar spanCount = document.createElementNS(this.xhtmlns, \"span\");\n\tspanCount.setAttribute(\"id\", \"spanCount\");\n\tspanCount.appendChild(document.createTextNode(\"0\"));\n\n\tvar whosCrib = document.createElementNS(this.xhtmlns, \"img\");\n\twhosCrib.setAttribute(\"id\", \"whosCrib\");\n\twhosCrib.setAttribute(\"src\", \"img/crib.png\");\n\n\tdisplayContent.appendChild(whosCrib);\n\tdisplayContent.appendChild(spanCountHeader);\n\tdisplayContent.appendChild(spanCount);\n}", "function show(el) {\n el = getList(el);\n\n for (var i = 0; i < el.length; i++) {\n el[i].style.display = 'block';\n }\n\n return el;\n }", "function displayNewMembers(){\n\n for (let i = 0; i < newMembers.length; i++) {\n //save printMembersHTML function in a variable\n const newMembersList = printMembersHTML(newMembers[i].image, newMembers[i].name, newMembers[i].mail, newMembers[i].date);\n //set attributes for new div section on createDivActivitiesSection function\n createDivActivitiesSection(newMembersList, 'new-member', newMembersSection );\n }\n\n}", "function showingInDomAlphabeth(totalNameArray) {\n\t/*getting elements from dom*/\n var alphabethContainer = document.getElementById(\"containerAlphabeth\");\n\t\n\tvar whiteContainer = document.getElementById(\"conteiner-text\");\n\t\n\t\n\t/*creating new elements*/\n\twhiteContainer.style.background = \"transparent\";\n\tvar li = document.createElement(\"li\");\n\tli.className += \"row collection-item\";\n\tvar p = document.createElement(\"p\");\n\tvar p1 = document.createElement(\"p\");\n\tp.className = \"green-text col m6 s6\";\n\t/*\tpNum.style.marginTop = \"7%\"; */\n\tp.style.fontSize =\"90%\";\n\tp1.style.fontSize =\"90%\";\n\tp1.textContent = \"Name:\"\n\tp.textContent = totalNameArray;\n\tp1.style.color= \"#f0cf7b\";\n\tp1.className= \"left\";\n\tli.appendChild(p1);\n\tli.appendChild(p);\n\talphabethContainer.appendChild(li);\t\t\n\tthis.addEventListener(\"click\", showingWholeInformation);\n}", "function display() {\n for (var i = 0; i < arrs.length; i++) {\n //tao the div va dat ten class\n var div = document.createElement(\"div\");\n div.className = \"product\";\n //tao the img\n var img = document.createElement(\"img\");\n img.src = arrs[i].image;\n //tao the p (mo to san pham)\n var px = document.createElement(\"div\");\n px.className = \"dix\"\n px.innerHTML = arrs[i].price + \" đ\";\n var p = document.createElement(\"p\");\n p.innerHTML = \"<div class='showra'>\" + \"<div class='name'>\" + arrs[i].name + \"</div>\" + \"<br>\" + arrs[i].detail + \"<a class='nutmua' href='#'onclick='add(\" + i + \")'><i class='fa fa-shopping-cart' aria-hidden='true' style='font-size:25px'></i></a>\" + \"</div>\";\n //dua vao lam con\n div.appendChild(img);\n div.appendChild(p);\n div.appendChild(px);\n //gan the div vao lam con body\n document.body.appendChild(div);\n }\n}", "function display() {\n for (var i = 0; i < arrs.length; i++) {\n //tao the div va dat ten class\n var div = document.createElement(\"div\");\n div.className = \"product\";\n //tao the img\n var img = document.createElement(\"img\");\n img.src = arrs[i].image;\n //tao the p (mo to san pham)\n var px = document.createElement(\"div\");\n px.className = \"dix\"\n px.innerHTML = arrs[i].price + \" đ\";\n var p = document.createElement(\"p\");\n p.innerHTML = \"<div class='showra'>\" + \"<div class='name'>\" + arrs[i].name + \"</div>\" + \"<br>\" + arrs[i].detail + \"<a class='nutmua' href='#'onclick='add(\" + i + \")'><i class='fa fa-shopping-cart' aria-hidden='true' style='font-size:25px'></i></a>\" + \"</div>\";\n //dua vao lam con\n div.appendChild(img);\n div.appendChild(p);\n div.appendChild(px);\n //gan the div vao lam con body\n document.body.appendChild(div);\n }\n}", "function buildAndShow () {\n\tsectionNameContainer.innerText = exercises[pointer].sectionName;\n\tsectionOrderContainer.innerText = exercises[pointer].sectionOrder;\n\tcontainer.innerHTML\t \t\t\t= exercises[pointer].buildExercise();\n}", "function showDetails(element)\n{\n element.lastChild.style.display = \"inline\";\n}", "function appendDetails() {\n document.getElementById(\"container\").style.display = \"none\";\n document.getElementById(\"detailsContainer\").style.display = \"block\";\n}", "function updateAddedComponentDisplay() {\n let addedComponentsDiv = document.getElementById(\"addedComponentsDiv\");\n let componentString = \"\";\n\n bodyArray.forEach((v, i) => {\n componentString += `<button class='addedComponent ${v.toLowerCase()}' value=\"${i}\">${v}</button>`;\n });\n\n addedComponentsDiv.innerHTML = componentString;\n }", "function _display(){\n\t\t\t$(levelID).html(level);\n\t\t\t$(pointsID).html(points);\n\t\t\t$(linesID).html(lines);\n\t\t}", "function displayButtons() {\n $('#button-display').empty();\n // loops through topics and creates buttons\n for (var i = 0; i < topics.length; i++) {\n var buttons = $('<button>');\n // adds the class gif to each button\n buttons.addClass('gif');\n // creates a unique value for each button\n buttons.attr('data-name', topics[i]);\n // adds text to the buttons\n buttons.text(topics[i]);\n // displays buttons in the button-display div\n $('#button-display').append(buttons);\n };\n}", "function displayEvent(event) {\n var display = '<div class=\"box\">';\n display += \"<p class=\\\"subtitle is-5\\\">\" + event.name + \"</p>\";\n display += createButton(EVENT_NOTIFY_TEXT, \"showNotifyEvent\", event._id, \"button is-small\",\n \"event_notification_button\"+event._id);\n display += '<div id=\"eventNotifyText' + event._id + '\"></div>'\n display += \"<br>\"\n var showNumber = 1;\n //display = displayShowsForEvent(event, display)\n event.shows.forEach((show) => {\n var list = \"<ul id=\\\"\" + show._id + \"\\\"></ul>\";\n var name = \"Show #\" + showNumber + \" on \" + prettyDate(show.start_date) + \" at \" + prettyTime(show.start_time);\n var tickets = \"<br>Tickets sold: \" + show.tickets_sold;\n var btn1 = createButton(TOGGLE_ATTENDEES_TEXT, \"viewShow\", show._id, \"button is-small\",\"show_button\"+show._id);\n var btn2 = createButton(SHOW_NOTIFY_TEXT, \"showNotifyShow\", show._id, \"button is-small\",\n \"show_notification_button\" + show._id);\n var notificationBox = '<div id=\"showNotifyText' + show._id + '\"></div>';\n display += name + tickets + \"<br>\" + \n btn1 + btn2 + notificationBox + list + \"<br>\";\n showNumber += 1;\n }); \n var footer = '<footer class=\"card-footer\">';\n footer += '<a href=\"/edit_event/'+encodeURI(event.name)+'\" class=\"card-footer-item\">Edit Event</a>'\n footer += '<a href=\"/view_stats/'+encodeURI(event.name)+'\" class=\"card-footer-item\">Statistics</a>'\n footer += '</footer>';\n display += footer;\n display += ' </div>'\n return display;\n}", "function displayButtons() {\n $(\"#button-box\").empty();\n for (var i = 0; i < topics.length; i++) {\n var button = $('<button>');\n button.addClass(\"dog-button\");\n button.attr(\"id\", topics[i]);\n button.attr(\"value\", i);\n button.html(topics[i]);\n $(\"#button-box\").append(button);\n console.log(\"working\");\n };\n }", "function display() {\n\t\t\t\t\t\t$(\"#uListPos\").html(\"Number: \" + (i+1) + \"/\" + (userList.length));\n\t\t\t\t\t\t$(\"#uListName\").html(\"User: \" + userList[i][1]);\n\t\t\t\t\t\t$(\"#uListFact\").html(\"Fact:<br>\" + userList[i][2]);\n\t\t\t\t\t}", "function displaysButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var btn = $(\"<button class='gifBtn'>\");\n btn.attr(\"data-name\", topics[i]);\n btn.text(topics[i]);\n $(\"#buttons-view\").append(btn)\n\n }\n }", "function fruitShow(){\n var fruit = document.getElementById('fruit-list');\n console.log(fruit);\n for(var i = 0; i < fruitStand.length; i++) {\n var createListEle = fruitStand[i].createLi();\n fruit.appendChild(createListEle);\n var genImg = fruitStand[i].showImage();\n fruit.appendChild(genImg);\n }\n}", "function displayDetails(x) {\n //accessing the array that we need//\n let jsonResults=x [\"recordSet\"][\"recordSetData\"];\n console.log(jsonResults)\n\n let results=document.getElementById(\"results\")\n\n\n for (let i=0; i<jsonResults.length; i++) {\n // console.log(jsonResults)\n\n let generalDiv=document.createElement(\"div\")\n generalDiv.id=\"insurance_results\"\n\n let pClass=document.createElement(\"p\");\n pClass.textContent = jsonResults[i][\"pClass\"];\n\n let companyName=document.createElement(\"p\");\n companyName.textContent = jsonResults[i][\"company\"]\n\n\n let paymentMode=document.createElement(\"p\");\n paymentMode.textContent = jsonResults[i][\"paymentMode\"];\n\n let premiumText=document.createElement(\"p\");\n premiumText.textContent = jsonResults[i][\"premiumText\"];\n\n let btn=document.createElement(\"button\");\n btn.classList=\"btn\";\n btn.textContent=\"SELECT\"\n\n\n generalDiv.append(companyName,pClass,paymentMode,premiumText,btn\n )\n\n results.append(generalDiv)\n console.log(results)\n \n }\n\n \n}", "function show() {\r\ndocument.getElementById(\"wins\").appendChild;\r\ndocument.getElementById(\"losses\").appendChild;\r\ndocument.getElementById(\"guesses\").appendChild;\r\ndocument.getElementById(\"lettersGuessed\").appendChild;\r\n\r\n}", "function display(argument){\n\t$('#display').append(\"<p class='input-1'>\" + argument + \"</p>\");\t\n\t}", "function _displayElements(elementsArr) {\n const elementsContainer = document.createElement(\"div\");\n elementsContainer.classList.add(\"elements-container\");\n elementsArr.forEach((el) => {\n elementsContainer.appendChild(el);\n });\n _mixGalContainer.appendChild(elementsContainer);\n container.appendChild(_mixGalContainer);\n }", "function showButtons(){\n\n // for loop to go through the array and create the buttomns\n // need to add class and atributes and name\n // have to append the buttons in the webpage\n $(\"#button-list\").html(\"\"); // cleans the button list before a new buttom is added and showButtons function add back the buttons\n for (var i = 0; i < topics.length; i++) {\n var plugButton = $(\"<button>\");\n\n plugButton.addClass(\"mma\");\n plugButton.attr(\"data-name\", topics[i]);\n plugButton.text(topics[i]);\n $(\"#button-list\").append(plugButton);\n }\n }", "function displayInfo(element) {\n const container = document.getElementById('container');\n const divInfo = createAndAppend('div', container, {\n id: 'leftSide',\n class: 'left-div whiteframe',\n });\n // Table info\n createAndAppend('table', divInfo, { id: 'table' });\n const table = document.getElementById('table');\n createAndAppend('tbody', table, { id: 'tbody' });\n function createTableRow(label, description) {\n const tableR = createAndAppend('tr', table);\n createAndAppend('td', tableR, { text: label, class: 'label' });\n createAndAppend('td', tableR, { text: description });\n }\n\n createTableRow('Repository: ', element.name);\n createTableRow('Description: ', element.description);\n createTableRow('Forks : ', element.forks);\n const newDate = new Date(element.updated_at).toLocaleString();\n createTableRow('Updated: ', newDate);\n }", "showItems() {\r\n this.generateItems();\r\n this.shuffleItems();\r\n this.items.forEach((item) => {\r\n screenDiv.appendChild(item.div);\r\n });\r\n }", "function display(){\r\n\r\n \r\n}", "displayInfo() {\n let imageContainer = document.querySelector(\"#image-container\");\n let thumbnailEl = document.createElement(\"img\");\n thumbnailEl.setAttribute(\"src\", this.thumbnailImg)\n imageContainer.append(thumbnailEl);\n let artistNameDiv = document.querySelector(\"#artist-name\");\n artistNameDiv.textContent = this.name;\n let artistInfoDiv = document.querySelector(\"#profile-info\");\n artistInfoDiv.textContent = this.profileInfo;\n\n }", "display() {\n document.querySelector(\".addressList\").innerHTML = \"\";\n let count = 0;\n for(let contact of this.contacts) {\n const newEntry = document.createElement(\"div\");\n newEntry.setAttribute(\"index\", count);\n newEntry.classList.add(\"contact_box\");\n newEntry.innerHTML= `\n <p>Name: ${contact.name}</p>\n <p>Email: ${contact.email}</p>\n <p>Phone: ${contact.phone}</p>\n <p>Relationship: ${contact.relation}</p>\n <i class=\"fas fa-trash trash\" id=\"trash\" ></i>\n `;\n document.querySelector(\".addressList\").append(newEntry);\n count++;\n }\n }", "function displayElementsPlayers(){\n\tdisplayPlayers();\n}", "function displaySelected() {\n console.log(\"response text\", this.responseText);\n var response = JSON.parse( this.responseText );\n console.log( response );\n\n // DOM final results\n var displayAt = document.querySelector('#show-detail');\n\n var title = document.createElement(\"h1\");\n title.innerHTML = response.name;\n displayAt.appendChild(title);\n\n var image = document.createElement(\"img\");\n image.src = response.image.medium;\n displayAt.appendChild(image);\n\n var summary = document.createElement(\"p\");\n summary.innerHTML = response.summary;\n displayAt.appendChild(summary);\n\n}", "display(){\n this.htmlBuilder.build();\n this.displayCityName();\n this.displayTodayWeather();\n this.displayWeekWeather();\n this.displayTimeSlots();\n }", "function displayEntities() {\n // clear the preview div\n $(\"#previewDiv\").empty();\n // dispaly each entity in the entities list\n for (var i = 0; i < entities.length; i++) {\n displayEntity(entities[i]);\n }\n}", "function divs(objeto) {\r\n\r\n var newDiv = $(\"<div class='noticia'></div>\")\r\n $(newDiv).html(\"<h3>\" + \" <a href=\" + objeto.url + \" target=_blank>\" + objeto.title + \"</a>\" + \"</h3>\" + \"<br>\" + \"<br>\" + \"<img src=\" + objeto.urlToImage + \">\" + \"<p>\" + objeto.description + \"</p>\" + \"<br>\");\r\n\r\n $(newDiv).append($('<button>').attr(\"class\", \"boton\").text(\"+info\").click(function () {\r\n info(objeto)\r\n }));\r\n\r\n $(\"#container\").append(newDiv)\r\n}", "function showElement(el1) {\n el1.style.display = \"inline-block\";\n }", "function showElement(e) {\n e.style.display = \"block\";\n }", "function displayItems(items) {\r\n const container=document.querySelector('.items');\r\n container.innerHTML=items.map(item=>createHTMLString(item)).join('');\r\n}", "function showCreate(){\n var container = document.getElementById(\"showCreate\");\n container.style.display = \"block\";\n console.log(\"w\");\n}", "_buildDisplayView() {\n this.element.innerHTML = this.value;\n }", "_buildDisplayView() {\n this.element.innerHTML = this.value;\n }", "function displayData() {\n\n $(\"#peopleButtons\").empty();\n\n \n for (var i = 0; i < people.length; i++) {\n\n var x = $(\"<button>\");\n x.addClass(\"person\");\n x.attr(\"data-name\", people[i]); \n x.text(people[i]);\n $(\"#peopleButtons\").append(x);\n }\n }", "function renderNodes(dataInstance){\n currentDisplay.innerHTML +=\n `<i class=\"fab fa-first-order-alt selector\" data-id = ${dataInstance.id} style=\"position:\n fixed;top:${dataInstance.position_top}%;left:${dataInstance.position_left}%;\n font-size: 1.5em; \"></i>`\n}", "function display(resultat) {\n Erase();\n let blocButton = document.createElement(\"restitution\");\n blocButton.innerText = boutonSelectionne;\n document.getElementById(\"restitution\").appendChild(blocButton);\n\n let blocValue = document.createElement(\"restitution\");\n blocValue.innerText = \"Mesure relevée: \" + resultat.type;\n document.getElementById(\"restitution\").appendChild(blocValue);\n\n let blocData = document.createElement(\"restitution\");\n blocData.innerText = resultat.value + \" \" + resultat.unit;\n document.getElementById(\"restitution\").appendChild(blocData);\n\n let blocDate = document.createElement(\"restitution\");\n FormateDate(resultat.measureDate);\n blocDate.innerText = \"date et heure du relevé: \" + dateDisplay;\n document.getElementById(\"restitution\").appendChild(blocDate);\n}", "function displayList()\n{\n\t\n\t//Variable for creating & storing dynamic HTML elements\n\tvar taskListContent = \"<ul>\";\n\t\n\t//Create LI tags and loop through the array\n\tfor(var i=0; i < taskList.length; i++)\n\t{\n\t\ttaskListContent += \"<li>\"+taskList[i]+\"</li>\";\n\t}\n\t\n\ttaskListContent += \"</ul>\";\n\t//Replace the HTML Elements inside the id=\"TaskListValue\"\n\tdocument.getElementById(\"TaskListValue\").innerHTML = taskListContent;\n}", "function show(result) {\n var div = document.querySelector('.shapceship-list');\n var p = document.createElement('p');\n p.innerText = result;\n div.appendChild(p);\n }", "function showDescription(i) {\n document.querySelector('#description').style.opacity = 1;\n document.querySelector('.name').innerHTML = description(i)[0];\n document.querySelector('.artist').innerHTML = description(i)[1];\n item = \".tooltiptext\" + i\n document.querySelector(item).innerHTML = description(i)[2];\n \n}", "function showPeople(){ // maak de functie showPeople om de opmaak van het tinder profiel te maken\n\t\t\tlet box = document.querySelector('#container__tinderBox');\n\t\t\tlet div = document.createElement('div'); // maak een div element aan\n\t\t\tdiv.className =\"container__tinderBox--info\"; // div krijgt de classe info\n\t\t\tlet img = document.createElement('img'); // maak een img element aan\n\t\t\timg.src = person_array[0].picture; // img src instellen\n\t\t\timg.className =\"profilePic\";// img krijgt de classe profilePic\n\t\t\tlet name = document.createElement('h1'); // maak een h1 element aan\n\t\t\tname.innerHTML = person_array[0].name;// innerHTML van h1 is de name uit object collection\n\t\t\tname.className =\"name\"; // de H1 krijgt de classnaam name\n\t\t\tlet age = document.createElement('h2'); // maak een h2 element aan\n\t\t\tage.innerHTML = person_array[0].age;// innerHTML van h2 is de leeftijd uit object collection\n\t\t\tage.className = \"age\"; // de H12krijgt de classnaam age\n\t\t\tlet adress = document.createElement('p'); // maak een p element aan\n\t\t\tadress.innerHTML = person_array[0].location;// innerHTML van adress is de locatie uit object collection\n\t\t\tadress.className = \"adress\";// de p krijgt de classnaam adress\n\t\t\tdiv.appendChild(img);\n\t\t\tdiv.appendChild(name);\n\t\t\tdiv.appendChild(age);\n\t\t\tdiv.appendChild(adress);\n\t\t\tbox.appendChild(div);\n\t\t}", "function displayLoc(arr) {\r\n\tget(\"continue-box\").style.display = \"none\";\r\n\tget(\"choice1Btn\").style.display = \"none\";\r\n\tget(\"choice2Btn\").style.display = \"none\";\r\n\tget(\"choice3Btn\").style.display = \"none\";\r\n\tget(\"content-options\").style.display = \"none\";\r\n\tvar locDisplay = \" \";\r\n\tfor(var i = 0; i < 1; i++) {\r\n\t\tlocDisplay += arr.name + \"<br>\";\r\n\t\tlocDisplay += arr.desc + \"<br>\";\r\n\t}\r\n\tget(\"content-one\").innerHTML = locDisplay;\r\n\tget(\"loc-content\").style.display = \"block\";\r\n}", "function renderToPage(){\n var targetDisplayParent = document.getElementById('choices'); \n var newDisplayContent = findThreeUniq();\n \n for(var i = 0; i <= 2; i++){\n var newDisplayEl = document.createElement('img');\n var newLi = document.createElement('li');\n newDisplayEl.src = newDisplayContent[i].imageUrl;\n newDisplayEl.id = newDisplayContent[i].product;\n newLi.appendChild(newDisplayEl);\n newDisplayContent[i].views ++;\n targetDisplayParent.appendChild(newLi);\n \n } \n}", "function writeDOM(){\n var domString = \"\";\n for(var i=0; i<expolsive.length; i++){\n domString += `<div class=\"col-sm-6 col-md-4 container\">`\n domString += `<div class=\"row\" id=\"card-${[i]}\">`\n domString += `<h1>${expolsive[i].name}</h1>`;\n domString += `<h1>${expolsive[i].description}</h1>`;\n domString += `</div></div>`;\n }\n // $(\"#explosiveDiv\").append(domString);\n // if($(expolsive).length){\n // $(\"#card\")\n // if($('#myModal').length) {\n // $(\"#\")\n \n // $('#purchaseNotice').html($('#myModal').html()) // set html\n // .show(); // show purchaseNotice div\n // } else {\n // $('#purchaseNotice').hide();\n // }\n }", "function addBoxes() {\n O('box-container').innerHTML += \"<div class='box'>More Boxes!!!!</div>\"\n}", "function displayRecipeTiles (template) {\n $('.displayBox').append(template);\n}", "function display(text) {\n\t\tvar resultNode = document.createElement(\"p\"); //create a paragraph tag to store and display result\n\t\tresultNode.innerHTML = text; //store that result\n\t\tvar resultParent = document.getElementById(\"biases\"); //find place to attach result\n\t\tresultParent.appendChild(resultNode); //actually attach value to that div tag thing\n\t}", "function display() {\n\treturn {\n\t\tdisplayStores: function() {\n\t\t\tfor (var i = 0; i < stores.length; i++) {\n\t\t\t\t$('<a class=\"storeLink\"></a>').appendTo('#mainDiv').append($('<img>').attr('src', stores[i].src))\n\t\t\t}\n\n\t\t\t$('.storeLink').click(function() {\n\t\t\t\tnewPage();\n\t\t\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' + products[i].size, $('<input type=\"checkbox\">').attr('id',i))\n\t\t\t\t\t}\n\n\t\t\t\t$('#mainDiv').append(\n\t\t\t\t buttons()\n\t\t\t\t)\n\t\t\t});\n\t\t},\n\n\t\tdisplayMen: function() {\n\t\t\tnewPage();\n\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\tif (products[i].cat === 'men') {\n\t\t\t\t\tconsole.log(i)\n\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' +products[i].size)\n\t\t\t\t\t.append($('<input type=\"checkbox\">').attr('id', i))\n\t\t\t\t\t.append(buttons());\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tdisplayWomen: function() {\n\t\t\tnewPage();\n\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\tif (products[i].cat === 'women') {\n\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' +products[i].size)\n\t\t\t\t\t.append($('<input type=\"checkbox\">').attr('id', i))\n\t\t\t\t\t.append(buttons());\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tdisplayKids: function() {\n\t\t\tnewPage();\n\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\tif (products[i].cat === 'kids') {\n\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' +products[i].size)\n\t\t\t\t\t.append($('<input type=\"checkbox\">').attr('id', i))\n\t\t\t\t\t.append(buttons());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function displayItems(items) {\n const contents = document.getElementById('contents');\n const html = items.map(item => createHTMLString(item));\n contents.innerHTML = items.map(item => createHTMLString(item)).join('');\n}", "function showBoards(){\r\n tbl.innerHTML=\"\"\r\n GetWorkflow(2)\r\n /*\r\n var board_title=document.createElement(\"span\")\r\n board_title.className=\"board-title\"\r\n board_title.appendChild(document.createTextNode(\"TO DO\"))\r\n var board_panel=document.createElement(\"div\")\r\n board_panel.className=\"board-elements-container panel\"\r\n var board_element=document.createElement(\"div\")\r\n board_element.className=\"board-element\"\r\n var eletitle=document.createElement(\"h4\")\r\n eletitle.className=\"element-title\"\r\n board_panel.appendChild(eletitle)\r\n eletitle.appendChild(document.createTextNode(\"Statement of Changes in Equity\"))\r\n */\r\n \r\n}", "function CreateBox(){\n for(i = 0; i < Letters.length; i++){\n var newBox = document.createElement(\"p\")\n var newContent = document.createTextNode(Letters[i])\n newBox.appendChild(newContent) \n \n newDiv.style.backgroundColor = \"red\"\n newDiv.appendChild(newBox)\n newDiv.hidden = true;\n }\n}", "function viewTodoListDom() {\n //clear list of items before render\n list.innerHTML = \"\";\n for (let i = 0; todoItemsOjb.todoItemsRender.length > i; i++) {\n addToDoItemDom(todoItemsOjb.todoItemsRender[i]);\n }\n}", "function ShowItems() {\n for (let book of Books) {\n makeBookItem(book).appendTo(\"#AllBooks\");\n }\n }", "function addElement() {\n document.getElementById(\"addcustom\").style.display = \"block\";\n}", "function displayButtons() {\n \n //hides weather card display at start up\n $(\".card\").hide();\n $(\"#button-area\").empty();\n \n // loop that appends a button for each string in the array\n for (var i = 0; i < topics.length; i++) {\n var showButton = $(\"<button>\");\n \n //add a class earth-bttn\n showButton.addClass(\"btnClass\");\n \n //add a data-attribute\n showButton.attr(\"data-earth\", topics[i]);\n \n // providing the initial button text\n showButton.text(topics[i]);\n \n // add button to button-area\n $(\"#button-area\").append(showButton);\n }\n }", "function populateMyWorks(myWorks) {\n for(i=0; i <myWorks.length; i++){\n var object = myWorks[i];\n var row = document.createElement('div');\n row.className = 'col-md-4 no_padding';\n row.innerHTML = '<div class=\"single_image\"><img src=\"'+object['img']+'\" alt=\"\"> <div class=\"image_overlay\"> <a href=\"'+object['link']+'\">Ver Proyecto</a><h2>'+object['name']+'</h2></div>';\n //document.getElementById('recentWorks').appendChild(row);\n $(row).hide().appendTo('#recentWorks').fadeIn(1000);\n }\n}", "function characterDisplay() {\n //display the first character on the page\n characterSelect(characters[0].name, 1, characters[0].class, characters[0].portrait, characters[0].colors.dark, characters[0].colors.light, characters[0].stats);\n //loop through array and append all of the sprite version\n for (var i = 0; i < characters.length; i++) {\n var chibiContainer = $(\"<div>\").addClass(\"character-container\").attr({\n \"data-class\": characters[i].class,\n \"data-key\": i + 1\n });\n var characterImage = $(\"<img>\").attr(\"src\", characters[i].chibi);\n chibiContainer.append(characterImage);\n $(\".character-list\").append(chibiContainer);\n }\n }", "function render() {\n\t$(\"#content\").empty();\n\n\tfor (let i = 0; i < employeeList.length; i++) {\n\t\tlet info = employeeList[i];\n\n\t\tlet nameData = info.name;\n\t\tlet officeData = info.office;\n\t\tlet phoneData = info.phone;\n\n\t\tlet objectDiv = `<div class=\"objectDiv\"><p>Employee: ${nameData}</p><p>Office: ${officeData}</p><p>Phone Number: ${phoneData}</p></div>`\n\t\t$(\"#content\").append(objectDiv);\n\t}\n}", "function popularDisplayView(targetname){\n\n let target = document.getElementsByClassName(targetname);\n let template = Handlebars.compile(\n document.getElementById(\"display-list-template\").textContent\n ) \n\n target[0].innerHTML = template({'display': Model.getPopularPosts(10)})\n\n}//View template for \"Recent Posts\" section on the main page.", "function showNewViewbox(el, result) {\n let output = document.createElement('div');\n output.classList.add('output');\n output.textContent = result;\n el.insertAdjacentElement('beforebegin', output);\n}", "function createDom(templates) {\n var domc = document.createElement('div');\n domc.className = 'lk-outline-container';\n var content = document.createElement('div');\n content.className = 'lk-content LK-HIDE';\n content.innerHTML = templates;\n var operate = document.createElement('div');\n operate.className = 'LK-OPERATE LK-SHOW';\n operate.addEventListener('click', function () {\n if (content.className === 'lk-content LK-HIDE') {\n content.className = 'lk-content LK-SHOW';\n }\n else {\n content.className = 'lk-content LK-HIDE';\n }\n });\n domc.appendChild(content);\n domc.appendChild(operate);\n document.body.append(domc);\n}", "function displayEntries() {\n var contactsDiv = document.getElementById(\"contacts\"); \n // i) clear the list by settin innerHTML on the list empty\n contactsDiv.innerHTML = \"\"; \n // ii) (re-)add all entries\n for (var i = 0; i < contacts.length; i++) {\n var entryDiv = document.createElement(\"div\");\n entryDiv.innerHTML = \"<div id=\\\"contact_\" + i + \"\\\" class=\\\"contact\\\">\" \n + contacts[i].display(i) + \"</div>\";\n contactsDiv.appendChild(entryDiv);\n }\n}", "function buildList(){\n var medOut = '';\n var researchOut = '';\n var academicOut = '';\n var athleticOut = '';\n var adminOut = '';\n \n for(i = 0; i < data.features.length; i++){\n var object = data.features[i];\n var button = '<button class=\"list-group-item building-button\">'+object.properties.name+'</button>';\n switch(object.properties.type){\n case \"medical\" : medOut += button; break;\n case \"research\" : researchOut += button; break;\n case \"athletic\" : athleticOut += button; break;\n case \"academic\" : academicOut += button; break;\n case \"admin\" : adminOut += button; break; \n default: medOut += button;\n }\n \n }\n \n $(\"#medical-list\").html(medOut);\n $(\"#research-list\").html(researchOut);\n $(\"#academic-list\").html(academicOut);\n $(\"#athletic-list\").html(athleticOut); \n $(\"#admin-list\").html(adminOut); \n \n}", "function displayButtons() {\n $(\"#myButtons\").empty();\n for (var i = 0; i < topics.length; i++) {\n var newButton = $('<button class=\"btn btn-danger\">');\n newButton.attr(\"id\", \"topic\");\n newButton.attr(\"data-search\", topics[i]);\n newButton.text(topics[i]);\n $(\"#myButtons\").append(newButton);\n }\n }", "function renderDom() {\n stackList.innerHTML = \"\";\n myStack.stackControl.forEach(el => {\n stackList.innerHTML += `<li>${el}</li>`;\n })\n }", "function displayHTML(){\n\t\tdom.name.innerHTML = \"1. Name: \"+studentArray[position].name;\n\t\tdom.address.innerHTML = \"2. Address: \"+studentArray[position].street+\n\t\t\", \"+studentArray[position].city+\n\t\t\", \"+studentArray[position].state;\n\t\tdom.grades.innerHTML = \"3. Grades: \"+studentArray[position].grades;\n\t\tdom.date.innerHTML = \"4. Date: \"+studentArray[position].getDate();\n\t\tdom.gpaAvg.innerHTML = \"5. Average GPA: \"+studentArray[position].getAverage(studentArray[position].grades).toFixed(2);\n\t}//close displayHTML function", "function displayButtons() {\n $(\"#button-layout\").empty();\n for (var i = 0; i < topics.length; i++) {\n var b = $(\"<button>\").text(topics[i]);\n b.attr({\"data-topic\": topics[i]}).addClass(\"topic-button\");\n $(\"#button-layout\").append(b);\n }\n}", "function renderButtons() {\n console.log(topics);\n // previous div elements are emptied\n $(\"#topics\").empty();\n // loop through array to create button for each topic\n for (var i = 0; i < topics.length; i++) { \n var buttons = $(\"<button>\");\n buttons.addClass(\"btn btn-info show\");\n buttons.attr(\"data-name\", topics[i]);\n buttons.text(topics[i]);\n $('#topics').append(buttons);\n } \n}", "function displayHouses() {\n let houses = document.getElementById('listHouses');\n\n for (let i = 0; i < house.length; i++){\n newDiv = document.createElement('div');\n newImage = document.createElement('img');\n newImage.src = house[i].picture;\n newImage.alt = house[i].name;\n newImage.classList = \"zoom\";\n newName = document.createElement('h1');\n newName.appendChild(document.createTextNode(house[i].name));\n\n newDiv.className = \"houseDiv\";\n\n newImage.onclick = function(){\n printData(i);\n };\n\n houses.appendChild(newDiv);\n newDiv.appendChild(newImage);\n newDiv.appendChild(newName);\n \n }\n \n document.getElementsByClassName('houseDiv')[0].className += \" noMargin\";\n}", "display(){\n\n //for(let i = 0; i < images.length; i++){}\n let random_num = Math.floor(Math.random() * images.length);\n\n this.title = document.getElementById('title').innerHTML = titles[random_num]\n\n this.author = document.getElementById('author').innerHTML = authors[random_num];\n this.location = document.getElementById('location').innerHTML = locations[random_num];\n this.year = document.getElementById('year').innerHTML = years[random_num];\n this.description = document.getElementById('description').innerHTML = descriptions[random_num];\n this.image = document.getElementById('photo').src = images[random_num];\n }", "function displayButtons() {\n $(\"#gifsView\").empty();\n for (var i = 0; i < topics.length; i++) {\n var gifButton = $(\"<button>\");\n gifButton.addClass(\"MovieStar\");\n gifButton.addClass(\"btn btn-primary\");\n gifButton.attr(\"data-name\", topics[i]);\n gifButton.text(topics[i]);\n $(\"#gifsView\").append(gifButton);\n }\n }", "function displayForm(form, arrayKeys){\r form['linkedElement'][0].innerHTML = '';\r\r suppressElementsBySelector('.' + form['className']);\r form['originalContent'] = eval('arrayColumn'+createArrayColumnPath(arrayKeys));\r\r form['domElement'].className = form['className'];\r\r form['linkedElement'][0].appendChild(form['domElement']);\r form['domElement'].innerHTML = '<textarea id=\"newContent\" placeholder=\\\"enter a ' + form['fieldType'] + '\\\">'\r + form['originalContent'] + '</textarea>';\r}", "function generateListDisplay() {\n cityListEl.innerHTML = \"\";\n for (var i = 0; i < cityInput.length; i++) {\n var newEl = document.createElement(\"BUTTON\");\n newEl.textContent = cityInput[i];\n newEl.setAttribute(\"class\", \"list-group-item list-group-item-action\");\n cityListEl.appendChild(newEl);\n }\n}", "function populateMyWorks(myWorks) {\n for(i=0; i <myWorks.length; i++){\n var object = myWorks[i];\n var row = document.createElement('div');\n\t row.className = 'col-md-4 anba329';\n row.innerHTML = '<div class=\"single_image\"><img src=\"'+object['img']+'\" alt=\"\"> <div class=\"image_overlay\"> <a href=\"'+object['link']+'\">View Project</a><h2>'+object['name']+'</h2></div>';\n //document.getElementById('recentWorks').appendChild(row);\n $(row).hide().appendTo('#recentWorks').fadeIn(1000);\n }\n}", "function AppendToDiv() {\n //must reset every time to make sure that there is no brake in name numbers, we need the numbers to send the list to controler\n TagContainer.empty();\n for (var i = 0; i < tagArray.length; i++) {\n var TagToAppend = \"<div class='addedTag \" + i + \"' name='Tag[\" + i + \"]' id = '\" + i + \"'>\" + tagArray[i] + \"</div>\";\n var hiddenInput = \"<input class='hiddenInput \" + i + \"' name='Tag[\" + i + \"]' value='\" + tagArray[i] + \"'/>\"\n TagContainer.append(TagToAppend);\n TagContainer.append(hiddenInput);\n var btn = $(\"#\" + i + \"\");\n btn.click(removeTag);\n }\n }", "function showAddDiv() {\n\tshowActionDiv('add');\n}", "function displayList(newArray) {\n currentArray = newArray;\n\n //show total students in current list\n document.querySelector(\"#totalStudents>span\").textContent =\n currentArray.length;\n\n //clear main\n main.innerHTML = \"\";\n\n newArray.forEach(student => {\n //fill template + append\n const copy = template.cloneNode(true);\n let article = copy.querySelector(\"article\");\n copy.querySelector(\"#firstname\").textContent = student.firstname;\n copy.querySelector(\"#lastname\").textContent = student.lastname;\n copy.querySelector(\"#housename\").textContent = student.house;\n article.id = `${student.firstname}_${student.lastname}`;\n\n article.draggable = \"true\";\n\n article.addEventListener(\"click\", function() {\n showDetails(student);\n });\n\n main.appendChild(copy);\n });\n}", "function show() {\n list.innerHTML = \"\";\n for (let i = 0; i < allItems.length; i++) {\n let itemDiv = document.createElement('div');\n itemDiv.textContent = allItems[i];\n itemDiv.classList.add(\"todo-item\");\n\n let removeButton = document.createElement(\"button\");\n removeButton.textContent = \"Remove\";\n removeButton.classList.add(\"remove-button\");\n\n itemDiv.append(removeButton);\n list.append(itemDiv);\n\n removeButton.addEventListener('click', removeItem);\n removeButton.setAttribute(\"id\", id);\n id++;\n }\n}", "function func (){\n var element = document.getElementById('display_pane');\n element.innerHTML = printObj(object);\n }", "function displayPostsDOM(posts) {\n posts.forEach((post) => {\n appendPostDOM(post);\n });\n}", "show(\n title,\n elements,\n invokedBy,\n align = \"left\",\n size = \"256px\",\n clone = false\n ) {\n this.set(\"invokedBy\", invokedBy);\n this.title = title;\n this.align = align;\n this.updateStyles({ \"--simple-drawer-width\": size });\n let element;\n // append element areas into the appropriate slots\n // ensuring they are set if it wasn't previously\n let slots = [\"header\", \"content\"];\n for (var i in slots) {\n if (elements[slots[i]]) {\n if (clone) {\n element = elements[slots[i]].cloneNode(true);\n } else {\n element = elements[slots[i]];\n }\n element.setAttribute(\"slot\", slots[i]);\n dom(this).appendChild(element);\n }\n }\n // minor delay to help the above happen prior to opening\n setTimeout(() => {\n this.opened = true;\n this._resizeContent();\n }, 100);\n }", "function createdivs(len) {\n\n // Creating the div in html\n var div = $(\"<div class='divproduct'>\");\n\n // Creating the img and class in html\n var img = $(\"<img class='proImage'>\");\n // Giving the img an attribute\n img.attr(\"src\", response.items[len].mediumImage);\n // appending the img to the div\n div.append(img);\n\n // Creating a p tag for the title of the product\n var p = $(\"<p>\");\n p.text(response.items[len].name);\n div.append(p);\n\n // Appending the productoptions class to the div\n //$(\".productOptions\").append(div);\n }", "function generateList() {\r\n inputDisplay();\r\n seatingArrangement();\r\n document.getElementById(\"outputButton\").style.visibility = \"visible\";\r\n}", "function displayMealDetails(meal) {\n const ingredients=`\n <div class=\"text-center\">\n <img src=\"${meal.strMealThumb}\" class=\"img\">\n <h3 class=\"title\">${meal.strMeal}</h3>\n </div>\n <div>\n <h4>Ingredients</h4>\n <ul id=\"list\">\n </ul>\n </div>\n `\n document.getElementById(\"showDetails\").innerHTML = ingredients;\n //for accessing ingredients\n for (let index = 1; index <= 20; index++) {\n let ingredient = 'strIngredient' + index;\n let number = 'strMeasure' + index;\n if (meal[ingredient] == null || meal[ingredient] === \"\" ) {\n break;\n }\n const li = document.createElement(\"li\");\n const item=`\n <li>${meal[number]} ${meal[ingredient]}</li>\n `;\n li.innerHTML = item;\n document.getElementById(\"list\").appendChild(li)\n }\n document.getElementById(\"mealDetails\").style.display = \"block\";\n}", "function showListView() {\n buildListView();\n\n listViewDom.style.display = 'block';\n}" ]
[ "0.68576753", "0.66220754", "0.66220754", "0.66217947", "0.65971184", "0.6596704", "0.6596704", "0.6596704", "0.65895253", "0.65471905", "0.6508946", "0.6502533", "0.6492728", "0.6475005", "0.6465796", "0.6452137", "0.64462066", "0.64462066", "0.6435482", "0.6389102", "0.635471", "0.63501245", "0.63308364", "0.63267297", "0.6299615", "0.6292012", "0.6289641", "0.6289412", "0.6285553", "0.6284432", "0.6278759", "0.6275256", "0.62751967", "0.62664384", "0.62645763", "0.6254061", "0.6251777", "0.6242047", "0.62319547", "0.62315816", "0.6227375", "0.6212283", "0.6200684", "0.6200616", "0.6190279", "0.6173763", "0.61699665", "0.6166607", "0.61659503", "0.61659503", "0.6163906", "0.6148846", "0.6147946", "0.6145284", "0.6142435", "0.6142157", "0.6141819", "0.6140359", "0.6133842", "0.6131507", "0.61269706", "0.6126964", "0.6119788", "0.6119055", "0.6115239", "0.6096957", "0.6096754", "0.6096687", "0.60924286", "0.60827374", "0.6080472", "0.6077949", "0.60712975", "0.6066433", "0.606579", "0.6059257", "0.6058814", "0.60575527", "0.6053656", "0.6041992", "0.6039437", "0.6035874", "0.6033693", "0.6033183", "0.60255444", "0.60223144", "0.6019837", "0.6012534", "0.60115117", "0.6009405", "0.6008812", "0.6008586", "0.6008062", "0.6007805", "0.6005229", "0.6004315", "0.6003294", "0.600229", "0.5999065", "0.59978235", "0.59959584" ]
0.0
-1
constructor q: what is container? is it the html container?
constructor(container) { camera = createCamera(); scene = createScene(); renderer = createRenderer(); container.append(renderer.domElement); const cube = createCube(); const light = createLights(); // TODO: Check if scene.add allows you to add: // * any type of object // * explicitly-typed parameters scene.add(cube, light); const resizer = new Resizer(container, camera, renderer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LContainer() { }", "function LContainer() { }", "function LContainer() {}", "function LContainer() {}", "function LContainer() {}", "function LContainer(){}", "constructor() {\n this._container = document.createElement(\"div\");\n }", "constructor() {\n this._container = document.createElement(\"div\");\n }", "constructor(container) {\n this.container = container;\n }", "constructor(container) {\n this.container = container;\n }", "constructor(container) {\n this.container = container;\n }", "function TContainerNode() {}", "function TContainerNode() {}", "function TContainerNode() {}", "function TContainerNode() { }", "function TContainerNode() { }", "function TElementContainerNode() {}", "function TElementContainerNode() {}", "function TElementContainerNode() {}", "function TContainerNode(){}", "function TElementContainerNode() { }", "function TElementContainerNode() { }", "function TElementContainerNode(){}", "function Container(dragon, elm) {\n if(DEV) console.log('Container instance created, elm:', elm);\n\n this.id = elm.id || 'container' + id++;\n this.dragon = dragon;\n this.elm = elm;\n this.options = {};\n this.options.mirrorContainer = doc.body;\n}", "function Container() {\n\tthis.context = new String();\n\tthis.json = new Object();\n}", "get container() { return this._container; }", "get container() { return this._container; }", "function getContainer(p) {\n var container = document;\n if (typeof p === 'string' && p[0] === '#') {\n p = p.slice(1);\n container = document.getElementById(p) || document;\n } else if (p instanceof _main.default.Element) {\n container = p.elt;\n } else if (p instanceof HTMLElement) {\n container = p;\n }\n return container;\n }", "constructor (container) {\n super(container, 'AbstractPage')\n\n /**\n * Container element\n *\n * @type {HTMLElement}\n */\n this.rootElement = null\n\n /**\n * Page id\n *\n * @type {String|null}\n */\n this.id = null\n\n /**\n * Page context (static or ajax)\n *\n * @type {String|null}\n */\n this.context = null\n\n /**\n * Page type\n *\n * @type {String|null}\n */\n this.type = null\n\n /**\n * Is home ?\n *\n * @type {boolean}\n */\n this.isHome = null\n\n /**\n * AbstractBlock collection.\n *\n * @type {Array<AbstractBlock>}\n */\n this.blocks = []\n\n /**\n * Node name\n *\n * @type {String|null}\n */\n this.name = null\n\n /**\n * Meta title\n * @type {String|null}\n */\n this.metaTitle = null\n\n // Bind methods\n this.onResize = this.onResize.bind(this)\n this.onResizeDebounce = debounce(this.onResize, 50, false)\n this.bindedUpdateBlocks = debounce(this.updateBlocks.bind(this), 50, false)\n }", "function ComponentContainer()\r\n{\r\n\t//this function never will be called (because only the methods are attached to other classes)\r\n\t//unless you instantiate this class directly, something that would be weird\r\n}", "function TIcuContainerNode(){}", "constructor(container = []) {\n this.container = container;\n }", "function TIcuContainerNode() { }", "function TIcuContainerNode() { }", "init () {\n // Current nothing to init for this container. Method left here for ref.\n const { mediator } = this;\n formatterContainer = formatterContainer || new FormatterContainer({ mediator });\n uiContainer = uiContainer || new UIContainer({ mediator });\n canvasContainer = canvasContainer || new CanvasContainer({ mediator });\n }", "function ContainerWrapper(container, id) {\n\tvar self = this;\n\tself.container = container;\n\tself.id = id;\n}", "getContainer() {\n return document.body\n }", "createNewContainer(container) {\n this.elements.container = createElement('div', {\n class: this.player.config.classNames.editor.container,\n });\n\n insertAfter(this.elements.container, container);\n }", "function Container (init) {\n this._value = init;\n}", "getContainer() {\n return document.body;\n }", "getContainer() {\n return document.body;\n }", "function TIcuContainerNode() {}", "function TIcuContainerNode() {}", "function TIcuContainerNode() {}", "createContainer(){\n new comp.section({className:\"new--news\"},\n new comp.btn(\"New Article\"),\n ).render(\".container--inner\")\n new comp.section({className: \"news--title\"},\n new comp.title(\"h1\",\"News Articles\")).render(\".container--inner\")\n new comp.section({className: \"display--news\"}).render(\".container--inner\")\n\n }", "function setContainer(container) {\n _container = container;\n}", "constructor(form, container) {\n\t\tsuper();\n\n\t\tthis.form = document.forms[form];\n\t\tthis.container = document.getElementById(container);\n\t\t\n\t\t// set in render()\n\t\tthis.masterkey = null;\n\t\tthis.errors = null;\n\t}", "constructor (containerList) {\n this.containerList = document.querySelector(containerList);\n\n const builder = this;\n window.addEventListener('load', function(){\n builder.render(builder, builder.containerList);\n });\n }", "function getContainerElement(){\ncl(document.getElementById(\"container\"));\n\n}", "function PlaceholderContainer() {\n\t\tthis.placeholderA = new PlaceholderElement();\n\t\tthis.placeholderB = new PlaceholderElement();\n\t}", "getContainer() {\n if (isBrowser) {\n const container = this.container\n return isString(container) ? select(container) : container\n } else {\n return null\n }\n }", "function CB_ContainerView(params) {\r\n\tthis.TYPE = \"CONTAINER_VIEW\";\r\n\tthis.setting(params);\r\n}", "initContainer() {\n\t\tthis.container = document.createElement( 'div' );\n\t\tthis.container.classList.add( 'kl-container' );\n\n\t\tthis.keysList = document.createElement( 'div' );\n\t\tthis.keysList.classList.add( 'kl-container__keys-list' );\n\t\tthis.container.appendChild( this.keysList );\n\n\t\tdocument.addEventListener( 'dragover', this.onDragOver )\n\t\tthis.container.addEventListener( 'dragstart', this.onDragStart );\n\t\tthis.container.addEventListener( 'dragend', this.onDragEnd );\n\t\t\n\t\tthis.container.draggable = true;\n\t\tdocument.body.appendChild( this.container );\n\t}", "constructor() {\n const containerId = \"message-container\";\n const containerElement = document.getElementById(containerId);\n if (containerElement)\n this.containerElement = containerElement;\n else {\n this.containerElement = document.createElement(\"div\");\n this.containerElement.id = containerId;\n document.body.appendChild(this.containerElement);\n }\n }", "function CB_WContainerView(params) {\r\n\tthis.TYPE = \"WIDGET_CONTAINER_VIEW\";\r\n\tthis.setting(params);\r\n\t// must be overrided\r\n\tthis.setContTitleBar=function(params){};\r\n\tthis.setContBorder\t=function(params){};\r\n\tthis.setTitleBar\t=function(params){};\r\n\tthis.setStatusBar\t=function(params){};\r\n\tthis.setBorder\t\t=function(params){};\r\n\tthis.setOption \t\t=function(params){};\r\n\tthis.setCss \t\t=function(params){};\r\n\tthis.minimize\t\t=function(params){};\r\n\tthis.maximize\t\t=function(params){};\r\n\tthis.close\t\t\t=function(params){};\r\n\tthis.popup\t\t\t=function(params){};\r\n\tthis.restore\t\t=function(params){};\r\n\tthis.active\t\t\t=function(index){};\r\n}", "function createContainer(i) {\n const container = DOMtools.returnElement({\n type: \"div\",\n class: \"container\",\n attribute: {\n \"data-projectindex\": (projIndex !== null) ? projIndex : i,\n \"data-todoindex\": (projIndex !== null) ? i : \"null\"\n }\n });\n // container.addEventListener(\"click\", _renderView); // if click event better \n return container;\n }", "function Container(data) {\n this['.'] = data;\n}", "_initContainer() {\n this._element.classList.add('carousel');\n\n this._element.append(this._createContainerHeader());\n\n this._cardsContainer = this._createContainerContent();\n this._element.append(this._cardsContainer);\n\n this._calculateCardsDisplayed();\n }", "containerTemplate() {\n\n return this.createDomElement(\n \"div\",\n {\n \"class\": [\n \"scrolling-js-container\"\n ],\n \"style\": {\n height: this.INIT_PAGES.length * 100 + \"%\",\n }\n }\n );\n }", "constructor() {\n this.container = [];\n }", "_initContainers() {\n const that = this;\n\n that.dataValidationContainer = document.createElement('div');\n that.dataValidationContainer.classList.add('smart-data-validation-container');\n\n that.criteriaContainer = document.createElement('div');\n that.criteriaContainer.classList.add('smart-criteria-container');\n\n that.criteriaTypeContainer = document.createElement('div');\n that.criteriaTypeContainer.classList.add('smart-criteria-type-container');\n\n that.inputsCriteriaContainer = document.createElement('div');\n that.inputsCriteriaContainer.classList.add('smart-input-criteria-container');\n\n that.textBetweenInputsHolder = document.createElement('div');\n that.textBetweenInputsHolder.classList.add('smart-text-between-inputs-container');\n\n that.onInvalidDataContainer = document.createElement('div');\n that.onInvalidDataContainer.classList.add('smart-on-invalid-data-container');\n\n that.appearanceContainer = document.createElement('div');\n that.appearanceContainer.classList.add('smart-appearance');\n\n that.footerButtonsContainer = document.createElement('div');\n that.footerButtonsContainer.classList.add('smart-footer-buttons');\n\n that._generateStaticElements();\n }", "function Container()\n\t{\n\t DisplayObject.call(this);\n\t\n\t /**\n\t * The array of children of this container.\n\t *\n\t * @member {PIXI.DisplayObject[]}\n\t * @readonly\n\t */\n\t this.children = [];\n\t}", "getContainer() {\n return this._container;\n }", "function view_container(enabled, id, title, children) {\n if (enabled) {\n return div(undefined, undefined, {\n hd: class$prime(\"container container-\" + id),\n tl: /* [] */0\n }, {\n hd: div(undefined, undefined, {\n hd: class$prime(\"title\"),\n tl: /* [] */0\n }, {\n hd: text(title),\n tl: /* [] */0\n }),\n tl: {\n hd: div(undefined, undefined, {\n hd: class$prime(\"scroller \" + id),\n tl: /* [] */0\n }, children),\n tl: /* [] */0\n }\n });\n } else {\n return noNode;\n }\n }", "function initContainer() {\n // If the container already exists, make the needed elements visible\n if (container != null) {\n reset();\n return;\n }\n\n container = document.createElement('div');\n container.className = 'datipi-container';\n\n // Header containing headline and buttons\n var head = document.createElement('div');\n head.className = 'datipi-head';\n\n // Button left\n btnPreviousMonth = document.createElement('div');\n btnPreviousMonth.className = 'datipi-switch';\n btnPreviousMonth.innerHTML = '◀';\n btnPreviousMonth.addEventListener('click', onPreviousMonth);\n\n // Headline containing text, e.g. current month\n headline = document.createElement('div');\n headline.className = 'datipi-headline';\n\n // Button right;\n btnNextMonth = document.createElement('div');\n btnNextMonth.className = 'datipi-switch';\n btnNextMonth.innerHTML = '▶';\n btnNextMonth.addEventListener('click', onNextMonth);\n\n // Calendar container for month selection\n calendar = document.createElement('div');\n calendar.className = 'datipi-calendar datipi-circle-selector';\n\n // Clock container for time selection\n clock = document.createElement('div');\n clock.className = 'datipi-clock';\n\n // Fill the calendar with the current month days\n initCalendar();\n\n // Append all childs to DOM\n head.appendChild(btnPreviousMonth);\n head.appendChild(headline);\n head.appendChild(btnNextMonth);\n\n container.appendChild(head);\n container.appendChild(calendar);\n container.appendChild(clock);\n\n inputField.parentElement.appendChild(container);\n }", "function TryItDisplay(containerElement) {\n this.iframe = new Iframe();\n this.create(containerElement);\n}", "function SelObj(container, caption) {\n this.container = container;\n $(this.container).hide();\n this.caption = null;\n this.items = null;\n if (this.container) {\n this.container.addClass('sel-section');\n this.caption = $('<h2>').addClass('sel-caption').append(caption).appendTo(this.container);\n this.items = $('<div>').addClass('sel-items').data('name', name).appendTo(this.container);\n };\n}", "function Container() {\n this.factories = {};\n this.instances = {};\n this.fns = {};\n}", "function Container(id) {\r\n if (!(this instanceof Container)) {\r\n return Container.containers[id];\r\n }\r\n Container.containers[id] = this;\r\n this.id = id;\r\n}", "function Container( options ) {\n\t// Clone options if necessary\n\toptions = ! options ? {} : options.internal ? options : Object.create( options ) ;\n\toptions.internal = true ;\n\n\tElement.call( this , options ) ;\n\n\tthis.onClick = this.onClick.bind( this ) ;\n\tthis.onDrag = this.onDrag.bind( this ) ;\n\tthis.onWheel = this.onWheel.bind( this ) ;\n\n\tif ( options.keyBindings ) { this.keyBindings = options.keyBindings ; }\n\n\t//console.error( 'this.document:' , !! this.document , !! ( this.document && this.document.palette ) , !! options.palette ) ;\n\tthis.palette = options.palette || ( this.document && this.document.palette ) ;\n\tthis.object2attr = object => ScreenBuffer.object2attr( object , this.palette && this.palette.colorNameToIndex ) ;\n\n\tthis.scrollable = !! options.scrollable ;\n\tthis.hasVScrollBar = this.scrollable && !! options.vScrollBar ;\n\tthis.hasHScrollBar = this.scrollable && !! options.hScrollBar ;\n\tthis.scrollX = options.scrollX || 0 ;\n\tthis.scrollY = options.scrollY || 0 ;\n\tthis.vScrollBarSlider = null ;\n\tthis.hScrollBarSlider = null ;\n\n\tthis.movable = !! options.movable ;\n\n\tthis.viewportX = this.outputX + this.containerBorderSize ;\n\tthis.viewportY = this.outputY + this.containerBorderSize ;\n\tthis.viewportWidth = this.outputWidth - this.containerBorderSize * 2 ;\n\tthis.viewportHeight = this.outputHeight - this.containerBorderSize * 2 ;\n\n\tthis.inputX = options.inputX || this.viewportX + this.scrollX ;\n\tthis.inputY = options.inputY || this.viewportY + this.scrollY ;\n\tthis.inputWidth = options.inputWidth || this.viewportWidth ;\n\tthis.inputHeight = options.inputHeight || this.viewportHeight ;\n\n\tthis.inputDst = new ScreenBuffer( {\n\t\tdst: this.outputDst ,\n\t\tx: this.inputX ,\n\t\ty: this.inputY ,\n\t\twidth: this.inputWidth ,\n\t\theight: this.inputHeight ,\n\t\tpalette: this.palette\n\t} ) ;\n\n\tthis.deltaDraw = false ;\t// Useful for Document, not so useful for other containers\n\tthis.backgroundAttr = options.backgroundAttr || { bgColor: 'default' } ;\n\n\tthis.on( 'key' , this.onKey ) ;\n\tthis.on( 'click' , this.onClick ) ;\n\tthis.on( 'drag' , this.onDrag ) ;\n\tthis.on( 'wheel' , this.onWheel ) ;\n\n\tthis.initChildren() ;\n\n\t// Only draw if we are not a superclass of the object\n\tif ( this.elementType === 'Container' && ! options.noDraw ) { this.draw() ; }\n}", "function renderContainer() {\n var node = document.getElementById(\"blq-content\");\n\t\tnode = node.getElementsByClassName(\"g-group\")[1];\n\t\tnode = node.getElementsByClassName(\"g-w8\")[0];\n\t\t\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.setAttribute(\"id\", \"gm-semantic-tags\");\n\t\tdiv.setAttribute(\"class\", \"g-container\");\n\t\tdiv.setAttribute(\"style\", \"border-top:5px solid #E0E0E0; margin-bottom:1.38em; padding-top:0.46em;\");\n\n\t\tvar title = document.createElement(\"h2\");\n\t\ttitle.appendChild(document.createTextNode(\"Tags\"));\n\t\ttitle.setAttribute(\"style\", \"margin-bottom:10px; text-transform:uppercase;\");\n\t\t\n\t\tvar content = document.createElement(\"div\");\n\t\tcontent.setAttribute(\"id\", \"gm-semantic-tags-content\");\n\t\tcontent.setAttribute(\"style\", \"min-height:40px; background:url(http://dbpedia-i18n.appspot.com/images/progress.gif) 30% 30% no-repeat\");\n\t\t\n\t\tvar disclaimer = document.createElement(\"p\");\n\t\tdisclaimer.setAttribute(\"class\", \"disclaimer\");\n\t\tdisclaimer.innerHTML = \"Powered by <a href=\\\"http://www.google.com\\\">Google</a> and <a href=\\\"http://www.zemanta.com\\\">Zemanta</a>\";\n\t\n\t\tdiv.appendChild(title);\n\t\tdiv.appendChild(content);\n\t\tdiv.appendChild(disclaimer);\n\t\t\n\t\tnode.insertBefore(div, node.firstChild); \t\n\t}", "function create_container($) {\n \n // set body to relative - may not be necessary\n document.body.style.position = \"relative\";\n \n var d = document.createElement('div');\n $(d).css({\n \"background-color\": \"#ffffff\",\n \"border\": \"1px solid #000000\",\n \"font-size\": \"small\",\n \"padding\": \"2px\",\n \"position\": \"fixed\",\n \"right\": \"0\",\n \"top\": \"0\",\n \"bottom\": \"0\",\n \"overflow\": \"scroll\",\n \"zIndex\": \"1000\",\n \"display\": \"none\",\n }).attr('id', 'container');\n $(d).prependTo($(\"body\"));\n \n }", "function getContainerHtml(container) {\n let html = '';\n container.get('components').forEach(component => html += component.toHTML());\n let htmlDom = $(\"<container>\" + html + \"</container>\");\n // replace phpb-block elements with shortcode\n htmlDom.find('phpb-block').each(function() {\n $(this).replaceWith('[block slug=\"' + $(this).attr('slug') + '\" id=\"' + $(this).attr('id') + '\"]');\n });\n return htmlDom.html();\n }", "function getContainer() {\n return $(options.contentSelector)[0];\n }", "createHtml() {\n this.container = document.createElement('div');\n this.container.className = 'container';\n this.container.innerHTML = `\n <div class=\"quiz-container display-flex-center\">\n <div class=\"question-text display-flex-center\">What would you say cross-sells best when magazines and publications are selling a lot?</div>\n <ul id=\"questionContainer\" class=\"display-flex-center\"></ul> \n </div>\n `;\n\n document.body.appendChild(this.container);\n this.createButtons();\n }", "install() {\n this.container = document.createElement('div');\n this.container.id = this.id;\n document.body.appendChild(this.container);\n }", "function findContainerFor(container) {\n container = $(container)\n\n if (!container.length) {\n throw \"no pjax container for \" + container.selector\n } else if (container.selector !== '' && container.context === document) {\n return container\n } else if (container.attr('id')) {\n return $('#' + container.attr('id'))\n } else {\n throw \"cant get selector for pjax container!\"\n }\n }", "function Container()\n{\n DisplayObject.call(this);\n\n /**\n * The array of children of this container.\n *\n * @member {PIXI.DisplayObject[]}\n * @readonly\n */\n this.children = [];\n}", "function Container()\n{\n DisplayObject.call(this);\n\n /**\n * The array of children of this container.\n *\n * @member {PIXI.DisplayObject[]}\n * @readonly\n */\n this.children = [];\n}", "function getContainer() {\n var container = document.getElementById('canvasContainer') || document.createElement('div');\n\n container.id = 'canvasContainer'; //TODO: wont work for multiple containers\n container.style.position = 'relative';\n container.style.top = '0';\n container.style.left = '0';\n container.style.margin = 'auto';\n\n return container;\n }", "initContainerDrag() {\n const me = this;\n //use container drag as default mode\n if (!me.mode) me.mode = 'container';\n if (me.mode === 'container' && !me.containers) throw new Error('Container drag mode must specify containers');\n }", "function createDivContainer() {\r\n\tvar divContainer = self.document.getElementById(v_divname);\r\n\treturn divContainer;\r\n}", "function CB_ContainerControl(params) {\r\n\tthis.TYPE = \"CONTAINER_CONTROL\";\r\n\tthis.components = null;\r\n\tthis.setting(params);\r\n\r\n\tthis.setComponent = function(component) {\r\n\t\tif ((typeof component==='undefined')||(component===null)) return;\r\n\t\tif (this.components===null) this.components = new Array();\t// inherit issue\r\n\t\tvar len = this.components.push(component);\r\n\t\tcomponent.setContainer(this);\r\n\t\tcomponent.setting({index:len-1});\r\n\t\treturn len-1;\r\n\t};\r\n\r\n\tthis.setTheme = function (params) {\r\n\t\tthis.viewObj.loadTheme(params);\r\n\t\t// reload every component's theme\r\n\t\tfor (var i=0; i<this.components.length; i++) {\r\n\t\t\tthis.components[i].viewObj.loadTheme();\r\n\t\t}\r\n\t};\r\n}", "constructor(containerClass, showTime = 3000) {\n this.container = document.querySelector(containerClass);\n this.showTime = showTime;\n }", "function CB_WContainerControl(params) {\r\n\tthis.TYPE = \"WIDGET_CONTAINER_CONTROL\";\r\n\tthis.setting(params);\r\n\t\r\n\tthis.setContTitleBar=function(params){this.viewObj.setContTitleBar(params);};\r\n\tthis.setContBorder\t=function(params){this.viewObj.setContBorder(params);};\r\n\tthis.setTitleBar\t=function(params){this.viewObj.setTitleBar(params);};\r\n\tthis.setStatusBar\t=function(params){this.viewObj.setStatusBar(params);};\r\n\tthis.setBorder\t\t=function(params){this.viewObj.setBorder(params);};\r\n\tthis.setOption \t\t=function(params){this.viewObj.setOption(params);};\r\n\tthis.setCss \t\t=function(params){this.viewObj.setCss(params);};\r\n\tthis.minimize\t\t=function(params){this.viewObj.minimize(params);};\r\n\tthis.maximize\t\t=function(params){this.viewObj.maximize(params);};\r\n\tthis.close\t\t\t=function(params){this.viewObj.close(params);};\r\n\tthis.popup\t\t\t=function(params){this.viewObj.popup(params);};\r\n\tthis.restore\t\t=function(params){this.viewObj.restore(params);};\r\n\tthis.active\t\t\t=function(index){this.viewObj.active(index);};\r\n\r\n}", "appendTargetContainer() {\n const { config, elements, player } = this;\n elements.container = config.target;\n\n // String selector passed\n if (is.string(elements.container)) {\n elements.container = document.querySelectorAll(elements.container);\n }\n\n // jQuery, NodeList or Array passed, use first element\n if (\n (window.jQuery && elements.container instanceof jQuery) ||\n is.nodeList(elements.container) ||\n is.array(elements.container)\n ) {\n // eslint-disable-next-line\n this.elements.container = elements.container[0];\n }\n\n // Clone the original element so if the element gets destroyed we can return it to its original state\n const clone = this.elements.container.cloneNode(true);\n this.elements.original = clone;\n\n // set editor container class\n this.elements.container.classList.add(player.config.classNames.editor.container);\n }", "function getContainer() {\n var startbutton_container = document.getElementById(\"startbutton_container\")\n var question_container = document.getElementById(\"question_container\");\n var content_container = document.getElementById(\"content_container\");\n var button_container = document.getElementById(\"button_container\");\n var end_container = document.getElementById(\"end_container\");\n var text_container = document.getElementById(\"text_container\");\n var endbutton_container = document.getElementById(\"endbutton_container\");\n var vote_weighting_container = document.getElementById(\"vote_weighting_container\");\n var partijenSelectie_container = document.getElementById(\"partijenSelectie_container\");\n var Selectie_container = document.getElementById(\"Selectie_container\");\n}", "function findContainerFor(container) {\n container = $(container)\n\n if ( !container.length ) {\n throw \"no pjax container for \" + container.selector\n } else if ( container.selector !== '' && container.context === document ) {\n return container\n } else if ( container.attr('id') ) {\n return $('#' + container.attr('id'))\n } else {\n throw \"cant get selector for pjax container!\"\n }\n}", "function findContainerFor(container) {\n container = $(container)\n\n if ( !container.length ) {\n throw \"no pjax container for \" + container.selector\n } else if ( container.selector !== '' && container.context === document ) {\n return container\n } else if ( container.attr('id') ) {\n return $('#' + container.attr('id'))\n } else {\n throw \"cant get selector for pjax container!\"\n }\n}", "function findContainerFor(container) {\n container = $(container)\n\n if ( !container.length ) {\n throw \"no pjax container for \" + container.selector\n } else if ( container.selector !== '' && container.context === document ) {\n return container\n } else if ( container.attr('id') ) {\n return $('#' + container.attr('id'))\n } else {\n throw \"cant get selector for pjax container!\"\n }\n}", "function findContainerFor(container) {\n container = $(container)\n\n if ( !container.length ) {\n throw \"no pjax container for \" + container.selector\n } else if ( container.selector !== '' && container.context === document ) {\n return container\n } else if ( container.attr('id') ) {\n return $('#' + container.attr('id'))\n } else {\n throw \"cant get selector for pjax container!\"\n }\n}", "function findContainerFor(container) {\n container = $(container)\n\n if ( !container.length ) {\n throw \"no pjax container for \" + container.selector\n } else if ( container.selector !== '' && container.context === document ) {\n return container\n } else if ( container.attr('id') ) {\n return $('#' + container.attr('id'))\n } else {\n throw \"cant get selector for pjax container!\"\n }\n}", "function findContainerFor(container) {\n container = $(container)\n\n if ( !container.length ) {\n throw \"no pjax container for \" + container.selector\n } else if ( container.selector !== '' && container.context === document ) {\n return container\n } else if ( container.attr('id') ) {\n return $('#' + container.attr('id'))\n } else {\n throw \"cant get selector for pjax container!\"\n }\n}", "function findContainerFor(container) {\n container = $(container)\n\n if ( !container.length ) {\n throw \"no pjax container for \" + container.selector\n } else if ( container.selector !== '' && container.context === document ) {\n return container\n } else if ( container.attr('id') ) {\n return $('#' + container.attr('id'))\n } else {\n throw \"cant get selector for pjax container!\"\n }\n}", "function findContainerFor(container) {\n container = $(container)\n\n if ( !container.length ) {\n throw \"no pjax container for \" + container.selector\n } else if ( container.selector !== '' && container.context === document ) {\n return container\n } else if ( container.attr('id') ) {\n return $('#' + container.attr('id'))\n } else {\n throw \"cant get selector for pjax container!\"\n }\n}", "getSearchResultsContainers() {\n return {\n searchArtistContainer: document.getElementById('search-artist-container'),\n searchAlbumContanier: document.getElementById('search-album-container'),\n searchTrackContainer: document.getElementById('search-track-container'),\n searchPlaylistContainer: document.getElementById('search-playlist-container')\n }\n }", "static setup(container:HTMLElement) {\n this.isoWorld = new Iso(container);\n }", "function LiquidContainer(parent, opts) {\n this.parent = parent;\n this.opts = opts || {};\n this.draw();\n}", "createDragContainer() {\n this.dragContainer = document.createElement('div');\n this.dragContainer.className = c.CLASS_NAMES.DRAG_CONTAINER;\n\n document.body.appendChild(this.dragContainer);\n }", "initContainerDrag() {\n const me = this; //use container drag as default mode\n\n if (!me.mode) me.mode = 'container';\n if (me.mode === 'container' && !me.containers) throw new Error('Container drag mode must specify containers');\n }" ]
[ "0.7439379", "0.7439379", "0.7337559", "0.7337559", "0.7337559", "0.7328251", "0.70548034", "0.70548034", "0.69716597", "0.69716597", "0.69349724", "0.6858214", "0.6858214", "0.6858214", "0.68473464", "0.68473464", "0.6801963", "0.6801963", "0.6801963", "0.67981917", "0.67747575", "0.67747575", "0.6745256", "0.6723082", "0.6715928", "0.6692535", "0.6692535", "0.6628377", "0.6617911", "0.6585608", "0.6493579", "0.64502084", "0.6360856", "0.6360856", "0.6351868", "0.63434404", "0.63233453", "0.62970424", "0.6290779", "0.628842", "0.628842", "0.6280833", "0.6280833", "0.6280833", "0.62579733", "0.62327266", "0.6223668", "0.6176289", "0.6175964", "0.61632824", "0.6152307", "0.6141612", "0.613592", "0.61023176", "0.6080966", "0.606913", "0.60669005", "0.60667914", "0.60547495", "0.60423714", "0.6036637", "0.60034215", "0.5988078", "0.59503925", "0.59493494", "0.59453714", "0.5936569", "0.5933769", "0.5925244", "0.5904371", "0.5901136", "0.59002393", "0.58948123", "0.5894556", "0.5885788", "0.5868355", "0.5866884", "0.58663815", "0.58663815", "0.5859378", "0.5850927", "0.58445793", "0.5837391", "0.58247244", "0.58229387", "0.5820365", "0.5817175", "0.58162683", "0.58162683", "0.58162683", "0.58162683", "0.58162683", "0.58162683", "0.58162683", "0.58162683", "0.5813417", "0.5800521", "0.5799157", "0.57920593", "0.5779762" ]
0.5921352
69
render function no parameters
render() { renderer.render(scene, camera); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {}", "render() {}", "render() {}", "render(){}", "render(){}", "_render() {}", "function render() {\n\t\t\n\t}", "function render() {\n\t}", "render() { }", "function render() {\r\n\r\n}", "function render() {\r\n\r\n}", "function render() {\n\t\t\t}", "function render() {\n\n\t\t\t}", "render() {\n\n\t}", "render() {\n\n\t}", "static rendered () {}", "static rendered () {}", "render() {\n }", "render() {\n\n }", "render( ) {\n return null;\n }", "render(){return html``}", "render(){\r\n\r\n\t}", "render() {\n\n }", "render() {\n\n }", "render() {\n\n }", "render() {\n\t\treturn (\n\t\t\tnull\n\t\t)\n\t}", "render() {\n }", "render() {\n }", "render() { // it is a function ==> render: function() {}\n return (<h1>Hello World!!!!!!!</h1>);\n }", "render() {\n\t\treturn null;\n\t}", "render() {\n // Subclasses should override\n }", "render(){return renderNotImplemented;}", "function general_render(obj) {\n obj.render();\n }", "render() {\n return html ``;\n }", "render() {\n return \"\";\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render () {\n throw new Error('render function must be override!')\n }", "renderPage() {}", "render() {\n return renderNotImplemented;\n }", "render() {\n return renderNotImplemented;\n }", "render(map)\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}", "render(context)\n {\n throw new Error(\"Not Implenemted\")\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return '';\n }", "render() {\n return this.renderContent()\n }", "render() {\n\t\treturn <div>{this.renderContent()}</div>;\n\t}", "render() {\n return(\n null\n );\n }", "function nullRender() { return null; }", "renderHTML() {\n \n }", "render() {\n return this.renderContent();\n }", "render() { return super.render(); }", "render() {\n return <div>{this.toRender()}</div>;\n }", "render(){\n //esto es lo que te devuelve esta funcion\n return <div></div>;\n }", "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "render() {\n return (\n\n\n\n\n\n )\n }", "function nullRender() {\r\n return null;\r\n}", "function nullRender() {\r\n return null;\r\n}", "render() {\r\n return;\r\n }", "render()\n {\n return template;\n }", "function nullRender() {\n return null;\n}", "function nullRender() {\n return null;\n}", "function nullRender() {\n return null;\n}", "function nullRender() {\n return null;\n}", "function RenderEvent() {}", "render() {\n\n return (\n <div>\n {this.renderContent()}\n </div>\n );\n \n }", "render(){\n //Every render method always return HTML\n return <h1>Welcome to Myclass</h1>;\n }", "render(force=false) {\n return;\n }", "onRender()/*: void*/ {\n this.render();\n }", "render(data, render =true ) {\n if (!data || (Array.isArray(data) && data.length ===0))return this.renderError();\n this._data =data;\n const markup = this._generateMarkup();\n if(!render) return markup;\n this._clear();\n this._parentElement.insertAdjacentHTML('afterbegin',markup);}", "render() {\n return super.render();\n }", "renderScreenContent(){}", "function Renderer(args) {\n\n\n}", "function render() {\n renderRegistry();\n renderDirectory();\n renderOverride();\n}", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "function render(){ \n console.log('`render function` ran');\n const createdHtml = generateHtml(STORE); \n $('main').html(createdHtml);\n}", "function render() {\n\t\treturn graphTpl;\n\t}", "function render() {\n let bigString;\n console.log('render fxn ran')\n if (store.view === 'landing') {\n bigString = generateTitleTemplate(store);\n\n }\n else if (store.view === 'question') {\n bigString = generateQuestionTemplate(store);\n\n }\n else if (store.view === 'feedback') {\n bigString = generateFeedbackTemplate(store)\n\n }\n else if (store.view === 'results') {\n bigString = generateResultsTemplate(store);\n\n }\n $('main').html(bigString);\n\n //attach event listeners\n\n\n}", "function render() {\n htmlString = `<div>\n <h1>${state.pageHeader}</h1>\n ${renderGames()} \n <div onclick='addGame()'>[Add Games]</div>\n </div>`;\n\n document.getElementById(\"app\").innerHTML = htmlString;\n }", "function init() { render(this); }", "function Render(params) {\n Transform.call(this, null, params);\n }", "render(webGLRenderer) {}", "render() {\n\t\tthis.a1.render(this.context);\n\t\tthis.b1.render(this.context);\n\t\tthis.c1.render(this.context);\n\t\tthis.c2.render(this.context);\n\t\tthis.d1.render(this.context);\n\t\tthis.e1.render(this.context);\n\t\tthis.f1.render(this.context);\n\t\tthis.g1.render(this.context);\n\t\tthis.a1s.render(this.context);\n\t\tthis.c1s.render(this.context);\n\t\tthis.d1s.render(this.context);\n\t\tthis.f1s.render(this.context);\n\t\tthis.g1s.render(this.context);\n\n\t}", "Render(){\n throw new Error(\"Render() method must be implemented in child!\");\n }", "render() {\n// A render method must contain a return statement. Usually, this return statement returns a JSX expression\n return <h1>Hello world</h1>;\n }", "render(...args) {\n if (this._render) {\n this.__notify(EV.BEFORE_RENDER);\n this._render(...args);\n this.__notify(EV.RENDERED);\n }\n\n this.rendered = true;\n }", "onRender () {\n\n }", "render() {\n if (this.state.error) {\n return this.renderError();\n }\n else if (this.state.showResult) {\n return this.renderResult();\n } else {\n return this.renderNormal();\n }\n }", "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "render(){\n\n //retorna el template usando el html del tag del template, crea los elementos en el dom\n return html`\n <div>Hello Word!!</div>\n `;\n }", "_render()\n {\n if (this.isDisabled())\n return;\n\n this._setContentSizeCss();\n this._setDirection();\n const paragraph = html`<p>${this.text}</p>`;\n let anchor = \"\";\n let action = \"\";\n if (this.link && this.linkText)\n anchor = html`<a href=\"${this.link}\" target=\"_blank\">${this.linkText}</a>`;\n if (this.action && this.actionText)\n action = html`${anchor ? \" | \" : \"\"}<a href=\"javascript:void(0)\" @click=${this.action}>${this.actionText}</a>`;\n let heading = \"\";\n if (this.heading)\n heading = html`<h4>${this.heading}</h4>`;\n\n render(html`${heading}${paragraph}<div id=\"links\">${anchor}${action}</div>`, this.tooltipElem);\n }", "renderContent() {\n return null;\n }", "function TextRenderer(){}// no need for block level renderers", "render() {\n return(<div />);\n }", "function render() {\n renderCards();\n renderValue();\n}" ]
[ "0.8659872", "0.8659872", "0.8659872", "0.8652602", "0.8652602", "0.8313013", "0.81083506", "0.81060207", "0.80614984", "0.8010545", "0.8010545", "0.7989533", "0.7971203", "0.77132833", "0.77132833", "0.7700337", "0.7700337", "0.7667921", "0.76674515", "0.760555", "0.7482885", "0.74667686", "0.7459891", "0.7459891", "0.7459891", "0.74455595", "0.74450666", "0.74450666", "0.7355814", "0.73176956", "0.7282095", "0.723659", "0.7135044", "0.709279", "0.7015849", "0.70127636", "0.70127636", "0.69750243", "0.6960294", "0.69014955", "0.69014955", "0.6877879", "0.6854977", "0.68452114", "0.68452114", "0.68452114", "0.68452114", "0.68452114", "0.68452114", "0.6817993", "0.6744302", "0.67357504", "0.6723404", "0.672065", "0.67175984", "0.6697383", "0.66837865", "0.666255", "0.6651649", "0.66121155", "0.6597178", "0.65772456", "0.65772456", "0.6550794", "0.65477175", "0.6522895", "0.6522895", "0.6522895", "0.6522895", "0.6519679", "0.6506838", "0.65065145", "0.6503451", "0.64832544", "0.6462217", "0.64616483", "0.64603746", "0.6458415", "0.6440179", "0.64179885", "0.64179885", "0.6412695", "0.64119095", "0.64107025", "0.63979393", "0.6377756", "0.6366025", "0.6358549", "0.63534284", "0.63353103", "0.63224405", "0.63222516", "0.6309197", "0.6298519", "0.6283345", "0.62699866", "0.6260372", "0.62547606", "0.6253786", "0.6247374", "0.62466127" ]
0.0
-1
todo: 'npmlink` doesn't track adding new files, so watch mode should be added
function npmLinkCommand({ project, local, deep, verbose, yarn, here }) { const noDeepLinking = deep === false; // 1. clean dist folders // 2.1 merge pkg json // 2.2 validate pkg (main, module, types) // 2.3 write pkg // 3. compile ts return utils_1.findSubmodules(project, { local }) .then((opts) => new Listr([ { title: 'Link all submodules', task: () => { const linkingTasks = new Listr(opts.map(opt => ({ title: `npm link ${opt.pkg.name} (from: ${opt.dist})`, task: () => tasks_1.npmLink({ yarn, cwd: opt.dist }) }))); if (noDeepLinking) { return linkingTasks; } opts.filter(opt => opt.cross.length > 0) .forEach(opt => opt.cross .forEach(crossName => linkingTasks.add({ title: `npm link ${crossName} to ${opt.pkg.name} (${opt.src})`, task: () => tasks_1.npmLink({ yarn, cwd: opt.dist, module: crossName }) }))); return linkingTasks; } }, { title: 'Link submodules to local project', task: () => new Listr(opts.map(opt => ({ title: `npm link ${opt.pkg.name}`, task: () => tasks_1.npmLink({ yarn, module: opt.pkg.name, cwd: '.' }) }))), skip: () => here !== true } ], { renderer: verbose ? 'verbose' : 'default' })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "function FsEventsHandler() {} // Private method: Handle symlinks encountered during directory scan", "async function notifySymlink(name) {\n if (!ApplicationState._symlinks)\n return;\n\n //if there's a symlink that refers to this path\n let symlinks = ApplicationState._reverseSymlink(name);\n //and there's a listener on that symlink, trigger that notification\n for (let index = 0; index < symlinks.length; index++) {\n const symlink = symlinks[index];\n if (!ApplicationState._listeners[symlink]) return;\n if (options.exclude_notification_paths.indexOf(symlink) >= 0) return;\n\n const symlink_listeners = ApplicationState._listeners[symlink];\n for (let listener_index = 0; listener_index < symlink_listeners.lenth; listener_index++) {\n await send(symlink_listeners[listener_index], symlink);\n }\n }\n }", "function maybeSync(localPath, name, rest) {\n var stats = fs.statSync(localPath);\n if (!stats.isFile(localPath)) {\n return;\n }\n var source = fs.realpathSync(path.join(jlab.linkedPackages[name], rest));\n if (source === localPath) {\n return;\n }\n fs.watchFile(source, { 'interval': 500 }, function(curr) {\n if (!curr || curr.nlink === 0) {\n return;\n }\n try {\n console.log('updating', path.join(name, rest));\n fs.copySync(source, localPath);\n } catch (err) {\n console.error(err);\n }\n });\n}", "watch() {\n fs.readdir(this.watchDir, (err, files) => {\n if (err) throw err;\n for (let index in files) {\n this.emit('process', files[index]);\n }\n });\n }", "ondir() {}", "function addWatcher (newPath) {\n fileWatcher = chokidar.watch(newPath, {\n persistent: true,\n ignored: /(^|[/\\\\])\\../ //For .DS_Store on MacOS\n });\n // console.log(newPath)\n //Signals to setMovieFolder that a watcher exists\n isWatching = true;\n fileWatcher.on('ready', async () => {\n // Retrieve files being watched\n let watched = fileWatcher.getWatched();\n watched = watched[newPath]\n // console.log(watched)\n // Calls sync function\n await onReadySync(watched);\n fileWatcher.on('add', filePath => insertMovie(filePath));\n fileWatcher.on('unlink', filePath => removeMovie(filePath));\n fileWatcher.on('error', error => {\n console.error(`FILEWATCHER ERROR: ${error}`)\n }); \n });\n}", "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 }", "watch() {\n const watcher = this;\n fs.readdir(this.watchDir, function(err, files) {\n if (err) throw err;\n for (let index in files) {\n watcher.emit(\"process\", files[index]);\n }\n });\n }", "[_changePath] (newPath) {\n // have to de-list before changing paths\n this[_delistFromMeta]()\n const oldPath = this.path\n this.path = newPath\n const namePattern = /(?:^|\\/|\\\\)node_modules[\\\\/](@[^/\\\\]+[\\\\/][^\\\\/]+|[^\\\\/]+)$/\n const nameChange = newPath.match(namePattern)\n if (nameChange && this.name !== nameChange[1])\n this.name = nameChange[1].replace(/\\\\/g, '/')\n\n // if we move a link target, update link realpaths\n if (!this.isLink) {\n this.realpath = newPath\n for (const link of this.linksIn) {\n link[_delistFromMeta]()\n link.realpath = newPath\n link[_refreshLocation]()\n }\n }\n // if we move /x to /y, then a module at /x/a/b becomes /y/a/b\n for (const child of this.fsChildren)\n child[_changePath](resolve(newPath, relative(oldPath, child.path)))\n for (const [name, child] of this.children.entries())\n child[_changePath](resolve(newPath, 'node_modules', name))\n\n this[_refreshLocation]()\n }", "function maybeSync(localPath, name, rest) {\n let stats;\n try {\n stats = fs.statSync(localPath);\n } catch (e) {\n return;\n }\n\n if (!stats.isFile(localPath)) {\n return;\n }\n const source = fs.realpathSync(path.join(jlab.linkedPackages[name], rest));\n if (source === fs.realpathSync(localPath)) {\n return;\n }\n fs.watchFile(source, { interval: 500 }, function (curr) {\n if (!curr || curr.nlink === 0) {\n return;\n }\n try {\n fs.copySync(source, localPath);\n } catch (err) {\n console.error(err);\n }\n });\n}", "function createRootSymLink() {\n var li1 = process.argv[1].lastIndexOf('\\\\'), li2 = process.argv[1].lastIndexOf('/');\n if (li2 > li1) { li1 = li2; }\n var AppPath = process.argv[1].substring(0,li1);\n var p1 = resolve(AppPath + \"/\" + nativescriptAppPath);\n var p2 = resolve(AppPath + \"/\" + webAppPath);\n if (debugging) {\n console.log(\"Path: \", p1, p2);\n }\n fs.symlinkSync(p2, p1, 'junction');\n\n p1 = resolve(AppPath + \"/\" + nativescriptAssetsPath);\n p2 = resolve(AppPath + \"/\" + webAssetsPath);\n if (debugging) {\n console.log(\"Path: \", p1, p2);\n }\n fs.symlinkSync(p2,p1,'junction');\n}", "compileAll () {\n const { from } = this.data\n globby.sync(from, { onlyFiles: true })\n .map(fromRelative => this.switchCallback('change', fromRelative, false))\n }", "startMonitor () {\n this.watchers.length = 0\n this.dirs.forEach((dir) => {\n let watcher\n try {\n watcher = fs.watch(path.resolve(dir.metadata.localPath), { recursive: true }, () => {\n this.dirty = true\n setTimeout(() => this.run(), 0) // start backup 3s later\n })\n } catch (e) {\n console.warn('watch file error', e)\n return\n }\n this.watchers.push(watcher)\n })\n }", "function symlinkNodeModules() {\n Object.keys(requiredNodeModules).forEach(importName => {\n const outputPath = path.join(tmpDir, 'node_modules', importName);\n const moduleDir = requiredNodeModules[importName];\n shx.mkdir('-p', path.dirname(outputPath));\n fs.symlinkSync(moduleDir, outputPath, 'junction');\n });\n}", "function notifyLiveReload(event) {\n\tvar fileName = require('path').relative(__dirname + '/dist', event.path);\n\ttinylr.changed({\n\t\tbody: {\n\t\t\tfiles: [fileName]\n\t\t}\n\t});\n}", "async updateAllLinks() {\n await this.db.transaction('rw', this.db.files, this.db.links, () => {\n this.db.files.where(\"type\").equals(\"file\").each((file) => {\n this.addLinks(file) \n })\n })\n console.log('updateAllLinks() finished.')\n }", "function statFollowLinks() {\n return fs.statSync.apply(fs, arguments);\n}", "function statFollowLinks() {\n return fs.statSync.apply(fs, arguments);\n}", "function statFollowLinks() {\n return fs.statSync.apply(fs, arguments);\n}", "function statFollowLinks() {\n return fs.statSync.apply(fs, arguments);\n}", "function onNewFile(file) {\n\n\tconsole.log(\"onNewFile() - watch_old: \" + this.watchDir + \n\t \" process_old: \" + this.processedDir);\n\n\tvar watchFile = this.watchDir + '/' + file;\n\tvar processedFile = this.processedDir + '/' + file.toLowerCase();\n\n\tconsole.log(\"onNewFile() - watch_new: \" + watchFile + \n\t \" process_new: \" + processedFile);\n\n\tfs.rename(watchFile, processedFile, onError);\n}", "_register() {\n // let relativeStartIndex = this.root.length + 1\n // let pathRelativeToRoot = (absolutePath) => {\n // return absolutePath.substr(relativeStartIndex)\n // }\n \n let watcher = this.watcher\n // add\n watcher.on(\"add\", (filepath) => {\n \n invokeNodeChildEventCallback.call(this, filepath, \"child.addFile\")\n })\n \n // addDir\n watcher.on(\"addDir\", (filepath) => {\n invokeNodeChildEventCallback.call(this, filepath, \"child.addDir\")\n })\n \n // unlink\n watcher.on(\"unlink\", (filepath) => {\n \n invokeNodeChildEventCallback.call(this, filepath, \"child.removeFile\")\n invokeNodeEventCallback.call(this, filepath, \"remove\")\n })\n \n // unlinkDir\n watcher.on(\"unlinkDir\", (filepath) => {\n \n invokeNodeChildEventCallback.call(this, filepath, \"child.removeDir\")\n invokeNodeEventCallback.call(this, filepath, \"remove\")\n })\n \n \n watcher.on(\"change\", (filepath) => {\n // on file change, we also need to update the file in model to mark it dirty\n this.rootDirectory.markFileDirty(filepath)\n invokeNodeChildEventCallback.call(this, filepath, \"child.change\")\n invokeNodeEventCallback.call(this, filepath, \"change\")\n })\n }", "function addWatch(folderPath/*absolute path*/){\n\n //read through the folder. if it contains subfolder, add watcher on those too\n _.each(fs.readdirSync(folderPath), function(filename, index){\n var abs = path.join(folderPath, filename);\n //check whether the file is a folder\n if(fs.lstatSync(abs).isDirectory()){\n addWatch(abs);\n }\n \n });\n\n var watcher = fs.watch(folderPath, _.debounce(function(event, filename){\n //absolute path for the file\n var abs = path.join(folderPath, filename);\n\n //return, if a file is not folder and not .html\n if(!watchers[abs] && !(fs.existsSync(abs) && fs.lstatSync(abs).isDirectory()) && path.extname(filename) !== '.less') return;\n\n //events\n if(fs.existsSync(abs)){//add or change\n\n //check whether the newly added file is a folder\n if(fs.lstatSync(abs).isDirectory() && !watchers[abs]){\n addWatch(abs);\n }\n doCompile((event === \"rename\") ? 'added' : 'changed', abs);\n }else{//delete\n\n //check whether the file is previously in the watchers obj\n if(watchers[abs]){\n watchers[abs].close();\n delete watchers[abs];\n }\n\n doCompile('deleted', abs);\n }\n }, 200));\n\n watchers[folderPath] = watcher;\n }", "async writelink(filename, buffer) {\n return this._symlink(buffer.toString('utf8'), filename)\n }", "constructor(_opts) {\n super();\n\n const opts = {};\n if (_opts) Object.assign(opts, _opts); // for frozen objects\n\n /** @type {Map<String, DirEntry>} */\n this._watched = new Map();\n /** @type {Map<String, Array>} */\n this._closers = new Map();\n /** @type {Set<String>} */\n this._ignoredPaths = new Set();\n\n /** @type {Map<ThrottleType, Map>} */\n this._throttled = new Map();\n\n /** @type {Map<Path, String|Boolean>} */\n this._symlinkPaths = new Map();\n\n this._streams = new Set();\n this.closed = false;\n\n // Set up default options.\n if (undef(opts, 'persistent')) opts.persistent = true;\n if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false;\n if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false;\n if (undef(opts, 'interval')) opts.interval = 100;\n if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300;\n if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false;\n opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;\n\n // Enable fsevents on OS X when polling isn't explicitly enabled.\n if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;\n\n // If we can't use fsevents, ensure the options reflect it's disabled.\n const canUseFsEvents = FsEventsHandler.canUse();\n if (!canUseFsEvents) opts.useFsEvents = false;\n\n // Use polling on Mac if not using fsevents.\n // Other platforms use non-polling fs_watch.\n if (undef(opts, 'usePolling') && !opts.useFsEvents) {\n opts.usePolling = isMacos;\n }\n\n // Always default to polling on IBM i because fs.watch() is not available on IBM i.\n if(isIBMi) {\n opts.usePolling = true;\n }\n\n // Global override (useful for end-developers that need to force polling for all\n // instances of chokidar, regardless of usage/dependency depth)\n const envPoll = process.env.CHOKIDAR_USEPOLLING;\n if (envPoll !== undefined) {\n const envLower = envPoll.toLowerCase();\n\n if (envLower === 'false' || envLower === '0') {\n opts.usePolling = false;\n } else if (envLower === 'true' || envLower === '1') {\n opts.usePolling = true;\n } else {\n opts.usePolling = !!envLower;\n }\n }\n const envInterval = process.env.CHOKIDAR_INTERVAL;\n if (envInterval) {\n opts.interval = Number.parseInt(envInterval, 10);\n }\n\n // Editor atomic write normalization enabled by default with fs.watch\n if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents;\n if (opts.atomic) this._pendingUnlinks = new Map();\n\n if (undef(opts, 'followSymlinks')) opts.followSymlinks = true;\n\n if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false;\n if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};\n const awf = opts.awaitWriteFinish;\n if (awf) {\n if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000;\n if (!awf.pollInterval) awf.pollInterval = 100;\n this._pendingWrites = new Map();\n }\n if (opts.ignored) opts.ignored = arrify(opts.ignored);\n\n let readyCalls = 0;\n this._emitReady = () => {\n readyCalls++;\n if (readyCalls >= this._readyCount) {\n this._emitReady = EMPTY_FN;\n this._readyEmitted = true;\n // use process.nextTick to allow time for listener to be bound\n process.nextTick(() => this.emit(EV_READY));\n }\n };\n this._emitRaw = (...args) => this.emit(EV_RAW, ...args);\n this._readyEmitted = false;\n this.options = opts;\n\n // Initialize with proper watcher.\n if (opts.useFsEvents) {\n this._fsEventsHandler = new FsEventsHandler(this);\n } else {\n this._nodeFsHandler = new NodeFsHandler(this);\n }\n\n // You’re frozen when your heart’s not open.\n Object.freeze(opts);\n}", "function init_watchlinks() {\r\n var links = document.getElementsByTagName(\"A\");\r\n var thisuser = get_profilename();\r\n\r\n for (var i=0; i<links.length; ++i) {\r\n var link = links[i];\r\n\r\n // Skip if the link's parent already contains a watch button\r\n if (link.parentNode.getElementsByClassName('watchbutton').length > 0)\r\n continue;\r\n\r\n var username = user_from_href(link.href);\r\n\r\n // Skip if the link matches the current URL\r\n if (username && username != thisuser) {\r\n var watchbutton = create_watchbutton(username, 0);\r\n\r\n if (link.nextSibling == undefined)\r\n link.parentNode.appendChild(watchbutton);\r\n else\r\n link.parentNode.insertBefore(watchbutton, link.nextSibling);\r\n }\r\n }\r\n\r\n update_watchbuttons();\r\n}", "async function copy({ watch } = {}) {\n const ncp = Promise.promisify(require('ncp'));\n\n await Promise.all([\n ncp('src/public', 'build/public'),\n ncp('src/content', 'build/content'),\n ]);\n\n await fs.writeFile('./build/package.json', JSON.stringify({\n private: true,\n engines: pkg.engines,\n dependencies: pkg.dependencies,\n scripts: {\n start: 'node server.js',\n },\n }, null, 2));\n\n if (watch) {\n const watcher = await new Promise((resolve, reject) => {\n gaze('src/content/**/*.*', (err, val) => err ? reject(err) : resolve(val));\n });\n watcher.on('changed', async (file) => {\n const relPath = file.substr(path.join(__dirname, '../src/content/').length);\n await ncp(`src/content/${relPath}`, `build/content/${relPath}`);\n });\n }\n}", "function logFileChange(event) {\n var fileName = path.relative(__dirname, event.path);\n console.log('[' + 'WATCH'.green + '] ' + fileName.magenta + ' was ' + event.type + ', running tasks...');\n }", "start() {\n fs.watchFile(this.watchDir, () => {\n this.watch();\n });\n }", "function touch_dir (dirname, op, fcb) {\n\tfs.readdir(dirname, function(err, files){\n\t\tif (err) {\n\t\t\tconsole.log('failed to read : ' + dirname);\n\t\t\tthrow err;\n\t\t}\n\t\ttouch_file(dirname, files, op, fcb);\n\t});\n}", "function startFileStatus(){\n // Javascript Files\n var file = document.createElement('script'); // Hack to extract absolute url\n $jQ('script[src]').each(function(){\n file.src=$jQ(this).attr('src');\n setLink($jQ(this),'src', file.src);\n });\n // CSS Files\n file = document.createElement('link'); // Hack to extract absolute url\n $jQ('link[href]').each(function(){\n file.href=$jQ(this).attr('href');\n setLink($jQ(this),'href', file.href);\n });\n}", "_watch(target, recurse) {\n let start,\n jsFileRE = /[\\w_$-]+\\.(js|jsx|ts)/,\n watchCB\n\n// Configure http and socket communications....\n this._configureHTTP()\n\n// Start the server...\n this._igniteServer(\n process.env.PORT || this.options.watchOpts.port || app.get('port')\n )\n\n watchCB =(fn, pass=false)=> {\n/// If the changed file is valid....\n if (pass || this._validFileName(fn)) {\n// Get start time.....\n start = Date.now()\n\n// Roll up a new bundle....\n this._bundleFiles(this.entryFile, ()=> {\n// Send message via websocket to browser...\n io.emit('file-change', { file: fn })\n })\n// Stop the timer and subtract start time to get elapsed bundle time....\n this.ms = Date.now() - start\n// Stop the spinner with success....\n this.spinner.succeed('🗞')\n }\n }\n\n if (jsFileRE.test(target)) {\n // log('TARGET', 'magenta');log(target)\n// watch the target directory for file changes....\n fs.watchFile(target, (curr, prev)=> {\n// Execute cb.......\n watchCB(target, true)\n })\n } else {\n/// watch the root directory for file changes....\n fs.watch(target, {recursive: recurse}, (event, fileName)=> {\n // log('FILENAME', ['red', 'bold']);log(fileName);log(fileName.includes(this.outputFile));\n// Execute cb.......\n watchCB(fileName)\n })\n }\n }", "function watchArchivos(){\n watch(paths.watch,css);\n watch(paths.js,javascript)\n }", "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 }", "function createRef(file){\n\n\t\t// Create a new fileRef\n\t\tvar pointer = new fileRef({\n\t\t\tname : file.name,\n\t\t\ttype : file.type,\n\t\t\tfile : file\n\t\t}, current_network, current_bucket, true);\n\n\t\tref.push( pointer );\n\n\t\tif(current_folder===\"local\"){\n\t\t\treadFile(file, function(dataURL){\n\n\t\t\t\t// Update list\n\t\t\t\tpointer.update({\n\t\t\t\t\tthumbnail : dataURL,\n\t\t\t\t\tpicture : dataURL\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\telse{\n\t\t\t// Upload the files to the current directory\n\t\t\thello.api(current_folder, \"post\", {file: file}, function(r){\n\t\t\t\t// Once the files have been successfully upload lets update the pointer\n\t\t\t\tpointer.update({\n\t\t\t\t\tid : r.id,\n\t\t\t\t\tthumbnail : r.source,\n\t\t\t\t\tpicture : r.source\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "async onWatchedFileOrFolderChanged(params) {\n // An issue for `@import ...` resources:\n // It's common that we import resources inside `node_modules`,\n // but we can't get notifications when those files changed.\n if (!this.startDataLoaded) {\n return;\n }\n for (let change of params.changes) {\n let uri = change.uri;\n let fsPath = vscode_uri_1.URI.parse(uri).fsPath;\n // New file or folder.\n if (change.type === vscode_languageserver_1.FileChangeType.Created) {\n this.trackFileOrFolder(fsPath);\n }\n // Content changed file or folder.\n else if (change.type === vscode_languageserver_1.FileChangeType.Changed) {\n if (await fs.pathExists(fsPath)) {\n let stat = await fs.stat(fsPath);\n if (stat && stat.isFile()) {\n if (this.shouldTrackFile(fsPath)) {\n this.retrackChangedFile(uri);\n }\n }\n }\n }\n // Deleted file or folder.\n else if (change.type === vscode_languageserver_1.FileChangeType.Deleted) {\n this.untrackDeletedFile(uri);\n }\n }\n }", "function symlinkPaths (srcpath, dstpath, callback) {\n\t if (path.isAbsolute(srcpath)) {\n\t return fs.lstat(srcpath, function (err, stat) {\n\t if (err) {\n\t err.message = err.message.replace('lstat', 'ensureSymlink')\n\t return callback(err)\n\t }\n\t return callback(null, {\n\t 'toCwd': srcpath,\n\t 'toDst': srcpath\n\t })\n\t })\n\t } else {\n\t var dstdir = path.dirname(dstpath)\n\t var relativeToDst = path.join(dstdir, srcpath)\n\t return fs.exists(relativeToDst, function (exists) {\n\t if (exists) {\n\t return callback(null, {\n\t 'toCwd': relativeToDst,\n\t 'toDst': srcpath\n\t })\n\t } else {\n\t return fs.lstat(srcpath, function (err, stat) {\n\t if (err) {\n\t err.message = err.message.replace('lstat', 'ensureSymlink')\n\t return callback(err)\n\t }\n\t return callback(null, {\n\t 'toCwd': srcpath,\n\t 'toDst': path.relative(dstdir, srcpath)\n\t })\n\t })\n\t }\n\t })\n\t }\n\t}", "function symlinkPaths (srcpath, dstpath, callback) {\n\t if (path.isAbsolute(srcpath)) {\n\t return fs.lstat(srcpath, function (err, stat) {\n\t if (err) {\n\t err.message = err.message.replace('lstat', 'ensureSymlink')\n\t return callback(err)\n\t }\n\t return callback(null, {\n\t 'toCwd': srcpath,\n\t 'toDst': srcpath\n\t })\n\t })\n\t } else {\n\t var dstdir = path.dirname(dstpath)\n\t var relativeToDst = path.join(dstdir, srcpath)\n\t return fs.exists(relativeToDst, function (exists) {\n\t if (exists) {\n\t return callback(null, {\n\t 'toCwd': relativeToDst,\n\t 'toDst': srcpath\n\t })\n\t } else {\n\t return fs.lstat(srcpath, function (err, stat) {\n\t if (err) {\n\t err.message = err.message.replace('lstat', 'ensureSymlink')\n\t return callback(err)\n\t }\n\t return callback(null, {\n\t 'toCwd': srcpath,\n\t 'toDst': path.relative(dstdir, srcpath)\n\t })\n\t })\n\t }\n\t })\n\t }\n\t}", "watch (path, delay) {\n console.log('Start watching');\n this.watcher = chokidar.watch(path + '/*.csv', {\n followSymlinks: false,\n usePolling: true,\n interval: delay,\n binaryInterval: delay\n });\n this.watcher.on('change', file => this.emit('dirwatcher:changed', fs.realpathSync(file)));\n }", "static createSymbolicLinkJunction(options) {\n FileSystem._wrapException(() => {\n return FileSystem._handleLink(() => {\n // For directories, we use a Windows \"junction\". On POSIX operating systems, this produces a regular symlink.\n return fsx.symlinkSync(options.linkTargetPath, options.newLinkPath, 'junction');\n }, options);\n });\n }", "[ISREUSABLE] (entry, st) {\n return entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n process.platform !== 'win32'\n }", "[ISREUSABLE] (entry, st) {\n return entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n process.platform !== 'win32'\n }", "async function copy({\n watch\n} = {}) {\n const ncp = Promise.promisify(require('ncp'));\n\n try {\n await processCSS();\n } catch (e) {\n throw e;\n }\n\n await Promise.all([\n ncp('node_modules/milligram/dist/', 'build/public/'),\n ncp('node_modules/font-awesome/css/', 'build/public/'),\n ncp('node_modules/font-awesome/fonts/', 'build/public/fonts/'),\n ncp('src/shared/content/', 'build/public/'),\n ncp('package.json', 'build/package.json')\n ]);\n\n replace({\n regex: '\"start\".*',\n replacement: '\"start\": \"node server.js\"',\n paths: ['build/package.json'],\n recursive: false,\n silent: false,\n });\n\n if (watch) {\n const watcher = await new Promise((resolve, reject) => {\n gaze(['src/shared/content/**/*.*', 'src/shared/styles/**/*.*'], (err, val) =>\n err ? reject(err) : resolve(val)\n );\n });\n watcher.on('changed', async(file) => {\n await processCSS();\n await ncp('src/shared/content', 'build/public');\n });\n }\n}", "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}", "function walkAndUnlink(dirPath, regex){\n\n var emitter = walkdir(dirPath)\n\n emitter.on('file',function(filename,stat){\n if( regex.test(filename) ){\n console.log(\"Removing old file: \" + filename)\n fs.unlinkSync( path.resolve( dirPath, filename) )\n }\n })\n\n}", "function walkAndUnlink(dirPath, regex){\n \n var emitter = walkdir(dirPath)\n\n emitter.on('file',function(filename,stat){\n if( regex.test(filename) ){\n console.log(\"Removing old file: \" + filename)\n fs.unlinkSync( path.resolve( dirPath, filename) )\n }\n })\n \n}", "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}", "constructor(_opts) {\n super();\n\n const opts = {};\n if (_opts) Object.assign(opts, _opts); // for frozen objects\n\n /** @type {Map<String, DirEntry>} */\n this._watched = new Map();\n /** @type {Map<String, Array>} */\n this._closers = new Map();\n /** @type {Set<String>} */\n this._ignoredPaths = new Set();\n\n /** @type {Map<ThrottleType, Map>} */\n this._throttled = new Map();\n\n /** @type {Map<Path, String|Boolean>} */\n this._symlinkPaths = new Map();\n\n this._streams = new Set();\n this.closed = false;\n\n\n // Set up default options.\n if (undef(opts, 'persistent')) opts.persistent = true;\n if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false;\n if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false;\n if (undef(opts, 'interval')) opts.interval = 100;\n if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300;\n if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false;\n opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;\n\n // Enable fsevents on OS X when polling isn't explicitly enabled.\n if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;\n\n // If we can't use fsevents, ensure the options reflect it's disabled.\n const canUseFsEvents = FsEventsHandler.canUse();\n if (!canUseFsEvents) opts.useFsEvents = false;\n\n // Use polling on Mac if not using fsevents.\n // Other platforms use non-polling fs_watch.\n if (undef(opts, 'usePolling') && !opts.useFsEvents) {\n opts.usePolling = process.platform === 'darwin';\n }\n\n // Global override (useful for end-developers that need to force polling for all\n // instances of chokidar, regardless of usage/dependency depth)\n const envPoll = process.env.CHOKIDAR_USEPOLLING;\n if (envPoll !== undefined) {\n const envLower = envPoll.toLowerCase();\n\n if (envLower === 'false' || envLower === '0') {\n opts.usePolling = false;\n } else if (envLower === 'true' || envLower === '1') {\n opts.usePolling = true;\n } else {\n opts.usePolling = !!envLower;\n }\n }\n const envInterval = process.env.CHOKIDAR_INTERVAL;\n if (envInterval) {\n opts.interval = parseInt(envInterval);\n }\n\n // Editor atomic write normalization enabled by default with fs.watch\n if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents;\n if (opts.atomic) this._pendingUnlinks = new Map();\n\n if (undef(opts, 'followSymlinks')) opts.followSymlinks = true;\n\n if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false;\n if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};\n const awf = opts.awaitWriteFinish;\n if (awf) {\n if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000;\n if (!awf.pollInterval) awf.pollInterval = 100;\n this._pendingWrites = new Map();\n }\n if (opts.ignored) opts.ignored = arrify(opts.ignored);\n\n let readyCalls = 0;\n this._emitReady = () => {\n readyCalls++;\n if (readyCalls >= this._readyCount) {\n this._emitReady = EMPTY_FN;\n this._readyEmitted = true;\n // use process.nextTick to allow time for listener to be bound\n process.nextTick(() => this.emit('ready'));\n }\n };\n this._emitRaw = (...args) => this.emit('raw', ...args);\n this._readyEmitted = false;\n this.options = opts;\n\n // Initialize with proper watcher.\n if (opts.useFsEvents) {\n this._fsEventsHandler = new FsEventsHandler(this);\n } else {\n this._nodeFsHandler = new NodeFsHandler(this);\n }\n\n // You’re frozen when your heart’s not open.\n Object.freeze(opts);\n}", "function macWatch() {\n var terminal = require('child_process').spawn('fswatch', [dirMonitored2]);\n\n terminal.stdout.on('data', function (data) {\n data = data.toString().split(\"\\n\");\n console.log('stdout: ' + data);\n sh.each ( data, function (i, file) {\n if ( sh.isFileType(file, 'js') ) {\n helper.trigger(file)\n }\n if ( sh.isFileType(file, 'html') ) {\n helper.trigger(file)\n }\n //var split = file.split(\"\");\n })\n\n });\n\n terminal.on('exit', function (code) {\n console.log('child process exited with code ' + code);\n });\n\n }", "function watch(){\n //Watch for changes in json files\n gaze(path.join(process.cwd(), myOptions.watchedDir) + '/**/*.json', (err, watcher) => {\n // On changed/added/deleted\n watcher.on('all', (event, filepath) => {\n if (myOptions.logLevel>1)\n console.log(filepath + ' was ' + event);\n //If the file is a JSON (database,validation) restart the database\n if (isJSON(filepath)) {\n start(myOptions.restartMode===undefined ? 1 : myOptions.restartMode); //Reload data\n }\n });\n\n });\n}", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, function (err, stat) {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': srcpath\n })\n })\n } else {\n var dstdir = path.dirname(dstpath)\n var relativeToDst = path.join(dstdir, srcpath)\n return fs.exists(relativeToDst, function (exists) {\n if (exists) {\n return callback(null, {\n 'toCwd': relativeToDst,\n 'toDst': srcpath\n })\n } else {\n return fs.lstat(srcpath, function (err, stat) {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "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}", "start() {\n var watcher = this;\n fs.watchFile(watchDir, function() {\n watcher.watch();\n });\n }", "function watchForChanges() {\n watch(\n [srcFiles.pathPug, srcFiles.pathSCSS, srcFiles.pathJS],\n series(\n parallel(compileToReadableHTML, compileToReadableCSS, compileToReadableJS)\n )\n );\n}", "constructor(_opts) {\n super();\n\n const opts = {};\n if (_opts) Object.assign(opts, _opts); // for frozen objects\n\n /** @type {Map<String, DirEntry>} */\n this._watched = new Map();\n /** @type {Map<String, Array>} */\n this._closers = new Map();\n /** @type {Set<String>} */\n this._ignoredPaths = new Set();\n\n /** @type {Map<ThrottleType, Map>} */\n this._throttled = new Map();\n\n /** @type {Map<Path, String|Boolean>} */\n this._symlinkPaths = new Map();\n\n this._streams = new Set();\n this.closed = false;\n\n // Set up default options.\n if (undef(opts, 'persistent')) opts.persistent = true;\n if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false;\n if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false;\n if (undef(opts, 'interval')) opts.interval = 100;\n if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300;\n if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false;\n opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;\n\n // Enable fsevents on OS X when polling isn't explicitly enabled.\n if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;\n\n // If we can't use fsevents, ensure the options reflect it's disabled.\n const canUseFsEvents = FsEventsHandler.canUse();\n if (!canUseFsEvents) opts.useFsEvents = false;\n\n // Use polling on Mac if not using fsevents.\n // Other platforms use non-polling fs_watch.\n if (undef(opts, 'usePolling') && !opts.useFsEvents) {\n opts.usePolling = isMacos;\n }\n\n // Global override (useful for end-developers that need to force polling for all\n // instances of chokidar, regardless of usage/dependency depth)\n const envPoll = process.env.CHOKIDAR_USEPOLLING;\n if (envPoll !== undefined) {\n const envLower = envPoll.toLowerCase();\n\n if (envLower === 'false' || envLower === '0') {\n opts.usePolling = false;\n } else if (envLower === 'true' || envLower === '1') {\n opts.usePolling = true;\n } else {\n opts.usePolling = !!envLower;\n }\n }\n const envInterval = process.env.CHOKIDAR_INTERVAL;\n if (envInterval) {\n opts.interval = Number.parseInt(envInterval, 10);\n }\n\n // Editor atomic write normalization enabled by default with fs.watch\n if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents;\n if (opts.atomic) this._pendingUnlinks = new Map();\n\n if (undef(opts, 'followSymlinks')) opts.followSymlinks = true;\n\n if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false;\n if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};\n const awf = opts.awaitWriteFinish;\n if (awf) {\n if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000;\n if (!awf.pollInterval) awf.pollInterval = 100;\n this._pendingWrites = new Map();\n }\n if (opts.ignored) opts.ignored = arrify(opts.ignored);\n\n let readyCalls = 0;\n this._emitReady = () => {\n readyCalls++;\n if (readyCalls >= this._readyCount) {\n this._emitReady = EMPTY_FN;\n this._readyEmitted = true;\n // use process.nextTick to allow time for listener to be bound\n process.nextTick(() => this.emit(EV_READY));\n }\n };\n this._emitRaw = (...args) => this.emit(EV_RAW, ...args);\n this._readyEmitted = false;\n this.options = opts;\n\n // Initialize with proper watcher.\n if (opts.useFsEvents) {\n this._fsEventsHandler = new FsEventsHandler(this);\n } else {\n this._nodeFsHandler = new NodeFsHandler(this);\n }\n\n // You’re frozen when your heart’s not open.\n Object.freeze(opts);\n}", "function addLatestArch() {\n if (!globalid)\n return;\n\n watcherSlow.unwatch(retPgn.pgnFile);\n retPgn = checkLatestArchive();\n if (retPgn) {\n touchFile(retPgn.pgnFile);\n LS(retPgn);\n LS(`Monitor pgn file: ${retPgn.pgnFile}`);\n watcherSlow.add(retPgn.pgnFile);\n }\n else\n LS(\"No current file to monitor\");\n}", "constructor(_opts) {\n super();\n\n const opts = {};\n if (_opts) Object.assign(opts, _opts); // for frozen objects\n\n /** @type {Map<String, DirEntry>} */\n this._watched = new Map();\n /** @type {Map<String, Array>} */\n this._closers = new Map();\n /** @type {Set<String>} */\n this._ignoredPaths = new Set();\n\n /** @type {Map<ThrottleType, Map>} */\n this._throttled = new Map();\n\n /** @type {Map<Path, String|Boolean>} */\n this._symlinkPaths = new Map();\n\n this._streams = new Set();\n this.closed = false;\n\n // Set up default options.\n if (undef(opts, 'persistent')) opts.persistent = true;\n if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false;\n if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false;\n if (undef(opts, 'interval')) opts.interval = 100;\n if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300;\n if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false;\n opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;\n\n // Enable fsevents on OS X when polling isn't explicitly enabled.\n if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;\n\n // If we can't use fsevents, ensure the options reflect it's disabled.\n const canUseFsEvents = fseventsHandler.canUse();\n if (!canUseFsEvents) opts.useFsEvents = false;\n\n // Use polling on Mac if not using fsevents.\n // Other platforms use non-polling fs_watch.\n if (undef(opts, 'usePolling') && !opts.useFsEvents) {\n opts.usePolling = isMacos;\n }\n\n // Global override (useful for end-developers that need to force polling for all\n // instances of chokidar, regardless of usage/dependency depth)\n const envPoll = process.env.CHOKIDAR_USEPOLLING;\n if (envPoll !== undefined) {\n const envLower = envPoll.toLowerCase();\n\n if (envLower === 'false' || envLower === '0') {\n opts.usePolling = false;\n } else if (envLower === 'true' || envLower === '1') {\n opts.usePolling = true;\n } else {\n opts.usePolling = !!envLower;\n }\n }\n const envInterval = process.env.CHOKIDAR_INTERVAL;\n if (envInterval) {\n opts.interval = Number.parseInt(envInterval, 10);\n }\n\n // Editor atomic write normalization enabled by default with fs.watch\n if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents;\n if (opts.atomic) this._pendingUnlinks = new Map();\n\n if (undef(opts, 'followSymlinks')) opts.followSymlinks = true;\n\n if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false;\n if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};\n const awf = opts.awaitWriteFinish;\n if (awf) {\n if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000;\n if (!awf.pollInterval) awf.pollInterval = 100;\n this._pendingWrites = new Map();\n }\n if (opts.ignored) opts.ignored = arrify(opts.ignored);\n\n let readyCalls = 0;\n this._emitReady = () => {\n readyCalls++;\n if (readyCalls >= this._readyCount) {\n this._emitReady = EMPTY_FN$2;\n this._readyEmitted = true;\n // use process.nextTick to allow time for listener to be bound\n process.nextTick(() => this.emit(EV_READY));\n }\n };\n this._emitRaw = (...args) => this.emit(EV_RAW, ...args);\n this._readyEmitted = false;\n this.options = opts;\n\n // Initialize with proper watcher.\n if (opts.useFsEvents) {\n this._fsEventsHandler = new fseventsHandler(this);\n } else {\n this._nodeFsHandler = new nodefsHandler(this);\n }\n\n // You’re frozen when your heart’s not open.\n Object.freeze(opts);\n}", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n 'toCwd': relativeToDst,\n 'toDst': srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n 'toCwd': relativeToDst,\n 'toDst': srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n 'toCwd': relativeToDst,\n 'toDst': srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "[ISREUSABLE] (entry, st) {\n return entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n !isWindows\n }", "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}", "function watchPresentDirectory() {\n // Node 4.0 `fs.watch` function supports the \"recursive\" option on both OSX and Windows\n // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)\n if (options === undefined) {\n if (isNode4OrLater && (process.platform === \"win32\" || process.platform === \"darwin\")) {\n options = { persistent: true, recursive: !!recursive };\n }\n else {\n options = { persistent: true };\n }\n }\n const dirWatcher = _fs.watch(directoryName, options, callback);\n dirWatcher.on(\"error\", () => {\n if (!directoryExists(directoryName)) {\n // Deleting directory\n watcher = watchMissingDirectory();\n // Call the callback for current directory\n callback(\"rename\", \"\");\n }\n });\n return dirWatcher;\n }", "async function copy({ watch } = {}) {\n const ncp = Promise.promisify(require('ncp'));\n\n await Promise.all([\n ncp('./favicon.ico', 'build/util/favicon.ico'),\n ncp('./apple-touch-icon-114x114.png', 'build/util/apple-touch-icon-114x114.png'),\n ncp('./css/lib', 'build/util/css/lib'),\n ncp('./js/lib', 'build/util/js/lib'),\n ncp('./public', 'build/util/public'),\n ncp('./views', 'build/util/views')\n ]);\n\n await fs.writeFile('./build/util/package.json', JSON.stringify({\n private: true,\n engines: pkg.engines,\n dependencies: pkg.dependencies,\n scripts: {\n stop: 'forever stop 0',\n start: 'forever start js/server.js',\n },\n }, null, 2));\n\n}", "statFile(fileName) {\n const configs = this.configs;\n const folder = this.parent;\n this.initNode(fileName);\n this.fromFilePlainName = utils.getFilePlainName(this.fromFileName);\n this.fromFileExtension = path.extname(this.fromFileName);\n this.isHtmlFile = utils.isHtmlFile(this.fromFileExtension);\n this.isMarkdownFile = utils.isMarkdownFile(this.fromFileExtension);\n if (this.isHtmlFile) {\n configs.counterHtmlFiles.push(this);\n // Ignoring the HTML files.\n return;\n }\n if (!this.isMarkdownFile) {\n folder.pushFile(this);\n return;\n }\n this.toFilePlainName = utils.getFilePlainName(this.toFileName);\n this.toFileName = this.toFilePlainName + constants.DOT_HTML;\n this.toFilePath = path.join(folder.toFilePath, this.toFileName);\n this.setHref(this.toFileName, this.toFilePath);\n switch (this.toFilePlainName) {\n case constants.INDEX:\n configs.counterTestFileIndexFiles.push(this);\n break;\n case folder.toFileName:\n configs.counterTestFileTestFileFiles.push(this);\n break;\n default:\n configs.counterTestFolderTestFileFiles.push(this);\n break;\n }\n if (configs.noTrailingSlash) {\n // Case 1. Rendering in the no trailing slash mode.\n switch (this.toFilePlainName) {\n case folder.toFileName:\n this.toFileName = folder.toFileName + constants.DOT_HTML;\n this.toFilePath = path.join(folder.toFilePath, this.toFileName);\n // The href is useless as a list page, the same of its folder.\n this.setHref(folder.toFileName, folder.toFilePath);\n folder.setFolderPage(this);\n break;\n // case constants.README:\n case constants.INDEX:\n // index.md -> ${folder.toFileName}.html\n this.toFileName = folder.toFileName + constants.DOT_HTML;\n this.toFilePath = path.join(folder.toFilePath, this.toFileName);\n // The href is useless as a list page, the same of its folder.\n this.setHref(folder.toFileName, folder.toFilePath);\n // Set the folder page if not set yet.\n if (!folder.page) {\n folder.setFolderPage(this);\n }\n break;\n default:\n this.toFileName = this.toFilePlainName + constants.DOT_HTML;\n // Create a folder to store the html in the no-trailing-slash mode.\n this.toFolderPath = path.join(folder.toFilePath, this.toFilePlainName);\n this.toFilePath = path.join(this.toFolderPath, this.toFileName);\n // The folder is created for the document, so the href is #toFolderPath.\n this.setHref(this.toFilePlainName, this.toFolderPath);\n folder.pushFile(this);\n break;\n }\n return;\n }\n if (configs.trailingSlash) {\n // Case 2. Rendering in the trailing slash mode.\n this.toFileName = constants.INDEX_DOT_HTML;\n if (this.toFilePlainName === constants.INDEX) {\n this.toFilePath = path.join(folder.toFilePath, constants.INDEX_DOT_HTML);\n // The folder is for the document, so the href is folder#toFolderPath.\n // this.setHref(utils.addTrailingSlash(folder.toFileName), utils.addTrailingSlash(folder.toFilePath));\n // this.setHref(folder.toFileName, folder.toFilePath);\n this.setHref(folder.hrefRelative, folder.hrefAbsolute);\n folder.setFolderPage(this);\n }\n else {\n // Create a folder to store the html in the trailing-slash mode.\n this.toFolderPath = path.join(folder.toFilePath, this.toFilePlainName);\n // Render the markdown document to index.html to add a trailing slash.\n this.toFilePath = path.join(this.toFolderPath, constants.INDEX_DOT_HTML);\n // The folder is created for the document, so the href is #toFolderPath.\n this.setHref(utils.addTrailingSlash(this.toFilePlainName), utils.addTrailingSlash(this.toFolderPath));\n folder.pushFile(this);\n }\n return;\n }\n // Case 3. Rendering in the default mode.\n this.toFileName = this.toFilePlainName + constants.DOT_HTML;\n this.toFilePath = path.join(folder.toFilePath, this.toFileName);\n if (this.toFilePlainName === constants.INDEX) {\n // The folder is for the document, so the href is folder#toFolderPath.\n this.setHref(folder.hrefRelative, folder.hrefAbsolute);\n folder.setFolderPage(this);\n }\n else {\n this.setHref(this.toFileName, this.toFilePath);\n folder.pushFile(this);\n }\n }", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "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}", "static ln(target, link_path) {\n if (!ApplicationState._symlinks)\n ApplicationState._symlinks = {};\n //this is an optimization to store backrefs from targeted nodes. It makes lookups for notifications fast\n if (!ApplicationState._reverse_symlinks)\n ApplicationState._reverse_symlinks = {};\n\n target = ApplicationState._dereferencePath(target);\n let parts = link_path.split('.');\n let leaf = parts.slice(-1);\n //dereference the parent path so that its materialized.\n let parent_path = ApplicationState._dereferencePath(parts.slice(0, -1).join('.'));\n link_path = parent_path + '.' + leaf;\n\n ApplicationState._symlinks[link_path] = target;\n if (!(ApplicationState._reverse_symlinks[target]))\n ApplicationState._reverse_symlinks[target] = [];\n //a node can be referred to by multiple symlinks, so we store an array\n ApplicationState._reverse_symlinks[target].push(link_path);\n }", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err, stat) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n 'toCwd': relativeToDst,\n 'toDst': srcpath\n })\n } else {\n return fs.lstat(srcpath, (err, stat) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "function symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err, stat) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n 'toCwd': relativeToDst,\n 'toDst': srcpath\n })\n } else {\n return fs.lstat(srcpath, (err, stat) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n 'toCwd': srcpath,\n 'toDst': path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}", "static createHardLink(options) {\n FileSystem._wrapException(() => {\n return FileSystem._handleLink(() => {\n return fsx.linkSync(options.linkTargetPath, options.newLinkPath);\n }, Object.assign(Object.assign({}, options), { linkTargetMustExist: true }));\n });\n }", "function watch() {\n gulp.watch('src/**/*', gulp.series(build, reload));\n}", "function watch() {\n gulp.watch(['packages/**/*', 'app/**/*'], gulp.series(['build', 'docs:build']))\n}", "function isSymlink(source) {\n return fsLstatSync(source).isSymbolicLink();\n}", "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}", "function fillAliasMap(path, list, map) {\n\treturn list.reduce(function (symlinkedList, mod) {\n\t\tvar realPath = relative(path, fs.realpathSync(join(path, mod)));\n\t\tif (realPath !== mod) {\n\t\t\tsymlinkedList[realPath] = (mod);\n\t\t}\n\t\treturn symlinkedList;\n\t}, map || {});\n}", "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}", "function symlinkWithOverwrite(source, target) {\n var args = [source, target];\n\n if (process.platform === \"win32\") {\n if (!files.stat(source).isDirectory()) {\n throw new Error(\"symlink source must be a directory: \" + source);\n }\n\n args[2] = \"junction\";\n }\n\n try {\n files.symlink.apply(files, args);\n } catch (e) {\n if (e.code === 'EEXIST') {\n // overwrite existing link, file, or directory\n files.rm_recursive(target);\n files.symlink.apply(files, args);\n } else {\n throw e;\n }\n }\n}", "chownSync(files, uid, recursive = false) {\n let filesList = this.makeIter(files);\n for (let file of filesList) {\n let stat = fs.statSync(file);\n if (stat.isSymbolicLink()) {\n fs.lchownSync(file, uid, stat.gid);\n }\n else {\n fs.chownSync(file, uid, stat.gid);\n }\n if (recursive && stat.isDirectory() && !stat.isSymbolicLink()) {\n let dirs = fs.readdirSync(file);\n this.chownSync(dirs.map((dir) => file + '/' + dir), uid, true);\n }\n }\n }", "notify(){\n /**\n * Informs listeners that file system received new data\n * @event DirService#update\n * @type void\n */\n this.emit( \"update\" );\n }", "function fileHooks(){\n const File = Java.use(\"java.io.File\")\n\n File.$init.overload(\"java.lang.String\").implementation = function(a0) {\n send(\"file:init|\" + a0);\n var ret = this.$init(a0);\n return ret;\n }\n\n File.$init.overload(\"java.lang.String\", \"java.lang.String\").implementation = function(a0, a1) {\n send(\"file:init|\" + a0 + \"/\" + a1);\n var ret = this.$init(a0,a1);\n return ret;\n }\n\n File.isDirectory.overload().implementation = function() {\n send(\"file:isDirectory|\" + this);\n var ret = this.isDirectory();\n return ret;\n }\n}", "function watchFiles() {\n gulp.watch(paths.scripts.src, scripts);\n gulp.watch(paths.styles.src, styles);\n gulp.watch(paths.html.src, html);\n}", "function LOOP() {\n // stop if scanned past end of path\n if (pos >= p.length) {\n if (cache) cache[original] = p;\n return cb(null, p);\n }\n\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n return process.nextTick(LOOP);\n }\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // known symbolic link. no need to stat again.\n return gotResolvedLink(cache[base]);\n }\n\n return fs$e.lstat(base, gotStat);\n }", "phototaked(file) {}", "emitEvent(type, file, stat) {\n let key = type + '-' + file;\n let addKey = ADD_EVENT + '-' + file;\n if (type === CHANGE_EVENT && this.changeTimers[addKey]) {\n // Ignore the change event that is immediately fired after an add event.\n // (This happens on Linux).\n return;\n }\n clearTimeout(this.changeTimers[key]);\n this.changeTimers[key] = setTimeout(\n function() {\n delete this.changeTimers[key];\n if (type === ADD_EVENT && stat.isDirectory()) {\n // Recursively emit add events and watch for sub-files/folders\n common.recReaddir(\n path.resolve(this.root, file),\n function emitAddDir(dir, stats) {\n this.watchdir(dir);\n this.rawEmitEvent(\n ADD_EVENT,\n path.relative(this.root, dir),\n stats\n );\n }.bind(this),\n function emitAddFile(file, stats) {\n this.register(file);\n this.rawEmitEvent(\n ADD_EVENT,\n path.relative(this.root, file),\n stats\n );\n }.bind(this),\n function endCallback() {},\n this.checkedEmitError,\n this.ignored\n );\n } else {\n this.rawEmitEvent(type, file, stat);\n }\n }.bind(this),\n DEFAULT_DELAY\n );\n }", "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}", "function setMovieFolder(newPath, oldPath) {\n if (isWatching === false) {\n addWatcher(newPath);\n } else {\n fileWatcher.close()\n addWatcher(newPath)\n }\n}", "function watchFiles() {\n gulp.watch(paths.scripts.src, scripts);\n gulp.watch(paths.styles.src, styles);\n}", "onUpdateFolder() {\n this.onUpdateFolder();\n }", "function handleNewFiles() {\n var fileName;\n do {\n // If there is a file, move it from staging into the application folder\n fileName = inbox.nextFile();\n if (fileName) {\n console.log(\"/private/data/\" + fileName + \" is now available\");\n // refresh weather now\n weatherFromFile();\n }\n } while (fileName);\n}", "function addWatchers() {\n let directories = atom.project.getDirectories();\n directories.forEach((element) => {\n initWatcher(element.path);\n }, this);\n}", "function watch() {\n config.watch.forEach(item => {\n gulp.watch(item.globs, require(item.task));\n });\n}", "function startLinkStatus(){\n var a = document.createElement('a'); // Hack to extract absolute url\n $jQ('a[href]').each(function() {\n if ($jQ(this).attr('href').length > 0 &&\n $jQ(this).attr('href').search('javascript:')==-1 &&\n $jQ(this).attr('href').search('mailto:')==-1 &&\n $jQ(this).attr('href').search('#')!=0) {\n a.href = $jQ(this).attr('href');\n setLink($jQ(this),'href', a.href);\n }\n });\n}", "function startWatcher(rootPath) {\n fs.readdir(rootPath, function (err, files) {\n if (err) {\n console.error(err);\n watcher_notification.dismiss();\n messenger.error(\n ModuleMessage.WATCHER_ERROR,\n true,\n err\n );\n process.exit(1);\n }\n //Processing each directory for watcher.\n files.forEach((item) => {\n\n if (DIR_AVOID.indexOf(item) == -1) {\n //creating full path to current file item.\n let fullPath = Path.join(rootPath, item);\n\n //stats for file to check is directory or is file.\n fs.stat(fullPath, function (error, stat) {\n if (error) {\n console.error(error);\n }\n\n //Add watcher if this is a directory.\n if (stat.isDirectory()) {\n let watcher = fs.watch(fullPath, (eventType, filename) => {\n\n if (filename) {\n if (FILE_AVOID.indexOf(filename) == -1 && !isInvalidFile(filename)) {\n let filePath = Path.join(fullPath, filename);\n\n setTimeout(function () {\n VltService.push(new PayloadModel(filePath), true);\n }, 2000);\n\n }\n }\n\n });\n WATCHERS.push(watcher);\n //Search for more directories inside current directory.\n startWatcher(fullPath);\n }\n });\n }\n\n }, this);\n\n watcher_notification.dismiss();\n });\n}", "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}", "function LOOP() {\n // stop if scanned past end of path\n if (pos >= p.length) {\n if (cache) cache[original] = p;\n return cb(null, p);\n }\n\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || cache && cache[base] === base) {\n return process.nextTick(LOOP);\n }\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // known symbolic link. no need to stat again.\n return gotResolvedLink(cache[base]);\n }\n\n return fs.lstat(base, gotStat);\n }", "function LOOP() {\n // stop if scanned past end of path\n if (pos >= p.length) {\n if (cache) cache[original] = p;\n return cb(null, p);\n }\n\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n return process.nextTick(LOOP);\n }\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // known symbolic link. no need to stat again.\n return gotResolvedLink(cache[base]);\n }\n\n return fs.lstat(base, gotStat);\n }" ]
[ "0.62139815", "0.61247855", "0.60881317", "0.577993", "0.57328844", "0.5674339", "0.56728595", "0.56325614", "0.55907804", "0.546793", "0.54618967", "0.54378986", "0.54240143", "0.53641075", "0.53574693", "0.53514504", "0.53398466", "0.53370374", "0.53370374", "0.53370374", "0.53370374", "0.53194714", "0.53108543", "0.5309185", "0.52909017", "0.52676666", "0.5225733", "0.5224367", "0.5217764", "0.5193978", "0.5185761", "0.5163357", "0.51424813", "0.51318264", "0.512207", "0.50954074", "0.5095312", "0.50854784", "0.50854784", "0.50837207", "0.50805485", "0.5070284", "0.5070284", "0.50698966", "0.5062809", "0.5059552", "0.50532585", "0.5017937", "0.5015155", "0.50122714", "0.50113827", "0.500938", "0.50084686", "0.5007538", "0.5003268", "0.5000565", "0.49987236", "0.49978894", "0.49912587", "0.49912587", "0.49912587", "0.4989597", "0.49888486", "0.49830836", "0.49788496", "0.49787804", "0.496737", "0.496737", "0.496737", "0.496737", "0.49612135", "0.49602863", "0.49524665", "0.49524665", "0.49385455", "0.4934703", "0.49277446", "0.4919131", "0.491215", "0.49119762", "0.490797", "0.49063656", "0.4892888", "0.4888983", "0.48879635", "0.48842454", "0.4883573", "0.48824972", "0.4880192", "0.48727491", "0.48713368", "0.48691723", "0.48636225", "0.48623782", "0.48564926", "0.48559234", "0.48552853", "0.48538476", "0.4849671", "0.48491812", "0.48449403" ]
0.0
-1
attempt to update the version number in provided `bumpFiles`
function updateConfigs (args, newVersion) { const dotgit = DotGitignore() args.bumpFiles.forEach(function (bumpFile) { const updater = resolveUpdaterObjectFromArgument(bumpFile) if (!updater) { return } const configPath = path.resolve(process.cwd(), updater.filename) try { if (dotgit.ignore(configPath)) return const stat = fs.lstatSync(configPath) if (!stat.isFile()) return const contents = fs.readFileSync(configPath, 'utf8') checkpoint( args, 'bumping version in ' + updater.filename + ' from %s to %s', [updater.updater.readVersion(contents), newVersion] ) writeFile( args, configPath, updater.updater.writeVersion(contents, newVersion) ) // flag any config files that we modify the version # for // as having been updated. configsToUpdate[updater.filename] = true } catch (err) { if (err.code !== 'ENOENT') console.warn(err.message) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bumpVersion(bump) {\n log('Bump version number');\n return run('npm --no-git-tag-version version ' + bump)\n .then(function getNewVersion() {\n var newVersion = JSON.parse(fs.readFileSync('./package.json')).version;\n if (!newVersion) {\n throw new Error('Error when detecting new version.');\n }\n\n return newVersion;\n });\n}", "function verBump () {\n const { version: currentVersion, versions } = npmGetJson();\n const [version, tag] = currentVersion.split('-');\n const [,, patch] = version.split('.');\n const lastVersion = versions?.npm || currentVersion;\n\n if (argv['skip-beta'] || patch === '0') {\n // don't allow beta versions\n execSync('yarn polkadot-dev-version patch');\n withNpm = true;\n } else if (tag || currentVersion === lastVersion) {\n // if we don't want to publish, add an X before passing\n if (!withNpm) {\n npmAddVersionX();\n } else {\n npmDelVersionX();\n }\n\n // beta version, just continue the stream of betas\n execSync('yarn polkadot-dev-version pre');\n } else {\n // manually set, got for publish\n withNpm = true;\n }\n\n // always ensure we have made some changes, so we can commit\n npmSetVersionFields();\n rmFile('.123trigger');\n\n execSync('yarn polkadot-dev-contrib');\n execSync('git add --all .');\n}", "function bumpVersion(cb) {\n const bump = yargs.argv.bump;\n const validBump = '--bump can be major | minor | patch | premajor | preminor | prepatch | prerelease'\n\n if (!bump) {\n throw `--bump is required. ${validBump}`;\n }\n if (bump !== 'major' && bump !== 'minor' && bump !== 'patch' && bump !== 'premajor' && bump !== 'preminor' && bump !== 'prepatch' && bump !== 'prerelease') {\n throw `--bump cannot be '${bump}'. ${validBump}`\n }\n\n runShellCommand(`npm version ${bump}`);\n cb();\n}", "async bump(type) {\n let changelog = await read();\n changelog = parse(changelog);\n\n // Make sure there is content to bump\n if (changelog[0].released || Object.keys(changelog[0].content).length === 0) {\n fatal(`No ${filename} content available to perform version bump`);\n } else {\n\n // Get the previous version\n let version = (changelog.length > 1) ? changelog[1].version : \"0.0.0\";\n\n // Check the argument\n if (semver.valid(type)) {\n\n // Update to specific version\n changelog[0].version = type;\n changelog[0].released = true;\n changelog[0].date = new Date();\n\n // Save the updated file\n await write(changelog);\n console.log(\"Updated from \" + version + \" -> \" + changelog[0].version);\n\n } else {\n\n // If the type has not been specified, default to patch\n type = (type === null || type === undefined) ? \"patch\" : type;\n\n switch (type) {\n case \"patch\":\n case \"minor\":\n case \"major\":\n changelog[0].version = semver.inc(version, type);\n changelog[0].released = true;\n changelog[0].date = new Date();\n\n await write(changelog);\n console.log(\"Updated from \" + version + \" -> \" + changelog[0].version);\n break;\n\n default:\n fatal(`\"${type}\" is not a valid version number or update type`);\n }\n\n }\n\n }\n }", "function majorBump() {\n return gulp.src([\n './package.json',\n './bower.json'\n ]).pipe(bump({type: 'major'}))\n .pipe(gulp.dest('./'));\n}", "function patchBump() {\n return gulp.src([\n './package.json',\n './bower.json'\n ]).pipe(bump({type: 'patch'}))\n .pipe(gulp.dest('./'));\n}", "function versionBump(currentVersion, incrementType){\n const versionArray = currentVersion.split('.');\n // loop through index in array\n for (const versionIndex in versionArray) {\n versionArray[versionIndex] = parseInt(versionArray[versionIndex], 10);\n }\n // match incrementType type with case type\n switch (incrementType.toLowerCase()) {\n case 'patch':\n versionArray[2] += 1; // patch\n break;\n case 'minor':\n versionArray[1] += 1;// minor\n versionArray[2] = 0; // patch\n break;\n case 'major':\n versionArray[0] += 1;// major\n versionArray[1] = 0;// minor\n versionArray[2] = 0;// patch\n break;\n }\n // return result as string\n return versionArray.join('.');\n}", "function minorBump() {\n return gulp.src([\n './package.json',\n './bower.json'\n ]).pipe(bump({type: 'minor'}))\n .pipe(gulp.dest('./'));\n}", "function updateVersion(file, content, version) {\n const prev = /id=\"branch-cordova-sdk\"[\\s]*version=\"\\d+\\.\\d+\\.\\d+\"/gim;\n const next = `id=\"branch-cordova-sdk\"\\n version=\"${version}\"`;\n\n try {\n if (isFileXml(file)) {\n content = content.replace(prev, next);\n } else {\n isChange = content.version !== version;\n content.version = version;\n }\n } catch (e) {\n throw new Error(\n `BRANCH SDK: update to update npm version with file ${file}`\n );\n }\n return content;\n }", "function bump(callback) {\n var\n log = 'bump to ' + config.newVersion,\n pkg = grunt.file.readJSON(PACKAGE_JSON);\n\n if (noWrite) {\n grunt.log.ok('[dry-run]: ' + log);\n return callback();\n } else {\n grunt.log.ok(log);\n pkg.version = config.newVersion;\n fs.writeFile(PACKAGE_JSON,\n JSON.stringify(pkg, null, NB_SPACES_FOR_TAB) + '\\n',\n function (err) {\n callback(err);\n });\n }\n }", "function updateNpmVersion(pluginConfig, config, callback) {\n const files = readFilePaths(FILES);\n const version = config.nextRelease.version;\n let git = \"\";\n\n for (let i = 0; i < files.length; i++) {\n // update\n const file = files[i];\n const content = readContent(file);\n const updated = updateVersion(file, content, version);\n\n // save\n git += `git add ${file} && `;\n saveContent(file, updated);\n }\n // publish\n isChange && commitChanges(git, version);\n }", "function commitBump() {\n return gulp.src([\n './package.json',\n './bower.json',\n './README.md'\n ]).pipe(git.commit('Bump version to ' + packageJson().version));\n}", "function bumpit(vNow, incType){\n // major = [0]\n // minor = [1]\n // patch = [2]\n const vArray = vNow.split('.');\n\nfor(const vIndex in vArray) {\n vArray[vIndex] = parseInt(vArray[vIndex], 10);\n}\n // patch\n if (incType === 'patch'){\n vArray[2] += 1; // increase patch\n } else if (incType === 'minor'){\n vArray[2] = 0; // set patch to 0\n vArray[1] += 1; // increase minor by 1\n } else if (incType === 'major'){\n vArray[2] = 0; // set patch to 0\n vArray[1] = 0; // set minor to 0\n vArray[0] += 1; // increase major by 1\n }\n\n return vArray.join('.');\n}", "function bumpVersion(newversion) {\n console.log('Bumping version number.');\n return exec(`npm --no-git-tag-version version ${newversion}`);\n}", "async function nextVersion (bumpType, version) {\n if (versionUtils.isNightly(version) || versionUtils.isBeta(version)) {\n switch (bumpType) {\n case 'nightly':\n version = await versionUtils.nextNightly(version)\n break\n case 'beta':\n version = await versionUtils.nextBeta(version)\n break\n case 'stable':\n version = semver.valid(semver.coerce(version))\n break\n default:\n throw new Error('Invalid bump type.')\n }\n } else if (versionUtils.isStable(version)) {\n switch (bumpType) {\n case 'nightly':\n version = versionUtils.nextNightly(version)\n break\n case 'beta':\n throw new Error('Cannot bump to beta from stable.')\n case 'stable':\n version = semver.inc(version, 'patch')\n break\n default:\n throw new Error('Invalid bump type.')\n }\n } else {\n throw new Error(`Invalid current version: ${version}`)\n }\n return version\n}", "async updateAllVersions(max) {\n \n var files = await this.db.transaction('rw', this.db.files, this.db.versions, () => {\n return this.db.files.where(\"type\").equals(\"file\").toArray()\n })\n files = files.filter(file => file.url && file.url.startsWith(lively4url))\n files = files.filter(file => file.name ) // && file.name.match(/\\.js$/)\n if (max) files = files.slice(0, max)\n for(let file of files) {\n console.log(\"[fileindex] add verions: \" + file.name)\n await this.addVersions(file)\n }\n }", "changeVersion({ filePath, version, replacingTag }) {\n logger.section(`Set '${version}' as version in ${filePath}`);\n let versionFile = fs.readFileSync(filePath, 'utf-8');\n this.checkReplacingTag({\n filePath,\n replacingTag,\n checkBuildTask: false\n });\n try {\n let newVersionFile = versionFile.replace(replacingTag, version);\n versionFile = newVersionFile;\n fs.writeFileSync(filePath, versionFile, 'utf-8');\n }\n catch (err) {\n logger.error(err);\n }\n }", "function changeVersion(increment, preid) {\n const json = JSON.parse(fs.readFileSync('./package.json'));\n\n console.log('-------------------------------------------------');\n console.log('--- OLD PACKAGE VERSION: ' + json.version + ' ---');\n\n json.version = semver.inc(json.version, increment, preid);\n\n console.log('--- NEW PACKAGE VERSION: ' + json.version + ' ---');\n console.log('-------------------------------------------------');\n\n fs.writeFileSync('./package.json', JSON.stringify(json, null, '\\t'));\n}", "function inc(importance) {\n gulp.src(['./package.json', './bower.json'])\n // bump the version number in those files\n .pipe(plugins.bump({type: importance}))\n // save it back to filesystem\n .pipe(gulp.dest('./'))\n // commit the changed version number\n .pipe(plugins.git.add())\n .pipe(plugins.git.commit('update version'))\n\n // read only one file to get the version number\n .pipe(plugins.filter('package.json'))\n // **tag it in the repository**\n .pipe(plugins.tagVersion());\n }", "inc(release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major += 1;\n this.inc('pre', identifier);\n break;\n case 'preminor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor += 1;\n this.inc('pre', identifier);\n break;\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0;\n this.inc('patch', identifier);\n this.inc('pre', identifier);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier);\n }\n this.inc('pre', identifier);\n break;\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major += 1;\n }\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor += 1;\n }\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch += 1;\n }\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0];\n } else {\n let i = this.prerelease.length;\n\n // eslint-disable-next-line no-plusplus\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i] += 1;\n i = -2;\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0);\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (Number.isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0];\n }\n } else {\n this.prerelease = [identifier, 0];\n }\n }\n break;\n\n default:\n throw new Error(`invalid increment argument: ${release}`);\n }\n this.format();\n this.raw = this.version;\n return this;\n }", "inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }", "inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }", "inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }", "inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }", "inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }", "inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }", "inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }", "inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }", "inc (release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n const base = Number(identifierBase) ? 1 : 0\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, base]\n }\n } else {\n this.prerelease = [identifier, base]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }", "inc (release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }", "onlyUpdating() {\n return Number.isInteger(this.props.projectVersion);\n }", "inc(release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc('pre', identifier);\n break;\n\n case 'preminor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc('pre', identifier);\n break;\n\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0;\n this.inc('patch', identifier);\n this.inc('pre', identifier);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier);\n }\n\n this.inc('pre', identifier);\n break;\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n this.major++;\n }\n\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n\n this.patch = 0;\n this.prerelease = [];\n break;\n\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0];\n } else {\n let i = this.prerelease.length;\n\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++;\n i = -2;\n }\n }\n\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0);\n }\n }\n\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0];\n }\n } else {\n this.prerelease = [identifier, 0];\n }\n }\n\n break;\n\n default:\n throw new Error(`invalid increment argument: ${release}`);\n }\n\n this.format();\n this.raw = this.version;\n return this;\n }", "inc(release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc('pre', identifier);\n break;\n\n case 'preminor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc('pre', identifier);\n break;\n\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0;\n this.inc('patch', identifier);\n this.inc('pre', identifier);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier);\n }\n\n this.inc('pre', identifier);\n break;\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n this.major++;\n }\n\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n\n this.patch = 0;\n this.prerelease = [];\n break;\n\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0];\n } else {\n let i = this.prerelease.length;\n\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++;\n i = -2;\n }\n }\n\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0);\n }\n }\n\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0];\n }\n } else {\n this.prerelease = [identifier, 0];\n }\n }\n\n break;\n\n default:\n throw new Error(`invalid increment argument: ${release}`);\n }\n\n this.format();\n this.raw = this.version;\n return this;\n }", "function setup(file, type) {\n var\n pkg = grunt.file.readJSON(file),\n newVersion = pkg.version;\n\n if (options.bump) {\n if (semver.valid(type)) {\n newVersion = type;\n } else {\n newVersion = semver.inc(pkg.version, type || 'patch');\n }\n }\n return {\n newVersion: newVersion,\n pkg: pkg\n };\n }", "inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc('pre', identifier);\n break\n case 'preminor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc('pre', identifier);\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0;\n this.inc('patch', identifier);\n this.inc('pre', identifier);\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier);\n }\n this.inc('pre', identifier);\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++;\n }\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n this.patch = 0;\n this.prerelease = [];\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n this.prerelease = [];\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0];\n } else {\n let i = this.prerelease.length;\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++;\n i = -2;\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0);\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0];\n }\n } else {\n this.prerelease = [identifier, 0];\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format();\n this.raw = this.version;\n return this\n }", "async function commitVersionBump (version) {\n const gitArgs = ['commit', '-a', '-m', `Bump v${version}`, '-n']\n await GitProcess.exec(gitArgs, ELECTRON_DIR)\n}", "function bumpMinorVersion(version) {\n const parts = version.split('.')\n if (parts.length !== 3) {\n throw new Error(`${version} is not a valid MAJOR.MINOR.PATCH version`);\n }\n const majorVersion = parseInt(parts[0]);\n const newMinorVersion = parseInt(parts[1]) + 1;\n const patchVersion = parseInt(parts[2]);\n if (isNaN(majorVersion) || isNaN(newMinorVersion) || isNaN(patchVersion)) {\n throw new Error(`${version} does not have valid integer parts`);\n }\n return `${parts[0]}.${newMinorVersion}.${parts[2]}`\n}", "function tagBump(cb) {\n var version = packageJson().version;\n git.checkout('master', function(error) {\n if (error) {\n return cb(error);\n }\n git.tag(version, 'Tag version ' + version, function(error) {\n if (error) {\n return cb(error);\n }\n git.push('origin', 'master', {\n args: '--tags'\n }, cb);\n });\n });\n}", "inc( release, identifier ) {\n\t\tswitch ( release ) {\n\t\t\tcase 'premajor':\n\t\t\t\tthis.prerelease.length = 0;\n\t\t\t\tthis.patch = 0;\n\t\t\t\tthis.minor = 0;\n\t\t\t\tthis.major++;\n\t\t\t\tthis.inc( 'pre', identifier );\n\t\t\t\tbreak;\n\n\t\t\tcase 'preminor':\n\t\t\t\tthis.prerelease.length = 0;\n\t\t\t\tthis.patch = 0;\n\t\t\t\tthis.minor++;\n\t\t\t\tthis.inc( 'pre', identifier );\n\t\t\t\tbreak;\n\n\t\t\tcase 'prepatch':\n\t\t\t\t// If this is already a prerelease, it will bump to the next version\n\t\t\t\t// drop any prereleases that might already exist, since they are not\n\t\t\t\t// relevant at this point.\n\t\t\t\tthis.prerelease.length = 0;\n\t\t\t\tthis.inc( 'patch', identifier );\n\t\t\t\tthis.inc( 'pre', identifier );\n\t\t\t\tbreak;\n\t\t\t// If the input is a non-prerelease version, this acts the same as\n\t\t\t// prepatch.\n\n\t\t\tcase 'prerelease':\n\t\t\t\tif ( this.prerelease.length === 0 ) {\n\t\t\t\t\tthis.inc( 'patch', identifier );\n\t\t\t\t}\n\n\t\t\t\tthis.inc( 'pre', identifier );\n\t\t\t\tbreak;\n\n\t\t\tcase 'major':\n\t\t\t\t// If this is a pre-major version, bump up to the same major version.\n\t\t\t\t// Otherwise increment major.\n\t\t\t\t// 1.0.0-5 bumps to 1.0.0\n\t\t\t\t// 1.1.0 bumps to 2.0.0\n\t\t\t\tif ( this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0 ) {\n\t\t\t\t\tthis.major++;\n\t\t\t\t}\n\n\t\t\t\tthis.minor = 0;\n\t\t\t\tthis.patch = 0;\n\t\t\t\tthis.prerelease = [];\n\t\t\t\tbreak;\n\n\t\t\tcase 'minor':\n\t\t\t\t// If this is a pre-minor version, bump up to the same minor version.\n\t\t\t\t// Otherwise increment minor.\n\t\t\t\t// 1.2.0-5 bumps to 1.2.0\n\t\t\t\t// 1.2.1 bumps to 1.3.0\n\t\t\t\tif ( this.patch !== 0 || this.prerelease.length === 0 ) {\n\t\t\t\t\tthis.minor++;\n\t\t\t\t}\n\n\t\t\t\tthis.patch = 0;\n\t\t\t\tthis.prerelease = [];\n\t\t\t\tbreak;\n\n\t\t\tcase 'patch':\n\t\t\t\t// If this is not a pre-release version, it will increment the patch.\n\t\t\t\t// If it is a pre-release it will bump up to the same patch version.\n\t\t\t\t// 1.2.0-5 patches to 1.2.0\n\t\t\t\t// 1.2.0 patches to 1.2.1\n\t\t\t\tif ( this.prerelease.length === 0 ) {\n\t\t\t\t\tthis.patch++;\n\t\t\t\t}\n\n\t\t\t\tthis.prerelease = [];\n\t\t\t\tbreak;\n\t\t\t// This probably shouldn't be used publicly.\n\t\t\t// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n\n\t\t\tcase 'pre':\n\t\t\t\tif ( this.prerelease.length === 0 ) {\n\t\t\t\t\tthis.prerelease = [ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tlet i = this.prerelease.length;\n\n\t\t\t\t\twhile ( --i >= 0 ) {\n\t\t\t\t\t\tif ( typeof this.prerelease[ i ] === 'number' ) {\n\t\t\t\t\t\t\tthis.prerelease[ i ]++;\n\t\t\t\t\t\t\ti = -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( i === -1 ) {\n\t\t\t\t\t\t// didn't increment anything\n\t\t\t\t\t\tthis.prerelease.push( 0 );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( identifier ) {\n\t\t\t\t\t// 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n\t\t\t\t\t// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n\t\t\t\t\tif ( this.prerelease[ 0 ] === identifier ) {\n\t\t\t\t\t\tif ( isNaN( this.prerelease[ 1 ] ) ) {\n\t\t\t\t\t\t\tthis.prerelease = [ identifier, 0 ];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.prerelease = [ identifier, 0 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error( `invalid increment argument: ${ release }` );\n\t\t}\n\n\t\tthis.format();\n\t\tthis.raw = this.version;\n\t\treturn this;\n\t}", "function updateUnifiedDeps(pathToUnifiedDeps, pathToNewUnifiedDeps, outputPath) {\n const currentDeps = fs.readFileSync(pathToUnifiedDeps, 'utf8');\n const newDeps = fs.readFileSync(pathToNewUnifiedDeps, 'utf8');\n\n const currentDepsArr = currentDeps.split('\\n');\n const newDepsArr = newDeps.split('\\n');\n const newDepsDict = formatDeps(newDepsArr);\n\n const updatedDeps = [];\n // Tasks that was updated and should be presented in TfsServer.Servicing.core.xml\n const changedTasks = [];\n\n currentDepsArr.forEach(currentDep => {\n const depDetails = currentDep.split('\"');\n const name = depDetails[1];\n\n // find if there is a match in new (ignoring case)\n if (name) {\n const newDepsKey = Object.keys(newDepsDict).find(key => key.toLowerCase() === name.toLowerCase());\n if (newDepsKey && newDepsDict[newDepsKey]) {\n // update the version\n depDetails[3] = newDepsDict[newDepsKey];\n updatedDeps.push(depDetails.join('\"'));\n\n changedTasks.push(newDepsKey);\n delete newDepsDict[newDepsKey];\n } else {\n updatedDeps.push(currentDep);\n console.log(`\"${currentDep}\"`);\n }\n } else {\n updatedDeps.push(currentDep);\n }\n });\n\n // add the new deps from the start\n // working only for generated deps\n\n if (Object.keys(newDepsDict).length > 0) {\n for (let packageName in newDepsDict) {\n // new deps should include old packages completely\n // Example:\n // Mseng.MS.TF.DistributedTask.Tasks.AndroidSigningV2-Node16(packageName) should include \n // Mseng.MS.TF.DistributedTask.Tasks.AndroidSigningV2(basePackageName)\n const depToBeInserted = newDepsArr.find(dep => dep.includes(packageName));\n const pushingIndex = updatedDeps.findIndex(basePackage => {\n if (!basePackage) return false;\n\n const depDetails = basePackage.split('\"');\n const name = depDetails[1];\n return name && name.startsWith(msPrefix) && packageName.includes(name)\n });\n\n if (pushingIndex !== -1) {\n // We need to insert new package after the old one\n updatedDeps.splice(pushingIndex + 1, 0, depToBeInserted);\n changedTasks.push(packageName);\n }\n }\n }\n // write it as a new file where currentDeps is\n fs.writeFileSync(outputPath, updatedDeps.join('\\n'));\n console.log('Updating Unified Dependencies file done.');\n return changedTasks;\n}", "function incGitTag() {\n let output = runCommand('git describe --abbrev=0 --tags', {stdio: 'pipe'});\n if (output && output !== \"\") {\n let versionArray;\n versionArray = output.split(\".\");\n if (versionArray.length !== 3) {\n logError(\"invalid version: \" + version);\n }\n var version3 = parseInt(versionArray[2]);\n if (isNaN(version3)) {\n logError(\"invalid version: \" + version);\n }\n var newVersion = versionArray[0] + \".\" + versionArray[1] + \".\" + (version3 + 1);\n console.log('new tag version', newVersion);\n // write tag\n output = runCommand(`git tag ${newVersion}`);\n console.log(\"version updated to \" + newVersion);\n } else {\n logError(\"git describe output was invalid\");\n }\n}", "async function formatUpdateFiles() {\n await Promise.all(\n touchedFiles.map(file => {\n return execAsync(`npx eslint --ext js --ext ts --fix ${file}`);\n })\n );\n await Promise.all(\n touchedFiles.map(file => {\n return execAsync(`npx prettier --write ${file}`);\n })\n );\n}", "function updateVersion2gitTag(pkg) {\n\tlet tag = child_process.execSync('git describe --tag').toString().trim();\n\tpkg.version = tag;\n}", "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n}", "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n}", "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n}", "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n}", "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n}", "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n}", "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, parse.parsePatch /*istanbul ignore end*/)(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n }", "updateRepositoryBuildNumber(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The repository // PipelineBuildNumber | The build number to update.\n /*let username = \"username_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ /*let body = new Bitbucket.PipelineBuildNumber();*/ apiInstance.updateRepositoryBuildNumber(\n incomingOptions.username,\n incomingOptions.repoSlug,\n incomingOptions.body,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "updateProjectVersion(newVersion) {\n return tslib.__awaiter(this, void 0, void 0, function* () {\n const pkgJsonPath = path.join(this.projectDir, packageJsonPath);\n const pkgJson = JSON.parse(yield fs.promises.readFile(pkgJsonPath, 'utf8'));\n pkgJson.version = newVersion.format();\n // Write the `package.json` file. Note that we add a trailing new line\n // to avoid unnecessary diff. IDEs usually add a trailing new line.\n yield fs.promises.writeFile(pkgJsonPath, `${JSON.stringify(pkgJson, null, 2)}\\n`);\n info(green(` ✓ Updated project version to ${pkgJson.version}`));\n });\n }", "function updateDepModuleVersions () {\n return request.post({\n url: `http://${HOST}/api/DepModuleVersions/add`,\n followAllRedirects: true,\n headers: {\n \"Authorization\": TOKEN\n },\n body: {\n obj: obj\n },\n json: true // Automatically stringifies the body to JSON\n }, (err, res, body) => {\n licenseObj(body);\n check(err, res, body);\n });\n}", "async function upgrade(){\n logger.log(\"info\", \"Entering upgrade\");\n try{\n await logExistingFiles();\n logger.log(\"debug\", \"|before upgrade|\"); \n let [versionToBkup, upgradeToVersion, preList] = await bkupPrevVersion();\n let sqlScripts = RESTORE_GRAPH[versionToBkup][upgradeToVersion];\n await upgradeToCurrentVersion(versionToBkup, upgradeToVersion, sqlScripts, preList); \n logger.log(\"info\", \"upgrade successful!\"); \n } catch(err){\n logger.log(\"info\", \"upgrade not done|\", err);\n }\n await logExistingFiles();\n logger.log(\"debug\", \"|after upgrade|\");\n logger.log(\"info\", \"Exiting upgrade\");\n}", "_verifyPackageVersions(version, packages) {\n return tslib.__awaiter(this, void 0, void 0, function* () {\n for (const pkg of packages) {\n const { version: packageJsonVersion } = JSON.parse(yield fs.promises.readFile(path.join(pkg.outputPath, 'package.json'), 'utf8'));\n if (version.compare(packageJsonVersion) !== 0) {\n error(red('The built package version does not match the version being released.'));\n error(` Release Version: ${version.version}`);\n error(` Generated Version: ${packageJsonVersion}`);\n throw new FatalReleaseActionError();\n }\n }\n });\n }", "function inc(importance) {\n return gulp.src(['./package.json', './bower.json'])\n .pipe(gp_bump({type: importance}))\n .pipe(gulp.dest('./'))\n .pipe(gp_git.commit('Creating new package version'))\n .pipe(gp_filter('package.json'))\n .pipe(gp_tagversion());\n}", "function applyLinks(releases, packagesByName, linked) {\n let updated = false;\n if (!linked) return updated; // We do this for each set of linked packages\n\n for (let linkedPackages of linked) {\n // First we filter down to all the relevent releases for one set of linked packages\n let releasingLinkedPackages = [...releases.values()].filter(release => linkedPackages.includes(release.name) && release.type !== \"none\"); // If we proceed any further we do extra work with calculating highestVersion for things that might\n // not need one, as they only have workspace based packages\n\n if (releasingLinkedPackages.length < 1) continue;\n let highestReleaseType;\n let highestVersion;\n\n for (let pkg of releasingLinkedPackages) {\n // Note that patch is implictly set here, but never needs to override another value\n if (!highestReleaseType) {\n highestReleaseType = pkg.type;\n } else if (pkg.type === \"major\") {\n highestReleaseType = pkg.type;\n } else if (pkg.type === \"minor\" && highestReleaseType !== \"major\") {\n highestReleaseType = pkg.type;\n }\n } // Next we determine what the highest version among the linked packages will be\n\n\n for (let linkedPackage of linkedPackages) {\n let pkg = packagesByName.get(linkedPackage);\n\n if (pkg) {\n if (highestVersion === undefined || semver__default['default'].gt(pkg.packageJson.version, highestVersion)) {\n highestVersion = pkg.packageJson.version;\n }\n } else {\n console.error(`FATAL ERROR IN CHANGESETS! We were unable to version for linked package: ${linkedPackage} in linkedPackages: ${linkedPackages.toString()}`);\n throw new Error(`fatal: could not resolve linked packages`);\n }\n }\n\n if (!highestVersion || !highestReleaseType) throw new Error(`Large internal changesets error in calculating linked versions. Please contact the maintainers`); // Finally, we update the packages so all of them are on the highest version\n\n for (let linkedPackage of releasingLinkedPackages) {\n if (linkedPackage.type !== highestReleaseType) {\n updated = true;\n linkedPackage.type = highestReleaseType;\n }\n\n if (linkedPackage.oldVersion !== highestVersion) {\n updated = true;\n linkedPackage.oldVersion = highestVersion;\n }\n }\n }\n\n return updated;\n}", "function bump(type) {\n return gulp.src(['./package.json', './bower.json'])\n .pipe(plugins.bump({ type: type }))\n .pipe(gulp.dest('./'))\n .on('error', getErrorHandler());\n}", "function applyPatches(uniDiff, options) {\n\t if (typeof uniDiff === 'string') {\n\t uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n\t }\n\n\t var currentIndex = 0;\n\t function processIndex() {\n\t var index = uniDiff[currentIndex++];\n\t if (!index) {\n\t return options.complete();\n\t }\n\n\t options.loadFile(index, function (err, data) {\n\t if (err) {\n\t return options.complete(err);\n\t }\n\n\t var updatedContent = applyPatch(data, index, options);\n\t options.patched(index, updatedContent, function (err) {\n\t if (err) {\n\t return options.complete(err);\n\t }\n\n\t processIndex();\n\t });\n\t });\n\t }\n\t processIndex();\n\t}", "function applyPatches(uniDiff, options) {\n\t if (typeof uniDiff === 'string') {\n\t uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n\t }\n\n\t var currentIndex = 0;\n\t function processIndex() {\n\t var index = uniDiff[currentIndex++];\n\t if (!index) {\n\t return options.complete();\n\t }\n\n\t options.loadFile(index, function (err, data) {\n\t if (err) {\n\t return options.complete(err);\n\t }\n\n\t var updatedContent = applyPatch(data, index, options);\n\t options.patched(index, updatedContent, function (err) {\n\t if (err) {\n\t return options.complete(err);\n\t }\n\n\t processIndex();\n\t });\n\t });\n\t }\n\t processIndex();\n\t}", "function applyPatches(uniDiff, options) {\n\t if (typeof uniDiff === 'string') {\n\t uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n\t }\n\n\t var currentIndex = 0;\n\t function processIndex() {\n\t var index = uniDiff[currentIndex++];\n\t if (!index) {\n\t return options.complete();\n\t }\n\n\t options.loadFile(index, function (err, data) {\n\t if (err) {\n\t return options.complete(err);\n\t }\n\n\t var updatedContent = applyPatch(data, index, options);\n\t options.patched(index, updatedContent, function (err) {\n\t if (err) {\n\t return options.complete(err);\n\t }\n\n\t processIndex();\n\t });\n\t });\n\t }\n\t processIndex();\n\t}", "function applyPatches(uniDiff, options) {\n\t if (typeof uniDiff === 'string') {\n\t uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n\t }\n\n\t var currentIndex = 0;\n\t function processIndex() {\n\t var index = uniDiff[currentIndex++];\n\t if (!index) {\n\t return options.complete();\n\t }\n\n\t options.loadFile(index, function (err, data) {\n\t if (err) {\n\t return options.complete(err);\n\t }\n\n\t var updatedContent = applyPatch(data, index, options);\n\t options.patched(index, updatedContent, function (err) {\n\t if (err) {\n\t return options.complete(err);\n\t }\n\n\t processIndex();\n\t });\n\t });\n\t }\n\t processIndex();\n\t}", "_incrementVersion() {\n if (this.scheme.major) {\n this.version.major++\n this.version.minor = 0\n this.version.patch = 0\n } else if (this.scheme.minor) {\n this.version.minor++\n this.version.patch = 0\n } else {\n this.version.patch++\n }\n }", "function getCommitMessageForExceptionalNextVersionBump(newVersion) {\n return `release: bump the next branch to v${newVersion}`;\n}", "async function getNewVersion() {\n const sharedPackage = core.getInput('shared-package');\n const result = await exec(`npm view ${sharedPackage} version`);\n const newVersion = bumpMinorVersion(result.stdout);\n return newVersion;\n}", "function updateBitMap(consumer: Consumer, untagResults: untagResult[]): void {\n untagResults.forEach((result: untagResult) => {\n const { id, versions, component } = result;\n const currentId: BitId = consumer.bitMap.getBitId(id, { ignoreVersion: true });\n if (currentId.hasVersion() && versions.includes(currentId.version)) {\n const newVersion = component.versionArray.length ? component.latest() : null;\n const newId = currentId.changeVersion(newVersion);\n consumer.bitMap.updateComponentId(newId);\n }\n });\n}", "_computeNewVersion() {\n const { version } = this.active.releaseCandidate;\n return semver.parse(`${version.major}.${version.minor}.${version.patch}`);\n }", "_createNextBranchUpdatePullRequest(newVersion, newBranch) {\n return tslib.__awaiter(this, void 0, void 0, function* () {\n const { branchName: nextBranch, version } = this.active.next;\n // We increase the version for the next branch to the next minor. The team can decide\n // later if they want next to be a major through the `Configure Next as Major` release action.\n const newNextVersion = semver.parse(`${version.major}.${version.minor + 1}.0-next.0`);\n const bumpCommitMessage = getCommitMessageForExceptionalNextVersionBump(newNextVersion);\n yield this.checkoutUpstreamBranch(nextBranch);\n yield this.updateProjectVersion(newNextVersion);\n // Create an individual commit for the next version bump. The changelog should go into\n // a separate commit that makes it clear where the changelog is cherry-picked from.\n yield this.createCommit(bumpCommitMessage, [packageJsonPath]);\n let nextPullRequestMessage = `The previous \"next\" release-train has moved into the ` +\n `release-candidate phase. This PR updates the next branch to the subsequent ` +\n `release-train.`;\n const hasChangelogCherryPicked = yield this.createCherryPickReleaseNotesCommitFrom(newVersion, newBranch);\n if (hasChangelogCherryPicked) {\n nextPullRequestMessage += `\\n\\nAlso this PR cherry-picks the changelog for ` +\n `v${newVersion} into the ${nextBranch} branch so that the changelog is up to date.`;\n }\n else {\n error(yellow(` ✘ Could not cherry-pick release notes for v${newVersion}.`));\n error(yellow(` Please copy the release note manually into \"${nextBranch}\".`));\n }\n const nextUpdatePullRequest = yield this.pushChangesToForkAndCreatePullRequest(nextBranch, `next-release-train-${newNextVersion}`, `Update next branch to reflect new release-train \"v${newNextVersion}\".`, nextPullRequestMessage);\n info(green(` ✓ Pull request for updating the \"${nextBranch}\" branch has been created.`));\n info(yellow(` Please ask team members to review: ${nextUpdatePullRequest.url}.`));\n });\n }", "checkout(version) {}", "function setPackageVersion(cb) {\n if (version !== release) {\n // bump version without committing and tagging\n // await execa('npm', ['version', release, '--no-git-tag-version'], {stdio})\n src('./package.json')\n .pipe(jeditor({ 'version': release } ) )\n .pipe(dest('.') )\n } else {\n console.log('setPackageVersion: Requested version is same as current version - nothing will change')\n }\n cb()\n}", "function auto_fabric_upgrade(available_orderer_versions, orderer_docs, up_cb) {\n\t\t\tt.async.eachLimit(orderer_docs, 1, (comp_doc, async_cb) => {\n\t\t\t\tconst upgrade_to_version = find_version_to_use(available_orderer_versions, comp_doc.version);\n\t\t\t\tif (!upgrade_to_version) {\n\t\t\t\t\t// already logged, skip this component & continue\n\t\t\t\t\treturn async_cb();\n\t\t\t\t}\n\n\t\t\t\tshould_upgrade(upgrade_to_version, comp_doc, (_, should_do_upgrade) => {\n\t\t\t\t\tif (!should_do_upgrade) {\n\t\t\t\t\t\tlogger.debug('[fab upgrade] will not upgrade comp:', comp_doc._id, 'version:', comp_doc.version);\n\t\t\t\t\t\treturn async_cb();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger.debug('[fab upgrade] upgrading comp:', comp_doc._id, 'version:', comp_doc.version, 'to version:', upgrade_to_version);\n\n\t\t\t\t\t\tconst fake_req = {\n\t\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\t\tathena_component_id: comp_doc._id\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\theaders: {},\n\t\t\t\t\t\t\tsession: {},\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\tversion: upgrade_to_version\t\t\t\t// this is the version we will upgrade to\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tt.deployer.update_component(fake_req, (err_resp, resp) => {\n\t\t\t\t\t\t\tif (err_resp) {\n\t\t\t\t\t\t\t\tlogger.error('[fab upgrade] failed to upgrade component. dep error.', comp_doc._id, err_resp);\n\t\t\t\t\t\t\t\treturn async_cb(err_resp, resp);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlogger.debug('[fab upgrade] successfully upgraded component:', comp_doc._id, err_resp);\n\t\t\t\t\t\t\t\twait_for_start(comp_doc, (start_err) => {\n\t\t\t\t\t\t\t\t\tif (start_err) {\n\t\t\t\t\t\t\t\t\t\tlogger.error('[fab upgrade] failed to start comp after update. all stop.', start_err);\n\t\t\t\t\t\t\t\t\t\treturn async_cb(start_err, resp);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlogger.debug('[fab upgrade] component has started:', comp_doc._id);\n\t\t\t\t\t\t\t\t\t\treturn async_cb(null, resp);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}, (auto_error) => {\n\t\t\t\tif (auto_error) {\n\t\t\t\t\tlogger.error('[fab upgrade] blocking error occurred during auto fabric update. stopping auto fab updates.');\n\t\t\t\t}\n\t\t\t\treturn up_cb();\n\t\t\t});\n\t\t}", "update() {\n if (this.state.addedFiles && this.state.addedFiles.length > 0) {\n this.props.onUpdate({ value: this.state.addedFiles });\n } else {\n this.props.onUpdate({ value: undefined });\n }\n }", "async function checkForUpdate(currentVersion) {\n try {\n const latestVersion = await new Request(\n 'https://raw.githubusercontent.com/jchicano/scriptable-republicamovil/master/version.txt'\n ).loadString();\n return currentVersion.replace(/[^1-9]+/g, '') <\n latestVersion.replace(/[^1-9]+/g, '')\n ? true\n : false;\n } catch (err) {\n log('try checkForUpdate: ' + err);\n return false;\n }\n}", "async calcNextVersion(lastTag) {\n const bump = await this.getSemverBump(lastTag);\n return semver_1.inc(lastTag, bump);\n }", "function updateApp(watcher, app, outfilePattern, isProd, changedFiles){\n if(changedFiles){\n // Only lint JavaScript, not JSON\n let filesToLint = _.filter(changedFiles, function(file){\n return file.indexOf('.json') === -1;\n });\n\n lintFiles(filesToLint);\n }\n\n bundleApp(watcher, app, outfilePattern, isProd);\n}", "function updatePackages() {\n\tvar dataDir = getDataDirectory();\n\n\tfs.readdir(dataDir, function(err, files) {\n\t\tfiles.forEach(function(file) {\n\t\t\tvar name = path.basename(file, '.json');\n\n\t\t\tvar infoFilePath = path.join(dataDir, file);\n\t\t\tfs.readFile(infoFilePath, 'utf8', function(err, data) {\n\t\t\t\tif (err) {\n\t\t\t\t\tlog('error', \"could not access data for %s -- skipping\", name);\n\t\t\t\t} else {\n\t\t\t\t\tvar info = JSON.parse(data);\n\t\t\t\t\tretrievePackage(name, info.repo, function(err, result) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tlog('error', \"failed to update %s\", name);\n\t\t\t\t\t\t} else if (result.retrieved) {\n\t\t\t\t\t\t\tlog('info', \"%s updated successfully\", name);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t})\n\t});\n}", "function tagsToUpdate(v) {\n const idx = TypeScriptVersion.supported.indexOf(v);\n assert_1.default(idx !== -1);\n return TypeScriptVersion.supported\n .slice(idx)\n .map(v => \"ts\" + v)\n .concat(\"latest\");\n }", "processFileChanges(aManifests, aUpdateCompatibility, aOldAppVersion, aOldPlatformVersion) {\n let loadedManifest = (aInstallLocation, aId) => {\n if (!(aInstallLocation.name in aManifests))\n return null;\n if (!(aId in aManifests[aInstallLocation.name]))\n return null;\n return aManifests[aInstallLocation.name][aId];\n };\n\n // Get the previous add-ons from the database and put them into maps by location\n let previousAddons = new Map();\n for (let a of XPIDatabase.getAddons()) {\n let locationAddonMap = previousAddons.get(a.location);\n if (!locationAddonMap) {\n locationAddonMap = new Map();\n previousAddons.set(a.location, locationAddonMap);\n }\n locationAddonMap.set(a.id, a);\n }\n\n // Build the list of current add-ons into similar maps. When add-ons are still\n // present we re-use the add-on objects from the database and update their\n // details directly\n let currentAddons = new Map();\n for (let installLocation of XPIProvider.installLocations) {\n let locationAddonMap = new Map();\n currentAddons.set(installLocation.name, locationAddonMap);\n\n // Get all the on-disk XPI states for this location, and keep track of which\n // ones we see in the database.\n let states = XPIStates.getLocation(installLocation.name);\n\n // Iterate through the add-ons installed the last time the application\n // ran\n let dbAddons = previousAddons.get(installLocation.name);\n if (dbAddons) {\n for (let [id, oldAddon] of dbAddons) {\n // Check if the add-on is still installed\n let xpiState = states && states.get(id);\n if (xpiState) {\n // Here the add-on was present in the database and on disk\n recordAddonTelemetry(oldAddon);\n\n // Check if the add-on has been changed outside the XPI provider\n if (oldAddon.updateDate != xpiState.mtime) {\n // Did time change in the wrong direction?\n if (xpiState.mtime < oldAddon.updateDate) {\n XPIProvider.setTelemetry(oldAddon.id, \"olderFile\", {\n name: XPIProvider._mostRecentlyModifiedFile[id],\n mtime: xpiState.mtime,\n oldtime: oldAddon.updateDate\n });\n } else {\n XPIProvider.setTelemetry(oldAddon.id, \"modifiedFile\",\n XPIProvider._mostRecentlyModifiedFile[id]);\n }\n }\n\n // The add-on has changed if the modification time has changed, or\n // we have an updated manifest for it. Also reload the metadata for\n // add-ons in the application directory when the application version\n // has changed\n let newAddon = loadedManifest(installLocation, id);\n if (newAddon || oldAddon.updateDate != xpiState.mtime ||\n (aUpdateCompatibility && (installLocation.name == KEY_APP_GLOBAL ||\n installLocation.name == KEY_APP_SYSTEM_DEFAULTS))) {\n newAddon = this.updateMetadata(installLocation, oldAddon, xpiState, newAddon);\n }\n else if (oldAddon.descriptor != xpiState.descriptor) {\n newAddon = this.updateDescriptor(installLocation, oldAddon, xpiState);\n }\n else if (aUpdateCompatibility) {\n newAddon = this.updateCompatibility(installLocation, oldAddon, xpiState,\n aOldAppVersion, aOldPlatformVersion);\n }\n else {\n // No change\n newAddon = oldAddon;\n }\n\n if (newAddon)\n locationAddonMap.set(newAddon.id, newAddon);\n }\n else {\n // The add-on is in the DB, but not in xpiState (and thus not on disk).\n this.removeMetadata(oldAddon);\n }\n }\n }\n\n // Any add-on in our current location that we haven't seen needs to\n // be added to the database.\n // Get the migration data for this install location so we can include that as\n // we add, in case this is a database upgrade or rebuild.\n let locMigrateData = {};\n if (XPIDatabase.migrateData && installLocation.name in XPIDatabase.migrateData)\n locMigrateData = XPIDatabase.migrateData[installLocation.name];\n\n if (states) {\n for (let [id, xpiState] of states) {\n if (locationAddonMap.has(id))\n continue;\n let migrateData = id in locMigrateData ? locMigrateData[id] : null;\n let newAddon = loadedManifest(installLocation, id);\n let addon = this.addMetadata(installLocation, id, xpiState, newAddon,\n aOldAppVersion, aOldPlatformVersion, migrateData);\n if (addon)\n locationAddonMap.set(addon.id, addon);\n }\n }\n }\n\n // previousAddons may contain locations where the database contains add-ons\n // but the browser is no longer configured to use that location. The metadata\n // for those add-ons must be removed from the database.\n for (let [locationName, addons] of previousAddons) {\n if (!currentAddons.has(locationName)) {\n for (let [id, oldAddon] of addons)\n this.removeMetadata(oldAddon);\n }\n }\n\n // Validate the updated system add-ons\n let systemAddonLocation = XPIProvider.installLocationsByName[KEY_APP_SYSTEM_ADDONS];\n let addons = currentAddons.get(KEY_APP_SYSTEM_ADDONS) || new Map();\n\n let hideLocation;\n if (systemAddonLocation.isActive() && systemAddonLocation.isValid(addons)) {\n // Hide the system add-on defaults\n logger.info(\"Hiding the default system add-ons.\");\n hideLocation = KEY_APP_SYSTEM_DEFAULTS;\n }\n else {\n // Hide the system add-on updates\n logger.info(\"Hiding the updated system add-ons.\");\n hideLocation = KEY_APP_SYSTEM_ADDONS;\n }\n\n let previousVisible = this.getVisibleAddons(previousAddons);\n let currentVisible = this.flattenByID(currentAddons, hideLocation);\n let sawActiveTheme = false;\n XPIProvider.bootstrappedAddons = {};\n\n // Pass over the new set of visible add-ons, record any changes that occured\n // during startup and call bootstrap install/uninstall scripts as necessary\n for (let [id, currentAddon] of currentVisible) {\n let previousAddon = previousVisible.get(id);\n\n // Note if any visible add-on is not in the application install location\n if (currentAddon._installLocation.name != KEY_APP_GLOBAL)\n XPIProvider.allAppGlobal = false;\n\n let isActive = !currentAddon.disabled;\n let wasActive = previousAddon ? previousAddon.active : currentAddon.active\n\n if (!previousAddon) {\n // If we had a manifest for this add-on it was a staged install and\n // so wasn't something recovered from a corrupt database\n let wasStaged = !!loadedManifest(currentAddon._installLocation, id);\n\n // We might be recovering from a corrupt database, if so use the\n // list of known active add-ons to update the new add-on\n if (!wasStaged && XPIDatabase.activeBundles) {\n // For themes we know which is active by the current skin setting\n if (currentAddon.type == \"theme\")\n isActive = currentAddon.internalName == XPIProvider.currentSkin;\n else\n isActive = XPIDatabase.activeBundles.indexOf(currentAddon.descriptor) != -1;\n\n // If the add-on wasn't active and it isn't already disabled in some way\n // then it was probably either softDisabled or userDisabled\n if (!isActive && !currentAddon.disabled) {\n // If the add-on is softblocked then assume it is softDisabled\n if (currentAddon.blocklistState == Blocklist.STATE_SOFTBLOCKED)\n currentAddon.softDisabled = true;\n else\n currentAddon.userDisabled = true;\n }\n }\n else {\n // This is a new install\n if (currentAddon.foreignInstall)\n AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_INSTALLED, id);\n\n if (currentAddon.bootstrap) {\n // Visible bootstrapped add-ons need to have their install method called\n XPIProvider.callBootstrapMethod(currentAddon, currentAddon._sourceBundle,\n \"install\", BOOTSTRAP_REASONS.ADDON_INSTALL);\n if (!isActive)\n XPIProvider.unloadBootstrapScope(currentAddon.id);\n }\n }\n }\n else {\n if (previousAddon !== currentAddon) {\n // This is an add-on that has changed, either the metadata was reloaded\n // or the version in a different location has become visible\n AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_CHANGED, id);\n\n let installReason = Services.vc.compare(previousAddon.version, currentAddon.version) < 0 ?\n BOOTSTRAP_REASONS.ADDON_UPGRADE :\n BOOTSTRAP_REASONS.ADDON_DOWNGRADE;\n\n // If the previous add-on was in a different path, bootstrapped\n // and still exists then call its uninstall method.\n if (previousAddon.bootstrap && previousAddon._installLocation &&\n previousAddon._sourceBundle.exists() &&\n currentAddon._sourceBundle.path != previousAddon._sourceBundle.path) {\n\n XPIProvider.callBootstrapMethod(previousAddon, previousAddon._sourceBundle,\n \"uninstall\", installReason,\n { newVersion: currentAddon.version });\n XPIProvider.unloadBootstrapScope(previousAddon.id);\n }\n\n // Make sure to flush the cache when an old add-on has gone away\n flushStartupCache();\n\n if (currentAddon.bootstrap) {\n // Visible bootstrapped add-ons need to have their install method called\n let file = Cc[\"@mozilla.org/file/local;1\"].createInstance(Ci.nsIFile);\n file.persistentDescriptor = currentAddon._sourceBundle.persistentDescriptor;\n XPIProvider.callBootstrapMethod(currentAddon, file,\n \"install\", installReason,\n { oldVersion: previousAddon.version });\n if (currentAddon.disabled)\n XPIProvider.unloadBootstrapScope(currentAddon.id);\n }\n }\n\n if (isActive != wasActive) {\n let change = isActive ? AddonManager.STARTUP_CHANGE_ENABLED\n : AddonManager.STARTUP_CHANGE_DISABLED;\n AddonManagerPrivate.addStartupChange(change, id);\n }\n }\n\n XPIDatabase.makeAddonVisible(currentAddon);\n currentAddon.active = isActive;\n\n // Make sure the bootstrap information is up to date for this ID\n if (currentAddon.bootstrap && currentAddon.active) {\n XPIProvider.bootstrappedAddons[id] = {\n version: currentAddon.version,\n type: currentAddon.type,\n descriptor: currentAddon._sourceBundle.persistentDescriptor,\n multiprocessCompatible: currentAddon.multiprocessCompatible,\n runInSafeMode: canRunInSafeMode(currentAddon),\n };\n }\n\n if (currentAddon.active && currentAddon.internalName == XPIProvider.selectedSkin)\n sawActiveTheme = true;\n }\n\n // Pass over the set of previously visible add-ons that have now gone away\n // and record the change.\n for (let [id, previousAddon] of previousVisible) {\n if (currentVisible.has(id))\n continue;\n\n // This add-on vanished\n\n // If the previous add-on was bootstrapped and still exists then call its\n // uninstall method.\n if (previousAddon.bootstrap && previousAddon._sourceBundle.exists()) {\n XPIProvider.callBootstrapMethod(previousAddon, previousAddon._sourceBundle,\n \"uninstall\", BOOTSTRAP_REASONS.ADDON_UNINSTALL);\n XPIProvider.unloadBootstrapScope(previousAddon.id);\n }\n AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_UNINSTALLED, id);\n\n // Make sure to flush the cache when an old add-on has gone away\n flushStartupCache();\n }\n\n // Make sure add-ons from hidden locations are marked invisible and inactive\n let locationAddonMap = currentAddons.get(hideLocation);\n if (locationAddonMap) {\n for (let addon of locationAddonMap.values()) {\n addon.visible = false;\n addon.active = false;\n }\n }\n\n // If a custom theme is selected and it wasn't seen in the new list of\n // active add-ons then enable the default theme\n if (XPIProvider.selectedSkin != XPIProvider.defaultSkin && !sawActiveTheme) {\n logger.info(\"Didn't see selected skin \" + XPIProvider.selectedSkin);\n XPIProvider.enableDefaultTheme();\n }\n\n // Finally update XPIStates to match everything\n for (let [locationName, locationAddonMap] of currentAddons) {\n for (let [id, addon] of locationAddonMap) {\n let xpiState = XPIStates.getAddon(locationName, id);\n xpiState.syncWithDB(addon);\n }\n }\n XPIStates.save();\n\n XPIProvider.persistBootstrappedAddons();\n\n // Clear out any cached migration data.\n XPIDatabase.migrateData = null;\n XPIDatabase.saveChanges();\n\n return true;\n }", "function version() {\n return gulp.src('./bower.json')\n .pipe($.bump({version: pkg.version}))\n .pipe(gulp.dest('./'));\n}", "function compareVersions(v1, v2) {\n const v1Split = v1.split(\".\");\n const v2Split = v2.split(\".\");\n\n for (let i = 0; i < v1Split.length || i < v2Split.length; i++) {\n // || 0 means if whatever is to the left of || is falsy, use 0 as the value instead\n const v1RevisionNum = parseInt(v1Split[i]) || 0;\n const v2RevisionNum = parseInt(v2Split[i]) || 0;\n\n if (v1RevisionNum > v2RevisionNum) {\n return 1;\n } else if (v1RevisionNum < v2RevisionNum) {\n return -1;\n }\n }\n return 0;\n}", "function version() {\n // Options are the same as command line, except camelCase\n // add --noskip args to ignore skip set\n var skip = cmdParser.argv['noskip'] ? {} : { commit: true, tag: true }\n\n // console.log(cmdParser.argv)\n\n standardVersion(\n {\n ...cmdParser.argv,\n skip,\n scripts: {\n postbump: jsonCMD,\n postchangelog: replaceCMD,\n },\n },\n function(err) {\n if (err) {\n console.error(`standard-version failed with message: ${err.message}`)\n }\n }\n ).then(() => {\n replaceHeader(LOGFILE, HEADER)\n copyFile(LOGFILE, COPYTO)\n })\n}", "function setUserRequestedPackageVersions(\n deps: Array<Dependency>,\n args: Array<string>,\n latest: boolean,\n packagePatterns,\n reporter: Reporter,\n) {\n args.forEach(requestedPattern => {\n let found = false;\n let normalized = normalizePattern(requestedPattern);\n\n // if the user specified a package name without a version range, then that implies \"latest\"\n // but if the latest flag is not passed then we need to use the version range from package.json\n if (!normalized.hasVersion && !latest) {\n packagePatterns.forEach(packagePattern => {\n const packageNormalized = normalizePattern(packagePattern.pattern);\n if (packageNormalized.name === normalized.name) {\n normalized = packageNormalized;\n }\n });\n }\n\n const newPattern = `${normalized.name}@${normalized.range}`;\n\n // if this dependency is already in the outdated list,\n // just update the upgradeTo to whatever version the user requested.\n deps.forEach(dep => {\n if (normalized.hasVersion && dep.name === normalized.name) {\n found = true;\n dep.upgradeTo = newPattern;\n reporter.verbose(reporter.lang('verboseUpgradeBecauseRequested', requestedPattern, newPattern));\n }\n });\n\n // if this dependency was not in the outdated list,\n // then add a new entry\n if (normalized.hasVersion && !found) {\n deps.push({\n name: normalized.name,\n wanted: '',\n latest: '',\n url: '',\n hint: '',\n range: '',\n current: '',\n upgradeTo: newPattern,\n workspaceName: '',\n workspaceLoc: '',\n });\n reporter.verbose(reporter.lang('verboseUpgradeBecauseRequested', requestedPattern, newPattern));\n }\n });\n}", "function updateReadmeVersion() {\n return gulp.src([\n './README.md'\n ]).pipe(replace(\n /([0-9]\\.[0-9]+\\.[0-9]+)/g, packageJson().version\n )).pipe(gulp.dest('./'));\n}", "async updateLibrary(files) {\n const response = await updateLibraryData(files, this.props.client)\n this.getCentralLibrary()\n return response;\n }", "function upgradeFn () {\n // == BEGIN MODULE SCOPE VARIABLES ==================================\n var\n xhiObj = this,\n\n catchFn = xhiObj.catchFn,\n commandMap = xhiObj.commandMap,\n logFn = xhiObj.logFn,\n nextFn = xhiObj.nextFn,\n packageMatrix = xhiObj.packageMatrix,\n prefixStr = xhiObj.makePrefixStr( commandMap ),\n stageStatusMap = xhiObj.stageStatusMap,\n\n aliasStr = commandMap.alias_str,\n postObj\n ;\n // == . END MODULE SCOPE VARIABLES ==================================\n\n // == BEGIN UTILITY METHODS =========================================\n // BEGIN utility /failFn/\n // Purpose: Wrap catchFn to store failure and finish\n //\n function failFn () {\n stageStatusMap[ aliasStr ] = false;\n catchFn( arguments );\n }\n // . END utility /failFn/\n // == . END UTILITY METHODS =========================================\n\n // == BEGIN EVENT HANDLERS ==========================================\n // BEGIN event handler /onOutdatedFn/\n function onOutdatedFn ( error_data, update_table ) {\n var\n solve_map = {},\n update_count = update_table.length,\n\n idx, row_list,\n package_name, current_str, target_str\n ;\n\n if ( error_data ) { return failFn( error_data ); }\n\n if ( update_count === 0 ) {\n stageStatusMap[ aliasStr ] = true;\n logFn( prefixStr + 'No package changes' );\n logFn( prefixStr + 'Success' );\n nextFn();\n }\n\n // Invalidate all these stages\n xhiObj.xhiUtilObj._clearMap_( stageStatusMap, [\n 'install', 'setup', 'dev_test', 'dev_lint',\n 'dev_cover', 'dev_commit', 'build'\n ]);\n\n // Load post-install methods\n xhiObj.loadLibsFn();\n postObj = xhiObj.makePostObj();\n\n // Begin aggregate changes and merge\n for ( idx = 0; idx < update_count; idx++ ) {\n row_list = update_table[ idx ];\n package_name = row_list[ 1 ];\n current_str = row_list[ 2 ];\n target_str = row_list[ 4 ];\n solve_map[ package_name ] = target_str;\n logFn(\n 'Update ' + package_name + ' from '\n + current_str + ' to ' + target_str\n );\n }\n Object.assign( packageMatrix.devDependencies, solve_map );\n // . End Aggregate changes an merge\n\n // Save to package file\n postObj.writePkgFileFn(\n function _onWriteFn ( error_data ) {\n if ( error_data ) { return failFn( error_data ); }\n\n // Mark install and setup as 'out of date'\n stageStatusMap.install = false;\n stageStatusMap.setup = false;\n\n // Store success and finish\n // A successful update invalidates all prior stages\n xhiObj.xhiUtilObj._clearMap_( stageStatusMap );\n stageStatusMap[ aliasStr ] = true;\n logFn( prefixStr + 'Success' );\n nextFn();\n }\n );\n }\n // . END event handler /onOutdatedFn/\n\n // BEGIN event handler /onLoadFn/\n function onLoadFn ( error_data, localNpmObj ) {\n if ( error_data ) { return catchFn( error_data ); }\n localNpmObj.outdated( onOutdatedFn );\n }\n // . END event handler /onLoadFn/\n // == . END EVENT HANDLERS ==========================================\n\n // == BEGIN MAIN ====================================================\n function mainFn () {\n logFn( prefixStr + 'Start' );\n xhiObj.npmObj.load( xhiObj.fqPkgFilename, onLoadFn );\n }\n // == . END MAIN ====================================================\n mainFn();\n}", "function fixInvalidVersions( version ) {\n\t\tvar originalVersion = version;\n\n\t\ttry {\n\t\t\tif ( semver.valid( version ) ) {\n\t\t\t\treturn version;\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\t// If the version is missing patch information ( eg \"1.5\" ), then append a .0 to complete it( \"1.5.0\" );\n\t\t\tif ( !rMajorMinorPatch.test( version ) ) {\n\t\t\t\tversion = version.replace( rMajorMinor, \"$1.0\" );\n\t\t\t}\n\n\t\t\t// If the version had bad label formatting ( eg \"1.5.1beta2\" ), then prepend a dash ( \"1.5.1-beta2\" );\n\t\t\tversion = version.replace( badLabel, \"$1-$2\" );\n\n\t\t\tfixedVersions[ version ] = originalVersion;\n\n\t\t\treturn version;\n\t\t}\n\t}", "function handleFileVersion(fileGuid, fileObj, versionObj, tempFile) {\n var versionGuid = jive.util.guid();\n if (fileObj.versionsList) {\n fileObj.versionsList.push(versionGuid);\n } else {\n fileObj.versionsList = [versionGuid];\n } // end if\n\n var firstStep = q.fcall(function () { });\n if (tempFile) {\n var fileExt = tempFile.originalname.split('.').pop();\n var fileVersionPath = fileObj.fileDirectoryPath + \"/version\" + fileObj.versionsList.length + \".\" + fileExt;\n firstStep = jive.util.fsrename(tempFile.path, fileVersionPath);\n } // end if\n\n return firstStep.then(function () {\n if (tempFile) {\n logger.info(\"File version binary was saved to: \" + fileVersionPath);\n } // end if\n return jive.context.persistence.save(\"files\", fileGuid, fileObj);\n }).then(function () {\n versionObj.fileVersionPath = fileVersionPath;\n return jive.context.persistence.save(\"fileVersions\", versionGuid, versionObj);\n }).then(\n function () {\n var version = {\n 'contentType': versionObj.contentType,\n 'fileName': versionObj.fileName,\n 'externalId': versionGuid,\n 'resources': [\n {\n 'name': 'self',\n 'url': '/fsstorage/version?version=' + versionGuid,\n 'verbs': ['GET', 'PUT', 'DELETE'] // PUT method is not implemented in this example\n },\n {\n 'name': 'downloadVersion',\n 'url': '/fsstorage/download?version=' + versionGuid,\n 'verbs': ['GET']\n },\n {\n 'name': 'fileParent',\n 'url': '/fsstorage/file?file=' + fileGuid,\n 'verbs': ['GET']\n }\n ]};\n if (tempFile) {\n version[\"size\"] = tempFile.size;\n } // end if\n\n var responseData = {\n 'externalId': fileGuid,\n 'version': version,\n 'resources': [\n {\n 'name': 'self',\n 'url': '/fsstorage/file?file=' + fileGuid,\n 'verbs': ['GET', 'PUT', 'DELETE']\n },\n {\n 'name': 'uploadVersion',\n 'url': '/fsstorage/uploadVersion?file=' + fileGuid,\n 'verbs': ['POST']\n }\n ]\n };\n\n return q.fcall(function () {\n return responseData;\n });\n });\n}", "function compareVersionNumbers(version1, version2){\n\n}", "function onOutdatedFn ( error_data, update_table ) {\n var\n solve_map = {},\n update_count = update_table.length,\n\n idx, row_list,\n package_name, current_str, target_str\n ;\n\n if ( error_data ) { return failFn( error_data ); }\n\n if ( update_count === 0 ) {\n stageStatusMap[ aliasStr ] = true;\n logFn( prefixStr + 'No package changes' );\n logFn( prefixStr + 'Success' );\n nextFn();\n }\n\n // Invalidate all these stages\n xhiObj.xhiUtilObj._clearMap_( stageStatusMap, [\n 'install', 'setup', 'dev_test', 'dev_lint',\n 'dev_cover', 'dev_commit', 'build'\n ]);\n\n // Load post-install methods\n xhiObj.loadLibsFn();\n postObj = xhiObj.makePostObj();\n\n // Begin aggregate changes and merge\n for ( idx = 0; idx < update_count; idx++ ) {\n row_list = update_table[ idx ];\n package_name = row_list[ 1 ];\n current_str = row_list[ 2 ];\n target_str = row_list[ 4 ];\n solve_map[ package_name ] = target_str;\n logFn(\n 'Update ' + package_name + ' from '\n + current_str + ' to ' + target_str\n );\n }\n Object.assign( packageMatrix.devDependencies, solve_map );\n // . End Aggregate changes an merge\n\n // Save to package file\n postObj.writePkgFileFn(\n function _onWriteFn ( error_data ) {\n if ( error_data ) { return failFn( error_data ); }\n\n // Mark install and setup as 'out of date'\n stageStatusMap.install = false;\n stageStatusMap.setup = false;\n\n // Store success and finish\n // A successful update invalidates all prior stages\n xhiObj.xhiUtilObj._clearMap_( stageStatusMap );\n stageStatusMap[ aliasStr ] = true;\n logFn( prefixStr + 'Success' );\n nextFn();\n }\n );\n }", "async exportAndOverwrite({ files /*, outcome is unused */ }) {\n files.forEach(async (filePath) => {\n const newSource = await this._readModifiedSourceFile(filePath);\n\n await this._updateTargetFile({ filePath, newTarget: newSource });\n });\n }", "function gitMyVersion(file) {\n var PLACEHOLDER = '__GIT_MY_VERSION__';\n var root = findRoot(file);\n var commitHash = null;\n var packageVersion = require(path.join(root, 'package.json')).version\n var regex = new RegExp(PLACEHOLDER, 'g');\n\n return through.obj(function fileStream(chunk, enc, cb) {\n if(commitHash) {\n cb(null, replaceChunk(chunk, regex, packageVersion + '-' + commitHash));\n } else {\n gitRev.short(function getShortCommitHash(hash) {\n commitHash = hash;\n\n cb(null, replaceChunk(chunk, regex, packageVersion + '-' + commitHash));\n });\n }\n });\n}", "function findModifiedFilesBuggy(activityBubbles, currentBubbleIndex, modifiedFiles){\n\t/* \n\t\tFOR EACH MODIFIED FILE:\n\t\t\t- Find changes\n\t\t\t- Find in which commit these changes were written\n\t\t\t- Set that commit as buggy (otherwise, the commit in which the file was created)\t\t\t\t\n\t*/\n\tif(modifiedFiles.length > 0){\n\t\t// Array is not empty\n\t\t$.each(modifiedFiles, function(){\n\t\t\t/*\n\t\t\t\tSTEPS:\n\t\t\t\t\t1) Retrieve file name\n\t\t\t\t\t2) Retreive deletions from previous commit\n\t\t\t\t\t3) Get commit info using GitHub API\n\t\t\t\t\t4) Look for the file in the response\n\t\t\t\t\t\t4.1) If it has status equals to \"added\" set that commit as buggy and terminate computation \n\t\t\t\t\t\t4.2) Otherwise compare changes and verify\n\t\t\t\t\t\t\t4.2.1) If changes were introducted in that commit set it as buggy and continue to the next commit\n\t\t\t\t\t\t\t4.2.2) Otherwise continue to the next commit\n\t\t\t*/\n\t\t\tvar this_string = this.toString();\n\t\t\t// point 1\n\t\t\tvar filename = getFileName(this_string);\n\t\t\t// point 2\n\t\t\tvar removedLines = getRemovedLines(this_string);\n\t\t\t// point 3\n\t\t\tvar foundAll = false; // Flag setted true if it is found the commit in which the file with changes was added\n\t\t\tfor(var i = currentBubbleIndex+2; i<activityBubbles.length && foundAll == false; i++){\n\t\t\t\tvar currentCommitUrl = activityBubbles[i].commitUrl;\n\t\t\t\t$.ajax({\n\t\t\t \t\turl: currentCommitUrl + \"?\" + githubCredentials,\n\t\t\t \t\tasync: false,\n\t\t\t \t\tsuccess: function(data){\t\n\t\t\t \t\t\t// point 4\n\t\t\t \t\t\t$.each(data.files, function(){\n\t\t\t \t\t\t\tif(this.filename == filename){\n\t\t\t \t\t\t\t\tif(this.status == \"added\"){\n\t\t\t \t\t\t\t\t\t// point 4.1\n\t\t\t\t \t\t\t\t\tactivityBubbles[i].buggyCommit = true;\n\t\t\t\t \t\t\t\t\tfound = true; \n\t\t\t \t\t\t\t\t} else if (this.status == \"modified\") {\n\t\t\t \t\t\t\t\t\t// point 4.2\n\t\t\t \t\t\t\t\t\t// Flag true if this is a buggy commit\n\t\t\t \t\t\t\t\t\tvar isPreviousBuggy = isBuggyPrevious(activityBubbles[currentBubbleIndex], activityBubbles[i], removedLines, filename);\n\t\t\t\t\t\t\t\t\tif(isPreviousBuggy.isBugHere == true){\n\t\t\t \t\t\t\t\t\t\t// point 4.2.1\n\t\t\t \t\t\t\t\t\t\tactivityBubbles[i-1].buggyCommit = true;\n\t\t\t \t\t\t\t\t\t}\n\t\t\t \t\t\t\t\t\tif(isPreviousBuggy.remainingRemovedLines.length <= 0) {\n\t\t\t \t\t\t\t\t\t\t// All lines are computed\n\t\t\t \t\t\t\t\t\t\tfoundAll = true;\n\t\t\t \t\t\t\t\t\t} else {\n\t\t\t \t\t\t\t\t\t\tremovedLines = isPreviousBuggy.remainingRemovedLines;\n\t\t\t \t\t\t\t\t\t\t// point 4.2.2\t\n\t\t\t \t\t\t\t\t\t}\t \t\t\t\t\t \n\t\t\t \t\t\t\t\t}\n\t\t\t \t\t\t\t\treturn false;\n\t\t\t \t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t \t\t},\n\t\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\n\t\t\t\t\t\tconsole.log(\"Error: GitHub findRemovedFilesBuggy\");\n\t\t\t\t\t\tthrow new GitHubException(jqXHR.status, textStatus, \"GetCommitInfo\");\n\t\t\t\t\t}\t\n\t\t\t\t});\t\t\n\t\t\t}\n\t\t});\n\t}\n\treturn activityBubbles;\n}", "function syncNpmVersions() {\n return new Promise((resolve, reject) => {\n fs.readFile(`${paths.distNpmPath()}/package.json`, (err, data) => {\n if (err) {\n return reject(err);\n }\n const npmPackage = JSON.parse(data);\n const promises = [\n updatePackageVersion(`./package.json`, npmPackage),\n updatePackageVersion(`./src/package.json`, npmPackage)\n ];\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch(err => {\n reject(err);\n });\n });\n });\n}", "async function changesToRelease () {\n const lastCommitWasRelease = /^Bump v[0-9]+.[0-9]+.[0-9]+(-beta.[0-9]+)?(-alpha.[0-9]+)?(-nightly.[0-9]+)?$/g;\n const lastCommit = await GitProcess.exec(['log', '-n', '1', '--pretty=format:\\'%s\\''], ELECTRON_DIR);\n return !lastCommitWasRelease.test(lastCommit.stdout);\n}", "_parseVersion() {\n if (this.packageJsonContent) {\n if (!this.packageJsonContent.hasOwnProperty('version')) {\n throw (new Error('Cannot find property \"version in package.json\"'))\n }\n\n const parts = this.packageJsonContent.version.split('.')\n if (!parts.length || parts.length !== 3) {\n throw (new Error(`Invalid version scheme. Expected: x.x.x, have ${this.packageJsonContent.version}`))\n }\n\n this.version.major = parseInt(parts[0], 10) || 0\n this.version.minor = parseInt(parts[1], 10) || 0\n this.version.patch = parseInt(parts[2], 10) || 0\n }\n }", "function decide(data) {\n actualVersion = data.version;\n if (actualVersion == bracketteData.version) {\n console.info(\"You have the latest version: \" + data.version);\n return Promise.reject(\"You have the latest version: \" + data.version);\n }\n if (fs.existsSync(\"../.git\")) {\n console.info(\"You have git, you should 'git pull' not run this updater.\");\n return Promise.reject(\"Please run 'git pull'\");\n }\n console.info(\"You are out of date. Updating now.\");\n downloadRelease(\n bracketteData.user,\n bracketteData.repo,\n bracketteData.outputdir,\n filterRelease,\n filterAsset\n )\n .then(function() {\n console.log(\"All done!\");\n })\n .catch(function(err) {\n console.error(err.message);\n // Assuming this worked...\n const zipname = `brackette-${actualVersion}.zip`;\n if (fs.existsSync(\"../\" + zipname)) {\n // it exists so let's go!\n console.log(\"please wait...\");\n const zip = new admzip(\"../\" + zipname);\n zip.extractAllTo(\"../\", true);\n fs.unlink(\"../\" + zipname);\n console.log(\"done\");\n } else {\n console.error(\n \"There was an error! Could not find the zip file that we need...\"\n );\n }\n });\n}", "function commitChanges(git, version) {\n git += `git commit -m \"chore: updated npm version to ${version}\" && git push`;\n exec(git, (err, stdout, stderr) => {\n if (err) {\n throw new Error(\n \"BRANCH SDK: Failed to commit git changes for the npm version. Docs https://goo.gl/GijGKP\"\n );\n }\n });\n }", "async function compare() {\n let branchDir = path.join(__dirname, '..', 'dist', 'branch-api');\n let publishedDir = path.join(__dirname, '..', 'dist', 'published-api');\n if (!(fs.existsSync(branchDir) && fs.existsSync(publishedDir))) {\n console.log(chalk.redBright(`you must have both a branchDir ${branchDir} and publishedDir ${publishedDir}`));\n return;\n }\n let summaryMessages = [];\n\n let branchAPIs = fg.sync(`${branchDir}/**/api.json`);\n let publishedAPIs = fg.sync(`${publishedDir}/**/api.json`);\n let pairs = [];\n // we only care about changes to already published APIs, so find all matching pairs based on what's been published\n for (let pubApi of publishedAPIs) {\n let pubApiPath = pubApi.split(path.sep);\n let sharedPath = path.join(...pubApiPath.slice(pubApiPath.length - 4));\n let matchingBranchFile;\n for (let branchApi of branchAPIs) {\n if (branchApi.includes(sharedPath)) {\n matchingBranchFile = branchApi;\n pairs.push({pubApi, branchApi});\n break;\n }\n }\n if (!matchingBranchFile) {\n summaryMessages.push({msg: `removed module ${pubApi}`, severity: 'error'});\n }\n }\n let privatePackages = [];\n // don't care about not private APIs, but we do care if we're about to publish a new one\n for (let branchApi of branchAPIs) {\n let branchApiPath = branchApi.split(path.sep);\n let sharedPath = path.join(...branchApiPath.slice(branchApiPath.length - 4));\n let matchingPubFile;\n for (let pubApi of publishedAPIs) {\n if (pubApi.includes(sharedPath)) {\n matchingPubFile = pubApi;\n // don't re-add to pairs\n break;\n }\n }\n if (!matchingPubFile) {\n let json = JSON.parse(fs.readFileSync(path.join(branchApi, '..', '..', 'package.json')), 'utf8');\n if (!json.private) {\n summaryMessages.push({msg: `added module ${branchApi}`, severity: 'warn'});\n } else {\n privatePackages.push(branchApi);\n }\n }\n }\n\n let count = 0;\n let diffs = {};\n for (let pair of pairs) {\n let diff = getDiff(summaryMessages, pair);\n if (diff.diff.length > 0) {\n count += 1;\n diffs[diff.name] = diff.diff;\n }\n }\n let modulesAdded = branchAPIs.length - privatePackages.length - publishedAPIs.length;\n if (modulesAdded !== 0) {\n summaryMessages.push({msg: `${Math.abs(modulesAdded)} modules ${modulesAdded > 0 ? 'added' : 'removed'}`, severity: modulesAdded > 0 ? 'warn' : 'error'});\n } else {\n summaryMessages.push({msg: 'no modules removed or added', severity: 'info'});\n }\n if (count !== 0) {\n summaryMessages.push({msg: `${count} modules had changes to their API ${Object.keys(diffs).map(key => `\\n - ${simplifyModuleName(key)}`)}`, severity: 'warn'});\n } else {\n summaryMessages.push({msg: 'no modules changed their API', severity: 'info'});\n }\n summaryMessages.push({});\n let matches = analyzeDiffs(diffs);\n let moreMessages = generateMessages(matches);\n [...summaryMessages, ...moreMessages].forEach(({msg, severity}) => {\n if (!msg) {\n console.log('');\n return;\n }\n let color = 'default';\n switch (severity) {\n case 'info':\n color = 'greenBright';\n break;\n case 'log':\n color = 'blueBright';\n break;\n case 'warn':\n color = 'yellowBright';\n break;\n case 'error':\n color = 'redBright';\n break;\n default:\n color = 'defaultBright';\n break;\n }\n console[severity](chalk[color](msg));\n });\n}", "async function updateVersionInPomXml (logger, versionStr) {\n logger.log(`Updating pom.xml to version ${versionStr}`)\n const command = await findCommand()\n await exec(\n command,\n ['versions:set', '-DgenerateBackupPoms=false', `-DnewVersion=${versionStr}`]\n )\n}", "set locallyModifiedVersion(value) {\n // Will eventually become a header, so coerce to string.\n this._locallyModifiedVersion = \"\" + value;\n }" ]
[ "0.6643119", "0.6504301", "0.6424855", "0.6318748", "0.626895", "0.6252685", "0.6239369", "0.6018477", "0.5977049", "0.59079313", "0.5866209", "0.5852599", "0.58280015", "0.57818645", "0.57788885", "0.5754935", "0.5750461", "0.5629583", "0.5619861", "0.55889", "0.5580781", "0.5580781", "0.5580781", "0.5580781", "0.5580781", "0.5580781", "0.5580781", "0.5580781", "0.557508", "0.557508", "0.55276614", "0.551752", "0.551752", "0.5510606", "0.5510148", "0.54668397", "0.5408264", "0.53822285", "0.5367079", "0.5360861", "0.53463346", "0.5317591", "0.5314909", "0.5278226", "0.5278226", "0.5278226", "0.5278226", "0.5278226", "0.5247969", "0.5200095", "0.5192585", "0.5188871", "0.51658005", "0.51320183", "0.5130458", "0.51231664", "0.5105716", "0.50991845", "0.5096054", "0.5096054", "0.5096054", "0.5096054", "0.5083732", "0.50549823", "0.50547415", "0.50355893", "0.50222594", "0.49996683", "0.4998151", "0.499605", "0.49747863", "0.49598637", "0.49477813", "0.49477717", "0.48918653", "0.4882844", "0.48721772", "0.48659685", "0.48555753", "0.48538798", "0.48381868", "0.48295832", "0.4822189", "0.48166582", "0.48145816", "0.48100975", "0.48019606", "0.4793262", "0.4765707", "0.47633776", "0.476186", "0.4760459", "0.4749583", "0.47359243", "0.47213945", "0.4702149", "0.47016007", "0.4695464", "0.4690633", "0.46774113" ]
0.64025974
3
displayanimalInfo function rerenders the HTML to display the appropriate content
function displayanimalInfo() { var animal = $(this).attr("data-name"); // var queryURL = "http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&limit=10&search?q="+ animal; var queryURL = "https://api.giphy.com/v1/gifs/search?q=" + animal + "&api_key=dc6zaTOxFJmzC&limit=10"; // Creating an AJAX call for the specific animal button being clicked $.ajax({ url: queryURL, method: "GET" }).done(function(response) { //removes previously populated divs of animal gifs to prep for load on page $( "div" ).remove( ".imgState" ); // loads new pics into the page var results = response.data; console.log("number of records = " + results.length); // loops through the API data pulled in for (var i = 0; i < results.length; i++) { // Creating and storing a div tag var animalDiv = $("<div class='imgState'>"); // Creating a paragraph tag with the result item's rating var p = $("<p>").text("Rating: " + results[i].rating); // Creating and storing still and animated images var animalImage = $("<img>"); animalImage.attr("src", results[i].images.fixed_height_still.url); animalImage.attr("data-still", results[i].images.fixed_height_still.url); animalImage.attr("data-animate", results[i].images.fixed_height.url) // Appending the paragraph and image tag to the animalDiv animalDiv.append(animalImage); animalDiv.append(p); $("#animals-view").append(animalDiv); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayAnimalInfo() {\n\n\t\tvar animal = $(this).attr(\"data-name\");\n\t\tconsole.log(\"animal= \" + animal);\n\t\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\t\tconsole.log(\"queryURL= \" + queryURL);\n\t\t\t//creating AJAX call for specific animal button being called\n\t\t\t$.ajax({ url: queryURL, method: \"GET\" }).done(function(response) {\n\t\t\tconsole.log(response);\n\t\t\t\t//creating a div to hold the gifs (I already have a div created in html file #gifs-view)\n\t\t\t\t//var gifDiv = $(\"<div class='gif'>\");\n\n\t\t\t\tfor (var index = 0; index < response.data.length; index++) {\n\t\t\t\t\t//storing the rating data\n\t\t\t\t\tvar rating = response.data[index].rating; \n\t\t\t\t\tconsole.log(rating);\n\n\t\t\t\t\tvar image = response.data[index].images.downsized.url;\n\t\t\t\t\tconsole.log(image);\n\n\t\t\t\t\t//add rating to page \n\t\t\t\t\t$(\"#gifs-view\").append(\"Rating: \" + rating);\n\n\t\t\t\t\t//add gifs to page \n\t\t\t\t\t$(\"#gifs-view\").append(\"<img src='\" + image + \"'>\");\n\t\t\t\t\tconsole.log(image);\n\t\t\t\t}\n\n\t\t\t});\n\n\t}", "function displayAnimalInfo() {\n\n var animal = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n animal + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function(response) {\n \n for (var i = 0; i < response.data.length; i++) {\n console.log(response);\n //This section creates a section of HMTL to repeatably print gifs to the screen\n var animalDiv = $('<div>');\n var p = $('<p>');\n p.text(\"Rating: \" + response.data[i].rating);\n var animalImage = $('<img>');\n animalImage.addClass(\"gif\");\n animalImage.attr('data-animate',response.data[i].images.fixed_height.url);\n animalImage.attr('data-still',response.data[i].images.fixed_height_still.url);\n animalImage.attr('data-state',\"still\");\n animalImage.attr(\"src\", response.data[i].images.fixed_height_still.url); //This line ensures the gifs prints when a button is clicked\n $(animalDiv).append(p);\n $(animalDiv).append(animalImage);\n $('#gif-view').prepend(animalDiv);\n }\n $('#gif-view').prepend(\"<br><hr>\");\n renderButtons();\n });\n }", "function displayAnimalInfo() {\n\n var animal = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=x8yAyu1xp1MRX1C3aQjtJahAr5047i7j&q=\"+animal;\n \n\n // Creating an AJAX call for the specific animal button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n for (var k = 0; k < amount.length; k++) { //forloop to make 10 appear\n // Creating a div to hold the animal\n var animalDiv = $(\"<div class='animal'>\");\n\n // Storing the rating data\n var rating = response.data[k].rating;\n\n // Creating an element to have the rating displayed\n var pOne = $(\"<p>\").text(\"Rating: \" + rating);\n\n // Displaying the rating\n animalDiv.append(pOne);\n\n\n // Retrieving the URL for the image\n var imgURL = response.data[k].images.fixed_height.url;\n\n // Creating an element to hold the image\n var image = $(\"<img>\").attr(\"src\", imgURL);\n\n // Appending the image\n animalDiv.append(image);\n \n // Putting the entire animal above the previous animals\n $(\"#giphy-view\").prepend(animalDiv);\n }//forloop end\n });\n\n}", "function renderDietInfo(diet) {\n var template = $('#dietInfoTemplate').html();\n var rendered = Mustache.render(template,\n diet\n );\n $('#dietInfo').html(rendered);\n\n //add images to each meal type\n for (var i = 0; i < types.length; i++) {\n var type = types[i];\n var id = type + 'Image';\n var image = diet[type+'image'];\n document.getElementById(id).style.backgroundImage = 'url('+image+')';\n }\n}", "function renderFunction(animal){\n\t// here we assemble our giphy API URL\n\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&limit=10&api_key=dc6zaTOxFJmzC&\";\n\n\t// perfoming an AJAX GET request for the queryURL\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: \"GET\"\n\t})\n\n\t// after the data from the AJAX request comes back\n\t.done(function(response) {\n\t\tconsole.log(response);\n\n\t\t// appending the animalImage to the images div\n\t\tfor (var i = 0; i < response.data.length; i++) {\n\t\t\tvar container = $(\"<div>\").addClass(\"gifParent col-sm-6\");\n\t\t\t\n\t\t\t// creating and storing an img tag\n\t\t\tvar animalImage = $(\"<img>\").addClass(\"img-rounded img-responsive\");\n\t\t\tvar rating = $(\"<p>\").text(\"rating: \" + response.data[i].rating);\n\n\t\t\tconfigImg(response.data[i], animalImage);\n\n \t\tcontainer.append(rating);\n \t\tcontainer.append(animalImage);\n \t\t$(\"#images\").append(container);\n\t\t};\n\t});\n}", "function displayAnimalInfo() {\n \n var animal = $(this).attr(\"data-name\");\n console.log(\"animal ==> \", animal);\n var queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=ZGFCXW4DL8GQr4WH9ycZuksvEfPaRaHm&q=\" + animal +\n \"&limit=10\";\n \n console.log(\"queryURL string ==>\", queryURL);\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(\"response ==> \", response);\n console.log(\"response.data.length ==>\", response.data.length);\n var results = response.data;\n for (var i = 0; i < response.data.length; i++) {\n if (results[i] !== \"r\" && results[i] !== \"pg-13\") {\n var animalDiv = $(\"<div>\");\n var p = $('<p>').text(\"Rating: \" + response.data[i].rating);\n \n console.log(\"Rating ==> \", response.data[i].rating);\n var animalImage = $(\"<img>\");\n animalImage.attr('src', response.data[i].images.fixed_height_still.url);\n animalImage.attr('data-still', response.data[i].images.fixed_height_still.url);\n animalImage.attr('data-animate', response.data[i].images.fixed_height.url);\n animalImage.attr('data-state', \"still\");\n animalImage.attr('rating', response.data[i].rating);\n // animalImage.attr('class', response.data[i].type);\n animalImage.attr('class', 'img-fluid gif');\n animalDiv.append(p);\n animalDiv.append(animalImage);\n \n $(\"#images\").prepend(animalDiv);\n \n \n } //end if\n } // for\n }\n \n );\n } // end function displayAnimal image and info", "function displayAnimal() {\n var animal = $(this).attr(\"data-name\");\n //call to giphy database\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&api_key=pKCHSjye8BR1VMWxmo4mxbHcwO58FBKt\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n\n })\n\n .done(function (response) {\n var { data, meta } = response\n console.log(response);\n\n // Loop through each result item \n for (var i = 0; i < response.data.length; i++) {\n // put gifs in a div\n var animalDiv = $(\"<div class='animal'>\");\n\n // Show results of gifs\n var results = response.data;\n var rating = response.Rated;\n\n // pull rating of gif\n var p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\n // pull gif\n var animalImage = $(\"<img class='image'>\");\n animalImage.attr(\"src\", results[i].images.fixed_height_still.url);\n //paused images\n animalImage.attr(\"data-still\", results[i].images.fixed_height_still.url);\n //animated images\n animalImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n //how images come in, already paused\n animalImage.attr(\"data-state\", \"still\");\n animalImage.addClass(\"gif\");\n animalDiv.append(p);\n animalDiv.append(animalImage);\n // add new div to existing divs\n $(\"#animal-view\").prepend(animalDiv);\n }\n });\n}", "function renderInfo(data){\n\n console.log(data);\n\n //display title\n title.innerHTML = data.name;\n\n //display image\n image.src = data.image.url;\n image.alt=\"Image not found\";\n \n //display favourite\n if(favList!==null && favList.includes(id)){\n fav.innerHTML = '<i id=\"heart-icon\" class=\"fas fa-heart\"></i>';\n }\n else{\n fav.innerHTML = '<i id=\"heart-icon\" class=\"far fa-heart\"></i>';\n }\n\n //display powerstats\n for(var i in data.powerstats){\n document.getElementById(i).innerHTML = data.powerstats[i];\n }\n\n //display biography\n for(var i in data.biography){\n document.getElementById(i).innerHTML = data.biography[i];\n }\n\n //display appearance\n for(var i in data.appearance){\n document.getElementById(i).innerHTML = data.appearance[i];\n }\n\n //display work\n for(var i in data.work){\n document.getElementById(i).innerHTML = data.work[i];\n }\n\n //display connections\n for(var i in data.connections){\n document.getElementById(i).innerHTML = data.connections[i];\n }\n}", "function displayAnimal() {\n var animal = $(this).attr(\"data-name\");\n //constructing a URL to search Giphy for the animal\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n console.log(queryURL); // displays the constructed URL\n \n //performing our ajax GET request\n $.ajax ({\n url: queryURL,\n method: 'GET'\n })\n //After the data comes back from the API\n .done(function(response) {\n console.log(response); // console test to make sure something returns\n \n //Deleting the animals prior to adding new animals\n $(\"#animalView\").empty();\n var results = response.data;\n if ( results == \"\" ) {\n alert (\"There is no animal for this selected button !\");\n }\n //looping through the array of animals\n for (var i = 0; i < results.length; i++) {\n \n // div for the animalgifs to go inside\n var gifDiv = $(\"<div>\");\n gifDiv.addClass(\"gifDiv\");\n //getting rating of animalGifs\n var gifRating = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n gifDiv.append(gifRating);\n \n //Creating an image tag\n var animalImage = $(\"<img>\");\n // still image stored into src of image\n animalImage.attr('src', results[i].images.fixed_height_small_still.url);\n // still image\n animalImage.attr (\"data-still\",results[i].images.fixed_height_small_still.url);\n //Animated image\n animalImage.attr (\"data-animate\",results[i].images.fixed_height_small.url);\n // Set the image state\n animalImage.attr (\"data-state\", \"still\");\n animalImage.addClass(\"image\");\n gifDiv.append(animalImage);\n // Pulling still image of gif \n // adding div of gifs to Buttons-View\n $(\"#animalView\").prepend(gifDiv);\n }\n });\n }", "function getAnimals() {\n console.log('getting animals');\n $.ajax({\n type: 'GET',\n url: '/poprandomizer',\n success: function (animals) {\n animals.forEach(function (animal) {\n var $el = $('<p>Type: ' + animal.type + ', Population: ' + animal.population + '</p>');\n $('#containerTitle').append($el);\n });\n },\n });\n}", "displayInfo() {\n clear(dogInfo())\n\n let image = document.createElement('img')\n image.src = this.image\n\n let h2 = document.createElement('h2')\n h2.innerText = this.name\n\n let button = document.createElement('button')\n button.innerText = this.buttonText()\n button.id = `toggle${this.id}`\n \n dogInfo().appendChild(image)\n dogInfo().appendChild(h2)\n dogInfo().appendChild(button)\n }", "function displayBreed(response) {\n console.log(response);\n if (response.status === 'error') {\n $('#results').html(`<p> ${response.message} </p>`)\n }\n else \n $('#results').html(`\n <h2>Look at this dog</h2>\n <img src=\"${response.message}\" class=\"results-img\" alt='image'>`)\n}", "function info_html(alist){\n\n var output = '';\n// output = output + '<div class=\"block\">';\n// output = output + '<h2>Intersection Information</h2>';\n output = output + group_info_html(alist); \n output = output + term_info_html(alist); \n output = output + gp_info_html(alist);\n// output = output + '</div>';\n return output;\n}", "function showPerson() {\n $('body').find('.name').text(\"Name: \" + muArray[number].name);\n $('body').find('.git').text(\"github: \" + muArray[number].git_username);\n $('body').find('.shoutout').text(\"Shoutout: \" + muArray[number].shoutout);\n }", "function displayMealDetails(meal){\n //clear search results:\n meals.innerHTML='';\n resultHeading.innerHTML='';\n\n //Array to hold ingridiants and measurements\n const ingidients = [];\n // loop over ingredients Attribute\n for ( let i=1; i <=20; i++ ){\n // check if ingridiants Exists\n if(meal[`strIngredient${i}`]){\n ingidients.push(`${meal[`strIngredient${i}`]}: ${meal[`strMeasure${i}`]}`);\n }\n else{\n break;\n }\n };\n\n //Render data into UI\n selecteMeal.innerHTML = `\n <div class=\"selected-meal-details\">\n <h1>${meal.strMeal}</h1>\n <img src=\"${meal.strMealThumb}\" alt=\"${meal.strMeal}\" />\n <div class=\"selected-meal-info\">\n ${meal.strCategory? `<p>${meal.strCategory} </p>`:''}\n ${meal.strArea ? `<p>${meal.strArea}</p>` : '' }\n </div>\n\n <div class=\"selected-meal-instructions\">\n <p>${meal.strInstructions}</p>\n <h3>Ingridiants</h3>\n <ul>\n ${ingidients.map(ingredient=>\n ` <li>${ingredient}</li> `).join('')}\n </ul>\n </div>\n\n </div>\n `\n}", "function listAnimals() {\n showAnimals.innerHTML =\n `<div>\n <div class=\"animalThumbnail\" onclick=\"displayAnimal('lion')\"> <img src=\"images/lion.png\"> </img></div>\n <div class=\"animalThumbnail\" onclick=\"displayAnimal('llama')\"> <img src=\"images/llama.png\"/> </div>\n <div class=\"animalThumbnail\" onclick=\"displayAnimal('owl')\"> <img src=\"images/owl.png\"/> </div>\n <div class=\"animalThumbnail\"onclick=\"displayAnimal('turtle')\"> <img src=\"images/turtle.png\"/> </div>\n </div>`\n}", "function updatePetInfoInHtml() {\n $('.name').text(pet_info['name']);\n $('.weight').text(pet_info['weight']);\n $('.happiness').text(pet_info['happiness']);\n }", "function updatePetInfoInHtml() {\n $('.name').text(pet_info['name']);\n $('.weight').text(pet_info['weight']);\n $('.happiness').text(pet_info['happiness']);\n }", "function displayInfo(html) {\n infoElement.innerHTML = html;\n show(infoElement);\n}", "function renderHTML(data) {\n var htmlString = \"\";\n //for loop to concatinate each object info into a sentence\n for (var i = 0; i < data.length; i++) {\n htmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes to eat \";\n\n for (var ii = 0; ii < data[i].foods.likes.length; ii++) {\n if (ii == 0) {\n htmlString += data[i].foods.likes[ii]\n\n }\n else {\n htmlString += \" and \" + data[i].foods.likes[ii]\n }\n }\n\n htmlString += \" and dislikes \";\n\n for (var ii = 0; ii < data[i].foods.dislikes.length; ii++) {\n if (ii == 0) {\n htmlString += data[i].foods.dislikes[ii]\n\n }\n else {\n htmlString += \" and \" + data[i].foods.dislikes[ii]\n }\n }\n\n htmlString += \".</p>\"\n }\n animals.insertAdjacentHTML('beforeend', htmlString);\n}", "function display(id){\n\tif (id == \"Tomato\"){\n\t\tdocument.getElementById('desc').innerHTML = descriptions[0] + images[0] + care[0];\n\t}\n\tif (id == \"Apple\"){\n\t\tdocument.getElementById('desc').innerHTML = descriptions[1] + images[1] + care[1];\n\t}\n if (id == \"Carrot\"){\n document.getElementById('desc').innerHTML = descriptions[2] + images[2] + care[2];\n }\n if (id == \"Onion\"){\n document.getElementById('desc').innerHTML = descriptions[3] + images[3] + care[3];\n }\n if (id == \"Eggplant\"){\n document.getElementById('desc').innerHTML = descriptions[4] + images[4] + care[4];\n }\n if (id == \"Brocolli\"){\n document.getElementById('desc').innerHTML = descriptions[5] + images[5] + care[5];\n }\n if (id == \"Potato\"){\n document.getElementById('desc').innerHTML = descriptions[6] + images[6] + care[6];\n }\n if (id == \"Peas\"){\n document.getElementById('desc').innerHTML = descriptions[7] + images[7] + care[7];\n }\n if (id == \"Corn\"){\n document.getElementById('desc').innerHTML = descriptions[8] + images[8] + care[8];\n }\n if (id == \"Pumpkin\"){\n document.getElementById('desc').innerHTML = descriptions[9] + images[9] + care[9];\n }\n}", "displayInfo() {\n let imageContainer = document.querySelector(\"#image-container\");\n let thumbnailEl = document.createElement(\"img\");\n thumbnailEl.setAttribute(\"src\", this.thumbnailImg)\n imageContainer.append(thumbnailEl);\n let artistNameDiv = document.querySelector(\"#artist-name\");\n artistNameDiv.textContent = this.name;\n let artistInfoDiv = document.querySelector(\"#profile-info\");\n artistInfoDiv.textContent = this.profileInfo;\n\n }", "function displayInfo(person, people) {\n let parentsString = getParents(person, people);\n\n\n let spouseString = getSpouse(person, people);\n\n alert(\"ID: \" + person.id + \"\\n\" +\n \"Name: \" + person.firstName + \" \" + person.lastName + \"\\n\" +\n \"Gender: \" + person.gender + \"\\n\" +\n \"Date of Birth: \" + person.dob + \"\\n\" +\n \"Height: \" + Math.floor(person.height / 12) + \" feet and \" + (person.height % 12) + \" inches\\n\" +\n \"Weight: \" + person.weight + \" pounds\\n\" +\n \"Eye Color: \" + person.eyeColor + \"\\n\" +\n \"Occupation: \" + person.occupation + \"\\n\" +\n parentsString + \"\\n\" +\n spouseString + \"\\n\" +\n \"Age: \" + person.age)\n\n\t\treturn mainMenu(person, people);\n}", "function displayGame() {\n getAnimal();\n animalType.innerHTML = gameAnimalType;\n animalToGuess.innerHTML = handleGameWord(gameAnimalExample);\n document.getElementById(\"guess\").focus();\n document.getElementById(\"guess\").select();\n wordWrapper.classList.remove(\"vis-hidden\");\n }", "function updatePetInfoInHtml() {\n $('.name').text(pet_info.name);\n $('.weight').text(pet_info.weight);\n $('.happiness').text(pet_info.happiness);\n $('.message').text(pet_info.message);\n }", "function renderHTML(data) {\n\tvar htmlString = \"\";\n\n\tfor (i = 0; i < data.length; i ++) {\n\t\thtmpString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \".</p>\";\n\t}\n\n\tanimalContainer.insertAdjacentHTML('beforeend', htmlString);\n}", "function displayAnimalInfo(){\n \n // Set our animal variable equal to the text of the button. \n var animal = $(this).attr(\"data-name\");\n console.log(animal);\n\n // Grab our GIPHY API by making an Ajax request\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal +\"&api_key=86gmopU2iKrSWy2FWvm1h5sM3An49fxH&limit=9\"\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n \n var results = response.data;\n\n for (i = 0; i < results.length; i++){\n\n // Creating a div to hold the movie\n var gifDiv = $(\"<div class='col-md-4'>\");\n\n // Storing the rating data\n var rating = results[i].rating;\n\n // Creating an element to have the rating displayed\n var ratingParagraph = $(\"<span>\").text(\"Rating: \" + rating);\n var favoriteButton = $(\"<button>\").text(\"♥\")\n $(favoriteButton).addClass(\"favoriteButton\");\n\n // Displaying the rating and fav button\n gifDiv.prepend(favoriteButton);\n gifDiv.prepend(ratingParagraph);\n\n\n // Retrieving the URL for the image\n var gifURL = results[i].images.fixed_height_still.url;\n var stillGIF = results[i].images.fixed_height_still.url;\n var movingGIF = results[i].images.fixed_height.url;\n\n // Creating an element to hold the image, giving it data attributes\n var gif = $(\"<img>\").attr(\"src\", gifURL);\n gif.attr(\"data-still\", stillGIF);\n gif.attr(\"data-animate\", movingGIF);\n gif.attr(\"data-state\", \"still\");\n gif.addClass(\"gif\")\n \n\n // Appending the image\n gifDiv.append(gif);\n //This keeps the image divs from taking up an entire row\n $(gifDiv).css({\"float\":\"left\"});\n $(gifDiv).css({\"margin-top\":\"20px\"});\n\n\n // Putting the entire movie above the previous movies\n $(\"#gif-view\").prepend(gifDiv);\n\n }\n\n // GIF on click still and animate function. \n $(\".gif\").on(\"click\", function() {\n var state = $(this).attr(\"data-state\");\n\n if (state === \"still\"){\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n console.log(state);\n }\n \n else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n console.log(this);\n\n }\n });\n\n // on click function to move the gif to our favorites section. Figured it out using .parent()!\n $(document).on(\"click\", \".favoriteButton\", function(){\n\n var newFav = $(this).parent();\n $(\"#favorites-view\").append($(newFav)); \n $(this).addClass(\"unFavoriteButton\");\n $(this).removeClass(\"favoriteButton\");\n })\n\n //Allows the user to then remove the gif from our favorites. This is not working - it's not even registering the click.\n $(document).on(\"click\", \".unFavoriteButton\" , function() {\n var unFav = $(this).parent();\n console.log(unFav);\n unFav.remove(); \n });\n // $(\".unFavoriteButton\").on(\"click\", function(){\n // var unFav = $(this).parent();\n // console.log(unFav);\n // $(\"#favorites-view\").remove(unFav);\n // })\n \n }); \n }", "function allDogs() {\n\t// Displays the dogs name on the left in a 'jumbotron'\n\tdocument.getElementById('dogsContainer').innerHTML += '<h3 class=\"jumbotron col-md-4 bg-dark text-center\">' + dogs[i].name + '</h3>';\n\t// Displays an image of the dog itself\n\tdocument.getElementById('dogsContainer').innerHTML += '<img id=\"d' + id.toString() + '\" class=\"img-thumbnail col-md-4 my-dogs\" src=\"' + dogs[i].photo + '\"alt=\"Dog\">'; // ID is incremented automatically\n\t// Displays the remaining information about the dog taken from the array function\n\tdocument.getElementById('dogsContainer').innerHTML += '<ul class=\"jumbotron col-md-4 bg-custom\">' +\n\t'<li><b>ID#:</b> D' + id++ + '</li>' + \n\t'<li><b>Breed:</b> ' + dogs[i].breed + '</li>' + \n\t'<li><b>Colour:</b> ' + dogs[i].color + '</li>' + \n\t'<li><b>Height (cm):</b> ' + dogs[i].height + '</li>' +\n\t'<li><b>Age(Years): </b>' + dogs[i].age + '</li>' + \n\t'<li><b>Job: </b>' + dogs[i].job + '</li>' +\n\t'</ul>';\n}", "function characterDisplay() {\n //display the first character on the page\n characterSelect(characters[0].name, 1, characters[0].class, characters[0].portrait, characters[0].colors.dark, characters[0].colors.light, characters[0].stats);\n //loop through array and append all of the sprite version\n for (var i = 0; i < characters.length; i++) {\n var chibiContainer = $(\"<div>\").addClass(\"character-container\").attr({\n \"data-class\": characters[i].class,\n \"data-key\": i + 1\n });\n var characterImage = $(\"<img>\").attr(\"src\", characters[i].chibi);\n chibiContainer.append(characterImage);\n $(\".character-list\").append(chibiContainer);\n }\n }", "function displaySelected() {\n console.log(\"response text\", this.responseText);\n var response = JSON.parse( this.responseText );\n console.log( response );\n\n // DOM final results\n var displayAt = document.querySelector('#show-detail');\n\n var title = document.createElement(\"h1\");\n title.innerHTML = response.name;\n displayAt.appendChild(title);\n\n var image = document.createElement(\"img\");\n image.src = response.image.medium;\n displayAt.appendChild(image);\n\n var summary = document.createElement(\"p\");\n summary.innerHTML = response.summary;\n displayAt.appendChild(summary);\n\n}", "function renderHTML(data){ //Sikter til funksjon som tidelere er blitt tildelt ourdata, parameter kan være samme\r\n var htmlString = \"\"; // tom string som vi skal fylle\r\n\r\n for(i = 0; i < data.length; i++){ // kjører gjennom listen\r\n htmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes to eat \" // bruker dot notation for å få tilgang til elementer\r\n\r\n for (ii = 0; ii < data[i].foods.likes.length; ii++){ //sikter oss dypere inn i underliggende arrays, så for loops inne i en for loop\r\n if (ii <= 0){\r\n htmlString += data[i].foods.likes[ii];\r\n } else{\r\n htmlString += \" and \" + data[i].foods.likes[ii];\r\n }\r\n }\r\n\r\n htmlString += \" and dislikes \";\r\n\r\n for(iii = 0; iii < data[i].foods.dislikes.length; iii++){\r\n if(iii <= 0){\r\n htmlString += data[i].foods.dislikes[iii];\r\n } else {\r\n htmlString += \" and \" + data[i].foods.dislikes[iii];\r\n }\r\n }\r\n\r\nhtmlString += \". </p>\"\r\n\r\n }\r\n\r\n animalContainer.insertAdjacentHTML('beforeend', htmlString);\r\n}", "function renderHTML(data) {\r\n\t// create empty string\r\n\tvar htmlString = \"\";\r\n\r\n\t// loop through array\r\n\tfor (i = 0; i < data.length; i++){\r\n\t\thtmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes to eat \"\r\n\t\tfor (ii = 0; ii < data[i].foods.likes.length; ii++){\r\n\t\t\tif (ii == 0){\r\n\t\t\t\thtmlString += data[i].foods.likes[ii];\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\thtmlString += \" and \" + data[i].foods.likes[ii];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t\r\n\t\thtmlString += \" and dislikes \";\r\n\r\n\t\tfor (ii = 0; ii < data[i].foods.likes.length; ii++){\r\n\t\t\tif (ii == 0){\r\n\t\t\t\thtmlString += data[i].foods.likes[ii];\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\thtmlString += \" and \" + data[i].foods.likes[ii];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\thtmlString += '.</p>'\r\n\t}\r\n\r\n\tanimalContainer.insertAdjacentHTML('beforeend', htmlString)\r\n}", "function displayDescription() {\n // get new random elements\n randomCondiment = getRandomElement(jsonData.condiments);\n randomCat = getRandomElement(jsonData.cats);\n randomRoom = getRandomElement(jsonData.rooms);\n randomName = getRandomElement(jsonData.firstNames);\n randomTitan = getRandomElement(jsonData.greek_titans);\n\n // Remove the past description\n $(\"body\").empty();\n\n // Check if the subject of the verb is plural for good conjugation\n let verb = \"is\";\n if (randomCondiment.charAt(randomCondiment.length - 1) === \"s\") {\n verb = \"are\";\n }\n\n // Check if the last letter of a possessive noun, adapt its form\n let possessive = \"'s\"\n if (randomName.charAt(randomName.length - 1) === \"s\") {\n possessive = \"'\";\n }\n\n // Check the first letter of the following noun to adapt its article\n let article = \"a\";\n let exceptions = [\"A\", \"E\", \"I\", \"O\", \"U\", \"H\"];\n for (let i = 0; i < exceptions.length; i++) {\n if (randomCat.charAt(0) === exceptions[i]) {\n article = \"an\";\n }\n }\n\n // Combine all parts and append it to the body\n let description = `${randomName}${possessive} ${randomCondiment} ${verb} like ${article} ${randomCat} in ${randomTitan}${possessive} ${randomRoom}.`;\n $(\"body\").append(description);\n}", "function DisplayInfo(){\n\t$(\"#content\").html('');\n\t\n\t$(\"#content\").append(\"<div class='page-header'><h1>\"+Language[\"Hints\"]+\"</h1></div>\");\n\tif (Debug)\n\t\tAddWarning();\n\t$(\"#content\").append(Language[\"WelcomeText\"]);\n\t$(\"#content\").append(\"<a id='startTestButton' class='btn btn-primary btn-lg' role='button'>\"+Language[\"StartTest\"]+\"</a>\");\n\t$(\"#content\").fadeIn();\n\t$(\"#startTestButton\").click(function(){\n\t\tLoadQuestion(-1);\n\t});\n;}", "renderInformationAdditional() {\n document.getElementsByClassName('pk-name')[0].innerHTML = this.pokemonSelected.Name;\n document.getElementsByClassName('pk-image')[0].setAttribute('src', pathImages + this.pokemonSelected.Image);\n /** Load Information Additional.**/\n document.getElementsByClassName('pk-description-no')[0].innerHTML = this.pokemonSelected.Data.Position;\n document.getElementsByClassName('pk-description-level')[0].innerHTML = this.pokemonSelected.Data.Level;\n document.getElementsByClassName('pk-description-type')[0].innerHTML = this.pokemonSelected.Data.Type;\n document.getElementsByClassName('pk-description-ability')[0].innerHTML = this.pokemonSelected.Data.Ability;\n document.getElementsByClassName('pk-description-height')[0].innerHTML = this.pokemonSelected.Data.Height;\n document.getElementsByClassName('pk-description-weight')[0].innerHTML = this.pokemonSelected.Data.Weight;\n }", "function detailView(character) {\n return `<div>\n <img src=\"${character.img}\" />\n <h2>${character.name}</h2>\n <h3>of ${character.location}</h3>\n </div>`;\n}", "function renderMealResults(mealDetails) {\n $('#mealResults').html(\n `<a href=\"${mealDetails.strYoutube}\">\n <img src=\"${mealDetails.strMealThumb}\" alt=\"meal\" />\n <div class=\"card-content\">\n <h2>${mealDetails.strMeal}</h2>\n <p>${mealDetails.strInstructions}</p>\n </div>\n </a>`\n );\n}", "function populatePokemanInfo(data){\n let html = \"<h2>\" + data.name + \"</h2><img src=http://pokeapi.co/media/img/\" + data.national_id + \".png><h4>Types</h4><ul>\"; //breaking to iterate through types\n for (let i = 0; i < data.types.length; i++){\n html += \"<li>\" + data.types[i].name + \"</li>\";\n }\n html += \"</ul><h4>Height</h4><p>\" + data.height + \"</p><h4>Weight</h4><p>\" + data.weight +\"</p>\";\n $(\".pokeman_info\").html(html);\n }", "function rederHtml(data){\n\t\n\t// create a variable that will hold the html code\n\tvar htmlString = \"\";\n\t//loop though the data and show it using html\n\tfor(i=0; i< data.length; i++){\n\t\thtmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes to eat \";\n\t\t\n\t\t// loop though the list favorites food likes\n\t\tfor(a =0; a< data[i].foods.likes.length; a++){\n\t\t\t// if it is the first element\n\t\t\tif(a == 0){\n\t\t\t\t\n\t\t\t\thtmlString +=\tdata[i].foods.likes[a];\n\t\t\t} else { // otherwise\n\t\t\t\thtmlString +=\t\" and \" + data[i].foods.likes[a];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\thtmlString += ' and dislikes ';\n\t\t\t\n\t\t\t// loop though the list dislikes food\n\t\t\tfor(a =0; a< data[i].foods.dislikes.length; a++){\n\t\t\t\t// if it is the first element\n\t\t\t\tif(a == 0){\n\t\t\t\t\t\n\t\t\t\t\thtmlString +=\tdata[i].foods.dislikes[a];\n\t\t\t\t} else { // otherwise\n\t\t\t\t\thtmlString +=\t\" and \" + data[i].foods.dislikes[a];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t}\n\t\thtmlString += \"</p> <hr />\";\n\t\t\n\t}\n\t\n\t// append html to the page\n\tanimalContainer.insertAdjacentHTML('beforeend', htmlString);\n}", "function renderInfo() {\n /** Get state */\n if (!wave.getState()) {\n return;\n }\n var state = wave.getState();\n \n /** Retrieve topics */\n var topics = toObject(state.get('topics','[]'));\n var votes = toObject(state.get('votes','[]'));\n \n /** Add topics to the canvas */\n var html = \"\";\n for (var i = 0; i < topics.length; i++){\n var id = \"topic\"+i;\n html += '<div class=\"topic\"><h4> ' + topics[i] + '</h4></div>';\n }\n document.getElementById('body').innerHTML = html;\n \n /** Create \"Add topic\" button to the footer */\n html += '<input type=\"text\" id=\"textBox\" value=\"\"/><button id=\"addInput\" onclick=\"addInput()\">Add Topic</button>';\n document.getElementById('footer').innerHTML = html;\n \n /** Adjust window size dynamically */\n gadgets.window.adjustHeight();\n}", "function showStrawFact(data) { //data accepting what is happening up top. \n //debugger; //comment out after bc you dont need to see what you did wrong anymore\n //parse the DB info and put it where it neds to go\n const { city, state, fact } = data; //destructuring assignmnet => MDN JS destructuring \n\n\n //might change some of this stuff for infographic all this is AJAX\n //grab the elements we need, and populate them with data\n document.querySelector('.city1').textContent = city; //will have three of these lines except with the selector in the quotes\n document.querySelector('.state').textContent = state;\n document.querySelector('.facts').textContent = fact;\n }", "function displayMealDetails(meal) {\n const ingredients = [];\n for (let i = 1; i <= 20; i++){\n // Check if ingredients exist\n if (meal[`strIngredient${i}`]) {\n // push all the ingredient into the array\n ingredients.push(`${meal[`strIngredient${i}`]} : ${meal[`strMeasure${i}`]}`);\n } else {\n break;\n }\n };\n // Render data into Ui\n selectedMeal.innerHTML = `\n <div class='selected_meal_details'>\n <h1>${meal.strMeal}</h1>\n <img src='${meal.strMealThumb}' alt='${meal.strMeal}' />\n <div class='selected_meal_info'>\n ${meal.strCategory ? `<p>${meal.strCategory}</p>` : ''}\n ${meal.strArea ? `<p>${meal.strArea}</p>` : ''}\n </div>\n <div class='selected_meal_instructions'>\n <p>${meal.strInstructions}</p>\n <h1>Ingredients</h1>\n <ul>\n ${ingredients.map( ingredient => `<li>${ingredient}</li>`).join('')}\n </ul>\n </div>\n </div>\n `;\n}", "function showItineraryInfo(){\n\tif(directionsDisplay){\n\t\tvar html = '';\n\t\thtml += '<div id=\"intinerary\"><ul>Your Itinerary:';\n\t\tvar letter = 'A';\n\t\tfor(var i=0;i<itinerary.length;i++){\n\t\t\thtml += '<li>'+letter+': '+results[itinerary[i]].name+'</li>';\n\t\t\tletter = String.fromCharCode(letter.charCodeAt(0) + 1);\n\t\t}\n\t\thtml += '</ul></div>';\n\t\t\n\t\titineraryContainer.innerHTML = html;\n\t\tdirectionsDisplay.setPanel(document.getElementById('intinerary'));\n\t}\n}", "function show() {\n best.html(population.pop[0].genes);\n averageFitness.html(population.averageFitness);\n generationNum.html(gNum);\n phrases.html(\"\");\n\n var phrs = \"\";\n\n for (let i = 1; i < population.pop.length && i < nPhrases.val(); i++) {\n phrs += '<span>' + population.pop[i].genes.join(\"\") + '</span>';\n }\n\n phrases.html(phrs);\n }", "function displayInfo(feature) {\r\n const title = feature.properties.title;\r\n var imageUrl = feature.properties.icon.slice(3);\r\n\r\n toggleSideBar(\"open\");\r\n infoContainer.innerHTML = \"\";\r\n\r\n let headerElement = document.createElement(\"h1\");\r\n headerElement.className = \"title\";\r\n headerElement.textContent = title;\r\n\r\n let imgElement = document.createElement(\"img\");\r\n imgElement.src = imageUrl;\r\n imgElement.className = \"img-description\";\r\n\r\n infoContainer.appendChild(headerElement);\r\n infoContainer.appendChild(imgElement);\r\n}", "function loadInfo() {\r\n\t\tvar info = JSON.parse(this.responseText);\r\n\t\tdocument.getElementById(\"title\").innerHTML = info.title;\r\n\t\tdocument.getElementById(\"author\").innerHTML = info.author;\r\n\t\tdocument.getElementById(\"stars\").innerHTML = info.stars;\r\n\t}", "function showBreed(event){\n // Jquery\n $(document).ready(function(){\n // Hide breed list\n $(\".breedList\").hide();\n $(\"#pageInformation\").hide();\n\n // Loop Through dog breed and find a breed that matches the clicked breed\n for (i = 0; i < dogBreedArray.length; i++) {\n if (event.target.id == (dogBreedArray[i])){\n // Show single breed view\n document.querySelector(\"#singleBreedView\").removeAttribute(\"style\");\n\n // Create Image of the dog breed\n breedImage();\n // create back link\n goBack('breeds.html', \"Back to Breed List\");\n\n // Display dog name, description and characteristics\n breedName.textContent = (dogBreeds[dogBreedArray[i]].breed);\n breedDescription.textContent = (dogBreeds[dogBreedArray[i]].description);\n\n breedCharacteristics.textContent = (dogBreeds[dogBreedArray[i]].characteristics);\n breedType.textContent = (dogBreeds[dogBreedArray[i]].type);\n breedSize.textContent = (dogBreeds[dogBreedArray[i]].size);\n\n // Check if the dog breed is hypoallergenic or rare and display the results\n var rarity = dogBreeds[dogBreedArray[i]].rarity;\n rarityCheck('breedRarity', rarity);\n var hypoallergenic = dogBreeds[dogBreedArray[i]].hypoallergenic;\n hypoallergenicCheck('breedHypoallergenic', hypoallergenic);\n\n // Display information about the friendliness of the dog breed\n breedFriendliness.textContent = (dogBreeds[dogBreedArray[i]].friendliness);\n\n // Create Star ratings for breed friendliness\n var friendlinessWithFamily = dogBreeds[dogBreedArray[i]].friendliness_with_family;\n starBuilder('breedFamilyFriendliness', friendlinessWithFamily );\n var goodWithChildren = dogBreeds[dogBreedArray[i]].good_with_children;\n starBuilder('breedChildrenFriendliness', goodWithChildren);\n var friendlinessWithStrangers = dogBreeds[dogBreedArray[i]].friendliness_with_strangers;\n starBuilder('breedStrangerFriendliness', friendlinessWithStrangers);\n var friendlinessWithDogs = dogBreeds[dogBreedArray[i]].friendliness_with_dogs;\n starBuilder('breedDogFriendliness', friendlinessWithDogs);\n\n // Display information about the lifestyle of the dog breed\n breedLifestyle.textContent = (dogBreeds[dogBreedArray[i]].lifestyle);\n\n // Create Star ratings for breed lifestyle\n var energy = dogBreeds[dogBreedArray[i]].energy;\n starBuilder('breedEnergy', energy);\n var apartmentAdaptability = dogBreeds[dogBreedArray[i]].apartment_adaptability;\n starBuilder('breedAdaptability', apartmentAdaptability);\n var independence = dogBreeds[dogBreedArray[i]].independence;\n starBuilder('breedIndependence', independence);\n var grooming = dogBreeds[dogBreedArray[i]].grooming;\n starBuilder('breedGrooming', independence);\n\n // Display information about the trainability of the dog breed\n breedTrainability.textContent = (dogBreeds[dogBreedArray[i]].trainability);\n\n // Create Star ratings for breed intelligence\n var intelligence = dogBreeds[dogBreedArray[i]].intelligence;\n starBuilder('breedIntelligence', intelligence);\n var noisiness = dogBreeds[dogBreedArray[i]].noisiness;\n starBuilder('breedNoisiness', noisiness);\n var preyDrive = dogBreeds[dogBreedArray[i]].prey_drive;\n starBuilder('breedPreyDrive', preyDrive);\n var wanderlust = dogBreeds[dogBreedArray[i]].wanderlust;\n starBuilder('breedWanderlust', wanderlust);\n\n // Display information about the health of the dog breed\n breedHealth.textContent = (dogBreeds[dogBreedArray[i]].common_health_issues);\n breedWeight.textContent = (dogBreeds[dogBreedArray[i]].weight);\n breedHeight.textContent = (dogBreeds[dogBreedArray[i]].height);\n breedCoatLength.textContent = (dogBreeds[dogBreedArray[i]].coat_length);\n breedLifespan.textContent = (dogBreeds[dogBreedArray[i]].lifespan);\n }\n }\n // Scroll to the top of the page\n $('html,body').scrollTop(0);\n });\n}", "function displayData(data){\n\tlet display_with_poster = `\n\t\t\t<a href=\"${data.id}\" class=\"moreInfo\">\n\t\t\t<img class=\"poster\" src=\"http://image.tmdb.org/t/p/w500/${data.poster_path}\">\n\t\t\t<h3 class=\"title\">${data.title}</h3>\n\t\t\t</a>\n\t\t\t<p class=\"year\">${data.release_date}</p>\n\t\t\t`\n\tlet display_no_poster = `\n\t\t\t<a href=\"${data.id}\" class=\"moreInfo\">\n\t\t\t<img class=\"poster\" src=\"img/no_poster.png\">\n\t\t\t<a href=\"${data.id}\">\n\t\t\t<h3 class=\"title\">${data.title}</h3>\n\t\t\t</a>\n\t\t\t<p class=\"year\">${data.release_date}</p>\n\t\t\t`\n\tif(data.poster_path === null){\n\t\t$(`.movie${data.id}`).html(display_no_poster);\n\t}\n\telse{\n\t\t$(`.movie${data.id}`).html(display_with_poster);\n\t}\n}", "function displayAnimalInfo() {\n\n $(\".images\").empty();\n\n // Grabbing and storing the data-animal property value from the button\n getAnimal = $(this).attr(\"data-animal\");\n\n // Constructing a queryURL using the animal name\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + \n getAnimal + \"&api_key=T0s8H2m5E8LgKBd12fUn0RY63Wzo7iiT&limit=10\";\n\n //ajax request from queryURL\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n\n .then(function(response) {\n\n console.log(queryURL);\n console.log(response);\n\n var results = response.data;\n for(var i = 0; i < 10; i++) {\n\n //create a new div tag\n var animalDiv = $(\"<div>\");\n animalDiv.addClass(\"mx-1 my-3\");\n\n // create a new paragraph tag that holds the results and rating of image\n var p = $(\"<p>\").text(results[i].title);\n var pB = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\n //create new image\n var animalImage = $(\"<img>\");\n\n animalImage.addClass(\"gif border border-secondary\");\n\n //add attribute of source of image\n animalImage.attr(\"src\", results[i].images.fixed_height_still.url);\n animalImage.attr(\"data-still\", results[i].images.fixed_height_still.url);\n animalImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n animalImage.attr(\"data-state\", \"still\");\n\n //adding a button to download image (But the website doesn't allow it!)\n var animalLink = $(\"<a href='\" + results[i].images.original.url + \"'>\").text(\"download\");\n animalLink.attr(\"download\");\n animalLink.addClass(\"btn btn-outline-secondary downloadbtn\");\n \n \n //adding paragraph and image tags to the animal div\n animalDiv.append(p);\n animalDiv.append(animalImage);\n animalDiv.append(pB);\n animalDiv.append(animalLink);\n\n $(\".images\").prepend(animalDiv);\n }\n n = 10;\n });\n\n}", "function pageDisplay(iteration) {\n // save the info from this iteration in the appendages array\n var title = appendages[iteration].title;\n var intro = appendages[iteration].intro;\n var link = appendages[iteration].link;\n var video = decodeURI(appendages[iteration].video);\n\n // format the info\n var titleText = $('<h4>').text(title);\n var introText = $('<p>').text(intro);\n var wikiLink = $('<a>').text(\"Click here for more info\")\n .addClass('wiki-link')\n .attr('target', '_blank')\n .attr('href', link);\n var videoDiv = $('<div>').append(video)\n .addClass(\"embed-container\");\n\n // append it all to the proper divs\n $('#wikiSpot').empty().append(titleText, introText, wikiLink);\n $('#videoSpot').empty().append(videoDiv);\n}", "function displayData() {\n displayUserInfo();\n displayRecipes();\n console.log(\"before\", chosenPantry)\n}", "showDetailsAnimal(id) {\n this.apiAnimal.get(id);\n }", "function renderInfo(name, description){\n $name.textContent = name\n $description.textContent = description\n}", "function displayEachEntry(entry) {\n // create variable with render html function and entry as parameter\n const eachEntry = renderEachEntry(entry);\n $(\".landing-page\").prop(\"hidden\", true);\n $(\".main-nav-bar\").prop(\"hidden\", true);\n // select main-area class div and html method that holds variable from above\n $(\".main-area\").html(eachEntry);\n}", "function displayCharacterInfo() {\n\n var character = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=cz8O9ixLJfRaCdt4Tof9PEYuxvrXx2Kz&q=\" + \"harry+potter+\" + character + \"&limit=10\";\n\n // Creating an AJAX call for the specific character button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n $(\"#character-view\").html(\"\");\n console.log(response);\n var results = response.data;\n\n console.log(\"length\", results.length);\n\n //resets html for view and view2\n $(\"#character-view\").html(\"\");\n $(\"#character-view2\").html(\"\");\n\n for (var i=0; i<results.length; i++) {\n var characterDiv = $(\"<div>\");\n characterDiv.attr('class', 'character');\n characterDiv.addClass(\"bg-light pt-3\");\n\n var rating = results[i].rating;\n var ratingDiv = $(\"<div>\");\n \n ratingDiv.addClass(\"w-100\");\n\n ratingDiv.attr('class', 'rating');\n ratingDiv.html(\"<p class='text-center'>\" + rating.toUpperCase() + \"</p>\");\n\n\n // Retrieving the URL and rating for the image\n var stillURL = results[i].images.fixed_height_small_still.url;\n var animatedURL = results[i].images.fixed_height_small.url;\n \n\n var newImg = $(\"<img>\");\n newImg.attr(\"class\", \"gif\");\n newImg.attr(\"src\", stillURL);\n newImg.attr(\"data-still\", stillURL);\n newImg.attr(\"data-animate\", animatedURL);\n newImg.attr(\"data-state\", \"still\");\n \n \n\n\n // Appending the image and rating\n characterDiv.append(ratingDiv);\n characterDiv.append(newImg);\n \n\n\n if (i<5){\n \n // Putting the entire character above the previous characters\n $(\"#character-view\").prepend(characterDiv);\n } else {\n $(\"#character-view2\").prepend(characterDiv);\n }\n\n }\n \n\n\n });\n\n\n }", "function displayMeetingInfo(ajax) {\r\n\t\r\n\t\t// Display the HTML on the page\r\n\t\t$(\"#meeting-info\").html(ajax);\r\n\t}", "function displayInfo(raw){\n var info = document.getElementById('info');\n while(info.hasChildNodes()){\n info.removeChild(info.childNodes[0]);\n }\n if(typeof(raw)=='string'){\n info.innerHTML = raw;\n return;\n } \n // Triggers:\n if(raw.house){\n // ID and Label\n var d0 = document.createElement('div');\n d0.innerHTML = `\n <div class='listItem'>Name:&nbsp;${raw.label}</div>\n <div class='listItem'>ID:&nbsp;${raw.id}</div>\n `;\n \n var d1 = document.createElement('details');\n var s1 = document.createElement('summary');\n s1.innerHTML = 'Basic Info';\n d1.appendChild(s1);\n d1.open = true;\n const tags = raw.tags.join(',&nbsp')\n repeatType = raw.repeat==0 ? 'one time OR' : raw.repeat==1 ? 'one time AND' : 'repeating OR' ;\n d1.innerHTML += `\n <div class='listItem'>House: ${raw.house}</div> \n <div class='listItem'>Repeat: ${raw.repeat} (${repeatType})</div>\n <div class='listItem'>Tags: ${tags} </div>`\n if(raw.link.trim() != '<none>'){\n console.log(raw.link);\n d1.innerHTML += `\n <div class='listItem'>Link Trigger: ${raw.link}</div>`\n }\n easy = raw.easy?'green':'red';\n normal = raw.normal?'green':'red';\n hard = raw.hard?'green':'red';\n disabled = raw.disabled?'red':'green';\n d1.innerHTML += `<div class='listItem'>Difficulty:&nbsp;<span class='${easy}'>Easy</span>&nbsp;&nbsp;<span class='${normal}'>Normal</span>&nbsp;&nbsp;<span class='${hard}'>Hard</span></div>`;\n d1.innerHTML += `<div class='listItem'>Disabled:&nbsp;<span class='${disabled}'>${raw.disabled?\"True\":\"False\"}</span></div>`;\n \n // events\n var d2 = document.createElement('details');\n var s2 = document.createElement('summary');\n s2.innerHTML = `Events`;\n d2.appendChild(s2);\n d2.open = true;\n\n for(var i=0;i<raw.events.length;i++){\n var t = raw.events[i].type;\n var d = document.createElement('div');\n d.className = 'listItem';\n d.innerHTML += `Event ${i}: ${events[t].name}`;\n d.title = `${t}: ${events[t].description}`;\n // check if the events type has more than 2 variables in its parameter\n if(events[t].p[0] > 0){\n d.innerHTML += ` ${raw.events[i].p[0]} ${raw.events[i].p[1]}`;\n }else{\n d.innerHTML += ` ${raw.events[i].p[0]}`\n }\n d2.appendChild(d);\n }\n\n //actions\n var d3 = document.createElement('details');\n var s3 = document.createElement('summary');\n s3.innerHTML = `Actions`;\n d3.appendChild(s3);\n d3.open = true;\n for(var i=0;i<raw.actions.length;i++){\n var t = raw.actions[i].type;\n var d = document.createElement('div');\n d.innerHTML += `Action ${i}: ${actions[t].name}`;\n d.className = 'listItem';\n d.title = `${t}: ${actions[t].description}`;\n for(j=0;j<7;j++){\n if(actions[t].p[j]>0){\n if(j!=6) d.innerHTML += ` ${raw.actions[i].p[j]}`;\n else d.innerHTML += ` @${wp(raw.actions[i].p[j])}`;\n }\n }\n d3.appendChild(d);\n }\n info.appendChild(d0);\n info.appendChild(d1);\n info.appendChild(d2);\n info.appendChild(d3);\n /*\n var d4 = document.createElement('details');\n var s4 = document.createElement('summary');\n s4.className = 'collapsible';\n s4.innerHTML = 'Neighbouring Nodes'\n \n d4.appendChild(s4);\n for(var item of raw.neighbour){\n var d = document.createElement('div');\n d.className = 'listItem';\n d.innerHTML = `neighbour: ${item}`;\n d4.appendChild(d);\n }\n info.appendChild(d4);*/\n \n }else{\n info.innerHTML = `\n Variable <br> \n Name:&nbsp;${raw.label}<br>\n ID:&nbsp;${raw.id}<br>\n Initial Value:&nbsp;${raw.initValue}`;\n \n }\n}", "function displayData(data) {\n for(const organism of data) {\n const sightingsAsHTML = convertSightingsToHTML(organism.sightings, organism.name);\n\n const organismID = cuid();\n\n $(\".wildlife-results .results-list\").append(`\n <li class=\"wildlife-result\" data-organism-id=\"${organismID}\">\n <section class=\"sightings\">\n ${sightingsAsHTML}\n </section>\n\n <h3 class=\"organism-name\">${organism.name}</h3>\n <a href=\"${organism.wikiURL}\" target=\"_blank\">\n ${organism.wikiURL}${newWindowIconGreen}\n </a>\n </li>\n `);\n\n /**\n * Some organisms may not have their wikipedia intros if the\n * Wikipedia fetch couldn't find anything, or if some other error\n * occurred with the fetch\n */\n if (organism.wikiIntro != undefined) {\n $(`.wildlife-result[data-organism-id=\"${organismID}\"]`)\n .find(\".organism-name\")\n .after(`<p>${organism.wikiIntro}</p>`);\n }\n }\n\n /**\n * Set the width of each sighting (photo and caption) in each\n * organism's slideshow to the with of the photo\n */\n $('.organism-photo').each((i, elem) => {\n $(elem).on('load', (event) => {\n const img = event.currentTarget;\n const width = $(img).actual(\"width\");\n $(img).closest(\".sighting\").css('width', `${width}px`);\n });\n });\n }", "function displayTopicInfo() {\n // Calls GIPHY api using queryURL\n var search = $(this).attr(\"data-search-item\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + search + \"&api_key=WBSORvGtsCMCwgWYyeKt6QjIwl0E7W8d\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function (response) {\n console.log(response);\n for (var i = 0; i < 10; i++) {\n var image = $(\"<img>\");\n image.attr(\"src\", response.data[i].images.original_still.url);\n image.attr(\"data-still\", response.data[i].images.original_still.url);\n image.attr(\"data-animate\", response.data[i].images.original.url);\n image.attr(\"data-state\", \"still\");\n var rating = $(\"<p>\");\n rating.addClass(\"rating\");\n rating.text(\"Rating: \" + response.data[i].rating);\n image.addClass(\"image\");\n gifContainer.append(rating);\n rating.append(image);\n }\n });\n gifContainer.empty();\n\n }", "function displayArticle() {\n\n var article = $(this).attr(\"article-name\");\n var queryURL = 'https://api.nytimes.com/svc/search/v2/articlesearch.json?q=' + articleRequest + '=election&api-key=LYzWgxYCysNiAmcwGN5cXJnHCfBcsUYR'\n }", "function populateInformationModal() {\n\t// add text to the label\n\tvar category = allViews[activeView];\n\t// trim the heading \"TissueSpecific\" if necessary\n\tif (category.substr(0,14) == \"TissueSpecific\") {\n\t\tcategory = category.substr(14);\n\t}\n\t$('#informationLabel').text(category+\" Information\"); \n\t\n\t// now put info text in body\n\t$('#informationBody').html(allInfoFiles[activeView]);\n\t\n}", "function renderOneDrink(drink) {\n var drink_name = drink.fields['Drinks'];\n var ingredients = drink.fields['Ingredients'];\n var drink_pics = drink.fields['Picture'];\n var drink_info = '';\n\n\n if (drink_name) {\n drink_info += '<h3><center><div class=\"panel-footer\">' + ingredients + '</div></center></h3>';\n drink_info +=`<div class=\"panel panel-default>`;\n drink_info +=`<div class=\"panel-body\">`;\n if (drink_pics) {\n $.each(drink_pics, function(i, pic){\n drink_info +=`<center><a href=\"detail.html?drinkID=${drink.id}\"><img src=\"${pic.url}\"></a></center>`;\n });\n }\n drink_info +=`</div>`;\n drink_info +=`</div>`;\n\n }\n $('.drink-detail').append(drink_info);\n}", "function showInfo() {\n let url = '';\n\n if (this.dataset.type) {\n url = `https://api.themoviedb.org/3/${this.dataset.type}/${this.dataset.id}?api_key=0e66e3cd5d8c014d6e406d8aba055a88&language=ru-RU`;\n } else {\n movies.innerHTML = '<h2 class=\"text-danger\">Произошла ошибка. Повторите позже</h2>';\n }\n\n fetch(url)\n .then(response => {\n if (response.status !== 200) {\n return Promise.reject(new Error(response.status));\n }\n return response.json();\n })\n .then(output => {\n console.log(output);\n movies.innerHTML = `\n <div class=\"col-4\">\n <img src=\"${(output.poster_path) ? `${img_url}${output.poster_path}` : 'img/no_image.png'}\" alt=\"${output.name || output.title}\">\n ${(output.homepage) ? `<p><a href=\"${output.homepage}\" target=\"_blank\">Официальная страница</a></p>` : ''}\n ${(output.imdb_id) ? `<p><a href=\"https://imdb.com/title/${output.imdb_id}\" target=\"_blank\">Сcылка на imdb.com</a></p>` : ''}\n </div>\n <div class=\"col-8\">\n <h3>${output.name || output.title}</h3>\n <p>Рейтинг: ${output.vote_average}</p>\n <p>Статус: ${output.status}</p>\n <p>Премьера: ${output.release_date || output.first_air_date}</p>\n ${(output.last_episode_to_air) ? `<p>Вышло сезонов: ${output.number_of_seasons}, серий: ${output.number_of_episodes}</p>` : ''}\n <p>${output.overview}</p>\n <p>Жанр: ${output.genres.map(item => item.name)}</p>\n <div class=\"row video\"></div>\n </div>\n `;\n getVideo(this.dataset.type, this.dataset.id);\n })\n .catch(reason => {\n movies.innerText = 'Что-то пошло не так...';\n console.error('error', reason);\n });\n}", "function updatePetInfoInHtml () {\n $('.name').text(pet_info['name'])\n $('.weight').text(pet_info['weight'])\n $('.happiness').text(pet_info['happiness'])\n $('#status').text(pet_info['status'])\n}", "function renderIndividual() {\n var artistId = window.location.search.split('=')[1]\n\n const xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n const artistData = JSON.parse(this.responseText);\n console.log(artistData);\n renderIndividualArtistData(artistData);\n }\n }\n xhttp.open('GET', `${apiUrl}posts/${artistId}`, true);\n xhttp.setRequestHeader('Authorization', `Bearer ${apiKey}`);\n xhttp.send();\n\n }", "function displayInfo(){\n $('#car-view').empty();\n var topic = $(this).attr('data-name');\n var queryURL = 'https://api.giphy.com/v1/gifs/search?q=' + topic + '&api_key=jVz8LzEOLKTNPSj1tux4I40dP1PX6Pbg&limit=10';\n\n // AJAX call to GET information \n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n // If no information on topics is found, the alert the user\n if (response.pagination.total_count == 0) {\n alert('Sorry, there are no Gifs for this topic');\n var itemindex = topics.indexOf(topic);\n // otherwise display button\n if (itemindex > -1) {\n topics.splice(itemindex, 1);\n renderButtons();\n }\n }\n \n // Save response from API call (JSON) to a variable results\n var results = response.data;\n for (var j = 0; j < results.length; j++){\n // Create new Div\n var newTopicDiv = $(\"<div class='car-name'>\");\n // Save responses from API into variables and add to DOM\n // GIF Rating\n var pRating = $('<p>').text('Rating: ' + results[j].rating.toUpperCase());\n // GIF Title\n var pTitle = $('<p>').text('Title: ' + results[j].title.toUpperCase());\n // GIF URL\n var gifURL = results[j].images.fixed_height_still.url; \n var gif = $('<img>');\n gif.attr('src', gifURL);\n gif.attr('data-still', results[j].images.fixed_height_still.url);\n gif.attr('data-animate', results[j].images.fixed_height.url);\n gif.attr('data-state', 'still');\n gif.addClass ('animate-gif');\n // Appending info \n newTopicDiv.append(pRating);\n newTopicDiv.append(pTitle);\n newTopicDiv.append(gif);\n // Putting the saved info to new div\n $('#car-view').prepend(newTopicDiv);\n } \n });\n }", "function showInfo() {\n d3.selectAll(\".titles\").remove();\n var titles = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"titles\")\n .style(\"left\", 0)\n .style(\"bottom\", 0);\n\n titles.append(\"div\")\n .html(\"Exploring Korean music: a map\")\n .attr(\"class\", \"title\");\n\n titles.append(\"div\")\n .html(`Each circle represents one musician. Circles attract each other based on how many collaborations they have together.\n <br> Color represents genre (blue being K-r&b, orange K-hiphop, green K-pop, and red K-indie). Size represents popularity relative to the genre.\n <br> Scroll to zoom. Click on circles to reveal collaborations between artists and basic artist info.`);\n titles.append(\"div\")\n .attr(\"display\", \"inline-block\")\n .html(`<a href = 'https://nathankim.name/portfolio/general/9_nongeographic/'>Click me to read more.</a>\n <button onclick='hideInfo()'>Click me to hide info.</button>`);\n}", "function displayGIFs(){\n\t//var animal\n\tvar animal = $(this).attr(\"data-name\");\n\tconsole.log(animal);\n\tconsole.log('this', this);\n\t//queryurl\n\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\tconsole.log('queryURL', queryURL);\n\t//ajax call\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: \"GET\"\n\t}).done(function(response){\n\t\tconsole.log(response);\n\t \t//empty animals div of gifs and rating info\n\t \t$(\"#animals\").empty();\n\t \t//variable to hold the response from ajax call\n\t\t\tvar gifs = response.data;\n\t\t\t//for loop to generate the rating and gifs for each of the objects\n\t\t\tfor(var i = 0; i < gifs.length; i++){\n\t\t\t\t//display the rating and the gif on the HTML\n\t \t\tvar rating = $(\"<p>\").text(\"Rating: \" + gifs[i].rating);\n\t \t\tvar animalGif = $('<img data-state=\"still\">');\n\t \t\t//assign attribute to animalgif var\n\t \t\tanimalGif.attr('src', gifs[i].images.fixed_height_still.url)\n\t \t\t\tanimalGif.attr('data-animate', gifs[i].images.fixed_height.url)\n\t \t\t\tanimalGif.attr('data-still', gifs[i].images.fixed_height_still.url)\t\n\t\t\t\tanimalGif.attr('class', 'gif img-responsive')\n\t \t\t//append the rating and gif to the animal Div on HTML\n\t \t\t$(\"#animals\").append(rating, animalGif);\n \t\t}\n\t\t});\n}", "function displayInfo(theSculpture) {\n var theName = theSculpture.name;\n var theDesc = theSculpture.description;\n var theYear = theSculpture.year;\n document.getElementById(\"location-container\").getElementsByTagName('h3')[0].innerHTML = theName;\n document.getElementById(\"location-container\").getElementsByTagName(\"p\")[0].innerHTML = theYear;\n document.getElementById(\"location-container\").getElementsByTagName(\"p\")[1].innerHTML = theDesc;\n document.getElementById(\"location-container\").style.display = \"block\";\n}", "function displayTvShow() {\n $.ajax({\n url: `http://api.tvmaze.com/shows/${$show_id}`,\n type: \"GET\",\n dataType: \"json\",\n }).done(function (response) {\n\n $show_title.append(`<p>${response.name} &#11088; ${$show_rating}</p>`);\n $show_img.append(`<img src='${response.image.original}' class='img-fluid' alt='tvShow'>`);\n $show_info.append(response.summary);\n\n });\n\n}", "function\tgetData () {\n\tvar data = JSON.parse(event.target.responseText);\n\tvar currentBrand = \" \";\n\tvar brand;\n\tvar type;\n\tvar volume;\n\tvar price;\n// Loop through dog_brands\n\tfor (i = 0; i < data.dog_brands.length; i++) {\n\t\t// variable to hold obj prop\n\t\tbrand = data.dog_brands[i].name;\n\t\t// create div wih unique id\n\t\tcurrentBrand += `<div>`;\n\t\tcurrentBrand += `<h1 id=\"b${i + 1}\" class=\"brand\">`;\n\t\tcurrentBrand += `${brand}`;\n\t\tcurrentBrand += `</h1>`;\n\t\t// repeat till we get through object\n\t\tfor (j = 0; j < data.dog_brands.length; j++) {\n\t\t\ttype = data.dog_brands[i].types[j].type;\n\t\t\tcurrentBrand += `<div class=\"infoDiv\">`;\n\t\t\tcurrentBrand += `<h2>`;\n\t\t currentBrand += `${type} :`;\n\t\t currentBrand += `</h2>`;\n\t \t for (x = 0; x < data.dog_brands.length; x++) {\n\t\t\t\tvolume = data.dog_brands[i].types[j].volumes[x].name;\n\t\t\t\tprice = data.dog_brands[i].types[j].volumes[x].price;\n\t\t\t\tcurrentBrand += `<div>`;\n\t\t\t\tcurrentBrand += `<h2>`;\n\t\t \tcurrentBrand += `${volume} `;\n\t\t \tcurrentBrand += `$ ${price}`;\n\t \t \tcurrentBrand += `</h2>`;\n\t\t\t\tcurrentBrand += `</div>`;\n\t \t }\n\t\t\t\tcurrentBrand += `</div>`;\n\n\t\t}\t\n\t\t\t\tcurrentBrand += `</div>`;\n\t}\n\tdogContainer.innerHTML = currentBrand;\n}", "function populate_showinfo(country_name,country_code) {\n\n\tvar new_content;\n\tvar filter_results;\n\tvar new_place_name = '<h4>' + country_name + '</h4>';\n\t//new_content = '';\n\tvar new_ingredients;\n\tvar new_dish;\n\n\tvar new_dish_menu_target = 'main';\n\tvar new_ingredient_menu_target = 'main';\n\tvar new_dish_sidepanel_content;\n\tvar new_ingredient_sidepanel_content;\n\tvar new_dish_sidepanel_item;\n\tvar new_ingredient_sidepanel_item;\n\n\tif(search_string !==\"\") {\n\n\n\t\tif(search_string == 'arroz' || search_string == 'frijoles' ) {\n\t\t\tresult_kind = 'Ingrediente';\n\t\t\tnew_ingredients = '<span class=\"result-number\">1</span> '+search_string.toLowerCase().replace(/\\b[a-z]/g, function(letter) {\n\t\treturn letter.toUpperCase();\n\t});\n\t\t\tnew_dish = '<span class=\"result-number\">28</span> Platos';\n\n\t\t\tnew_ingredient_sidepanel_content = 'generalinfo';\n\t\t\tnew_ingredient_sidepanel_item = 'arroz';\n\t\t\tnew_dish_sidepanel_content = 'dishes';\n\t\t\tnew_ingredient_menu_target = 'sub-ingredients';\n\n\t\t\t//new_content += '<a class=\"clickme\" href=\"#about\">1 '+ result_kind +' (' + search_string + ')</a> | \\\n\t\t\t //<a class=\"clickme\" href=\"#about\">24 Platos</a>';\n\t\t} else if(search_string == 'bisi bele bath') {\n\t\t\tresult_kind = 'Plato';\n\t\t\tnew_ingredients = '<span class=\"result-number\">12</span> Ingredientes';\n\t\t\tnew_dish = '<span class=\"result-number\">1</span> '+search_string.toLowerCase().replace(/\\b[a-z]/g, function(letter) {\n\t\treturn letter.toUpperCase();\n\t});\n\n\t\t\tnew_dish_sidepanel_content = 'generalinfo';\n\t\t\tnew_dish_sidepanel_item = 'bisi-bele-bath';\n\t\t\tnew_ingredient_sidepanel_content = 'ingredients';\n\t\t\tnew_dish_menu_target = 'sub-dishes';\n\n\t\t\t//new_content += '<a class=\"clickme\" href=\"#about\">4 Ingredientes</a> | \\\n\t\t\t //<a class=\"clickme\" href=\"#about\">1 '+ result_kind +' (' + search_string + ')</a>';\n\t\t}\n\n\t} else {\n\t\tnew_ingredients = '<span class=\"result-number\">12</span> Ingredientes';\n\t\tnew_dish = '<span class=\"result-number\">28</span> Platos';\n\n\t\tnew_dish_sidepanel_content = 'dishes';\n\t\tnew_ingredient_sidepanel_content = 'ingredients';\n\t\t//new_content += '<a class=\"clickme\" href=\"#about\">80 Ingredientes</a> | \\\n\t\t\t //<a class=\"clickme\" href=\"#about\">24 Platos</a>';\n\t}\n\n\tvar capitalize_new_dish = new_dish;\n\tvar capitalize_new_ingredients = new_ingredients;\n\n\t$(\"#showinfo\").css(\"opacity\",\"1.0\");\n\n\t$(\".modal-header\").html(new_place_name);\n\t$(\".modal-content .ingredients\").html(capitalize_new_ingredients);\n\t$(\".modal-content .dish\").html(capitalize_new_dish);\n\n\t$(\".modal-content .link-dishes\").attr({\n\t\t'href': '#'+new_dish_sidepanel_content,\n\t\t'data-sidepanel-content': new_dish_sidepanel_content,\n\t\t'data-country-code': country_code,\n\t\t'data-country-name': country_name,\n\t\t'data-menu-target': new_dish_menu_target\n\t});\n\t$(\".modal-content .link-ingredients\").attr({\n\t\t'href': '#'+new_ingredient_sidepanel_content,\n\t\t'data-sidepanel-content': new_ingredient_sidepanel_content,\n\t\t'data-country-code': country_code,\n\t\t'data-country-name': country_name,\n\t\t'data-menu-target': new_ingredient_menu_target\n\t});\n\tif ( new_dish_menu_target == 'sub-dishes') {\n\t\t$(\".modal-content .link-dishes\").attr({\n\t\t\t'data-sidepanel-item': new_dish_sidepanel_item\n\t\t});\n\t} else if ( new_ingredient_menu_target == 'sub-ingredients') {\n\t\t$(\".modal-content .link-ingredients\").attr({\n\t\t\t'data-sidepanel-item': new_ingredient_sidepanel_item\n\t\t});\n\t}\n\n\n\topen_side();\n\t//populate_side(/* country_name,country_code */);\n\t//populate not necessary, included in doc ready\n\n\n}", "function displayAdditionalInfo(){\r\n var container = _.findWhere(matchingContainers, {'Container': selectedContaier});\r\n var html = '';\r\n\r\n if(container) {\r\n $('#results-dwell-time tbody').empty();\r\n $('#results-movements tbody').empty();\r\n\r\n $additionalInfoContainer.fadeOut('fast', function(){\r\n var dwell = container.DwellTime;\r\n if(dwell) {\r\n html =\r\n '<tr>' +\r\n '<td>' + dwell.Container + '</td>' +\r\n '<td>' + dwell.DischargeDate + '</td>' +\r\n '<td>' + dwell.RampDate + '</td>' +\r\n '<td>' + dwell.DepartureDate + '</td>' +\r\n '<td>' + dwell.TermDwell + '</td>' +\r\n '<td>' + dwell.RailDwell + '</td>' +\r\n '<td>' + (dwell.TermDwell + dwell.RailDwell) + '</td>' +\r\n '</tr>';\r\n\r\n $('#results-dwell-time tbody').append(html);\r\n }\r\n\r\n var movements = container.Movements;\r\n if(movements) {\r\n html = '';\r\n\r\n _.each(movements, function(movement){\r\n html +=\r\n '<tr>' +\r\n '<td>' + movement.Container + '</td>' +\r\n '<td>' + movement.From + '</td>' +\r\n '<td>' + movement.DepartureDate + '</td>' +\r\n '<td>' + movement.To + '</td>' +\r\n '<td>' + movement.ArrivalDate + '</td>' +\r\n '<td>' + movement.Car + '</td>' +\r\n '<td>' + movement.Train + '</td>' +\r\n '</tr>';\r\n });\r\n\r\n $('#results-movements tbody').append(html);\r\n }\r\n\r\n $additionalInfoContainer.fadeIn('fast');\r\n });\r\n }\r\n }", "function showLocation(loc,alternateDescription,alternateImage){\n \n // Use alteranate descriptions and image if the exist\n // else use the normal ones provided for the location\n var image = alternateImage || loc.image;\n var description = alternateDescription || loc.description;\n\n // Write to elements\n $('.big-image').attr(\"src\",\"imgs/\" + image + \".jpg\");\n $('.description').html(description);\n \n // If a location is not an info page then change the memories\n // holding the last location and last description\n if(!loc.infopage){\n lastLocation = loc;\n lastDescription = description;\n }\n \n // Show bag content, update progress bars and build the menu\n showBag();\n updateProgressBars();\n buildMenu(loc.choices);\n\n}", "function viewArticle() {\n\t\t//set the content of the elements using the list items' attributes\n\t\t$(\"article h1\").html($(this).attr(\"title\"));\n\t\t$(\"article img\").attr(\"src\", $(this).attr(\"backgr\"));\n\t\t$(\"article h4\").html($(this).attr(\"author\") + \" - \" + $(this).attr(\"date\"));\n\t\t$(\"article .content\").html($(this).attr(\"description\"));\n\t}", "function getDogTemplate(dog) {\n /* This gets the information but does not work for nulls, would have to implement loops and format correctly\n console.log(dog.shows[0].location);\n console.log(dog.shows[0].medals[0].title);\n return `<li>${dog.name} - ${dog.description} - ${dog.breed} - ${dog.shows[0].location}</li>`;\n */\n return `<li>${dog.name} - ${dog.description} - ${dog.breed} </li>`;\n}", "function fn_createDOMAnimalList(detailType) {\n const dataJSON_Object = fn_getDataJSON(dataJSONURL);\n animalDescription.innerHTML = `\n <h3 class=\"text-capitalize mt-3\">List of ${detailType}</h3>\n \n `;\n for (let _animal of dataJSON_Object[detailType]) {\n animalListDOM.innerHTML += `\n <div class=\"animalList-item col-12 col-sm-6 col-md-4 mt-3 mb-3 \" animalID=\"${_animal.id}\"> \n <a href=\"./animals.html?detailType=${detailType}&detailID=${_animal.id}\">\n <img\n class=\"img-fluid animalList-item-imgURL\"\n src=\"./images/${_animal.imgURL}\"\n alt=\"\"\n />\n <h4>${_animal.name}</h4> \n </a>\n <p>${_animal.description}</p> \n </div>\n `;\n }\n}", "function displayMealDetails(meal) {\n const ingredients=`\n <div class=\"text-center\">\n <img src=\"${meal.strMealThumb}\" class=\"img\">\n <h3 class=\"title\">${meal.strMeal}</h3>\n </div>\n <div>\n <h4>Ingredients</h4>\n <ul id=\"list\">\n </ul>\n </div>\n `\n document.getElementById(\"showDetails\").innerHTML = ingredients;\n //for accessing ingredients\n for (let index = 1; index <= 20; index++) {\n let ingredient = 'strIngredient' + index;\n let number = 'strMeasure' + index;\n if (meal[ingredient] == null || meal[ingredient] === \"\" ) {\n break;\n }\n const li = document.createElement(\"li\");\n const item=`\n <li>${meal[number]} ${meal[ingredient]}</li>\n `;\n li.innerHTML = item;\n document.getElementById(\"list\").appendChild(li)\n }\n document.getElementById(\"mealDetails\").style.display = \"block\";\n}", "function displayUserInfo(userInfo){\n var $basicInfo = $('#basic-info');\n var $theStory = $('#the-story');\n var source = $('#card-template').html();\n var template = handlebars.compile(source);\n console.log(template(userInfo));\n $('.container').html(template(userInfo));\n\n }", "function displayMusicInfo() {\n var topic = $(this).text();\n var queryURL = \"https://api.giphy.com/v1/gifs/search?&limit=10&q=\" + topic + \"&apikey=0zZILNFM54RkhIOwIgD8PJ7wXBK1APDd\";\n $(\"#display-box\").empty();\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n var responseData = response.data;\n for (i = 0; i < responseData.length; i++) {\n var musicView = $(\"<div>\").addClass(\"music-view d-inline-block p-3\");\n var musicDiv = $(\"<img>\").addClass(\"music-div\");\n var pOne = $(\"<p>\").text(\"Rating: \" + responseData[i].rating);\n var imgStore = responseData[i].images.fixed_height_still.url;\n musicDiv.attr(\"src\", imgStore);\n musicDiv.attr(\"data-animate-img\", responseData[i].images.fixed_height.url);\n musicDiv.attr(\"data-still-img\", imgStore);\n musicDiv.attr(\"data-go\", \"false\");\n musicView.append(musicDiv);\n musicView.append(pOne);\n $(\"#display-box\").append(musicView);\n }\n });\n\n }", "function displayMovieInfo() {\n\n // YOUR CODE GOES HERE!!! HINT: You will need to create a new div to hold the JSON.\n\n }", "function showInformation(marker){\n document.getElementById(\"property-name\").innerHTML = \"<b>Properity Name</b>: \" + marker.data.property_name;\n document.getElementById(\"property-type\").innerHTML = \"<b>Properity Type</b>: \" + marker.data.property_type;\n document.getElementById(\"community-area-name\").innerHTML = \"<b>Community Area Name</b>: \" + marker.data.community_area;\n document.getElementById(\"address\").innerHTML = \"<b>Address</b>: \" + marker.data.address;\n document.getElementById(\"management_company\").innerHTML = \"<b>Management Company</b>: \" + marker.data.management_company;\n document.getElementById(\"phone-number\").innerHTML = \"<b>Phone Number</b>: \" + marker.data.phone_number;\n}", "function change(d) { \n var str = \"\"; //appends to string above \n for (i = 0; i < d.length; i++) { \n str += \"<p>\" + d[i].name + \" is a \" + d[i].species + \".</p>\"; \n } \n //inserts into empty div \n getAnimal.insertAdjacentHTML('beforeend', str); \n}", "displayOneThing (thing_object, thing_UID) {\n\n let outputAll = '<h3> Thing: </h3>';\n \n _name = thing_object.Thing_name\n _channels = thing_object.Available_channels\n\n let outputChnl = '<h5> Available Channels: </h5>';\n for (let i = 0; i< _channels.length; i++) {\n _channel_name = _channels[i].Channel_name\n _channel_ID = _channels[i].Channel_ID\n _channel_linkedItem = _channels[i].Linked_Items\n _channel_descrition = _channels[i].Channel_description \n\n\n outputChnl += `\n \n <ul>\n <li> <b>---- Channel ${i+1} </b> </li>\n <li> <b> Channel- Name </b>: ${_channel_name}</li>\n <li> <b> Channel- ID </b>: ${_channel_ID}</li>\n <li> <b> LinkedItem </b>: ${_channel_linkedItem}</li> \n <li> <b> Description </b>: ${_channel_descrition}</li> \n </ul> \n\n ` \n }\n\n outputAll +=\n ` <ul>\n <li> <b> Thing- Name </b>: ${_name} </li>\n <li> <div id= 'outputChnl'> </div> </li> \n \n </ul> \n ` \n document.getElementById ('outputAll').innerHTML = outputAll;\n document.getElementById ('outputChnl').innerHTML = outputChnl;\n }", "function showData(petfood){\n\tconsole.log(\"petfood\", petfood);\n\n\tfor (var i = 0; i < petfood.length; i++){\n\t\tpetFoodDiv.innerHTML += `<div><h2>${petfood[i].name}</h2></div>`;\n\t\tfor (var j = 0; j < petfood[i].types.length; j++){\n\t\t\tpetFoodDiv.innerHTML += `<div><h3>${petfood[i].types[j].type}</h3></div>`;\n\t\t\tfor (var k = 0; k < petfood[i].types[j].volumes.length; k++){\n\t\t\t\tpetFoodDiv.innerHTML += `<div>${petfood[i].types[j].volumes[k].name}</div>\n\t\t\t\t\t\t\t\t\t\t<div>${petfood[i].types[j].volumes[k].price}</div>`;\n\t\t\t}\n\t\t}\n\t}\n}", "function fetchData() {\n $.get('data/page-1.json')\n .then((data) => {\n console.log(data);\n data.forEach(animalData => {\n const newAnimal = new hornedAnimal(animalData)\n if(!dropdown.includes(newAnimal.keyword)) {\n dropdown.push(newAnimal.keyword);\n let options =$('#keyword').clone();\n options.attr('value', animalData.keyword).text(animalData.keyword);\n $('#dropdown-menu').append(options);\n }\n animalArray.push(newAnimal);\n })\n console.log(animalArray);\n const article = $('#all-animals');\n animalArray.forEach(animal => { ////$('section: nth-child(2)').empty(); add this here to empty out images\n const renderAnimal = animal.renderElement();\n console.log(renderAnimal);\n article.append(renderAnimal);\n })\n })\n}", "function disp_info(d) {\n //console.log(d);\n materialInfo.html(getMaterialInfo(d))\n .attr(\"class\", \"panel_on\");\n }", "function fn_createDOMAnimalDetail(detailType, detailID) {\n const dataJSON_Object = fn_getDataJSON(dataJSONURL);\n\n for (let _animal of dataJSON_Object[detailType]) {\n if (_animal.id === detailID) {\n animalDetailDOM.innerHTML += `\n \n <div class=\"row justify-content-center\">\n <div class=\"col-12 col-md-9 bg-light pt-3 border\">\n <div class=\"row\">\n <div class=\"col-12 col-md-6\">\n <img class=\"img-fluid\" src=\"./images/${_animal.imgURL}\" alt=\"\" dataName=\"imgURL\"/>\n </div>\n <div class=\"col-12 col-md-6 pt-3 pt-md-0\">\n <h4 dataName=\"name\">${_animal.name}</h4>\n <span dataName=\"description\">\n ${_animal.description}\n </span>\n </div>\n </div>\n <div class=\"row mt-3\">\n <div class=\"col-12 col-sm-4\">\n <strong>Animal type</strong>\n <p dataname=\"animalType\">${_animal.animalType}</p>\n <strong>Diet</strong>\n <p dataName=\"diet\">${_animal.diet}</p>\n </div>\n <div class=\"col-12 col-sm-4\">\n <strong>Habitat</strong>\n <p dataName=\"habitat\">${_animal.habitat}</p>\n <strong>Range</strong>\n <p dataName=\"range\">${_animal.range}</p>\n </div>\n <div class=\"col-12 col-sm-4\">\n <strong>Size</strong>\n <p dataName=\"size\">${_animal.size}</p>\n <strong>Relatives</strong>\n <p dataName=\"relatives\">${_animal.relatives}</p>\n </div>\n </div>\n </div>\n </div>\n \n \n `;\n }\n }\n}", "function displayWeather(response){\n displaySection.style.visibility = 'visible';\n tempDisplay.style.visibility = 'visible'; \n descriptionSection.style.visibility = 'visible';\n weatherDisplay.style.visibility = 'visible';\n cityDisplay.innerText = response.name;\n tempDisplay.innerHTML = `${Math.floor(response.main.temp)} °F`;\n descriptionSection.innerText = response.weather[0].description; \n weatherDisplay.innerHTML = `<img src = \"http://openweathermap.org/img/wn/${response.weather[0].icon}@2x.png\">`;\n\n}", "function showResult(json) {\r\n\t\tclear();\r\n\t\tfor(let i = 0; i < json.meals.length; i++) {\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\t\t\tlet p2 = document.createElement(\"p\");\r\n\t\t\tlet p = document.createElement(\"p\");\r\n\t\t\tlet img = document.createElement(\"img\");\r\n\r\n\t\t\t//we are appending the name and picture that the search result gave up\r\n\t\t\tp2.id = \"meal\"+i;\r\n\t\t\tdiv.className = \"name\";\r\n\t\t\tp2.innerHTML = json.meals[i].strMeal;\r\n\t\t\timg.src = json.meals[i].strMealThumb;\r\n\r\n\t\t\tdiv.appendChild(p2);\r\n\t\t\tp.appendChild(img);\r\n\t\t\tdocument.getElementById(\"result\").appendChild(div);\r\n\t\t\tdocument.getElementById(\"result\").appendChild(p);\r\n\r\n\t\t\tp2.onclick = pickFood;\r\n\t\t}\r\n\t}", "function displayCelebs() {\n\t\t// Display an error message if error code is not 410 or 200 (okay)\n\t\tif (this.status != 200 && this.status != 410) {\n\t\t\tdisplayError();\n\t\t}\n\t\tvar data = JSON.parse(this.responseText);\n\t\t// Display each actor\n\t\tfor (var i = 0; i < data.actors.length; i++) {\n\t\t\tdisplayActor(data.actors[i]);\n\t\t}\n\t\t// Hide loading icon when completed\n\t\tdocument.getElementById(\"loadingcelebs\").style.display = \"none\";\n\t}", "function displayResults(responseJson) {\n console.log(responseJson);\n let index = getQuantity();\n let dogHtml = \"\";\n for (let i=0; i < index; i++) {\n dogHtml+=`<br><img src=\"${responseJson.message[i]}\" class=\"results-img\">`;\n }\n $('section h2').replaceWith(`<h2>You got ${getQuantity()} dogs!</h2>`);\n $('div.response-images').html(dogHtml);\n $('.results').removeClass('hidden');\n }", "function displayAnimalInfo() {\n //First clear the previous gifs \n $(\"#gifs-appear-here\").empty();\n // Grabbing and storing the data-animal property value from the button\n var animal = $(this).attr(\"data-name\");\n // var dstill = $(this).attr(\"data-state\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&api_key=MPP1hsyRO2fkXqhVydWUuVh3BtfhEztj&limit=10\";\n\n // AJAX GET request to queryURL\n $.ajax({\n url: queryURL,\n method: \"Get\"\n })\n\n .then(function (response) {\n\n // storing the data from the AJAX request in the results variable\n var results = response.data;\n console.log(results);\n\n // Looping through each result item\n for (var i = 0; i < results.length; i++) {\n\n // Creating and storing a div tag\n var animalDiv = $(\"<div>\");\n\n // Creating a paragraph tag with the result item's rating\n var p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\n // Creating and storing an image tag\n var animalImage = $(\"<img>\");\n animalImage.addClass(\"gif\");\n\n // Setting the src attribute of the image to a property pulled off the result item, also stroe the still url in variable data-still and animated url in data-animate\n\n animalImage.attr(\"src\", results[i].images.fixed_height_still.url);\n animalImage.attr(\"data-still\", results[i].images.fixed_height_still.url);\n animalImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n // animalImage.attr(\"data-state\", 'unstill');\n\n\n //code to stop and play the picture when clicked or toggle \n $(animalImage).on(\"click\", function () {\n // The attr jQuery method allows us to get or set the value of any attribute on our HTML element\n var state = $(this).attr(\"data-state\");\n\n // If the clicked image's state is still, update its src attribute to what its data-animate value is.\n // Then, set the image's data-state to animate\n // Else set src to the data-still value\n if (state === \"animate\") {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n }\n\n });\n\n console.log(animalImage.attr);\n // Appending the paragraph and image tag to the animalDiv\n animalDiv.append(p);\n animalDiv.append(animalImage);\n\n // Prependng the animalDiv to the HTML page in the \"#gifs-appear-here\" div\n $(\"#gifs-appear-here\").append(animalDiv);\n }\n });\n\n}", "function displayGoatInformation() {\n var mouseOverImages = document.getElementById('mouseover_images');\n var div;\n var goatDisplay;\n var info;\n var infoField;\n var emailIcon = document.createElement('img');\n emailIcon.src = 'img/mail.png';\n\n for(var i=0; i <goats.length; i++) {\n div = document.createElement('div');\n div.setAttribute('class', 'goat-wrap');\n\n goatDisplay = document.createElement('img');\n if (goats[i].goatImage == '') {\n goatDisplay.src = 'adorableGoat.jpg';\n mouseOverImages.appendChild(div);\n div.appendChild(goatDisplay);\n\n } else {\n goatDisplay.src = goats[i].goatImage;\n mouseOverImages.appendChild(div);\n div.appendChild(goatDisplay);\n }\n\n info = document.createElement('p');\n info.setAttribute('class', 'name');\n info.textContent = goats[i].goatName;\n div.appendChild(info);\n\n infoField = document.createElement('div');\n infoField.setAttribute('class', 'infoDiv');\n div.appendChild(infoField);\n\n info = document.createElement('p');\n info.setAttribute('class', 'age');\n info.textContent = 'Age: ' + goats[i].goatAge;\n infoField.appendChild(info);\n\n info = document.createElement('p');\n info.setAttribute('class', 'location');\n info.textContent = 'Location: ' + goats[i].goatLocation;\n infoField.appendChild(info);\n\n info = document.createElement('p');\n info.setAttribute('class', 'service-needed');\n info.textContent = 'Need: ' + goats[i].serviceNeeded;\n infoField.appendChild(info);\n\n info = document.createElement('p');\n info.setAttribute('class', 'contact');\n info.textContent = goats[i].contact;\n infoField.appendChild(info);\n\n }\n}", "function displayGif() {\n var animalDisplay = $(this).attr(\"data-name\");\n\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animalDisplay + \"&api_key=4MpjWrAM3wf0qX6G6dbnCaxyWlDJPuHq&limit=10\";\n\n // Creating an AJAX call for the specific movie button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n\n var animalGif = response.data;\n for (var i = 0; i < animalGif.length; i++) {\n console.log(animalGif[i].rating)\n // Creating and storing a div tag\n var gifArea = $(\"<div class='inlineBlock'>\");\n\n // Creating a paragraph tag with the result item's rating\n var p = $(\"<p>\").text(\"Rating: \" + animalGif[i].rating);\n\n // Creating and storing an image tag\n var animalImage = $(\"<img class='gif img-fluid'>\");\n // Setting the src attribute of the image to a property pulled off the result item\n animalImage.attr(\"src\", animalGif[i].images.fixed_height_still.url)\n animalImage.attr(\"data-still\", animalGif[i].images.fixed_height_still.url)\n animalImage.attr(\"data-animate\", animalGif[i].images.fixed_height.url)\n animalImage.attr(\"data-state\", \"still\");\n\n // Appending the paragraph and image tag to the animalDiv\n gifArea.append(p);\n gifArea.append(animalImage);\n\n $(\"#display-view\").prepend(gifArea);\n }\n });\n\n }", "function updateDisplay(info) {\n\n display.innerHTML = info;\n\n }", "function displayHTML(){\n\t\tdom.name.innerHTML = \"1. Name: \"+studentArray[position].name;\n\t\tdom.address.innerHTML = \"2. Address: \"+studentArray[position].street+\n\t\t\", \"+studentArray[position].city+\n\t\t\", \"+studentArray[position].state;\n\t\tdom.grades.innerHTML = \"3. Grades: \"+studentArray[position].grades;\n\t\tdom.date.innerHTML = \"4. Date: \"+studentArray[position].getDate();\n\t\tdom.gpaAvg.innerHTML = \"5. Average GPA: \"+studentArray[position].getAverage(studentArray[position].grades).toFixed(2);\n\t}//close displayHTML function", "function _display(){\n\t\t\t$(levelID).html(level);\n\t\t\t$(pointsID).html(points);\n\t\t\t$(linesID).html(lines);\n\t\t}", "function redisplay (everything, id, summary) { \n\tvar out = ''\n\tvar re, pron, refpron, posspron, f, i, n, c, j, d, p, x, temp\n\t\t\n\tvar records = everything.split('§')\n\tvar given, fullname, text, born, bdate, id, male\n\tvar occ = ''\n\tvar gps = []\n\tvar thumb = ''\n\tvar thumbLegend = ''\n\t\n\t// get the general information\n\tvar person = db[id]\n\t\n\tvar fid = person.father\n\tvar mid = person.mother\n\tvar sid = []\n\tvar cid = []\n\tif (person.fg) {\n\t\tfor (i=0;i<person.fg.length;i++) {\n\t\t\tsid.push(person.fg[i][1])\n\t\t\t}\n\t\tfor (i=0;i<person.fg.length;i++) {\n\t\t\tfor (j=2;j<person.fg[i].length;j++) {\n\t\t\t\tcid.push(person.fg[i][j])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\n\tvar dob = id.split('_')\n\tout += '<div id=\"topMenu\" style=\"text-align:right;\">'\n\tout += '<a id=\"gotoTop\" href=\"#top\">Top</a>'\n\tout += '<span id=\"summarise\" onclick=\"summarise(this)\">Summarise</span>'\n\tout += '<span id=\"toggleDetails\" onclick=\"toggleDetails(this)\">Expand details</span>'\n\tout += '<span id=\"toggleEvents\" onclick=\"toggleHistory(this, '+dob[dob.length-1]+')\">Show history</span>'\n\tout += '<span id=\"toggleRelatives\" onclick=\"toggleRelatives(this)\">Hide relatives</span>'\n\t//out += '<span id=\"minimiseToggle\" onclick=\"addHistory(this, '+dob[dob.length-1]+')\">Show history</span>'\n\tout += '<a id=\"gotoTree\" href=\"tree.html?project='+window.project+'&person='+id+'\">Tree</a>'\n\tout += '<a style=\"margin-right:3em;\" href=\"index.html?project='+project+'\">Index</a> '\n\tout += '</div>'\n\tout += '<div id=\"top\"></div>'\n\t\n\t\n\t// popup window for summary\n\tout += '<div style=\"position:absolute; background-color:white; margin:auto;padding: 2em;border:1px solid #ccc;border-radius:1em;display:none; max-width: 70%;top: 18em;box-shadow: 10px 5px 5px gray;left: 15%;\" id=\"summaryWin\"></div>'\n\t\n\t// establish some basic information about the person the page is about\n\tgiven = getName('', id, 'k', false)\n\tfullname = getName('', id, 'gkf', false)\n\tmale = person.male\n\tborn = person.b\n\tif (data[id] && data[id].birth && data[id].birth.date) bdate = data[id].birth.bdate\n\telse if (person.bdate) bdate = person.bdate\n\telse bdate = '' \n\tif (male) { pron = 'He'; refpron = 'himself'; posspron = 'His'; }\n\telse { pron = 'She'; refpron = 'herself'; posspron = \"Her\"; }\n\ttemp = thumb.split(',')\n\tif (temp.length>1) { thumb = temp[0]; thumbLegend = temp[1]; }\n\telse thumbLegend = fullname\n\t\n\t\n\t// set the page title\n\tdocument.querySelector('title').textContent = getName('', id, 'gf', false)\n\t\n\t// draw top banner\n\tout += '<div id=\"banner\"><div id=\"pagetitle\">'+getName('', id, 'gf', false)+'<br><span id=\"bannerdates\">'+person.b+'\\u2013'+person.d\n\tif (person.occ) out += ' \\u2022 '+person.occ\n\tout += '</span></div></div>'\n\t\n\t// list parents\n\tout += '<div id=\"subbanner\"><div>Parents: '\n\tif (fid) out += getName('', fid, 'both', true)\n\tif (mid && fid ) out += ' \\u2022 '\n\tif (mid) out += getName('', mid, 'both', true)\n\tif (!mid && !fid) out += 'Unknown'\n\tout += ' </div></div>'\n\n\t// list spouses\n\tout += '<div id=\"subsubbanner\"><div>Spouse: '\n\tif (sid.length > 0) {\n\t\tfor (c=0;c<sid.length;c++) {\n\t\t\tout += getName('', sid[c], 'both', true)\n\t\t\tif (c<sid.length-1) out += ' \\u2022 '\n\t\t\t}\n\t\t}\n\telse out += 'None'\n\tout += '</div></div>'\n\n\t// list children\n\tout += '<div id=\"subsubsubbanner\"><div>Children: '\n\ttemp = []\n\tif (cid.length > 0) {\n\t\tfor (c=0;c<cid.length;c++) {\n\t\t\tif (cid[c] === 'a_child') {\n\t\t\t\ttemp.push('<span>Private</span>')\n\t\t\t\t}\n\t\t\telse if (cid[c] === 'noissue') {}\n\t\t\telse {\n\t\t\t\ttemp.push('<span>'+getName('', cid[c], 'given', true)+'</span>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tfor (i=0;i<temp.length;i++) {\n\t\tout += temp[i]\n\t\tif (i<temp.length-1) out += ' \\u2022 '\n\t\t}\n\n\tif (temp.length === 0) out += 'None'\n\tout += '</div></div>'\n\n\t// display the general information\n\tout += '<div id=\"main\">'\n\tout += '<div class=\"dateAndRecord\">'\n\tout += '<div id=\"summary\" class=\"record\"><div><p>'\n\t//out += '<div class=\"dateAndRecord\"><div><div class=\"recordDate\"><span style=\"font-size: 100%; margin-top:.8em;\">'+person.b+'-</span><span>'+person.d+'</span></div></div><div id=\"summary\" class=\"record\"><div><p>'\n\tif (person.thumb) out += '<img class=\"portrait\" src=\"'+project+'/thumbs/'+id+'.jpg\" alt=\"'+thumbLegend+'\" title=\"'+thumbLegend+'\">'\n\telse if (person.male) out += '<img class=\"portrait\" src=\"lib/i/man_pic.png\" alt=\"'+thumbLegend+'\" title=\"'+thumbLegend+'\">'\n\telse out += '<img class=\"portrait\" src=\"lib/i/woman_pic.png\" alt=\"'+thumbLegend+'\" title=\"'+thumbLegend+'\">'\n\t\n\t// create the life summary\n\tif (data[id] && data[id].intro) summary.innerHTML = data[id].intro\n\telse {\n\t\tvar intro = getName('', id, 'gfm', false)\n\t\tif (db[id].k) intro += ', known as '+db[id].k+', '\n\t\tif (db[id].b) intro += ' was born in '+db[id].b\n\t\tif (db[id].bplace) intro += ' at '+db[id].bplace\n\t\tintro += '. '\n\t\tif (db[id].fg) {\n\t\t\tfor (i=0;i<db[id].fg.length;i++) {\n\t\t\t\tintro += pron+' married '+getName('', db[id].fg[i][1], 'gf', false)+' in '+db[id].fg[i][0]\n\t\t\t\tif (db[id].fg[i].length > 2) {\n\t\t\t\t\tintro += ' and they had '\n\t\t\t\t\tif (db[id].fg[i].length === 3) intro += ' one child'\n\t\t\t\t\telse intro += db[id].fg[i].length-2+' children'\n\t\t\t\t\t}\n\t\t\t\telse intro += ' but we have no record of any children'\n\t\t\t\tintro += '. '\n\t\t\t\t}\n\t\t\t}\n\t\tif (db[id].occ) {\n\t\t\tvar occupations = db[id].occ.split(',')\n\t\t\tintro += posspron+' occupations included '\n\t\t\tfor (i=0;i<occupations.length;i++) {\n\t\t\t\tif (i === occupations.length-1 && i>0) intro += ' and '\n\t\t\t\telse if (i>0) intro += ', ' \n\t\t\t\tintro += occupations[i]\n\t\t\t\t}\n\t\t\tintro += '. '\n\t\t\t}\n\t\tif (db[id].d) {\n\t\t\tintro += pron+' died in '+db[id].d\n\t\t\tif (db[id].dplace) intro += ' at '+db[id].dplace\n\t\t\tvar ed = ey = bd = by = '?'\n\t\t\tif (db[id].b) intro += getAge(' aged ', db[id].ddate, db[id].d, db[id].bdate, db[id].b, '')\n\t\t\tintro += '. '\n\t\t\tintro = intro.replace('~',' about ')\n\t\t\t}\n\t\tintro += '</p>\\n'\n\t\tif (db[id].cstatus) intro += '<p style=\"color:#aaa; text-align:center;margin-top:1em;\">– '+db[id].cstatus+' –</p>'\n\t\tsummary.innerHTML = intro\n\t\t}\n\tout += summary.innerHTML+'</div></div><div class=\"keypoints\">'\n\t\n\t// add the general links\n\tif (data[id] && data[id].links) {\n\t\tfor (i=0;i<data[id].links.length;i++) {\n\t\t\tout += '<p><a href=\"'+data[id].links[i].url+'\" target=\"_blank\">'+data[id].links[i].title+'</a></p>'\n\t\t\t}\n\t\t}\n\n\telse out += ' '\n\tout += '</div></div>\\n'\n\n\n\t\n\t// WORK THROUGH EACH RECORD +++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\tfor (i=1;i<records.length;i++) {\n\t\tvar record = ''\n\t\tvar info = { }\n\t\tinfo.date = '' // sets default for age calculation\n\t\tvar fields = records[i].split('\\n')\n\t\t//console.log(fields[0])\n\t\t\n\t\t// read in the first line\n\t\tfields[0] = fields[0].replace(/ [\\s]+/g, ' ')\n\t\tvar firstline = fields[0].split(' ')\n\t\tvar year = firstline[1]\n\t\tvar who = firstline[2]\n\t\tvar what = ''\n\t\tif (firstline[3]) what = firstline[3]\n\t\tvar background = ''\n\t\tvar border = ''\n\t\t//var relations = false\n\t\tvar usegps = false\n\t\t// for census, notes, events, and background create a title row with the title info\n\t\tif (what && who.match(/census/i)) { fields.splice(1,0,'title: '+fields[0].replace(/.... census/i,'').trim()); what = '' }\n\t\tif (what && who.match(/notes/i)) { fields.splice(1,0,'title: '+fields[0].replace(/.... notes/i,'').trim()); what = '' }\n\t\tif (what && who.match(/background/i)) { fields.splice(1,0,'title: '+fields[0].replace(/.... background/i,'').trim()); what = '' } \n\t\tif (what && who.match(/event/i)) continue // { fields.splice(1,0,'event: '+fields[0].replace(/.... event/i,'').trim()); what = '' } \n\t\t \n\t\tif (what && who === 'notes') { fields.splice(1,0,'title: '+what) } // for Notes ....\n\t\tif (what && what === 'born') { fields.splice(1,0,'birth: '+firstline[4]); what = 'birth' } // for X born id\n\t\tif (what && what === 'dies') { fields.splice(1,0,'death: '+firstline[4]); what = 'death' } // for X dies id\n\t\tif (what && what === 'marries') { fields.splice(1,0,'marriage:'+firstline[4]); what = 'marriage' } // for X dies id\n\t\tif (! who.match(/son|daughter|husband|wife|spouse|birth|marriage|death|census|notes/i)) { background = ' other' }\n\t\tif (who.match(/birth|marriage|death|census|notes/i) || \n\t\t\t(who.match(/son|daughter/i) && what.match(/birth/i)) || \n\t\t\t(who.match(/wife|husband/i) && what.match(/death/i))) { usegps = true; }\n\t\tif (who.match(/marriage/i)) {\n\t\t\tbackground = ' marriage'; \n\t\t\tif (what) fields.splice(1,0,'marriage:'+what) // for Marriage id\n\t\t\t}\n\t\tif (who.match(/death/i)) background = ' death'\n\t\tif (who.match(/event/i)) background = ' event'\n\t\tif (what && what.match(/death/i)) background += ' familydeath'\n\t\tif (who.match(/figure/i)) background = ' figure'\n\n\n\n\t\tvar details = ''\n\t\tinfo.children = {}\n\t\tinfo.children = 0\n\t\tinfo.others = 0\n\t\tinfo.visitors = 0\n\t\tinfo.serv = 0\n\t\tinfo.notes = []\n\t\tinfo.fnotes = []\n\t\tinfo.siblings = []\n\t\tinfo.title = ''\n\t\tvar theLink\n\t\tvar floatedIcons = ''\n\t\n\t\n\t\n\t\n\t\n\t\t// WORK THROUGH EACH FIELD\n\t\tfor (f=1;f<fields.length;f++) {\n\t\t\tfields[f] = fields[f].trim()\n\t\t\tfields[f] = fields[f].replace(/:\\s*/,'§')\n\t\t\t\n\t\t\t\n\t\t\tif (fields[f] !== '' && fields[f].substr(-1) !== '§') {\n\t\t\t\t\t\t\n\t\t\t\n\n\t\t\t// split the label from the data\n\t\t\tvar parts = fields[f].trim().split('§')\n\t\t\tparts[0] = parts[0].trim()\n\t\t\tparts[1] = parts[1].trim()\n\n\n\t\t\t// get links for floated icons\n\t\t\tif (parts[0] === 'record') floatedIcons += addFIcon(parts[1],'record')\n\t\t\tif (parts[0] === 'gps') floatedIcons += addFIcon(parts[1],'gps')\n\t\t\tif (parts[0] === 'link') floatedIcons += addFIcon(parts[1],'link')\n\n\t\t\t// turn patterns of text+url into links\n\t\t\tif (parts[1].match(' http')) {\n\t\t\t\ttheLink = parts[1].split('http')\n\t\t\t\tparts[1] = '<a target=\"_blank\" href=\"http'+theLink[1].trim()+'\">'+theLink[0]+'</a>'\n\t\t\t\t}\n\t\t\tif (parts[1].match('url:')) {\n\t\t\t\ttheLink = parts[1].split('url:')\n\t\t\t\tparts[1] = '<a target=\"_blank\" href=\"'+window.project+'/'+theLink[1].trim()+'\">'+theLink[0]+'</a>'\n\t\t\t\t}\n\t\t\t\n\t\t\t// convert url{} to relative urls\n\t\t\tif (parts[1].match('url{')) {\n\t\t\t\tre = new RegExp(\"url{([^}]+)}\",\"g\")\n\t\t\t\tparts[1] = parts[1].replace(re, '<a target=\"_blank\" href=\"$1\">$1</a>');\n\t\t\t\t}\n\t\n\t\t\t// convert @{} to absolute urls\n\t\t\tif (parts[1].match('@{')) {\n\t\t\t\tre = new RegExp(\"@{([^ ]+) ([^}]+)}\",\"g\")\n\t\t\t\tparts[1] = parts[1].replace(re, '<a target=\"_blank\" href=\"http://$1\">$2</a>');\n\t\t\t\t}\n\t\n\t\t\t// convert link{} to relative urls\n\t\t\tif (parts[1].match('link{')) {\n\t\t\t\tre = new RegExp(\"link{([^ ]+) ([^}]+)}\",\"g\")\n\t\t\t\tparts[1] = parts[1].replace(re, '<a target=\"_blank\" href=\"$1\">$2</a>');\n\t\t\t\t}\n\t\n\t\t\t// convert q{} to markup\n\t\t\tif (parts[1].match('q{')) {\n\t\t\t\tre = new RegExp(\"q{([^}]+)}\",\"g\")\n\t\t\t\tparts[1] = parts[1].replace(re, '<q>$1</q>');\n\t\t\t\t}\n\t\n\t\t\t// collect new info\n\t\t\tvar censusline\n\t\t\tswitch (parts[0]) {\n\t\t\t\t case 'birth': info.id = parts[1].trim()\n\t\t\t\t \t\t\t\totherPerson = data[parts[1].trim()]\n\t\t\t\t\t\t\t\tif (otherPerson) {\n\t\t\t\t\t\t\t\t\t//fields.push('date§'+otherPerson.bdate)\n\t\t\t\t\t\t\t\t\tif (db[info.id] && db[info.id].bdate) fields.push('date§'+db[info.id].bdate)\n\t\t\t\t \t\t\t\t\tif (otherPerson.birth) for (x=0;x<otherPerson.birth.length;x++) fields.push(otherPerson.birth[x])\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t case 'marriage':\n\t\t\t\t \t\t\t\tvar mData = []\n\t\t\t\t\t\t\t\tvar spIds = parts[1].trim().split('+')\n\t\t\t\t\t\t\t\tif (spIds.length === 1) spIds.unshift(id)\n\t\t\t\t\t\t\t\tif (data[spIds[0]] && data[spIds[0]].marriages && data[spIds[0]].marriages[spIds[1]]) mData = data[spIds[0]].marriages[spIds[1]]\n\t\t\t\t\t\t\t\telse if (data[spIds[1]] && data[spIds[1]].marriages && data[spIds[1]].marriages[spIds[0]]) mData = data[spIds[1]].marriages[spIds[0]]\n\t\t\t\t\t\t\t\tif (mData.length > 0) for (x=0;x<mData.length;x++) fields.push(mData[x])\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// do the following if there is no detailed info (gets data from db)\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif (db[spIds[0]].male) mData = ['gid: '+spIds[0], 'bid: '+spIds[1]]\n\t\t\t\t\t\t\t\t\telse mData = ['bid: '+spIds[0], 'gid: '+spIds[1]]\n\t\t\t\t\t\t\t\t\tfor (x=0;x<mData.length;x++) fields.push(mData[x])\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\tbreak\n\t\t\t\t case 'death': \n\t\t\t\t \t\t\t\tinfo.id = parts[1].trim()\n\t\t\t\t \t\t\t\totherPerson = data[info.id]\n\t\t\t\t\t\t\t\tif (db[info.id] && db[info.id].ddate) fields.push('date§'+db[info.id].ddate)\n\t\t\t\t \t\t\t\tif (otherPerson && otherPerson.death) for (x=0;x<otherPerson.death.length;x++) fields.push(otherPerson.death[x])\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t case 'event': \n\t\t\t\t \t\t\t\t//info.id = parts[1].trim()\n\t\t\t\t \t\t\t\t//otherPerson = events[info.id]\n\t\t\t\t \t\t\t\t//if (otherPerson) for (x=0;x<otherPerson.length;x++) fields.push(otherPerson[x])\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\n\t\t\t\t case 'title': info.title = parts[1]; break\n\t\t\t\t case 'link': info.link = parts[1]; break\n\t\t\t\t \n\t\t\t\t case 'fid': info.fid = parts[1].trim(); break\n\t\t\t\t case 'mid': info.mid = parts[1].trim(); break\n\t\t\t\t case 'formerly': info.formerly = parts[1]; break\n\t\t\t\t case 'focc': info.focc = parts[1]; break\n\t\t\t\t case 'date': info.date = parts[1]; break\n\t\t\t\t case 'bapplace': info.bapplace = parts[1]; break\n\t\t\t\t case 'bapdate': info.bapdate = parts[1]; break\n\t\t\t\t case 'bapyear': info.bapyear = parts[1]; break\n\t\t\t\t case 'place': info.place = parts[1]; break\n\t\t\t\t case 'of': info.of = parts[1]; break\n\t\t\t\t case 'gid': info.gid = parts[1].trim(); break\n\t\t\t\t case 'gage': info.gage = parts[1]; break\n\t\t\t\t case 'gocc': info.gocc = parts[1]; break\n\t\t\t\t case 'gfather': info.gfather = parts[1].trim(); break\n\t\t\t\t case 'gfid': info.gfid = parts[1].trim(); break\n\t\t\t\t case 'gfocc': info.gfocc = parts[1]; break\n\t\t\t\t case 'bid': info.bid = parts[1].trim(); break\n\t\t\t\t case 'bage': info.bage = parts[1]; break\n\t\t\t\t case 'bocc': info.bocc = parts[1]; break\n\t\t\t\t case 'bfather': info.bfather = parts[1].trim(); break\n\t\t\t\t case 'bfid': info.bfid = parts[1].trim(); break\n\t\t\t\t case 'bfocc': info.bfocc = parts[1]; break\n\t\t\t\t case 'bstatus': info.bstatus = parts[1]; break\n\t\t\t\t case 'gstatus': info.gstatus = parts[1]; break\n\t\t\t\t case 'bparish': info.bparish = parts[1].trim(); break\n\t\t\t\t case 'gparish': info.gparish = parts[1].trim(); break\n\t\t\t\t case 'length': info.length = parts[1]; break\n\t\t\t\t case 'by': info.by = parts[1]; break\n\t\t\t\t case 'witnesses': info.witnesses = parts[1]; break\n\t\t\t\t case 'age': info.age = parts[1]; break\n\t\t\t\t case 'head': censusline = parts[1].split(','); info.head = censusline[0]; break\n\t\t\t\t case 'wife': censusline = parts[1].split(','); info.wife = censusline[0]; break\n\t\t\t\t case 'child': info.children++; break\n\t\t\t\t case 'relation': info.relation = parts[1]; break\n\t\t\t\t case 'other': info.others = info.others+1; break\n\t\t\t\t case 'serv': info.serv = info.serv+1; break\n\t\t\t\t case 'visitor': info.visitors = info.visitors+1; break\n\t\t\t\t case 'siblings': info.siblings = parts[1].split(','); break\n\t\t\t\t case 'text': info.text = parts[1]; break\n\t\t\t\t case 'cause': info.cause = parts[1].trim(); break\n\t\t\t\t case 'occ': info.occ = parts[1].trim(); break\n\t\t\t\t case 'informant': info.informant = parts[1].trim(); break\n\t\t\t\t case 'iocc': info.iocc = parts[1].trim(); break\n\t\t\t\t case 'iplace': info.iplace = parts[1].trim(); break\n\t\t\t\t case 'gravestone': info.gravestone = parts[1].trim(); break\n\t\t\t\t case 'burplace': info.burplace = parts[1].trim(); break\n\t\t\t\t case 'burdate': info.burdate = parts[1].trim(); break\n\t\t\t\t case 'probate': info.probate = parts[1].trim(); break\n\t\t\t\t case 'obit': info.obit = parts[1].trim(); break\n\t\t\t\t case 'note': info.notes.push( parts[1] ); fields[f] = ''; break\n\t\t\t\t case 'fnote': info.fnotes.push( parts[1] ); fields[f] = ''; break\n\t\t\t\t case 'quote': info.notes.push( '<q>'+parts[1]+'</q>' ); fields[f] = ''; break\n\t\t\t\t case 'img': info.img= parts[1]; break\n\t\t\t\t case 'caption': info.caption= parts[1]; break\n\t\t\t\t case 'gps': \n\t\t\t\t \t\tif (usegps) {\n\t\t\t\t \t\ttemp=''\n\t\t\t\t\t\tfor (p=1;p<parts.length;p++) temp+=parts[p]\n\t\t\t\t\t\tgps.push( temp )\n\t\t\t\t\t\t} \n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t// collect information for display in the details section\n\t\t\tif (parts[0] === 'note' || parts[0] === 'quote') {} // do nothing where the note will be displayed in main text\n\t\t\telse if (parts[0] === 'title') {} // do nothing for title info\n\t\t\telse if (parts[0] === 'source') details += '<img src=\"lib/i/source.png\" alt=\"Source link\" title=\"Source link\"/>'+parts[1]+\"\\n\"\n\t\t\telse if (parts[0] === 'record') details += '<img src=\"lib/i/record.png\" alt=\"Link to a record\" title=\"Link to a record\"/>'+parts[1]+\"\\n\"\n\t\t\telse if (parts[0] === 'media') details += '<img src=\"lib/i/media.png\" alt=\"Link to media\" title=\"Link to media\"/>'+parts[1]+\"\\n\"\n\t\t\telse if (parts[0] === 'gps') details += '<img src=\"lib/i/map.png\" alt=\"Show on Google Maps\" title=\"Show on Google Maps\"/>'+parts[1]+\"\\n\"\n\t\t\telse if (parts[0] === 'discussion') details += '<img src=\"lib/i/discn.png\" alt=\"Things to consider\" title=\"Things to consider\"/><span class=\"discn\">'+parts[1]+\"</span>\\n\"\n\t\t\telse if (parts[0] === 'documents' || parts[0] === 'link') details += '<img src=\"lib/i/info.png\" alt=\"More information\" title=\"More information\"/>'+parts[1]+\"\\n\"\n\t\t\telse details += parts[0]+': '+parts[1]+\"\\n\"\n\t\t\n\t\t\t}\n\t\t\t}\n\t\t\n\n\n\t\t// make the title\n\t\tvar title = ''\n\t\tvar type = ''\n\t\tvar namedother = false\n\t\tif (who && who.match(/brother|sister|grandfather|grandmother|daughter|son/i)) namedother = true\n\t\tif (namedother) { \n\t\t\tif (what && what.toLowerCase() === 'death') { title = who+' '+getName('', info.id, 'k', false)+' dies'; type = 'familydeath'; }\n\t\t\t//else if (what && what.toLowerCase() === 'birth') { title = who+' '+getName('', info.id, 'k', false)+' born'; type = 'familybirth'; }\n\t\t\telse if (what && what.toLowerCase() === 'birth') { title = getName('', info.id, 'k', false)+' born'; type = 'familybirth'; }\n\t\t\telse if (what && what.toLowerCase() === 'marriage') { \n\t\t\t\t//if (who.toLowerCase() === 'daughter' || who.toLowerCase() === 'sister') title = who+' '+getName('', info.bid, 'k', false)+' marries'+' '+getName('', info.gid, 'kf', false) \n\t\t\t\t//else title = who+' '+getName('', info.gid, 'k', false)+' marries'+' '+getName('', info.bid, 'kf', false) \n\t\t\t\tif (who.toLowerCase() === 'daughter' || who.toLowerCase() === 'sister') title = getName('', info.bid, 'k', false)+' marries'+' '+getName('', info.gid, 'kf', false) \n\t\t\t\telse title = getName('', info.gid, 'k', false)+' marries'+' '+getName('', info.bid, 'kf', false) \n\t\t\t\ttype = 'familymarriage'; }\n\t\t\telse { title = who; type = who.toLowerCase(); }\n\t\t\t}\n\t\telse if (what) { \n\t\t\tif (what && what.toLowerCase() === 'death') { title = who+' dies'; type = 'familydeath'; }\n\t\t\telse if (what && what.toLowerCase() === 'birth') { title = who+' born'; type = 'familybirth'; }\n\t\t\telse if (what && what.toLowerCase() === 'marriage') { title = who+' marries'; type = 'familymarriage'; }\n\t\t\telse { title = who; type = who.toLowerCase(); }\n\t\t\t}\n\t\telse if (who.toLowerCase() === 'marriage') {\n\t\t\tif (male) title = 'Marriage to '+getName('', info.bid, 'kf', false)\n\t\t\telse title = 'Marriage to '+getName('', info.gid, 'kf', false)\n\t\t\ttype = 'marriage'\n\t\t\t}\n\t\t//else { title = who+info.title; type = who.toLowerCase(); }\n\t\telse if (who.toLowerCase() === 'birth' || who.toLowerCase() === 'death') { title = who; type = who.toLowerCase(); }\n\t\t// else if (who.toLowerCase() === 'census') { title = 'Census: '+info.title; type = who.toLowerCase(); }\n\t\telse if (who.toLowerCase() === 'census') { title = 'Census'; type = who.toLowerCase(); }\n\t\telse { title = info.title; type = who.toLowerCase(); }\n\t\t\n\t\t\n\t\t// add the record title and any floating icons\n\t\trecord += '<div class=\"titleEtc\">\\n'\n\t\tif (type !== 'background') record += '<p class=\"recordTitleAge\">'+getAge('', info.date, year, bdate, born, '')+'</p>'\n\t\trecord += '<p class=\"recordTitle\">'+title+'</p>'\n\t\trecord += '</div>\\n'\n\t\t\n\t\t\n\t\t// create the summary text\n\t\trecord += '<div class=\"descriptionText\">'\n\t\tswitch (type) {\n\t\t\tcase 'Person': \n\t\t\t\t\trecord += '<p>'+text+'</p>'\n\t\t\t\t\tbreak\n\t\t\t\t\t\n\t\t\tcase 'familybirth': \n\t\t\t\t\trecord += '<p>'\n\t\t\t\t\t//if (male) record += 'His '; else record += 'Her '\n\t\t\t\t\trecord += upperCaseFirst(who) +' '\n\t\t\t\t\trecord += getName('', info.id, 'kg', true)\n\t\t\t\t\trecord += ' was born '\n\t\t\t\t\tif (db[info.id] && db[info.id].bdate) record += getDatePhrase(db[info.id].bdate,year)\n\t\t\t\t\telse if (data[info.id] && data[info.id].birth && data[info.id].birth.date) record += getDatePhrase(data[info.id].birth.date,year)\n\t\t\t\t\telse record += getDatePhrase('',year)\n\t\t\t\t\tif (info.place) record += ' at '+info.place;\n\t\t\t\t\trecord += getAge(', when '+given+' was ', info.date, year, bdate, born, ' years old')\n\t\t\t\t\trecord += '.</p>'\n\t\t\t\t\tif (info.focc) {\n\t\t\t\t\t\tif (male) record += '<p>'+given+'\\'s '; else record += '<p>'+getName('', info.id, 'kx', true)+'\\'s father\\'s '\n\t\t\t\t\t\trecord += ' occupation at the time was '+info.focc+'.</p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.notes.length > 0) for (n=0;n<info.notes.length;n++) { record += '<p>'+replaceNames(info.notes[n])+'</p>' }\n\t\t\t\t\tbreak\n\t\t\t\t\t\n\t\t\tcase 'familymarriage': \n\t\t\t\t\trecord += '<p>'\n\t\t\t\t\tif (who.toLowerCase() === 'daughter') { \n\t\t\t\t\t\trecord += given+'\\'s daughter '+getName('', info.bid, 'kg', true)+' married '+getName('', info.gid, 'gkf', true)+getDatePhrase(info.date,year)\n\t\t\t\t\t\tif (info.place) record += ' at '+info.place\n\t\t\t\t\t\trecord += '. </p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (who.toLowerCase() === 'son') {\n\t\t\t\t\t\trecord += given+'\\'s '+who.toLowerCase()+' '+getName('', info.gid, 'given', true)+' married '+getName('', info.bid, 'both', true)+getDatePhrase(info.date,year)\n\t\t\t\t\t\tif (info.place) record += ' at '+info.place\n\t\t\t\t\t\trecord += '. </p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (who.toLowerCase() === 'father') {\n\t\t\t\t\t\trecord += given+'\\'s '+who.toLowerCase()+' '+getName('', info.gid, 'given', true)+' married '+getName('', info.bid, 'both', true)+getDatePhrase(info.date,year)\n\t\t\t\t\t\tif (info.place) record += ' at '+info.place\n\t\t\t\t\t\trecord += '. </p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (who.toLowerCase() === 'mother') {\n\t\t\t\t\t\trecord += given+'\\'s '+who.toLowerCase()+' '+getName('', info.bid, 'given', true)+' married '+getName('', info.gid, 'both', true)+getDatePhrase(info.date,year)\n\t\t\t\t\t\tif (info.place) record += ' at '+info.place\n\t\t\t\t\t\trecord += '. </p>'\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\tif (who.toLowerCase() === 'daughter' && info.gfid) {\n\t\t\t\t\t\trecord += '<p>The father of the groom was '+getName('', info.gfid, 'both', true)\n\t\t\t\t\t\tif (info.gfocc) record += ', '+info.gfocc\n\t\t\t\t\t\trecord += '. '\n\t\t\t\t\t\tif (info.bfocc) record += ' The occupation of '+getName('', info.bfid, 'both', true)+' was '+info.bfocc+'. '\n\t\t\t\t\t\trecord += '</p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (who.toLowerCase() === 'son' && info.bfid) {\n\t\t\t\t\t\trecord += '<p>The father of the bride was '+getName('', info.bfid, 'both', true)\n\t\t\t\t\t\tif (info.bfocc) record += ', '+info.bfocc\n\t\t\t\t\t\trecord += '. '\n\t\t\t\t\t\tif (info.gfocc) record += ' The occupation of '+getName('', info.gfid, 'both', true)+' was '+info.gfocc+'. '\n\t\t\t\t\t\trecord += '</p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.notes.length > 0) for (n=0;n<info.notes.length;n++) { record += '<p>'+replaceNames(info.notes[n])+'</p>' }\n\t\t\t\t\tbreak\n\t\t\t\t\t\n\t\t\tcase 'familydeath': \n\t\t\t\t\trecord += '<p>'\n\t\t\t\t\t//record += posspron+' '+who.toLowerCase() +' '\n\t\t\t\t\trecord += upperCaseFirst(who) +' '\n\t\t\t\t\tswitch (who.toLowerCase()) {\n\t\t\t\t\t\tcase 'grandfather':\n\t\t\t\t\t\tcase 'grandmother': record += getName('', info.id, 'kfm', true); break\n\t\t\t\t\t\tdefault: record += getName('', info.id, 'k', true)\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.cause && info.cause.match(/killed/i)) record += ' was killed '\n\t\t\t\t\telse record += ' passed away '\n\t\t\t\t\tif (data[info.id] && data[info.id].death && data[info.id].death.date) record+= getDatePhrase(data[info.id].death.date,year)\n\t\t\t\t\telse if (db[info.id] && db[info.id].ddate) record+= getDatePhrase(db[info.id].ddate,year)\n\t\t\t\t\telse record+= getDatePhrase('',year)\n\t\t\t\t\tif (info.age) record += ', aged '+info.age+', '\n\t\t\t\t\tif (info.place) record += ' at '+info.place+', ';\n\t\t\t\t\trecord += getAge(' when '+given+' was ', info.date, year, bdate, born, ' years old.')\n\t\t\t\t\tif (info.cause) record += ' '+getName('', info.id, 'given', true)+'\\'s cause of death was '+info.cause+'. '\n\t\t\t\t\trecord += '</p>'\n\t\t\t\t\tif (info.informant) record += '<p>The informant was '+info.informant+'.</p>'\n\t\t\t\t\tif (info.notes.length > 0) for (n=0;n<info.notes.length;n++) { record += '<p>'+replaceNames(info.notes[n])+'</p>' }\n\t\t\t\t\tbreak\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\tcase 'birth':\n\t\t\t\t\t// check whether this is the baptism date\n\t\t\t\t\tif (db[info.id] && db[info.id].bdate) info.date = db[info.id].bdate\n\t\t\t\t\telse info.date = ''\n\t\t\t\t\tvar goingByBap = false\n\t\t\t\t\tif (info.date && info.bapdate && info.date.match('~') && info.date.replace('~','') === info.bapdate) {\n\t\t\t\t\t\tgoingByBap = true\n\t\t\t\t\t\tinfo.date = info.date.replace('~','onob ')\n\t\t\t\t\t\t}\n\t\t\t\t\trecord += '<p>'+fullname+' was born '+getDatePhrase(info.date,year)\n\t\t\t\t\tif (goingByBap) {\n\t\t\t\t\t\trecord += ' (the date of '+posspron.toLowerCase()+' baptism)'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.place) record += ' at '+info.place\n\t\t\t\t\trecord += getDBParents(', to ', id); \n\t\t\t\t\trecord += '.'\n\t\t\t\t\tif (db[id].mother && db[db[id].mother] && db[db[id].mother].f) {\n\t\t\t\t\t\trecord += ' '+posspron+' mother\\'s maiden name was '+db[db[id].mother].f+'.' \n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.informant) {\n\t\t\t\t\t\trecord += ' The informant on the birth certificate was '+info.informant+'.' \n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.focc) {\n\t\t\t\t\t\trecord += ' '+posspron+' father\\'s occupation was '+info.focc+'.' \n\t\t\t\t\t\t}\n\t\t\t\t\trecord += '</p>'\n\t\t\t\t\tif (info.siblings.length > 0) {\n\t\t\t\t\t\tif (info.siblings.length === 1) record += '<p>'+pron+' had an elder sibling, '+getName('', info.siblings[0].trim(), 'given', true)+'.</p>'\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\trecord += '<p>'+pron+' had '+info.siblings.length+' elder siblings: '\n\t\t\t\t\t\t\tfor (n=0;n<info.siblings.length;n++) {\n\t\t\t\t\t\t\t\trecord += getName('', info.siblings[n].trim(), 'given', true)\n\t\t\t\t\t\t\t\tif (n === info.siblings.length-2) record += ' and '\n\t\t\t\t\t\t\t\telse if (n<info.siblings.length-1) record += ', '\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trecord += '.</p>'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (info.bapdate) {\n\t\t\t\t\t\trecord += '<p>'+given+' was baptised '\n\t\t\t\t\t\tif (! goingByBap) {\n\t\t\t\t\t\t\tif (info.bapyear) record += getDatePhrase(info.bapdate,info.bapyear)\n\t\t\t\t\t\t\telse record += getDatePhrase(info.bapdate,year)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (info.bapplace) record += ' at '+info.bapplace+'.'\n\t\t\t\t\t\trecord += '</p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.notes.length > 0) for (n=0;n<info.notes.length;n++) { record += '<p>'+replaceNames(info.notes[n])+'</p>' }\n\t\t\t\t\tif (info.fnotes.length > 0) {\n\t\t\t\t\t\trecord += '<div class=\"footnotes\"><p>Notes</p><ol>'\n\t\t\t\t\t\tfor (n=0;n<info.fnotes.length;n++) record += '<li>'+info.fnotes[n]+'</li>'\n\t\t\t\t\t\trecord += '</ol></div>'\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\tcase 'marriage': \n\t\t\t\t\trecord += '<p>'+given+' married '\n\t\t\t\t\tif (male) record += getName('', info.bid, 'gkf', true)\n\t\t\t\t\telse record += getName('', info.gid, 'both', true)\n\t\t\t\t\trecord += ' at '+info.place+', '\n\t\t\t\t\tif (info.date) record+= getDatePhrase(info.date,year)\n\t\t\t\t\tif (male) pron = 'he'; else pron = 'she'\n\t\t\t\t\trecord += getAge(' when '+pron+' was ', info.date, year, bdate, born, ' years old')\n\t\t\t\t\trecord += '. '\n\t\t\t\t\t\n\t\t\t\t\tif (info.bage || info.bstatus || info.gocc || info.bocc || info.bparish || info.gparish) record += '<p>'\n\t\t\t\t\tif (male) {\n\t\t\t\t\t\tif (info.bage) record += 'The bride was '+info.bage+' years old'\n\t\t\t\t\t\tif (info.bage && info.bstatus) record += ' and a '+info.bstatus\n\t\t\t\t\t\telse if (info.bstatus) record += ' The bride was a '+info.bstatus\n\t\t\t\t\t\tif (info.bage || info.bstatus) record += '. '\n\t\t\t\t\t\t}\n\t\t\t\t\telse {\t\n\t\t\t\t\t\tif (info.gage) record += ' The groom was '+info.gage+' years old'\n\t\t\t\t\t\tif (info.gage && info.gstatus) record += ' and a '+info.gstatus\n\t\t\t\t\t\telse if (info.gstatus) record += ' The groom was a '+info.gstatus\n\t\t\t\t\t\tif (info.gage || info.gstatus) record += '. '\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (info.gocc) record += getName('', info.gid, 'k', true)+'\\'s occupation was '+info.gocc+'. '\n\t\t\t\t\tif (info.bocc) record += getName('', info.bid, 'k', true)+'\\'s occupation was '+info.bocc+'. '\n\t\t\t\t\n\t\t\t\t\tif (info.bparish && info.bparish === info.gparish) {\n\t\t\t\t\t\tif (info.gparish==='otp') record += ' Both were of this parish. '\n\t\t\t\t\t\telse record += ' Both were living at '+info.bparish+'. '\n\t\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (info.bparish) {\n\t\t\t\t\t\t\tif (info.bparish==='otp') record += ' The bride was of this parish'\n\t\t\t\t\t\t\telse record += ' The bride was from '+info.bparish\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (info.gparish && info.bparish) record += ' and the '\n\t\t\t\t\t\telse if (info.gparish) record += '. The '\n\t\t\t\t\t\tif (info.gparish) {\n\t\t\t\t\t\t\tif (info.gparish==='otp') record += ' groom was of this parish'\n\t\t\t\t\t\t\telse record += ' groom was from '+info.gparish\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (info.bparish || info.gparish) record += '. '\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.bage || info.bstatus || info.gocc || info.bocc || info.bparish || info.gparish) record += '</p>'\n\t\t\t\t\tif (info.bfid || info.gfid) record += '<p>'\n\t\t\t\t\tif (male) {\n\t\t\t\t\t\tif (info.bfid) record += ' The bride\\'s father was '+getName('', info.bfid, 'gf', true)\n\t\t\t\t\t\telse if (info.bfather) record += ' The bride\\'s father was '+info.bfather\n\t\t\t\t\t\tif (info.bfocc) record += ', and his occupation '+info.bfocc\n\t\t\t\t\t\tif (info.bfid || info.bfather) record += '. '\n\t\t\t\t\t\tif (info.gfocc) record += given+'\\'s father\\'s occupation was '+info.gfocc+'. '\n\t\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (info.gfid) record += ' The groom\\'s father was '+getName('', info.gfid, 'gf', true)\n\t\t\t\t\t\telse if (info.gfather) record += ' The groom\\'s father was '+info.gfather\n\t\t\t\t\t\tif (info.gfocc) record += ', and his occupation '+info.gfocc\n\t\t\t\t\t\tif (info.gfid || info.gfather) record += '. '\n\t\t\t\t\t\tif (info.bfocc) record += given+'\\'s father\\'s occupation was '+info.bfocc+'. '\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.bfid || info.gfid) record += '</p>'\n\t\t\t\t\t\n\t\t\t\t\tif (info.by && info.witnesses) record += '<p>They were married by '+info.by+' and the witnesses were '+info.witnesses+'.<p>'\n\t\t\t\t\telse { \n\t\t\t\t\t\tif (info.by) record += '<p>They were married by '+info.by+'.<p>'\n\t\t\t\t\t\tif (info.witnesses) record += '<p>Witnesses were '+info.witnesses+'.<p>'\n\t\t\t\t\t\t}\n\t\t\t\t\t//if (info.length) record += '<p>They were to be married for '+info.length+'.</p>'\n\t\t\t\t\t//console.log('death dates', db[info.bid].d, db[info.gid].d)\n\t\t\t\t\tif (db[info.bid] && db[info.gid] && db[info.bid].d && db[info.gid].d) {\n\t\t\t\t\t\tvar marrLength = Math.min(db[info.bid].d, db[info.gid].d) - year\n\t\t\t\t\t\tif (marrLength < 1) record += '<p>They were to be married for less than a year.</p>'\n\t\t\t\t\t\telse if (marrLength === 1) record += '<p>They were to be married for about a year.</p>'\n\t\t\t\t\t\telse record += '<p>They were to be married for around '+marrLength+' years.</p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.notes.length > 0) for (n=0;n<info.notes.length;n++) { record += '<p>'+replaceNames(info.notes[n])+'</p>' }\n\t\t\t\t\tif (info.fnotes.length > 0) {\n\t\t\t\t\t\trecord += '<div class=\"footnotes\"><p>Notes</p><ol>'\n\t\t\t\t\t\tfor (n=0;n<info.fnotes.length;n++) record += '<li>'+info.fnotes[n]+'</li>'\n\t\t\t\t\t\trecord += '</ol></div>'\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\tcase 'census': \n\t\t\t\t\trecord += '<p>On '+info.date+' '+year+', '+given+getAge(' (aged ', info.date, year, bdate, born, ')')\n\t\t\t\t\trecord += ' was at '+info.place+'. '\n\t\t\t\t\tif (info.head) {\n\t\t\t\t\t\trecord += ' The household included '\n\t\t\t\t\t\tif (info.relation && info.relation === 'head') record += ' '+refpron\n\t\t\t\t\t\telse if (info.relation && info.relation === 'wife') record += ' her husband '+getName('',info.head,'kf',true)\n\t\t\t\t\t\telse record += getName('',info.head,'kfm',true)\n\t\t\t\t\t\tif (! info.wife && info.children === 0) record += ''\n\t\t\t\t\t\telse if (info.wife && info.children === 0) record += ' and '\n\t\t\t\t\t\telse if (info.wife) record += ','\n\t\t\t\t\t\tif (info.wife) {\n\t\t\t\t\t\t\tif (info.relation && info.relation === 'wife') record += ' '+refpron\n\t\t\t\t\t\t\telse record += ' his wife '+getName('',info.wife,'k',true)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (info.wid && info.wid === id) record += ' ('+refpron+')'\n\t\t\t\t\t\tif (info.children) {\n\t\t\t\t\t\t\tif (info.children === 1) { record += ' and 1 child'; if (info.relation === 'child') record += ' ('+refpron+')' }\n\t\t\t\t\t\t\telse { record += ' and '+info.children+' children'; if (info.relation === 'child') record += ' (including '+refpron+')' }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\trecord += '. '\n\t\t\t\t\t\tif (info.others || info.visitors) {\n\t\t\t\t\t\t\trecord += ' There '\n\t\t\t\t\t\t\tif (info.others) {\n\t\t\t\t\t\t\t\tif (info.others === 1) { record += ' was also 1 other'; if (info.relation === 'other') record += ' ('+refpron+')' }\n\t\t\t\t\t\t\t\telse if (info.others) { record += ' were '+info.others+' others'; if (info.relation === 'other') record += ' (including '+refpron+')' }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (info.others && info.visitors) record += ' and there '\n\t\t\t\t\t\t\tif (info.visitors) {\n\t\t\t\t\t\t\t\tif (info.visitors === 1) { record += ' was also 1 visitor'; if (info.relation === 'visitor') record += ' ('+refpron+')' }\n\t\t\t\t\t\t\t\telse if (info.visitors) { record += ' were also '+info.visitors+' visitors'; if (info.relation === 'visitor') record += ' (including '+refpron+')' }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trecord += '.'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (info.serv) {\n\t\t\t\t\t\t\trecord += ' There '\n\t\t\t\t\t\t\tif (info.serv === 1) { record += ' was also 1 servant'; if (info.relation === 'serv') record += ' ('+refpron+')' }\n\t\t\t\t\t\t\telse if (info.serv) { record += ' were '+info.serv+' servants'; if (info.relation === 'serv') record += ' (including '+refpron+')' }\n\t\t\t\t\t\t\trecord += '.'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\trecord += '</p>'\n\t\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trecord += ' The household contained '+eval(info.others+info.children)+' people'\n\t\t\t\t\t\trecord += ' including '+given\n\t\t\t\t\t\tif (info.children === 1) record += ' and one child'\n\t\t\t\t\t\telse if (info.children > 0) record += ' and '+posspron.toLowerCase()+' '+info.children+' children'\n\t\t\t\t\t\trecord += '. '\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.notes.length > 0) for (n=0;n<info.notes.length;n++) { record += '<p>'+replaceNames(info.notes[n])+'</p>' }\n\t\t\t\t\tif (info.fnotes.length > 0) {\n\t\t\t\t\t\trecord += '<div class=\"footnotes\"><p>Notes</p><ol>'\n\t\t\t\t\t\tfor (n=0;n<info.fnotes.length;n++) record += '<li>'+info.fnotes[n]+'</li>'\n\t\t\t\t\t\trecord += '</ol></div>'\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t\t\n\t\t\tcase 'death': \n\t\t\t\t\t// check whether this is the burial date\n\t\t\t\t\tif (db[info.id] && db[info.id].ddate) info.date = db[info.id].ddate\n\t\t\t\t\telse info.date = ''\n\t\t\t\t\tvar goingByBur = false\n\t\t\t\t\tif (info.date && info.burdate && info.date.match('~') && info.date.replace('~','') === info.burdate) {\n\t\t\t\t\t\tgoingByBur = true\n\t\t\t\t\t\tinfo.date = info.date.replace('~','onob ')\n\t\t\t\t\t\t}\n\t\t\t\t\trecord += '<p>'+getName('', id, 'kfm', false)\n\t\t\t\t\tif (info.of) record += ' of '+info.of\n\t\t\t\t\trecord += ' died '+getDatePhrase(info.date,year)\n\t\t\t\t\tif (goingByBur) {\n\t\t\t\t\t\trecord += ' (the date of '+posspron.toLowerCase()+' burial)'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.place) record += ' at '+info.place\n\t\t\t\t\tif (male) pron = 'he'; else pron = 'she'\n\t\t\t\t\trecord += getAge(' when '+pron+' was ', info.date, year, bdate, born, ' years old')\n\t\t\t\t\trecord += '. '\n\t\t\t\t\tif (info.cause) record += ' The cause was '+info.cause+'. '\n\t\t\t\t\tif (info.occ) {\n\t\t\t\t\t\tif (male) record += ' His '; else record += ' Her '\n\t\t\t\t\t\trecord += ' occupation at the time was '+info.occ.toLowerCase()+'. '\n\t\t\t\t\t\t}\n\t\t\t\t\trecord += '</p>'\n\t\t\t\t\tif (info.informant) record += '<p>The informant was '+info.informant+'.</p>'\n\n\t\t\t\t\tif (info.burdate || info.burplace) {\n\t\t\t\t\t\tif (male) record += '<p>He '; else record += '<p>She '\n\t\t\t\t\t\trecord += ' was buried at '+info.burplace\n\t\t\t\t\t\tif (! goingByBur && info.burdate) record += getDatePhrase(info.burdate,year)\n\t\t\t\t\t\trecord += '.</p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.gravestone) {\n\t\t\t\t\t\tif (male) record += '<p>His '; else record += '<p>Her '\n\t\t\t\t\t\trecord += ' gravestone reads: <q>'+info.gravestone+'</q>.</p>'\n\t\t\t\t\t\t}\n\t\t\t\t\tif (info.probate) record += '<p>The probate index says: <q>'+info.probate+'</q>.</p>'\n\t\t\t\t\tif (info.obit) record += '<p>Obituary: <q>'+info.obit+'</q>.</p>'\n\t\t\t\t\tif (info.notes.length > 0) for (n=0;n<info.notes.length;n++) { record += '<p>'+replaceNames(info.notes[n])+'</p>' }\n\t\t\t\t\tif (info.fnotes.length > 0) {\n\t\t\t\t\t\trecord += '<div class=\"footnotes\"><p>Notes</p><ol>'\n\t\t\t\t\t\tfor (n=0;n<info.fnotes.length;n++) record += '<li>'+info.fnotes[n]+'</li>'\n\t\t\t\t\t\trecord += '</ol></div>'\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t\t\n\t\t\tcase 'residence': for (d=0;d<info.notes.length;d++) record += '<p>'+info.notes[d]+'</p>'; break\n\t\t\tcase 'notes': \n\t\t\t\tfor (d=0;d<info.notes.length;d++) record += '<p>'+replaceNames(info.notes[d])+'</p>'; \n\t\t\t\tbreak\n\t\t\tcase 'event': /*for (d=0;d<info.notes.length;d++) record += '<p>'+info.notes[d]+'</p>';*/ break\n\t\t\tcase 'background': \n\t\t\t\t\tfor (d=0;d<info.notes.length;d++) record += '<p>'+info.notes[d]+'</p>'; break\n\t\t\tcase 'figure': record += '<figure><p><a href=\"'+window.project+'/'+info.img+'\" target=\"_blank\"><img src=\"'+window.project+'/'+info.img+'\" alt=\"\"/></a></p>'\n\t\t\t\t\t\trecord += '<figcaption>'+info.caption+'</figcaption></figure>'\n\t\t\t\t\t\tbreak\n\t\t\t}\n\t\trecord += '</div>\\n'\n\t\t\t\n\t\t// draw age + year \n\t\tout += '<div class=\"dateAndRecord\"><div><div class=\"recordDate\"'\n\t\tif (type === 'background' || type === 'figure') out += ' style=\"background-color:transparent;\">'\n\t\telse out += '><span class=\"recordDateAge\">'+getAge('', info.date, year, bdate, born, '')+'</span><span class=\"recordDateAge\" style=\"font-size:1px;line-height:1px;\"> &bull; </span><span class=\"theYear\">'+year+'</span>'\n\t\t\n\t\tout += '</div></div><div class=\"record '+border+background+'\">' + record\n\t\tif (type !== 'background' && type !== 'figure') out += '<details><summary></summary><pre>'+details+'</pre></details>'\n\t\tout += '</div>\\n'\n\t\t\n\t\t// draw the key points summary\n\t\tout += '<div class=\"keypoints kp'+type+'\">'\n\t\tif (type === 'familybirth' && (who.toLowerCase() === 'son' || who.toLowerCase() === 'daughter')) { \n\t\t\tif (info.focc && male) out += '<div class=\"occ\">'+info.focc+'</div>'; \n\t\t\tif (info.place) out += '<div class=\"place\">'+info.place+'</div>' }\n\t\telse if (type === 'census') { if (info.occ) out += '<div class=\"occ\">'+info.occ+'</div>'; out += '<div class=\"place\">'+info.place+'</div>' }\n\t\telse if (type === 'birth') { out += '<div class=\"place\">'+info.place+'</div>' }\n\t\telse if (type === 'death') { if (info.occ) out += '<div class=\"occ\">'+info.occ+'</div>'\n\t\t\tif (info.of) out += '<div class=\"place\">'+info.of+'</div>'; else if (info.place) out += '<div class=\"place\">'+info.place+'</div>'; }\n\t\telse if (type === 'marriage') { \n\t\t\tif (male) { if (info.gocc) out += '<div class=\"occ\">'+info.gocc+'</div>'; if (info.gparish) out += '<div class=\"place\">'+info.gparish+'</div>' }\n\t\t\telse { \n\t\t\t\tif (info.bocc) out += '<div class=\"occ\">'+info.bocc+'</div>'; if (info.bparish) out += '<div class=\"place\">'+info.bparish+'</div>' \n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t}\n\t\telse if (type === 'familymarriage') {\n\t\t\tif (who.toLowerCase() === 'son') { if (info.gfocc) out += '<div class=\"occ\">'+info.gfocc+'</div>' }\n\t\t\tif (who.toLowerCase() === 'daughter') { if (info.bfocc) out += '<div class=\"occ\">'+info.bfocc+'</div>' }\n\t\t\t}\n\t\telse if (type === 'notes') { if (info.occ) out += '<div class=\"occ\">'+info.occ+'</div>'; if (info.place) out += '<div class=\"place\">'+info.place+'</div>' }\n\t\tif (type === 'familydeath') { \n\t\t\tif (info.iocc) out += '<div class=\"occ\">'+info.iocc+'</div>'; if (info.iplace) out += '<div class=\"place\">'+info.iplace+'</div>' }\n\t\telse out += '<div></div>'\n\t\tif (floatedIcons) out += '<p class=\"floatedIcons\">'+floatedIcons+'</p>'\n\t\tout += '</div>'\n\n\t\tout += '</div>\\n'\n\t\t}\n\t\t\n\t\t\n\t\t// create a list of places\n\t\t\n\t\t// normalise the list\n\t\tfor (i=0;i<gps.length;i++) gps[i] = gps[i].replace(/ [\\s]+/g,' ')\n\t\t\n\t\t// remove duplicates\n\t\ttemp = []\n\t\tfor (i=0;i<gps.length;i++) {\n\t\t\tvar found = false\n\t\t\tfor (j=0;j<temp.length;j++) {\n\t\t\t\tif (gps[i] === temp[j]) { found = true; break }\n\t\t\t\t}\n\t\t\tif (! found) temp.push(gps[i])\n\t\t\t}\n\t\tgps = temp\n\t\t\n\t\t// add the list\n\t\tout += '<div id=\"places\">'\n\t\tif (gps.length > 0) out +='<p class=\"placesTitle\">Places</p>'\n\t\tfor (i=0;i<gps.length;i++) out += '<p>'+gps[i]+'</p>'\n\t\t\n\t\t// crate a link to the map\n\t\tvar param = ''\n\t\tfor (i=0;i<gps.length;i++) {\n\t\t\tif (i>0) param += '|'\n\t\t\t// console.log(gps[i])\n\t\t\ttemp = gps[i].replace('<a target=\"_blank\" href=\"https://maps.google.com/maps?q=','')\n\t\t\ttemp = temp.replace('<a target=\"_blank\" href=\"http://maps.google.com/maps?q=','')\n\t\t\ttemp = temp.replace('<a target=\"_blank\" href=\"http//maps.google.com/maps?q=','')\n\t\t\ttemp = temp.replace('</a>','')\n\t\t\ttemp = temp.replace(',','§')\n\t\t\ttemp = temp.replace('\">','§')\n\t\t\t// console.log(temp)\n\t\t\tparam += temp\n\t\t\t}\n\t\tout += '<p><a href=\"map.html?locations='+param+'\" target=\"_blank\">View all on map</a></p>'\n\t\t\n\t\tout += '</div>'\n\t\tout += '</div>'\n\treturn out\n}", "static displayInfoProfile(photographer)\n {\n const infoProfile = InfoProfileFactory.create(photographer)\n document.querySelector(\".main\").appendChild(infoProfile)\n }" ]
[ "0.77738017", "0.6941505", "0.68746", "0.6629484", "0.662933", "0.65577686", "0.64657736", "0.6443781", "0.6357494", "0.635625", "0.6326772", "0.6292506", "0.6250406", "0.62418926", "0.62368184", "0.62300605", "0.6216243", "0.6216243", "0.621611", "0.6194009", "0.6180406", "0.617849", "0.6166709", "0.6163678", "0.6148357", "0.61420894", "0.61418194", "0.61382544", "0.61186665", "0.61128837", "0.60875803", "0.6076647", "0.6076451", "0.60723984", "0.60068816", "0.60060126", "0.59953344", "0.59724873", "0.59682584", "0.5942859", "0.59219646", "0.5914114", "0.59129936", "0.5902076", "0.58851767", "0.5878696", "0.58784246", "0.58605003", "0.5858957", "0.5853861", "0.5851722", "0.58390105", "0.5837819", "0.5831683", "0.5823088", "0.5820693", "0.58187944", "0.58166945", "0.5814608", "0.58138216", "0.5804456", "0.5776304", "0.577196", "0.57601535", "0.57582575", "0.5757017", "0.57488436", "0.5742559", "0.5742068", "0.57332706", "0.5732842", "0.57312244", "0.57264", "0.5723358", "0.57215375", "0.5720416", "0.57156074", "0.5714963", "0.57106155", "0.5710504", "0.5710469", "0.5710428", "0.5707877", "0.5707535", "0.5707197", "0.5706446", "0.5702301", "0.57021964", "0.57006097", "0.56979614", "0.56973696", "0.5691854", "0.5691107", "0.56854767", "0.5677224", "0.56769735", "0.56767297", "0.5672259", "0.5669859", "0.56666166" ]
0.70402473
1
Function for displaying animal buttons
function renderButtons() { // Deleting the animals prior to adding new animals // (this is necessary otherwise you will have repeat buttons) $("#buttons-view").empty(); //sort array of animals alphabetically ascending animals.sort(); // animals.sort(function(a, b){return b-a}); // Looping through the array of animals for (var i = 0; i < animals.length; i++) { var a = $("<button>"); // Adding a class of animal to our button a.addClass("animal"); // Adding a data-attribute a.attr("data-name", animals[i]); // Providing the initial button text a.text(animals[i]); // Adding the button to the buttons-view div $("#buttons-view").append(a); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderButtons() {\n \n //Deleting the animals prior to adding new animals, so that it doesn’t duplicate the results\n $(\"#buttons-view\").empty();\n \n for (var i = 0; i < animals.length; i++) {\n \n //Then dynamically generating buttons for each animal in the array\n var aBtn = $(\"<button>\");\n //adding a class\n aBtn.addClass(\"animal\");\n //adding a data attribute\n aBtn.attr(\"data-name\",animals[i]);\n //provided the initial button text\n aBtn.text(animals[i]);\n //added the button to the html\n $(\"#buttons-view\").append(aBtn);\n }\n }", "function renderButtons() {\n \n // Deleting the animals prior to adding new animals\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n \n // Looping through the array of animals\n for (var i = 0; i < animals.length; i++) {\n \n // Then dynamicaly generating buttons for each animal in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of animal to our button\n a.addClass(\"animal\");\n // Adding a data-attribute\n a.attr(\"data-name\", animals[i]);\n // Providing the initial button text\n a.text(animals[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons(){\n\n // We empty out the buttons, so we don't have repeats each time\n $(\"#buttons-view\").empty();\n\n // Loops through the array of animals\n for (var i = 0; i < animals.length; i++) {\n\n // Then dynamically generates buttons for each movie in the array.\n var b = $(\"<button>\");\n // Adding a class\n b.addClass(\"animal-button\");\n // Adding a data-attribute with a value of the animal at index i\n b.attr(\"data-name\", animals[i]);\n // Providing the button's text with a value of the animal at index i\n b.text(animals[i]);\n // Adding the button to the HTML\n $(\"#buttons-view\").append(b);\n }\n }", "function renderButtons() {\n\n // Deleting the buttons prior to adding new animals\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of animals\n for (var i = 0; i < animals.length; i++) {\n\n // Then dynamicaly generating buttons for each animal in the array\n var a = $(\"<button>\");\n // Adding a class of animal to our button\n a.addClass(\"animal\");\n // Adding a data-attribute\n a.attr(\"data-name\", animals[i]);\n // Providing the initial button text\n a.text(animals[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n\n // Deletes the animal prior to adding new animals\n $(\"#animalButtons\").empty();\n\n // Loops through the array of animals\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generates buttons for each animal in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n\n // Adds a class of animals to our button\n a.addClass(\"animals\");\n\n // Added a data-attribute\n a.attr(\"data-name\", topics[i]);\n\n // Provided the initial button text\n a.text(topics[i]);\n\n // Added the button to the buttons-view div\n $(\"#animalButtons\").append(a);\n\n }\n }", "function renderButtons() {\n\t\tconsole.log(\"starting function render buttons\");\n\n\t\t//deleting previously entered text prior to adding new text \n\t\t$(\"#buttons-view\").empty();\n\n\t\t//looping through the array of animals \n\t\tconsole.log(animals[5]);\n\t\tfor (var index = 0; index < animals.length; index++) {\n\t\t\tconsole.log(\"entering loop, currently at index= \" + index);\n\t\t\t//dynamically generating buttons for each animal in the array\n\t\t\tvar animalButton = $(\"<button>\");\n\t\t\t//adding a class of animal to button\n\t\t\tanimalButton.addClass(\"animal\");\n\t\t\t//adding a data-attribute ?\n\t\t\tanimalButton.attr(\"data-name\", animals[index]);\n\t\t\t//providing the initial button text\n\t\t\tanimalButton.text(animals[index]);\n\t\t\t//adding button to the buttons-view div\n\t\t\t$(\"#buttons-view\").append(animalButton);\n\t\t}\n\n\t}", "function renderButtons() {\n\n\t\t//make sure content is empty before adding buttons\n\t\t$('#button-div').empty();\n\n\t\t\t//loop through array of animals to generate buttons\n\t\t\tfor ( var i = 0; i < animals.length; i++) {\n\t\t\t\t\n\t\t\t\t//create a button\t\n\t\t\t\tvar a = $(\"<button>\");\n\n\t\t\t\t//add a class to each button\n\t\t\t\ta.addClass(\"animal\");\n\n\t\t\t\t//add a name attribute\n\t\t\t\ta.attr(\"animal-name\", animals[i]);\n\n\t\t\t\t//give each button text\n\t\t\t\ta.text(animals[i]);\n\n\t\t\t\t//append button in HTML\n\t\t\t\t$('#button-div').append(a);\n\n\t\t\t};\n\n\t\t}", "function renderButtons() {\n\n // Delete the content inside the movies-view div prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n\n $(\"#animalButtons\").empty();\n\n\n // Loop through the array of animals, then generate buttons for each animal in the array\n\n for (i = 0; i < animals.length; i++) {\n var $input = $('<input type=\"button\" class=\"animalButton\" data-playon=\"click\" value=\"'+animals[i]+'\"data-name=\"'+animals[i]+'\" />');\n $input.appendTo($(\"#animalButtons\"));\n }\n }", "function renderButtons() {\n \n // Deleting the movie buttons prior to adding new movie buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#animals\").empty();\n // Looping through the array of movies\n for (var i = 0; i < animals.length; i++) {\n // Then dynamicaly generating buttons for each movie in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"animal-button\");\n // Adding a data-attribute with a value of the movie at index i\n a.attr(\"data-name\", animals[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(animals[i]);\n // Adding the button to the HTML\n $(\"#animals\").append(a);\n }\n }", "function renderButtons() {\n // Devare the animals prior to adding new animals (this is necessary otherwise you will have repeat buttons) //\n $(\"#animal-buttons\").empty();\n\n // Loop through the array of animals\n for (var i = 0; i < animalList.length; i++) {\n // TDynamicaly generate buttons for each animal in the array //\n var a = $(\"<button>\");\n // Add a class of animal-btn to the button //\n a.addClass(\"animal-btn\");\n // Add a data-attribute //\n a.attr(\"data-name\", animalList[i]);\n // Provide the initial button text //\n a.text(animalList[i]);\n // Add the button to the buttons-view div //\n $(\"#animal-buttons\").append(a);\n }\n}", "function renderButtons() {\n\n\t\t// Deletes the movies prior to adding new animals (this is necessary otherwise you will have repeat buttons)\n\t\t$('#superButtons').empty();\n\n\t\t// Loops through the array of movies\n\t\tfor (var i = 0; i < villains.length; i++) {\n\n\t\t\t// Dynamicaly generates buttons for each villain in the array\n\t\t\tvar still = villains[i].images.fixed_height.url;\n\t\t\tvar animate = villains[i].images.fixed_height.url;\n\t\t\tvar a = $('<button>'); // This code $('<button>') is all jQuery needs to create the beginning and end tag. (<button></button>)\n\t\t\ta.addClass('villain'); // Added a class \n\t\t\ta.attr('data-name', villains[i]); // Added a data-attribute\n\t\t\ta.attr('src', $(this).data('animate'));\n\t\t\ta.attr('data-state', $(this).attr('data-state', 'animate'));\n\t\t\ta.text(villains[i]); // Provided the initial button text\n\t\t\t$('#superButtons').append(a); // Added the button to the HTML\n\n\t\t}\n\t}", "function renderButtons() {\n $(\"#buttons-view\").empty();\n\n for (var q = 0; q < animals.length; q++) {\n var a = $(\"<button>\");\n a.addClass(\"animal-btn\");\n a.attr(\"data-animal\", animals[q]);\n a.text(animals[q]);\n $(\"#buttons-view\").append(a);\n }\n}", "function renderButtons(){ \n\n\t// Deletes the animals prior to adding new animals (this is necessary otherwise you will have repeat buttons)\n\t$('#animalsView').empty();\n\n\t// Loops through the array of animals\n\tfor (var i = 0; i < animals.length; i++){\n\n\t\t// Then dynamicaly generates buttons for each animal in the array\n\t\tvar a = $('<button>').attr('type', 'button').addClass('btn btn-default'); //variable that creates the buttons\n\t\ta.addClass('animals'); // added a class \n\t\ta.attr('data-name', animals[i]); // added a data-attribute\n\t\ta.text(animals[i]); // provided the initial button text\n\t\t$('#animalsView').prepend(a); // added the button to the HTML\n\t}\n}", "function createButton () {\n animal = animal.toUpperCase ();\n $(\"#animalButtons\").append(\"<button type='button' class='btn btn-primary starterGif' id='\" + animal.toLowerCase() +\"'>\" + \"See \" + animal + \" gifs</button>\");\n animals.push(animal);\n }", "function renderButtons() {\n\n // Deleting the animals prior to adding new animals\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of animals\n for (var i = 0; i < animals.length; i++) {\n\n // Then dynamicaly generating buttons for each animal in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of animal-btn to our button\n a.addClass(\"animal-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", animals[i]);\n // Providing the initial button text\n a.text(animals[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n}", "function renderButtons(){\n\t\t$(\"#animalButtons\").empty();\n\t\t//loop through the array to render buttons\n\t\t//check movie-button-layout-solved.html\n\t\tfor (var i =0; i < animal.length; i++){\n\t\t\t// create a var to create a button\n\t\t\tvar btn = $(\"<button>\");\n\t\t\t//change the the newly created button attribute\n\t\t\tbtn.addClass(\"action\");\n\t\t\tbtn.attr(\"data-name\", animal[i]);\n\t\t\tbtn.addClass(\"btn btn-default\");\n\t\t\tbtn.text(animal[i]);\n\t\t\t$(\"#animalButtons\").append(btn);\n\t\t\tconsole.log(animal);\n\t\t};\n\t}", "function renderButtons() {\n\n // Deleting the animals prior to adding new animals\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < animals.length; i++) {\n\n // Then dynamicaly generating buttons for each animal in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var animalButton = $(\"<button>\");\n // Adding a class\n animalButton.addClass(\"animal\");\n // Added a data-attribute\n animalButton.attr(\"data-name\", animals[i]);\n // Provided the initial button text\n animalButton.text(animals[i]);\n // Added the button to the HTML\n $(\"#buttons-view\").append(animalButton);\n }\n }", "function renderButtons() {\n $(\"#animal-btns\").empty();\n \n // Goes through Array to create each individual button\n for (var j = 0; j < topics.length; j++) {\n var newBtn = $(\"<button>\");\n newBtn.addClass(\"animal-btn\");\n newBtn.attr(\"data-animal\", topics[j]);\n newBtn.text(topics[j]);\n\n // addes button to the DOM to be displayed\n $(\"#animal-btns\").append(newBtn);\n }\n }", "function buttonRendering() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < animalLists.length; i++) {\n //add a variable with new button\n var animalBtn = $(\"<button>\");\n\n animalBtn.text(animalLists[i]);\n\n animalBtn.addClass(\"animal\").attr(\"data-name\", animalLists[i]);\n\n $(\"#buttons-view\").append(animalBtn);\n\n }\n }", "function renderButtons(){\n $(\"#animal-slots\").empty();\n\n for (var i = 0; i < myAnimals.length; i++){\n var a = $(\"<button>\");\n a.addClass(\"each-animal\");\n a.attr(\"data-name\", myAnimals[i]);\n a.text(myAnimals[i]);\n $(\"#animal-slots\").append(a);\n };\n }", "function renderButtons() {\n\n // Deleting the animals prior to adding new animals\n // (this is necessary otherwise you will have repeat buttons)\n $(document).removeClass(\"showButton\");\n\n $(\"#buttons-view\").empty();\n\n // Looping through the array of animals\n for (var i = 0; i < animals.length; i++) {\n\n // Then dynamicaly generating buttons for each animal in the array\n var arrButton = $(\"<button>\");\n\n // Adding a class of animal-btn to our button\n arrButton.addClass(\"animal-btn\");\n\n // Adding a data-attribute\n arrButton.attr(\"data-name\", animals[i]);\n\n // Providing the initial button text\n arrButton.text(animals[i]);\n\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(arrButton);\n //$(\"#buttons-view\").removeClass(\"showButton\");\n }\n}", "function renderButtons(){\n// Deletes the movies prior to adding new movies\n// (this is necessary otherwise you will have \n//repeat buttons)\n\t\t$(\"#animalButtons\").empty();\n// Loops through the array of animals\n\t\tfor (var i = 0; i < animals.length; i++){\n\t\t\t// Then dynamicaly generates buttons for each animal in the array\n\t\t\t// Note the jQUery syntax here... \n\t\t var a = $('<button>'); // This code $('<button>') is all jQuery needs to create the beginning and end tag. (<button></button>)\n\t\t a.addClass('animal'); // Added a class \n\t\t a.addClass('btn btn-primary btn-s'); //added a button class\n\t\t a.attr('data-name', animals[i]); // Added a data-attribute\n\t\t a.attr('src', $(this).data('animate'));//make gifs animate\n\t\t a.attr('data-state'), $(this).attr('data-state', 'animate');//data state is animate\n\t\t a.text(animals[i]); // Provided the initial button text\n\t\t $('#animalButtons').append(a); // Added the button to the HTML\n\t\t}\n\t}", "function renderButtons() {\n btnsPlaceHolder.empty();\n for (var i = 0; i < animals.length; i++) {\n var button = $('<button>');\n button.addClass('animal btn btn-dark btn-lg text-white m-2');\n button.attr('data-name', animals[i]);\n button.text(animals[i]);\n btnsPlaceHolder.append(button);\n }\n}", "function createAnimalButton(animal) {\n var button = document.createElement(\"button\");\n var image = document.createElement(\"img\");\n button.className = \"animal-button\";\n button.addEventListener(\"click\", function (event) { return clickStyle(event, animal); });\n image.src = imageURL(animal);\n button.appendChild(image);\n answer.innerHTML = '';\n return button;\n }", "function displayButtons() {\n\t$(\"#buttons-col\").empty();\n\tfor (i = 0; i<animals.length; i++) {\n\t\tvar animalCaps = animals[i].charAt(0).toUpperCase() + animals[i].slice(1);\n\t\tvar nextButton = $(\"<div>\").addClass(\"searchTerm\").attr(\"data-name\", animals[i]).html(animalCaps);\n\t\t$(\"#buttons-col\").append(nextButton);\n\t}\n}", "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n // Loops through the array of animals\n for (var i = 0; i < animals.length; i++) {\n\n var a = $(\"<button>\");\n // Adds a class of animal to our button\n a.addClass(\"animal\");\n // Added a data-attribute\n a.attr(\"data-name\", animals[i]);\n // Provided the initial button text\n a.text(animals[i]);\n // Added the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n}", "function renderButtons() {\n // Deletes the animal prior to adding new animal\n $('#animal-btn').empty();\n \n // Display current animals button\n for (let i=0; i< animals.length; i++){\n $('#animal-btn').append(\n `\n <td><button type=\"button\" class=\"btn btn-info animalbtn\" data-value=\"${animals[i]}\">${animals[i]}</button></td>\n `\n )\n } \n}", "function renderButtons() {\n\n // Deleting the Marine Animals prior to adding new animals\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of marine animals\n for (var i = 0; i < marineAnimalsArr.length; i++) {\n\n // Then dynamicaly generate buttons for each marine animal in the array\n var a = $(\"<button>\");\n // Adding a class of marineAnimal-btn to our button\n a.addClass(\"marineAnimal-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", marineAnimalsArr[i]);\n // Providing the initial button text\n a.text(marineAnimalsArr[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n // preventing repeat\n $(\"#animals-button\").empty();\n\n\n for (var i = 0; i < animals.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"animal\");\n a.attr(\"data-name\", animals[i]);\n a.text(animals[i]);\n $(\"#animals-button\").append(a);\n }\n}", "function renderButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < animals.length; i++) {\n var button = $(\"<button>\");\n\n button.addClass(\"animal\");\n button.attr(\"data-name\", animals[i]);\n button.text(animals[i]);\n $(\"#buttons-view\").append(button);\n }\n\n}", "function presentAnimalButtons () {\n var i;\n var classesA=\"col s12 waves-effect waves-light btn myButton z-depth-1 animals\";\n\n //Clear out any buttons that were on the page\n $(\"#animalButtons\").empty();\n\n var h = \"Total Height: \" + screen.height;\n var w = \"Total Width: \" + screen.width;\n // console.log(\"Detected Screen Dimensions\");\n // console.log(h);\n // console.log(w);\n\n //Loop through the current array of animalButtons and generate a button for each animal\n for (i = 0; i < animalButtons.length; i++) {\n lastButton = i;\n var a = $(\"<a></a>\");\n var idString = \"animalButton\"+i;\n var iTag = $(\"<i></i>\");\n iTag.addClass(\"material-icons left img-responsive\");\n iTag.text(\"add_a_photo\");\n // console.log(\"writing idString \"+idString);\n a.attr(\"id\", idString);\n a.attr(\"animal-name\", animalButtons[i]);\n a.addClass(classesA);\n // a.addClass(classesB);\n a.text(animalButtons[i]);\n a.append(iTag);\n $(\"#animalButtons\").append(a);\n }\n \n}", "function renderButtons() {\n\n\t// Deleting the animal buttons prior to adding new animal buttons\n\t// (this is necessary otherwise we will have repeat buttons)\n\t$(\"#animals-view\").empty();\n\n\t// Looping through the array of animals\n\tfor (var i = 0; i < animals.length; i++) {\n\n\t\t// Then dynamicaly generating buttons for each animal in the array.\n\t\t// This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n\t\tvar a = $(\"<button>\");\n\t\t// Adding a class to grab data \n\t\ta.addClass(\"animal\");\n\t\t// Adding a data-attribute with a value of the animal at index i\n\t\ta.attr(\"data-name\", animals[i]);\n\t\t// Providing the button's text with a value of the animal at index i\n\t\ta.text(animals[i]);\n\t\ta.click(function() {\n\n\n\t\t//grabbing the info from the buttons\n\t\tvar animal = $(this).data(\"name\");\n\t\t//giphy api query \n\n\t\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n\t\t//ajax call to get the data from giphy\n\t\t$.ajax({\n\t\t\t\turl: queryURL,\n\t\t\t\tmethod: \"GET\"\n\t\t\t})\n\t\t\t.done(function(response) {\n\t\t\t\tvar results = response.data;\n\n\t\t\t\t//looping through the results \n\t\t\t\tfor (var i = 0; i < results.length; i++) {\n\n\t\t\t\t\t//This is adding the animal div\n\t\t\t\t\tvar animalDiv = $(\"<div>\").attr({\n\t\t\t\t\t\"class\":\"animalDiv1\"\n\t\t\t\t\t});\n\t\t\t\t\t//this is the p tag for the rating \n\t\t\t\t\tvar p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\t\t\t\t\tanimalDiv.append(p);\n\t\t\t\t\t//adding the still and animate to the gif\n\t\t\t\t\tvar animalGifAnimated=response.data[i].images.fixed_height.url;\n\t\t\t\t\tvar animalGifStill=response.data[i].images.downsized_still.url;\n\t\t\t\t\tvar animalImage = $(\"<img>\").attr({\n\t\t\t\t\t\t\"src\": animalGifAnimated,\n\t\t\t\t\t\t\"data-still\": animalGifStill,\n\t\t\t\t\t\t\"data-animate\": animalGifAnimated,\n\t\t\t\t\t\t\"data-state\": \"still\",\n\t\t\t\t\t\t\"class\":\"gif\",\n\t\t\t\t\t\t\"id\":\"animalImage\",\n\t\t\t\t\t});\n\n\t\t\t\t\tanimalImage.attr('src', results[i].images.downsized_still.url);\n\n\n\t\t\t\t\tanimalDiv.append(animalImage);\n\t\t\t\t\n\t\t\t\t\t$(\"#gifs-appear-here\").prepend(animalDiv);\n\n\t\t\t\t}\n\n\t\t\t});\n\n\n\t\t$(\"#animalImage\").on(\"click\", function() {\n // The attr jQuery method allows us to get or set the value of any attribute on our HTML element\n \n \n \n });\n\n\t\t});\n\t\t// Adding the button to the HTML\n\t\t$(\"#animals-view\").append(a);\n\t}\n\n}", "function renderButtons(){\n \n $(\"#animal-view\").empty();\n\n for (var i=0; i < queries.length; i++) {\n \n var a = $(\"<button>\");\n \n a.addClass(\"animal\");\n \n a.attr(\"data-name\", queries[i]);\n \n a.text(queries[i]);\n \n $(\"#animal-view\").append(a);\n \n }\n}", "function renderButtons() {\n\n // Deleting the animals prior to adding new animals\n // (this is necessary otherwise there will be repeat buttons)\n $(\"#buttonSection\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < animals.length; i++) {\n\n // Then dynamicaly generating buttons for each animal in the array\n var newButton = $(\"<button>\");\n // Adding a class of btn btn-primary to our button\n newButton.addClass(\"btn btn-primary gifButton\").css(\"margin\", \"10px 10px 10px 10px\");\n // Adding a data-attribute\n newButton.attr(\"data-name\", animals[i]);\n // Providing the initial button text\n newButton.text(animals[i]);\n // Adding the button to the #buttonSection\n $(\"#buttonSection\").append(newButton);\n }\n}", "function renderButtons(){\n//empty the div on the page\n\t$(\"#animal-buttons\").empty();\n//for loop through animals array. makes a button and puts the aimal name in as the data-name. this will be used when searching giphy api\n\tfor(i=0; i<animals.length; i++){\n\n\t\tnewBtn = $(\"<button class='btn btn-lg btn-primary animal'>\")\n\t\tnewBtn.attr(\"data-name\", animals[i]);\n\t\tnewBtn.html(animals[i]);\n\t\t$(\"#animal-buttons\").append(newBtn);\n\t};\n\n\n}", "function renderButtons() {\n // Deleting the buttons prior to adding new topics\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n // Then dynamically generating buttons for each animal in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of animal to our button\n a.addClass(\"animal\");\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 buttons-view div\n $(\"#buttons-view\").append(a);\n }\n } // end function renderButtons ", "function animalButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < animals.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"animal-btn\");\n a.addClass(\"btn btn-primary\"); // Add Bootstrap class\n a.attr(\"data-animal\", animals[i]);\n a.text(animals[i]);\n $(\"#buttons-view\").append(a);\n }\n}", "function renderButtons(){\n\t//empty buttons\n\t $(\"#animal-buttons\").empty();\n\t//every time the ajax is called, loop through each animal and display new buttons\n\t\tfor (var i = 0; i < animalArray.length; i++){\n\t \t\t//create new animal buttons \n\t\t\tvar newButton = $(\"<button>\");\n\t\t\t//add a class to the buttons\n\t\t\tnewButton.addClass(\"new-animals\");\n\t\t\t//add a data attribute \n\t\t\tnewButton.attr(\"data-name\", animalArray[i]);\n\t\t\t//add text to the button\n\t\t\tnewButton.text(animalArray[i]);\n\t\t\t//prepend buttons to the animal butttons Div\n\t\t\t$(\"#animal-buttons\").prepend(newButton);\n\t\t}\n}", "function animalButtons() {\n $(\"#buttons-area\").empty();\n for (var i = 0; i < animals.length; i++) {\n var button = $(\"<button>\");\n var randomColor = colors[Math.floor(Math.random() * colors.length)]\n button.addClass(\"btnClass \").css({ \"border-color\": randomColor, \"background-color\": \"black\" })\n button.attr(\"buttonName\", animals[i]).css({ \"color\": randomColor })\n button.text(animals[i]);\n $(\"#buttons-area\").append(button);\n }\n } // End of the animalButtons function", "function renderButtons() {\n // Deleting the topic buttons prior to adding new buttons\n $(\"#buttons-div\").empty();\n // Looping through the array of animals to dynamically generate buttons for each animal\n\tfor (var i = 0; i < topics.length; i++) {\n \tvar b = $(\"<button>\");\n // Adding classes\n b.addClass(\"btn btn-outline-primary btn-lg animal-button\");\n b.attr(\"id\", \"animal-button\");\n // Adding a data-attribute with a value of the topic at index i\n b.attr(\"data-name\", topics[i]);\n // Providing the button's text with a value of the topic at index i\n b.text(topics[i]);\n // Adding the button to the HTML\n $(\"#buttons-div\").append(b);\n // Console logging the array of animals\n console.log(topics[i]);\n };\n}", "function renderButtons() {\n // Deleting the gifs prior to adding new gifs\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < arrayAnimals.length; i++) {\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie to our button\n a.addClass(\"btn btn-primary\");\n // Adding a data-attribute and arrayAnimals[i]\n a.attr(\"data-animal\", arrayAnimals[i]);\n a.attr(\"id\", \"anotherButton\");\n // Providing the initial button text\n a.text(arrayAnimals[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n $(\"#images-view\").html(\"\"); //aha! this removed the previous data calls that were displayed!\n }\n }", "function renderButtons(){\n\n\t$(\"#animalButtons\").empty();\n\tfor (var i = 0; i < buttonArray.length; i++){\n\t\tvar a = $(\"<button>\")\n\t\ta.addClass(\"gif\");\n\t\ta.attr(\"data-name\", buttonArray[i]);\n\t\ta.text(buttonArray[i]);\n\t\t$(\"#animalButtons\").append(a);\n\t}\n\n}", "displayInfo() {\n clear(dogInfo())\n\n let image = document.createElement('img')\n image.src = this.image\n\n let h2 = document.createElement('h2')\n h2.innerText = this.name\n\n let button = document.createElement('button')\n button.innerText = this.buttonText()\n button.id = `toggle${this.id}`\n \n dogInfo().appendChild(image)\n dogInfo().appendChild(h2)\n dogInfo().appendChild(button)\n }", "function renderButtons() {\n\n //delting the gifs before adding new gifs \n $(\"#buttons-view\").empty();\n\n //looping through the array of animals\n for (var ctr = 0; ctr < topics.length; ctr++) {\n\n //generating buttons for each gif in the array\n var gifButton = $(\"<button>\");\n console.log(gifButton);\n // Adding a class of topic-btn to our button\n gifButton.addClass('topic-btn');\n // Adding a data-attribute\n gifButton.attr(\"data-name\", topics[ctr]);\n // Providing the initial button text\n gifButton.text(topics[ctr]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(gifButton);\n }\n}", "function renderButtons() {\n\n //clear all buttons initially\n $(\".buttonsList\").empty();\n\n //for loop to put all the animals in array into buttons\n for (var i = 0; i < animals.length; i++) {\n\n //variable a is assigned to a new button jquery\n var a = $(\"<button>\");\n\n //class is added to variable a\n a.addClass(\"btn btn-outline-info animal\");\n\n //attribute of data-name is added to each animal's name from array\n a.attr(\"data-animal\", animals[i]);\n\n //the text of the animals name from array is put on button to show\n a.text(animals[i]);\n\n //each new button is appended \n $(\".buttonsList\").append(a);\n }\n}", "function renderButtons() {\n $(\"#buttonList\").empty();\n for (var i = 0; i < animals.length; i++) {\n \tvar charButton = $(\"<button>\").html(animals[i]);\n \tcharButton.attr(\"name\",animals[i]);\n \tcharButton.addClass(\"btn btn-info animalButton\");\n \t$(\"#buttonList\").append(charButton);\n };\n}", "function button() {\n $('#panel').empty();\n for (var i = 0; i < topics.length; i++) {\n var button = $('<button>');\n button.addClass('animalButton');\n button.attr('data-name', topics[i]);\n button.text(topics[i]);\n $(\"#panel\").prepend(button);\n }\n addgif();\n}", "function insertButton() {\n $(\"#animalButtons\").empty();\n for (var i = 0; i < myanimals.length; i++) {\n var btn = $(\"<button>\");\n\n btn.addClass(\"button\");\n btn.attr(\"data-animal\", myanimals[i]);\n btn.text(myanimals[i]);\n $(\"#animalButtons\").append(btn);\n\n }\n}", "function makeButtons() {\n // deletes the shows prior to adding new shows so there are no repeat buttons\n $('#show-buttons').empty();\n // loops through the shows array\n for (var i = 0; i < animals.length; i++) {\n // dynamically makes buttons for every show in the array\n var a = $('<button>')\n a.addClass('animal'); // add a class\n a.attr('data-name', animals[i]); // add a data-attribute\n a.text(animals[i]); // make button text\n $('#show-buttons').append(a); // append the button to buttonsView div\n }\n}", "function renderButtons() {\n\n // Clear all of the buttons so that buttons don't repeat\n $(\".buttons\").empty();\n\n // Looping through the array of pokemon\n for (var i = 0; i < pokemon.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"btn btn-info poke-btn\");\n a.attr(\"data-name\", pokemon[i]);\n a.text(pokemon[i]);\n\n $(\".buttons\").append(a);\n }\n }", "function displayButtons() {\n $(\"#gifsView\").empty();\n for (var i = 0; i < topics.length; i++) {\n var gifButton = $(\"<button>\");\n gifButton.addClass(\"MovieStar\");\n gifButton.addClass(\"btn btn-primary\");\n gifButton.attr(\"data-name\", topics[i]);\n gifButton.text(topics[i]);\n $(\"#gifsView\").append(gifButton);\n }\n }", "function displaysButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var btn = $(\"<button class='gifBtn'>\");\n btn.attr(\"data-name\", topics[i]);\n btn.text(topics[i]);\n $(\"#buttons-view\").append(btn)\n\n }\n }", "function renderButtons (){\r\n//$(\"\")\r\n$(\"#button\").empty();\r\n//buttonAdder.empty();\r\n\r\nfor(var i =0 ; i < topics.length ; i++){\r\n//create button\r\nvar buttonAdder = $(\"<button>\");\r\n// add text class data to button\r\nbuttonAdder.text(topics[i]);\r\nbuttonAdder.addClass(\"animalButton\");\r\nbuttonAdder.attr(\"data-animal\", topics[i]);\r\n//append to button div \r\n$(\"#button\").append(buttonAdder);\r\n\r\n\r\n}\r\n}", "function renderButtons() {\n\n // Deleting the movie buttons prior to adding new movie buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#gifs-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < gifs.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"movie\");\n // Adding a data-attribute with a value of the movie at index i\n a.attr(\"data-name\", gifs[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(gifs[i]);\n // Adding the button to the HTML\n $(\"#gifs-view\").append(a);\n }\n }", "function renderButtons() {\n \n $(\"#gifdiv\").empty();\n \n for (var i = 0; i < person.length; i++) {\n \n var a = $(\"<button>\");\n a.addClass(\"gifDiv\");\n // Adding a data-attribute with a value of the movie at index i\n a.attr(\"data-name\", person[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(person[i]);\n // Adding the button to the HTML\n $(\"#person-view\").append(a);\n }\n }", "function renderButtons() {\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n \n // Then dynamicaly generating buttons for each movie in the array\n var button = $(\"<button>\");\n // Adding a class of movie-btn to our button\n button.addClass(\"movie-btn\");\n // Adding a data-attribute\n button.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n button.text(movies[i]);\n\n button.css({\n \"font-size\": \"30px\",\n \"background\": \"sienna\"\n });\n\n //a.css({\n // \"background-image\":\n //})\n //--------------------------------------------- \n //add the Movie Poster image to the movie-btn\n //on hover of the movie poster button, show Title, Year, Rating, and Short Plot\n //on click of movie poster button, link to movie URL\n //---------------------------------------------\n \n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(button);\n }\n }", "function renderGifs() {\n\t$('.buttons').empty();\n\tfor (var i = 0; i < animals.length; i++) {\n\t\tvar a = $(\"<button>\");\n\t\ta.addClass(\"animals\");\n\t\ta.attr(\"value\", animals[i]);\n\t\ta.html(animals[i]);\n\t\t$('.buttons').append(a);\n\t};\n}", "function renderButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < pokemons.length; i++) {\n var button = $(\"<button>\").addClass(\"gif-btn p-2 m-1 btn btn-dark btn\").attr(\"data-name\", pokemons[i]).text(pokemons[i]);\n $(\"#buttons-view\").append(button);\n }\n }", "function renderButtons() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < memes.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie to our button\n a.addClass(\"meme\");\n // Adding a data-attribute\n a.attr(\"data-name\", memes[i]);\n // Providing the initial button text\n a.text(memes[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function BeatlesButtons(beatlesList)\n{\n for (var i = 0; i < beatlesList.length; i++) {\n buttonBox.innerHTML += \"<button onClick=\"+beatlesList[i][1]+\">\" + beatlesList[i][0] + \"</button>\";\n };\n}", "function renderButtons() {\n\n // Deleting the cartoons prior to adding new cartoon shows\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of cartoon titles\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each show in the array\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of cartoon to our button\n a.addClass(\"cartoon\");\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 HTML\n $(\"#buttons-view\").append(a);\n }\n }", "function showButtons() {\n\n \t$(\"#animalButton\").empty();\n\n\tfor(var i = 0; i < topics.length; i++){\n\t\t\n\t\t var x = $(\"<button>\");\n\n\t\t x.addClass(\"animal\");\n\n\t\t x.attr(\"data-name\", topics[i]);\n\n\t\t x.text(topics[i]);\n\n\t\t $(\"#animalButton\").append(x);\n\t\t\n\t}\n\n// Event listener for all button elements\n $(\"button\").on(\"click\", function() {\n \t$(\"#animals\").empty();\n // In this case, the \"this\" keyword refers to the button that was clicked\t\n\tvar animalPic = $(this).attr(\"data-name\");\n// Constructing a URL to search Giphy for animal Gifs\n\t\tvar queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" +\n animalPic + \"&api_key=afdfd623a26640da8ec3cf24e92c8045&limit=10\";\n// Performing our AJAX GET request\n \t$.ajax({\n url: queryURL,\n method: \"GET\"\n })\n\n // After the data comes back from the API\n \t.done(function(response) {\n\n // Storing an array of results in the results variable\n var results = response.data;\n\n\n \t// Looping over every result item\n for (var i = 0; i < results.length; i++) {\n \t// Only taking action if the photo has an appropriate rating\n \tvar gifAnimalDiv = $(\"<div class='item'>\");\n \t// Storing the result item's rating\n \tvar rating = results[i].rating;\n \t// Creating a paragraph tag with the result item's rating\n \tvar x = $(\"<p>\").text(\"Rating: \" + rating);\n \t\t// Creating an image tag\n\t\t\tvar animalImage = $(\"<img>\");\n\n\t\t\tanimalImage.attr(\"data-state\", \"animate\");\n\n\t\t\tvar stillGif = results[i].images.fixed_height.url.replace(\"200.gif\", \"200_s.gif\");\n\n\t\t\tanimalImage.attr(\"data-still\", stillGif);\n\n\t\t\tanimalImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n\t\t\tanimalImage.addClass(\"gif\");\n\t\t\t// Giving the image tag an src attribute of a proprty pulled off the\n // result item\n\t\t\tanimalImage.attr(\"src\", results[i].images.fixed_height.url);\n\t\t\t// Appending the paragraph and animalImage created to the \"gifAnimalDiv\" div \n\t\t\tgifAnimalDiv.append(x);\n gifAnimalDiv.append(animalImage);\n // Prepending the gifAnimalDiv to the \"#animals\" div in the HTML\n $(\"#animals\").prepend(gifAnimalDiv);\n\t\t}\n\n\t\t \n\t\t$(\".gif\").on(\"click\", function() {\n\n\t\t\tvar state = $(this).attr(\"data-state\");\n\n\t\t\t if (state === \"still\") {\n\t\t\t \tconsole.log(\"state is still\");\n\t $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n\t $(this).attr(\"data-state\", \"animate\");\n\t } else {\n\t \tconsole.log(\"state is not still\");\n\t $(this).attr(\"src\", $(this).attr(\"data-still\"));\n\t $(this).attr(\"data-state\", \"still\");\n\t }\n \t\t});\n\n\n });\n });\n\n}", "function renderButtons(){ \n $(\"#animal-buttons\").empty();\n for (var i = 0; i < topics.length; i++){\n var newButton = $(\"<button>\") \n newButton.attr(\"class\", \"btn btn-default\");\n newButton.attr(\"id\", \"input\") \n newButton.attr(\"data-name\", topics[i]); \n newButton.text(topics[i]); \n $(\"#animal-buttons\").append(newButton); \n }\n }", "function displayButtons() {\n $(\".buttons-view\").empty();\n\n for (var i = 0; i < foodtopics.length; i++) {\n /*Do we want to put in a clear input field?\n anytime they look for a new food-that way they dont have to re-type this*/\n var showButton = $(\"<button>\");\n\n showButton.addClass(\"btnClass\");\n //added button animation (see eatin.css)\n showButton.addClass(\"animation-target\")\n\n showButton.attr(\"data-food\", foodtopics[i]);\n\n showButton.text(foodtopics[i]);\n\n $(\".buttons-view\").append(showButton);\n }\n }", "function makeButtons() {\n\n\t\t// clear the div\n\t\t$(\"#buttons-view\").empty();\n\n\t\t// Looping through the array of movies\n\t\tfor (var i = 0; i < buttons.length; i++) {\n\n\t\t\t// let's make some buttons!!\n\t\t var newButton = $(\"<button>\");\n\t\t // Adding a class of movie to our button\n\t\t newButton.addClass(\"animals\");\n\t\t // Adding a data-attribute\n\t\t newButton.attr(\"data-name\", buttons[i]);\n\t\t // Providing the initial button text\n\t\t newButton.text(buttons[i]);\n\t\t // Adding the button to the buttons-view div\n\t\t $(\"#buttons-view\").append(newButton);\n\t\t}\n\t}", "function renderButtons() {\n\n // Deleting the buttons prior to adding new Pokemon (this is necessary otherwise you will have repeat buttons)\n $(\"#rendered-buttons\").empty();\n\n // Looping through the array of Pokemon\n for (var i = 0; i < pokemon.length; i++) {\n\n // Then dynamically generating buttons for each Pokemon in the array.\n var gifButton = $(\"<button>\");\n // Adding a class of 'pokemon' to my button\n gifButton.addClass(\"pokemon\");\n // Adding a data-attribute\n gifButton.attr(\"data-name\", pokemon[i]);\n // Providing the initial button text\n gifButton.text(pokemon[i]);\n // Adding the button to the 'rendered-buttons' div\n $(\"#rendered-buttons\").append(gifButton);\n }\n}", "function animalsButtonFn(){ \n $('#btnDiv').empty();\n for(i=0;i<animalsArray.length;i++){ \n $('#btnDiv').append('<button class=\"animalbtn btn btn-success\">' + animalsArray[i] +'</button>');\n }\n }", "function renderButtons() {\n\n // Deleting the emotions prior to adding new emotions to avoid repeat buttons\n $(\"#buttons-view\").empty();\n\n // Looping through the array of emotions and dynamically generating buttons for each emotion in the array\n for (var i = 0; i < emotions.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"emotion-btn\");\n a.attr(\"data-name\", emotions[i]);\n a.text(emotions[i]);\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n\n // Deletes the gif prior to adding new ones\n $(\"#buttons-view\").empty();\n // Loops through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n var newButton = $(\"<button>\");\n \n newButton.addClass(\"sports\");\n \n newButton.attr(\"data-name\", topics[i]);\n \n newButton.text(topics[i]);\n // Added the button to the buttons-view div\n $(\"#buttons-view\").append(newButton);\n }\n }", "function renderButtons() {\n\t// Clears button array to start\n\t$(\"#button-array\").empty();\n\t// Using all items in the array\n\tfor (var i = 0; i < aussieFauna.length; i++) {\n\t// Creates a new button\n\taussieButton = $(\"<button>\");\n\t// Adds an attribute to identify specific button (not necessary, but called later and likely not bad practice)\n\taussieButton.attr(\"aussie-animal\", aussieFauna[i]);\n\t// Adds the button classes\n\taussieButton.addClass(\"aussie-button btn btn-danger\");\n\t// Adds the button text\n\taussieButton.text(aussieFauna[i]);\n\t// Displays the buttons in the preexisting array\n\t$(\"#button-array\").append(aussieButton);\n\t}\n}", "function renderButtons() {\n\n // Deleting the famousPeople buttons prior to adding new famousPeople\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of famousPeople\n for (var i = 0; i < famousPeople.length; i++) {\n\n // Then dynamically generate buttons for each person in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button><h4>\");\n // Adding a class of person to our button\n a.addClass(\"person\");\n // Adding a data-attribute\n a.attr(\"data-name\", famousPeople[i]);\n // Providing the initial button text\n a.text(famousPeople[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n\t//deletes the area to prevent duplicates\n\t$(\"#buttonsArea\").empty();\n\t//loops through existing array of fluffies\n\tfor (var i = 0; i < fluffies.length; i++) {\n\t\t//dynamically generates a button for each item in fluffies array\n\t\tvar btn = $(\"<button>\");\n\t\t//adds a new class of 'newSubject' to each button\n\t\tbtn.addClass(\"newSubject\");\n\t\t//adds a data attribute to each data-name based on the item in the array\n\t\tbtn.attr(\"data-name\", fluffies[i]);\n\t\t//adds the initial button text\n\t\tbtn.text(fluffies[i]);\n\t\t// Adds the button to the button area in the html\n\t\t$(\"#buttonsArea\").append(btn);\n\t};\n}", "function displayAnimalInfo() {\n\n\t\tvar animal = $(this).attr(\"data-name\");\n\t\tconsole.log(\"animal= \" + animal);\n\t\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\t\tconsole.log(\"queryURL= \" + queryURL);\n\t\t\t//creating AJAX call for specific animal button being called\n\t\t\t$.ajax({ url: queryURL, method: \"GET\" }).done(function(response) {\n\t\t\tconsole.log(response);\n\t\t\t\t//creating a div to hold the gifs (I already have a div created in html file #gifs-view)\n\t\t\t\t//var gifDiv = $(\"<div class='gif'>\");\n\n\t\t\t\tfor (var index = 0; index < response.data.length; index++) {\n\t\t\t\t\t//storing the rating data\n\t\t\t\t\tvar rating = response.data[index].rating; \n\t\t\t\t\tconsole.log(rating);\n\n\t\t\t\t\tvar image = response.data[index].images.downsized.url;\n\t\t\t\t\tconsole.log(image);\n\n\t\t\t\t\t//add rating to page \n\t\t\t\t\t$(\"#gifs-view\").append(\"Rating: \" + rating);\n\n\t\t\t\t\t//add gifs to page \n\t\t\t\t\t$(\"#gifs-view\").append(\"<img src='\" + image + \"'>\");\n\t\t\t\t\tconsole.log(image);\n\t\t\t\t}\n\n\t\t\t});\n\n\t}", "function giphyButtons() {\n\n $(\"#puppyLibrary\").empty();\n\n for ( var i = 0; i < allPuppies.length; i++) {\n var button = $(\"<button>\" + allPuppies[i] + \"</button>\");\n button.attr(\"data-dog-type\",allPuppies[i]);\n $(\"#puppyLibrary\").append(button);\n }\n }", "function renderButtons() {\n console.log(renderButtons);\n // prevents all existing buttons from creating a new row with each new button addition\n $(\"#buttons-view\").empty();\n\n\n\n // For Loop\n for (var i = 0; i < celeb.length; i++) {\n\n // Buttons for each gif in the array\n \n var x = $(\"<button class='btn btn-info'>\");\n // Adding a class of gif to button\n x.addClass(\"gif\");\n // Adding a data-attribute\n x.attr(\"data-name\", celeb[i]);\n // Providing the initial button text\n x.text(celeb[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(x);\n }\n }", "function renderButtons() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie to our button\n a.addClass(\"movie\");\n // Adding a data-attribute\n a.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n a.text(movies[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n // Deleting the buttons prior to adding new actor buttons\n $(\"#actorButtons\").empty();\n\n // Looping through the array of actors\n for (var i = 0; i < actors.length; i++) {\n // Generating buttons for each actor in the array\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"movie-btn\");\n // Adding a data-attribute with a value of the actor at index i\n a.attr(\"data-name\", actors[i]);\n // Providing the button's text with a value of the actor at index i\n a.text(actors[i]);\n // Adding the button to the HTML\n $(\"#actorButtons\").append(a);\n }\n} // END OF FUNCTION", "function renderButtons() {\n //deleting existing button info so there are not duplicates\n $(\"#buttons-appear-here\").empty();\n\n //looping through the array of emotions\n for (var i = 0; i < emotionsArray.length; i++) {\n //create a button\n var a = $(\"<button>\");\n //add a class of emotion-btn to the button\n a.addClass(\"emotion-btn btn-group btn-group-toggle btn-secondary\");\n //add an emotion attribute\n a.attr(\"data-emotion\", emotionsArray[i]);\n //Providing the inital button text\n a.text(emotionsArray[i]);\n //Adding the button to the buttons-appear-here div\n $(\"#buttons-appear-here\").append(a);\n\n }\n }", "function renderButtons() {\n // start by emptying the button-area div every time so that there are no duplicates\n $(\"#button-area\").empty();\n for (var i=0; i < topics.length; i++) {\n // create button element for each array item\n var button = $(\"<button>\");\n // Add classes\n button.addClass(\"btn btn-info tv-show\");\n // Add data attribute\n button.attr(\"data-name\", topics[i]);\n // Add text\n button.text(topics[i]);\n // Append to #button-area\n $(\"#button-area\").append(button);\n } \n }", "function renderButtons() {\n\n // Delete other buttons prior to adding new ones.\n $(\"#buttonsHolder\").empty();\n\n // Loop through array of gif topics.\n for (var i = 0; i < gifTopics.length; i++) {\n // Dynamically generate buttons for each gif topic in the array with $(\"<button\").\n var topicButton = $(\"<button>\");\n\n // Add class of \"gifBtn\" to button.\n topicButton.addClass(\"gifBtn\");\n\n // Add data attribute.\n topicButton.attr(\"data-name\", gifTopics[i]);\n\n // Provide initial button text.\n topicButton.text(gifTopics[i]);\n\n // Add the button to id=\"buttonsHolder\".\n $(\"#buttonsHolder\").append(topicButton);\n }\n }", "function renderButtons() {\n $(\".buttons-area\").empty();\n\n for (var i=0; i<categories.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"new-gif\");\n a.attr(\"data-name\", categories[i]);\n a.text(categories[i]);\n $(\".buttons-area\").append(a);\n }\n }", "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n\n for (i = 0; i < topics.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"topicgif\");\n\n a.attr(\"data-name\", topics[i]);\n\n a.text(topics[i]);\n\n $(\"#buttons-view\").append(a);\n }\n }", "function loadButtons(arrayOfTopics) {\n $(\".buttonArea\").empty();\n\n arrayOfTopics.forEach(function(arrayItem) {\n $(\".buttonArea\").append(\n $(\"<button>\", {\n type: \"button\",\n class: \"btn btn-success btn-sm m-3 animalButton\",\n text: arrayItem.toUpperCase()\n }).on(\"click\", function() {\n // console.log(\"Clicked Animal Button : \" + $(this).text());\n getGifs($(this).text());\n })\n );\n });\n }", "function renderButtons() {\n // Deletes the movies prior to adding new movies\n $('.buttons-view').empty();\n // Loops through the array of topics to create buttons for all topics\n for (var i = 0; i < topics.length; i++) {\n var createButtons = $('<button>');\n createButtons.addClass('topic btn btn-success');\n createButtons.attr('data-name', topics[i]);\n createButtons.text(topics[i]);\n $('.buttons-view').append(createButtons);\n }\n }", "function renderButtons() {\n\n // Deleting the buttons prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie to our button\n a.addClass(\"movie\");\n // Adding a data-attribute\n a.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n a.text(movies[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n // deletes the users input before adding new 'emotions', no repeat buttons\n $(\"#buttons-view\").empty();\n\n // loop through the array\n for (var i = 0; i < emotions.length; i++) {\n // Then dynamicaly generating buttons for each 'emotion' in the array\n var newButton = $(\"<button>\");\n // Adding a class of emotions-btn to our button\n newButton.addClass(\"emotion-btn\");\n // Adding a data-attribute\n newButton.attr(\"data-name\", emotions[i]);\n // Providing the initial button text\n newButton.text(emotions[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(newButton);\n }\n }", "function renderButtons() {\n\n // Deleting the buttons prior to adding new button to avoid repeats\n\n $(\"#buttons-view\").empty();\n\n // Looping through the array of terms\n for (var i = 0; i < nbaGifs.length; i++) {\n\n // Then dynamicaly generating buttons for each term in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of nbaGif to our button\n a.addClass(\"nbaGif\");\n // Adding a data-attribute\n a.attr(\"data-person\", nbaGifs[i]);\n // Providing the initial button text\n a.text(nbaGifs[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n}", "function listAnimals() {\n showAnimals.innerHTML =\n `<div>\n <div class=\"animalThumbnail\" onclick=\"displayAnimal('lion')\"> <img src=\"images/lion.png\"> </img></div>\n <div class=\"animalThumbnail\" onclick=\"displayAnimal('llama')\"> <img src=\"images/llama.png\"/> </div>\n <div class=\"animalThumbnail\" onclick=\"displayAnimal('owl')\"> <img src=\"images/owl.png\"/> </div>\n <div class=\"animalThumbnail\"onclick=\"displayAnimal('turtle')\"> <img src=\"images/turtle.png\"/> </div>\n </div>`\n}", "function renderButtons() {\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie-btn to our button\n a.addClass(\"movie-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n a.text(movies[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n\n // Deletes the athletes prior to adding new athletes\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n for(var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generates buttons for each athlete in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var athleteAdd = $(\"<button>\");\n // Adds a class of athlete to our button\n athleteAdd.addClass(\"athlete\");\n // Added a data-attribute\n athleteAdd.attr(\"data-name\", topics[i]);\n // Provided the initial button text\n athleteAdd.text(topics[i]);\n // Added the button to the buttons-view div\n $(\"#buttons-view\").append(athleteAdd);\n }\n }", "function renderButtons() {\n //deletes all existing buttons\n $(\"#buttons-view\").empty();\n\n // loop through array\n for (var i = 0; i < villains.length; i++) {\n //new button tag\n var newButton = $(\"<button>\");\n // class=\"villain-btn\" given to button tag\n newButton.addClass(\"villain-btn\");\n // data-name is the villains name\n newButton.attr(\"data-name\", villains[i]);\n // the label of each button\n newButton.text(villains[i]);\n // appending onto html\n $(\"#buttons-view\").append(newButton);\n }\n}", "function button(){\n\n\t$(\"#ballButton\").empty();\n\n\tfor (var i =0 ; i < bBall.length; i++) {\n\n\t\tvar athleteButton = $(\"<button>\");\n\n\t\tathleteButton.attr(\"data-name\", bBall[i]);\n\t\t\n\t\tathleteButton.text(bBall[i]);\n\n\n\t\t$(\"#ballButton\").append(athleteButton);\n\t}\n\n}", "function renderButtons() {\n\n // Deleting the movie buttons prior to adding new movie buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttonspace\").empty();\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"topic\");\n // Adding a data-attribute with a value of the movie at index i\n a.attr(\"data-name\", topics[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(topics[i]);\n // Adding the button to the HTML\n $(\"#buttonspace\").append(a);\n\n \n }\n }", "function renderButtons(){ \n\n\t\t// Deletes the movies prior to adding new movies (this is necessary otherwise you will have repeat buttons)\n\t\t$('#moviesView').empty();\n\n\t\t// Loops through the array of movies\n\t\tfor (var i = 0; i < movies.length; i++){\n\n\t\t\t// Then dynamicaly generates buttons for each movie in the array\n\n\t\t\t// Note the jQUery syntax here... \n\t\t var a = $('<button>') // This code $('<button>') is all jQuery needs to create the beginning and end tag. (<button></button>)\n\t\t a.addClass('movie'); // Added a class \n\t\t a.attr('data-name', movies[i]); // Added a data-attribute\n\t\t a.text(movies[i]); // Provided the initial button text\n\t\t $('#moviesView').append(a); // Added the button to the HTML\n\t\t}\n\t}", "function renderButtons() {\n\n // Deletes the shows prior to adding new shows\n $(\"#buttons-all\").empty();\n\n // Loops through the array \n for (var i = 0; i < myTVShows.length; i++) {\n // variable of an empty button\n var a = $(\"<button>\");\n // Adds a class of btn btn-info to our button for bootstrap\n a.addClass(\"btn btn-primary giphy-btn\");\n // Added a data-attribute\n a.attr(\"data-name\", myTVShows[i]);\n // Added a type-attribute for bootstrap\n a.attr(\"type\", \"button\");\n // Provided the initial button text\n a.text(myTVShows[i]);\n // Added the button to the buttons-view div\n $(\"#buttons-all\").append(a);\n }\n }", "function buttonCreate() { \n\n\t// make sure the buttonArea is empty before redrawing\n\t$(\"#buttonArea\").empty(); \t\t//side note: Ask if this is correct and why it is correct\n\n\n\t// now create a loop to get through the array of animals I created\n\tfor(var i = 0; i<animals.length; i++) {\n\n\t\t// creating buttons dynamically in the array\n\t\tvar button= $(\"<button>\");\n\n\t\t//adding a class to the selected element\n\t\tbutton.addClass(\"animalButton\"); \n\n\t\t// adding the attribute \"data-animal\" to the animal selected within the array\n\t\tbutton.attr(\"data-animal\", animals[i]);\n\n\t\t//putting text on the dynamically created button\n\t\tbutton.text(animals[i]);\n\n\n\t\t// now adding the button to the html\n\t\t$(\"#buttonArea\").append(button);\n\n\t}\n}", "function renderButtons() {\n //empty current buttons\n $(\"#gif-buttons\").empty();\n\n var giphy = $(this).attr(\"id\");\n\n //created a for loop that runs through array\n for (var i = 0; i < gifs.length; i++) {\n\n //created a button variable that pulls in gifs from array - makes button\n var button = $(\"<button>\" + gifs[i] + \"</button>\");\n //add \"gif\" class to button\n button.addClass(\"gifbutton\");\n //gave button attribute of \"id\" and gifs array pulled in\n button.attr(\"id\", gifs[i]);\n //\"gif buttons\" display is appended to button variable\n $(\"#gif-buttons\").append(button);\n }\n }", "function renderButtons () { \n\n\t\t// loops through the array of topics\n\t\tfor (var i = 0; i < topics.length; i++) {\n\n\t\t var a = $('<button>')\n\t\t a.addClass('topic button'); // add a class \n\t\t a.attr('data-name', topics[i]); // adds a data-attribute\n\t\t a.text(topics[i]); // initial button text\n\t\t $('#buttonsDiv').append(a); // add button to the HTML\n\t\t}\n\t}", "function renderButtons() {\n\n // Clearning the #buttons div prior to adding new items\n $(\"#buttons\").empty();\n\n // Looping through the summerArray\n for (var i = 0; i < summerArray.length; i++) {\n\n var newButton = $(\"<button>\");\n newButton.addClass(\"btn btn-info\");\n newButton.addClass(\"summerBtn\");\n newButton.attr(\"data-name\", summerArray[i]);\n newButton.text(summerArray[i]);\n $(\"#buttons\").append(newButton);\n }\n }", "function renderButtons() {\n\n // Deleting the vacation spots prior to adding new vacation spots\n $(\"#buttons-view\").empty();\n\n // Looping through the array of locations\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each vacation spot in the array\n var a = $(\"<button>\");\n // Adding a class of vacation-btn to our button\n a.addClass(\"vacation-btn\");\n // Adding a spot-attribute\n a.attr(\"spot-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }" ]
[ "0.7541866", "0.75310713", "0.7530555", "0.7520065", "0.7504506", "0.74898547", "0.74637014", "0.7461219", "0.74562323", "0.7450784", "0.74325067", "0.74126303", "0.7411726", "0.74049664", "0.7397738", "0.737985", "0.73462707", "0.7341651", "0.73315483", "0.7316369", "0.7311078", "0.73066986", "0.7253456", "0.72499204", "0.7231773", "0.7222301", "0.72017497", "0.71849406", "0.71716654", "0.7171454", "0.7144169", "0.71436745", "0.71426886", "0.71167517", "0.70956475", "0.7080505", "0.7080477", "0.7076407", "0.7043194", "0.70407486", "0.6994228", "0.69869155", "0.698629", "0.69741297", "0.6971343", "0.6964728", "0.68879795", "0.685305", "0.68220294", "0.68070334", "0.6795863", "0.6784386", "0.67736834", "0.6766579", "0.6757229", "0.674179", "0.67381483", "0.67238086", "0.671732", "0.6708853", "0.6696686", "0.66966796", "0.6685115", "0.66716594", "0.66713524", "0.6671041", "0.6660292", "0.66550606", "0.66193473", "0.6610755", "0.66089374", "0.6603501", "0.65981114", "0.6589225", "0.65858394", "0.6573237", "0.65664333", "0.65574014", "0.6543709", "0.65346515", "0.6530162", "0.6529492", "0.65277946", "0.65210795", "0.6514957", "0.65114415", "0.6509924", "0.65080726", "0.65067", "0.6504311", "0.64958066", "0.6494535", "0.6490776", "0.64877576", "0.64804053", "0.64755666", "0.6468032", "0.64675784", "0.64674824", "0.64534986" ]
0.7556065
0
can be expressed as where is a nonempty substring of and is a nonempty substring of . is a palindromic string. The length of is as long as possible. For each of the pairs of strings ( and ) received as input, find and print string on a new line. If you're able to form more than one valid string , print whichever one comes first alphabetically. If there is no valid answer, print instead. Input Format The first line contains a single integer, , denoting the number of queries. The subsequent lines describe each query over two lines: The first line contains a single string denoting . The second line contains a single string denoting . Constraints and contain only lowercase English letters. Sum of |a| over all queries does not exceed Sum of |b| over all queries does not exceed Output Format For each pair of strings ( and ), find some satisfying the conditions above and print it on a new line. If there is no such string, print instead. Sample Input 3 bac bac abc def jdfh fds Sample Output aba 1 dfhfd Explanation We perform the following three queries: Concatenate with to create . We're given and ; because both strings are composed of unique characters, we cannot use them to form a palindromic string. Thus, we print . Concatenate with to create . Note that we chose these particular substrings because the length of string must be maximal.
function buildPalindrome(a, b) { // compare the first string char by char to the second string char by char // iterate through each char of first string // compare current char to each char of second string starting from the end // if there's a match attempt palindrome assembly // compare char right of cur char in first string to char left of cur char in second string // if matches are successful and we run out of char to compare log as palindrome // iterate through each char of first string // compare current char to each char of second string starting from the end // if there's a match attempt palindrome assembly // combine both strings from using matches as start/end points ex: ('dfebhbe' + 'xfd') ('ac' + 'ba' ) ('dfh' + 'fd') // compare characters starting from the center (if odd length skip middle) (dfebhbexfd) let short, long if (a.length > b.length ) { long = a; short = b; } else { long = b; short = a; } findFragment(short.reverse(), long, short.length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longPelidrom(str) {\n let n = str.length;\n\n // make dp table\n let table = new Array(n);\n for (let i = 0; i < n; i++) table[i] = new Array(n);\n\n //all substring with size one is alwasys pelindrom\n let max_length = 1;\n for (let i = 0; i < n; i++) table[i][i] = true;\n\n // chske substring with size 2\n let start = 0;\n for (let i = 0; i < n - 1; i++) {\n if (str[i] == str[i + 1]) {\n table[i][i + 1] = true;\n start = i;\n max_length = 2;\n }\n }\n\n //chek for size more then 3\n //k is length of substring\n for (let k = 3; k <= n; ++k) {\n // i is denoted the starting index of=substring\n for (let i = 0; i < n - k + 1; ++i) {\n // value of j is show the last index of substring\n\n let j = i + k - 1;\n\n if (table[i + 1][j - 1] && str[i] == str[j]) {\n table[i][j] = true;\n if (k > max_length) {\n start = i;\n console.log(\"i = \" + i);\n max_length = k;\n console.log(k);\n }\n }\n }\n }\n return str.substring(start, start + max_length);\n}", "function longestPalindromicSubstring(string) {\n if (string.length === 1 || !string.length) return string;\n let count = 0;\n let palindrome = '';\n \n for (let i = 0; i < string.length; i++) {\n\n // First while loop, with current letter as the middle\n let left = i - 1;\n let right = i + 1;\n let temp = 1;\n let curPal = string[i]\n while (left >= 0 && right < string.length) {\n if (string[left] === string[right]) {\n curPal = string[left] + curPal + string[right];\n temp += 2;\n ++right;\n --left;\n } else break;\n }\n if (temp > count) {\n palindrome = curPal;\n count = temp;\n }\n \n // Second while loop scenario, with between i and i+1 as the middle\n left = i;\n right = i + 1;\n temp = 0;\n curPal = '';\n\n while (left >= 0 && right < string.length) {\n if (string[left] === string[right]) {\n curPal = string[left] + curPal + string[right];\n temp += 2;\n ++right;\n --left;\n } else break;\n }\n if (temp > count) {\n palindrome = curPal;\n count = temp;\n }\n }\n return palindrome\n }", "function solve2(s) {\n // Write your code here\n let ret_str = ''\n for (let i = 0; i < s.length; i++) {\n if (s[i] !== s[i+1] || i + 1 > s.length) ret_str += s[i]\n }\n // console.log(ret_str)\n return ret_str\n}", "function alg(str1, str2) {\n\tlet out = \"\";\n\tlet arr = [];\n\n\tfor (let l of str1) {\n\t\tlet index = str1.indexOf(l);\n\t\t// If the chars are the same\n\t\tif (l === str2[index]) {\n\t\t\tout += l;\n\t\t} else {\n\t\t\t// if there is a substring add to arr\n\t\t\tif (out.length > 0) {\n\t\t\t\tarr.push(out);\n\t\t\t}\n\t\t\tout = \"\";\n\t\t}\n\t}\n\tconsole.log(arr);\n\t// Compare and return If there is sub strings\n\tlet output = arr[0];\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tif (output.length > arr[i].length) output = arr[i];\n\t}\n\tif (output !== undefined) return output;\n\n\treturn undefined;\n}", "function morganAndString(a, b) {\n\n a += 'z';\n b += 'z';\n\n let final = '';\n let i = 0, j = 0;\n\n loop1: for (i = 0, j = 0; i < a.length || j < b.length; ) {\n if (a.charAt(i) === 'z') {\n i++;\n break loop1;\n }\n if (b.charAt(j) === 'z') {\n j++;\n break loop1;\n }\n if (a.charAt(i) < b.charAt(j)) {\n // a is lower\n final += a.charAt(i);\n i++;\n } else if (a.charAt(i) > b.charAt(j)) {\n // b is lower\n final += b.charAt(j);\n j++;\n } else {\n // charaters are equal\n if (a.charAt(i) === 'z' || b.charAt(j) === 'z') {\n i++;\n j++;\n }\n\n let startingI = i,\n startingJ = j,\n prev = '';\n\n loop2: while (a.charAt(i) === b.charAt(j)) {\n i++;\n j++;\n\n if (i >= a.length && j >= b.length) {\n i = startingI;\n j = startingJ;\n break loop2;\n } else if (i >= a.length) {\n prev = b.charAt(startingJ);\n while (b.charAt(startingJ) <= prev) {\n final += b.charAt(startingJ);\n startingI++;\n }\n i = startingI;\n j = startingJ;\n } else if (j > b.length) {\n prev = a.charAt(startingI);\n while (a.charAt(startingI) <= prev) {\n final += a.charAt(startingI);\n startingI++;\n }\n i = startingI;\n j = startingJ;\n }\n }\n\n if (a.charAt(i) <= b.charAt(j)) {\n prev = a.charAt(startingI);\n while (a.charAt(startingI) <= prev) {\n final += a.charAt(startingI);\n prev = a.charAt(startingI);\n startingI++;\n }\n i = startingI;\n j = startingJ;\n }\n\n if (a.charAt(i) > b.charAt(j)) {\n prev = b.charAt(startingJ);\n while (b.charAt(startingJ) <= prev) {\n final += b.charAt(startingJ);\n prev = b.charAt(startingJ);\n startingJ++;\n }\n i = startingI;\n j = startingJ;\n }\n }\n }\n // append remaining string to final answer\n if (i < a.length) {\n final += a.substring(i);\n }\n if (j < b.length) {\n final += b.substring(j);\n }\n\n return final=final.replace('z','');\n}", "function SearchingChallenge1(str) {\n const array = [...str];\n const k = Number(array.shift());\n\n let substring = [];\n let n = 1;\n\n let index = 0;\n\n let res = [];\n\n while (index < array.length) {\n if (substring === [] || substring.includes(array[index])) {\n substring.push(array[index]);\n index++;\n console.log(\"substring\", substring);\n } else if (!substring.includes(array[index]) && n <= k) {\n substring.push(array[index]);\n n++;\n index++;\n console.log(\"substring\", substring);\n } else {\n res.push(substring.join(\"\"));\n console.log(\"res during\", res);\n substring = [];\n n = 1;\n index--;\n console.log(\"substring after []\", substring.length);\n }\n }\n\n res.push(substring.join(\"\"));\n\n console.log(\"res final\", res);\n\n const lengths = res.map((e) => e.length);\n\n return res[lengths.indexOf(Math.max(...lengths))];\n}", "function longestPalindromicSubstring(string) {\n let longestString = \"\"\n //for each char in string compute all possible substrings\n\tfor(let i = 0; i < string.length; i++) {\n\t\tfor(let j = i + 1; j < string.length + 1; j++) {\n\t\t\tlet stringTest = string.substring(i, j)\n\t\t\t//console.log({stringTest})\n\t\t\tif(isPalindrome(stringTest)) {\n\t\t\tlongestString = longestString.length < stringTest.length ? stringTest : longestString\n\t\t\tconsole.log({longestString});\n\t\t\t}\n\t\t}\n\t}\n\treturn longestString\n}", "function palindromicSubstring(str){\n let count = str.length;\n\n for(let i=0; i<str.length; i++){\n count += countPalindrome(str, i, i + 1) + countPalindrome(str, i, i + 2) ;\n }\n\n return count;\n}", "function longestPalindromicSubstring(string) {\n // Write your code here.\n let currentLongest = [0, 1];\n for (let i = 1; i < string.length; i++) {\n const odd = getLongestPalindromeFrom(string, i - 1, i + 1);\n const even = getLongestPalindromeFrom(string, i - 1, i);\n const longest = odd[1] - odd[0] > even[1] - even[0] ? odd : even;\n currentLongest = currentLongest[1] - currentLongest[0] > longest[1] - longest[0] ? currentLongest : longest;\n }\n let result = string.slice(currentLongest[0], currentLongest[1])\n console.log(result);\n return string.slice(currentLongest[0], currentLongest[1]);\n}", "function longestPalindrome(str) {\n\n //it's only a palindrome if the first and last letter are the same and the pattern repeats to the \"center\"\n //check first and last character, if they are different, check first and second-to-last character\n //when you find a match, repeat the process\n\n let leftIndex = 0;\n let longest = \"\";\n\n while (leftIndex < str.length) {\n\n let rightIndex = str.length - 1;\n\n while (rightIndex >= leftIndex) {\n let offset = 0;\n\n while (str[leftIndex + offset] === str[rightIndex - offset] && leftIndex + offset < str.length) {\n offset++;\n }\n\n if (leftIndex + (2 * offset) >= rightIndex) {\n let palindrome = str.substring(leftIndex, rightIndex + 1);\n\n if (palindrome.length === str.length) {\n return str;\n }\n\n if (palindrome.length > longest.length) {\n longest = palindrome;\n }\n\n }\n rightIndex--;\n }\n leftIndex++;\n }\n\n return longest;\n\n // let longest = \"\";\n //\n // let rightIndex = str.length - 1;\n //\n // while (rightIndex >= 0) {\n //\n // let leftIndex = 0;\n //\n // while (leftIndex < rightIndex) {\n //\n // let count = 0;\n //\n // while (str[leftIndex] === str[rightIndex] && rightIndex > leftIndex) {\n // leftIndex++;\n // rightIndex--;\n // count++;\n // }\n //\n // if (rightIndex <= leftIndex) {\n // let palindrome = str.substring(leftIndex - count, rightIndex + count + 1);\n // if (palindrome.length > longest.length) {\n // longest = palindrome;\n // }\n // }\n // leftIndex++;\n // }\n // rightIndex--;\n // }\n //\n // return longest;\n\n //length <= 1 returns self\n //\n // let longestPalindrome = \"\";\n // let leftIndex = 0;\n //\n //\n // //example: badbob popop abacbacba\n //\n //\n // while (leftIndex < str.length) {\n //\n // let rightIndex = str.length - 1;\n //\n // while (rightIndex > leftIndex) {\n //\n // while (str[leftIndex] !== str[rightIndex] && rightIndex > leftIndex) {\n // rightIndex--;\n // }\n //\n // let iterations = (rightIndex - leftIndex) / 2;\n // let count = 0;\n //\n // while (count < iterations) {\n // leftIndex++;\n // rightIndex--;\n //\n // if (str[leftIndex] !== str[rightIndex]) {\n // break;\n // }\n // count++;\n // }\n //\n // if (count === iterations) {\n // let palindrome = str.substring(leftIndex - iterations, rightIndex + iterations + 1);\n // if (palindrome.length > longestPalindrome.length) {\n // longestPalindrome = palindrome;\n // }\n // }\n // rightIndex--;\n // }\n // leftIndex++;\n // }\n //\n // return longestPalindrome;\n}", "function findPalidrom(input) {\n var words = true;\n var spacesOut = function (sentence) {\n var letters = \"\";\n for (var i = 0; i < sentence.length; i++) {\n if (sentence[i] === \" \") {\n continue;\n }\n else {\n letters += sentence[i];\n }\n } return letters;\n }\n var finalArray = spacesOut(input);\n for (var i = 0, j = finalArray.length - 1; i < finalArray.length / 2; i++ , j--) {\n if (finalArray[i] === finalArray[j]) {\n continue;\n }\n else {\n return !words;\n }\n } return words;\n}", "function countSubstringsDP(str) {\n const dp = Array(str.length);\n for (let i = 0; i < str.length; i++) {\n dp[i] = Array(str.length).fill(false);\n }\n\n let ans = 0;\n for (let i = 0; i < str.length; i++) {\n for (let j = i; j < str.length; j++) {\n if (i === j || (i - 1 >= 0 && j + 1 < str.length && dp[i - 1] && dp[i - 1][j + 1])) {\n dp[i][j] = true;\n } else dp[i][j] = checkPalindrome(str, i, j);\n\n if (dp[i][j]) ans++;\n }\n }\n return ans;\n}", "function longestPalindromicSubstring(string) {\n let longest = [0,1]\n for (let i = 1; i < string.length; i++) {\n // get the longest the even and odd palindromes where midpoint is i\n const odd = getLongestPalindromeFrom(string, i - 1, i + 1)\n const even = getLongestPalindromeFrom(string, i - 1, i)\n \n // determine which between the two (even/odd) is longer\n let localLongest\n if (odd[1] - odd[0] > even[1] - even[0]) localLongest = odd\n else localLongest = even\n \n // change global if it the local is longer\n if (longest[1] - longest[0] < localLongest[1] - localLongest[0]) {\n longest = localLongest\n }\n }\n return string.slice(longest[0], longest[1])\n }", "function funnyString(s) {\r\n \r\n var rev=s.split(\"\").reverse().join(\"\");\r\n var ar=[];\r\n var result;\r\n var res=0;\r\n \r\n for(var i=0;i<2;i++){\r\n \r\n for(var j=0;j<s.length-1;j++){\r\n \r\n if(ar.length==s.length-1){\r\n result=rev.charCodeAt(j)-rev.charCodeAt(j+1);\r\n if(result<0){\r\n result=result*(-1);\r\n }\r\n if(ar[j]!=result){\r\n res=1;\r\n console.log(2);\r\n break;\r\n }\r\n }else{\r\n result=s.charCodeAt(j)-s.charCodeAt(j+1);\r\n if(result<0){\r\n result=result*(-1);\r\n }\r\n console.log(result);\r\n ar.push(result);\r\n }\r\n \r\n } \r\n \r\n }\r\n \r\n if(res==1){\r\n return \"Not Funny\";\r\n }else{\r\n return \"Funny\";\r\n }\r\n \r\n\r\n}", "function solve(st,a,b){\n //console.log(b)\n let str = st.slice(0, a) + st.slice(b+1, st.length)\n console.log(str)\n let subStr = st.substring(a,b+1).split(\"\")\n //console.log(subStr)\n let rev = subStr.reverse().join(\"\")\n //console.log(rev)\n let output = [str.slice(0,a),rev, str.slice(a)].join('');\n return output \n }", "function string(p1) {\n let string = p1.split(\"\")\n let sub = []\n let sub2 = []\n let count = 0\n for (i = 0; i < string.length; i++) {\n if (!sub.includes(string[i]) && count === 2) {\n if (sub2.length < sub.length) {\n sub2 = sub\n }\n count = 0\n sub = []\n let pos = 1\n let start = string[i - 1]\n for (j = i-1; j > 0; j--) {\n if (string[j] == start) {\n pos++\n } else {\n break;\n }\n }\n i = i - pos;\n } else if (sub.includes(string[i])) {\n sub.push(string[i])\n } else if (count < 2) {\n sub.push(string[i])\n count++\n }\n }\n\n return sub2\n}", "function longestPalindromicSubstring(string) {\n //edge case\n if (string.length === 1 || string.length === 2) return string[0]\n let maxPalindrome = ''\n // Write your code here.\n for ( let i = 0; i < string.length; i++){\n let potentialPalindrome = palindromeicSpreadChecker(string, i);\n if (potentialPalindrome.length > maxPalindrome.length) { maxPalindrome = potentialPalindrome };\n }\n console.log(maxPalindrome);\n return maxPalindrome\n }", "function isPalindrom(str) {\n str = str.replace(/\\s/g, '');\n str = str.toLowerCase();\n let str1 = str.trim().slice(0, str.length / 2);\n let str2;\n if (str.length % 2 === 0) {\n str2 = str.trim().slice(str.length / 2);\n }\n else {\n str2 = str.trim().slice(str.length / 2 + 1);\n }\n let reversedStr2 = '';\n for (i = str2.length - 1; i > -1; i--) {\n reversedStr2 += str2[i];\n }\n console.log(reversedStr2 === str1);\n}", "function StringChallenge(str) {\n let obj = {\n 'ab': 'c',\n 'ba':'c',\n 'bc': 'a',\n 'cb': 'a',\n 'ac': 'b',\n 'ca': 'b',\n }\n\n let array = str.split('');\n let newarray = [];\n\n for(var i = 0; i<array.length; i += 2){\n if(obj[array[i]+array[i+1]]){\n let value = obj[array[i]+array[i+1]]\n array = array.slice(2, array.length);\n newarray.push(value);\n i = -2;\n } else if (array.length > 2) {\n newarray.push(array[i]);\n newarray.push(array[i+1]);\n array = array.slice(2, array.length)\n } else {\n newarray.push(array[i]);\n array = array.slice(1)\n }\n\n if(array.length === 0){\n StringChallenge(newarray.join(''))\n }\n }\n\n // code goes here\n return newarray.length - 1;\n\n}", "function solution(str) {\n // write your code in JavaScript (Node.js 8.9.4)\n\n // substring - semi alternating - should not have more than 2 repititions\n // hmm so temo shuld be 2 and we should have a system to keep resetting it?\n // we need a result and a temp to keep count and need to update them as we find // consecutive characters\n\n let len = str.length;\n // corner condition\n if (len < 3) return len;\n\n let temp = 2,\n result = 2;\n\n for (let i = 2; i < len; i++) {\n if (str.charAt(i) !== str.charAt(i - 1) ||\n str.charAt(i) !== str.charAt(i - 2)) {\n temp++; // looking for consecutive characters\n } else {\n result = Math.max(result, temp);\n // reset temp\n temp = 2;\n }\n }\n result = Math.max(result, temp);\n return result;\n}", "function mix(s1, s2) {\n \n if(arguments.length !== 2) {\n return '';\n }\n \n let counts = [new Map(), new Map()];\n \n // keep track of any letters used, this is handy to return result of just those > 1\n let lettersUsed = new Set();\n \n for (let i = 0; i < counts.length; i++) {\n\n // iterate from sentence i, finding frequency of letters\n for (let chr of arguments[i]) {\n\n // Only need 97 --> 122: i.e. lowercase letters a-z\n if ((chr.charCodeAt(0) >= 97) && (chr.charCodeAt(0) <= 122)) {\n\n counts[i].set(chr, 1 + counts[i].get(chr) || 1);\n \n // we only want to return any of 2 or more, so we keep a note of these\n if(counts[i].get(chr) === 2) {\n lettersUsed.add(chr);\n }\n }\n\n }\n \n }\n \n // console.log('letters used', lettersUsed);\n \n // initialise our result array to correct size\n let result = [];\n\n for (let letter of lettersUsed) {\n \n // - funnel answers into array of arrays, where index of\n let answer = '';\n const s1count = counts[0].get(letter) || 0;\n const s2count = counts[1].get(letter) || 0;\n \n // the outer array is the no. letters of that solution\n if (s1count === s2count) {\n answer = '=:' + letter.repeat(s1count);\n \n } else if (s1count > s2count) {\n answer = '1:' + letter.repeat(s1count);\n } else {\n answer = '2:' + letter.repeat(s2count);\n }\n // console.log('answer',answer);\n \n // initialise to array if necessary:\n result[answer.length] = result[answer.length] || [];\n result[answer.length].push(answer);\n \n \n }\n \n // this is the final result we will return:\n let final = [];\n \n // then we sort inners ascendingly, lexically.\n // (...and in final return outer array descendingly)\n for (let i = 0; i < result.length; i++) {\n \n // we do not want the undefined elements\n if(result[i] !== undefined) {\n final.push(result[i].sort().join('/'));\n }\n \n }\n \n // finally return and join:\n if (!final.length) {\n return '';\n } else {\n //\n return final.reverse().join('/');\n }\n \n}", "function bpali(palind) {\n let palin = palind.toLowerCase().replace(/ /g, '');\n let length = palin.length;\n if (length % 2 == 0) {\n\n let end = palin.slice(length / 2, length);\n let end2 = end.split('').reverse().join('');\n\n let start = palin.slice(0, length / 2);\n if (end2 == start) {\n console.log(' even numbered palindrome');\n } else {\n console.log('bot palindrome');\n }\n } else {\n\n let end = palin.slice((length + 1) / 2, length)\n let end2 = end.split('').reverse().join('');\n\n let start = palin.slice(0, (length - 1) / 2)\n console.log(start);\n if (end2 == start) {\n console.log('odd numbered palindrome');\n } else {\n console.log('not palindrome');\n }\n\n }\n}", "function lookAndSay(str) {\n let ans = \"\",\n i = 0;\n while (i < str.length) {\n let sub = str[i],\n j = i + 1;\n inner: for (j; j < str.length; j++) {\n if (sub[0] !== str[j]) {\n break inner;\n }\n sub += str[j];\n }\n ans += sub.length + sub[0];\n i = j;\n }\n return ans;\n}", "function alternate(s) {\n let chars = [...new Set(s)];\n let max = 0;\n for (let i = 0; i < chars.length - 1; i++) {\n for (let j = i + 1; j < chars.length; j++) {\n let reg = new RegExp(`[${chars[i]}|${chars[j]}]`, \"gi\");\n let sub = s.match(reg);\n console.log(\"sub\", sub);\n let isValid = false;\n for (let x = 0; x < sub.length; x++) {\n if (sub[x] !== sub[x + 1]) {\n isValid = true;\n } else {\n console.log(\"not valid\");\n isValid = false;\n break;\n }\n }\n if (isValid) {\n console.log(\"valid\", max);\n if (max < sub.length) {\n max = sub.length;\n console.log(max);\n }\n }\n }\n }\n return max;\n}", "function paldindrom1(str){\nreturn str.split('').every((char, i) => {\n return char === str[str.length -1 -1];\n })\n}", "function abc(num) {\n loop1: for (i = num; i.toString().length >= num.toString().length; i--) {\n pal = parseInt(i.toString() + i.toString().split('').reverse().join(''))\n for (x = num; x.toString().length >= num.toString().length; x--) {\n if (pal % x === 0 && (pal / x).toString().length === num.toString().length) \n return `Largest palindrome: ${pal}, Components ${x} * ${pal/x} `\n }\n }\n}", "function palindromeSubstrings (str) {\n if (typeof str !== 'string') return null;\n var dictionary = {};\n for (var i = 0; i < str.length; i++) {\n //if current letter matches next letter, will need to check for palindromes with an even number of characters as well as an odd number of characters. If the current character does not match the following character, you only need to check for palindromes with an odd number.\n var count = str[i] === str[i + 1] ? 1 : 0;\n while (count >= 0) {\n var left = i;\n var right = i + count;\n while (left >= 0 && right < str.length && str[left] === str[right]) {\n var result = str.slice(left, right + 1);\n if (!dictionary[result]) dictionary[result] = true;\n left--;\n right++;\n }\n count--;\n }\n }\n return Object.keys(dictionary);\n}", "function palindromeSolution1(str){\n\tconst reversed = str.split('').reduce((accum, letter)=> letter + accum, '');\n\treturn reversed === str;\n}", "function solution_1 (s1, s2) {\r\n if (s2.length < s1.length) return false;\r\n const freq = {};\r\n for (const char of s1) {\r\n freq[char] = freq[char] ? freq[char] - 1 : -1;\r\n }\r\n for (let i = 0; i < s2.length; i++) {\r\n const newChar = s2[i];\r\n freq[newChar] = freq[newChar] ? freq[newChar] + 1 : 1;\r\n if (!freq[newChar]) delete freq[newChar];\r\n if (i >= s1.length) {\r\n const oldChar = s2[i - s1.length]\r\n freq[oldChar] = freq[oldChar] ? freq[oldChar] - 1 : -1;\r\n if (!freq[oldChar]) delete freq[oldChar];\r\n }\r\n if (!Object.keys(freq).length) return true;\r\n }\r\n return false;\r\n}", "function longestPalindromicSubstring(string) {\n let start, end, substring = string[0]\n //loop through each char in string\n\tfor(let i = 1; i < string.length; i++) {\n //for each character find longest possible substring from both sides of the current char\n\t\tstart = i - 1; end = i + 1\n\t\twhile(string[start] === string[end]) {\n\t\t\tif(start < 0 || end > string.length) break\n\t\t\tstart--\n\t\t\tend++\n\t\t}\n substring = substring.length < end - start ? string.substring(start + 1, end) : substring\n //or find longest possible substring mirrored from current char\n\t\tstart = i - 1; end = i\n\t\twhile(string[start] === string[end]) {\n\t\t\tif(start < 0 || end > string.length) break\n\t\t\tstart--\n\t\t\tend++\n\t\t}\n\t\tsubstring = substring.length < end + 1 - start ? string.substring(start + 1, end) : substring\n\t}\n\treturn substring\n}", "function solve(s) {\n // Write your code here\n const ht = {};\n let retstr = '';\n \n for(let i=0; i<s.length; i++) {\n if(ht[s[i]] !== undefined) {\n if(s[i] === s[i-1]) {\n continue\n }\n else {\n retstr += s[i]\n }\n }\n else {\n ht[s[i]] = s[i]\n retstr += s[i]\n }\n }\n s = retstr\n return s\n}", "function solve(inputStr){\r\n\r\n if(isNearPalindrome(inputStr) === false){\r\n var s = inputStr.split(\"\").sort();\r\n \r\n var nOperations = 0;\r\n var first = 0;\r\n var last = s.length -1;\r\n\r\n var incremented = 0;\r\n\r\n while(first < last){\r\n if(s[first] !== s[last]){\r\n incremented = Math.min(inputStr.charCodeAt(first++), inputStr.charCodeAt(last--)) + 1;\r\n nOperations++;\r\n }\r\n } \r\n return nOperations;\r\n }\r\n else {\r\n return -1;\r\n }\r\n}", "function main() {\n var a = readLine();\n var b = readLine();\n\n function make_anagrams (first_str, second_str) {\n var first_arr = first_str.split('')\n var second_arr = second_str.split('')\n\n var all_hash = {};\n var first_hash = {};\n // store the characters of first string as the key in a hash object\n // with count of occurences as the value\n // also store the characters in a hash that will contain all possible chars from the first and second strings\n for (var i = 0; i < first_arr.length; i++) {\n if (first_hash[first_arr[i]]) {\n first_hash[first_arr[i]]++;\n all_hash[first_arr[i]]++;\n } else { // if the key doesn't exist, initiate count to 1 for key\n first_hash[first_arr[i]] = 1;\n all_hash[first_arr[i]] = 1;\n }\n }\n\n var second_hash = {};\n // store the characters of second string as the key in hash object \n // with count of occurences as the value\n for (var i = 0; i < second_arr.length; i++) {\n if (!(second_arr[i] in second_hash)) { // initiate count to 1 if key does not exist\n second_hash[second_arr[i]] = 1;\n\n // set the count for all_hash appropriately depending if key already exists from looking at first_hash\n all_hash[second_arr[i]] = (second_arr[i] in all_hash) ? all_hash[second_arr[i]]+1 : 1; \n } else {\n second_hash[second_arr[i]]++;\n all_hash[second_arr[i]]++;\n }\n\n \n }\n\n // go through all the characters\n var deletions = 0; // number of deletion operations to make strings anagrams\n for (var letter in all_hash) {\n if (letter in first_hash && letter in second_hash) { \n // character in both strings, subtract to get extra count\n deletions += Math.abs(first_hash[letter] - second_hash[letter]);\n } else if (letter in first_hash) {\n // character only in the first string\n deletions += first_hash[letter]\n } else if (letter in second_hash) {\n // character only in the second string\n deletions += second_hash[letter];\n }\n }\n\n console.log(\"deletions\", deletions);\n }\n\n make_anagrams(a, b);\n}", "function substrings(str1)\n{\nvar array1 = [];\n for (var x = 0, y=1; x < str1.length; x++,y++) \n {\n array1[x]=str1.substring(x, y);\n }\n \n var combi = [];\n var temp= \"\";\n var slent = Math.pow(2, array1.length);\n\n for (var i = 0; i < slent ; i++)\n {\n temp= \"\";\n for (var j=0;j<array1.length;j++) {\n if ((i & Math.pow(2,j))){ \n temp += array1[j];\n }\n }\n if (temp !== \"\")\n {\n combi.push(temp);\n }\n }\n console.log(combi.join(\"\\n\"));\n}", "function palindrome(statement) {\n if (typeof statement !== \"string\"){\n return 'error input bukan string';\n } else {\n let hasil = ''\n for (let n = statement.length - 1; n >= 0; n--) {\n hasil += statement[n] \n if (hasil === statement[n]) {\n return true\n } else {\n return false\n }\n }\n console.log(hasil)\n }\n \n}", "function mix(s1, s2) {\n\n console.log(s1, \"string2: \" + s2)\n\n var finalStr = \"\";\n // remove all unnecessary characters in the string..\n s1 = s1.replace(/[^a-z]/gi, '');\n s2 = s2.replace(/[^a-z]/gi, '');\n\n var letterOccurrenceInSentences = {};\n\n // moves all the occurrence of every letter into a object with two properties\n\n\n countLetterOccurrence(s1, letterOccurrenceInSentences, 'first');\n countLetterOccurrence(s2, letterOccurrenceInSentences, 'second');\n\n // now need to check each value length if greater than 1, if it isn't remove it from the object\n\n // i dont think we need to actually check if it is bigger than one...\n\n // when doing the final check i can just only count it if is bigger than one...\n\n // console.log(\"first string \" + s1, \"second string \" + s2)\n // for (var key in letterOccurrenceInSentences) {\n // if (letterOccurrenceInSentences.hasOwnProperty(key)) {\n // console.log(letterOccurrenceInSentences)\n // }\n // }\n\n // starting to insert the maxium of letters into a string..\n\n console.log(letterOccurrenceInSentences);\n\n for (var key in letterOccurrenceInSentences) {\n if (\n letterOccurrenceInSentences[key].first > letterOccurrenceInSentences[key].second ||\n letterOccurrenceInSentences[key].second == undefined) {\n if (trueString(letterOccurrenceInSentences[key].first)) {\n finalStr += \"1:\"\n for (var i = 0; i < letterOccurrenceInSentences[key].first; i++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } else if (letterOccurrenceInSentences[key].first < letterOccurrenceInSentences[key].second ||\n letterOccurrenceInSentences[key].first == undefined) {\n if (trueString(letterOccurrenceInSentences[key].second)) {\n finalStr += \"2:\"\n for (var j = 0; j < letterOccurrenceInSentences[key].second; j++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } else if (letterOccurrenceInSentences[key].first == letterOccurrenceInSentences[key].second) {\n if (letterOccurrenceInSentences[key].first !== 1 && letterOccurrenceInSentences[key].second !== 1) {\n finalStr += \"=:\"\n for (var k = 0; k < letterOccurrenceInSentences[key].first; k++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } \n }\n\n finalStr = finalStr.split(\"/\").sort(function (a, b) {\n if (b.length === a.length) {\n return (a > b ? 1 : -1);\n } else {\n return b.length - a.length;\n }\n }).join(\"/\");\n\n // remove the last slash...\n finalStr = finalStr.slice(0, -1);\n console.log(finalStr);\n\n return console.log(finalStr);\n\n }", "function hasPermutationPalindrome(string) {\n let oddChar = string.length % 2 === 1;\n // let oddChar = false;\n // hm = new map()\n let value;\n\n // for (let i = 0; i < 'racecar'.length; i++) {\n // if (hm.has())\n // }\n \n const newMap = new Map();\n const strLength = string.length;\n // for even\n\n // pairs \n\n\n // for odd\n for (let i = 0; i < string.length; i++) {\n newMap.set(string[i].toLowerCase());\n }\n\n\n // console.log(newMap);\n // console.log('length: ', newMap.size);\n\n if (strLength % 2 === 0 && newMap.size === (strLength / 2)) {\n console.log(string, ' can be a palindrome');\n } \n\n // console.log('Math.floor(strLength / 2) + 1: ', Math.floor(strLength / 2) + 1);\n // console.log('newMap.size % 2 === 1 ', string === 1);\n\n if (strLength % 2 === 1 && newMap.size === Math.floor(strLength / 2) + 1) {\n console.log(string, ' can be a palindrome');\n } \n}", "algoanagram(s1, s2) {\n\n var l1 = s1.length\n var l2 = s2.length\n var flag = true\n if (l1 != l2) {\n flag = false\n }\n else {\n var s3 = s1.toLowerCase()\n var s4 = s2.toLowerCase()\n\n s3 = s3.split('').sort().join('');\n s4 = s4.split('').sort().join('');\n\n // console.log(s3);\n // console.log(s4);\n flag = s3 === s4;\n // var c=a.split(\" \")\n // var c=b.split(\" \")\n\n\n //console.log(c)\n // console.log(d)\n\n\n\n\n\n }\n if (flag == true) {\n console.log(s1 + \" and \" + s2 + \" are anagram\")\n }\n else {\n console.log(s1 + \" and \" + s2 + \" are not anagram\")\n }\n }", "function lengthen(str1,str2){\nlet min='';\nlet max='';\nlet count = 2;\nlet result='';\nif(str1.length < str2.length){\n min = str1, max= str2;\n} else if(str1 > str2){\n min=str2, max=str1;\n}\nwhile(result.length <= max.length){\n result = min.repeat(count);\n count= count+ 1;\n}\n return result.slice(0,max.length);\n}", "function longestCommonSubstring(string1, string2) {\n\t// Convert strings to arrays to treat unicode symbols length correctly.\n\t// For example:\n\t// '𐌵'.length === 2\n\t// [...'𐌵'].length === 1\n\tconst s1 = [...string1];\n\tconst s2 = [...string2];\n\n\t// Init the matrix of all substring lengths to use Dynamic Programming approach.\n\tconst substringMatrix = Array(s2.length + 1)\n\t\t.fill(null)\n\t\t.map(() => {\n\t\t\treturn Array(s1.length + 1).fill(null);\n\t\t});\n\n\t// Fill the first row and first column with zeros to provide initial values.\n\tfor (let columnIndex = 0; columnIndex <= s1.length; columnIndex += 1) {\n\t\tsubstringMatrix[0][columnIndex] = 0;\n\t}\n\n\tfor (let rowIndex = 0; rowIndex <= s2.length; rowIndex += 1) {\n\t\tsubstringMatrix[rowIndex][0] = 0;\n\t}\n\n\t// Build the matrix of all substring lengths to use Dynamic Programming approach.\n\tlet longestSubstringLength = 0;\n\tlet longestSubstringColumn = 0;\n\tlet longestSubstringRow = 0;\n\n\t//creates a table comparing each character in the strings\n\tfor (let rowIndex = 1; rowIndex <= s2.length; rowIndex += 1) {\n\t\tfor (let columnIndex = 1; columnIndex <= s1.length; columnIndex += 1) {\n\t\t\t//if (s1[columnIndex - 1] === s2[rowIndex - 1]) {\n\t\t\t//hack to change rowIndex to <= 6 since that was the longest substring...so it stops looking after the 6th match\n\t\t\tif (s1[columnIndex - 1] === s2[rowIndex - 1] && rowIndex <= 6) {\n\t\t\t\tsubstringMatrix[rowIndex][columnIndex] =\n\t\t\t\t\tsubstringMatrix[rowIndex - 1][columnIndex - 1] + 1;\n\t\t\t} else {\n\t\t\t\tsubstringMatrix[rowIndex][columnIndex] = 0;\n\t\t\t}\n\n\t\t\t// Try to find the biggest length of all common substring lengths\n\t\t\t// and to memorize its last character position (indices)\n\t\t\t// if (substringMatrix[rowIndex][columnIndex] > longestSubstringLength) {\n\t\t\tif (substringMatrix[rowIndex][columnIndex] > longestSubstringLength) {\n\t\t\t\tlongestSubstringLength = substringMatrix[rowIndex][columnIndex];\n\t\t\t\tlongestSubstringColumn = columnIndex;\n\t\t\t\tlongestSubstringRow = rowIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (longestSubstringLength === 0) {\n\t\t// Longest common substring has not been found.\n\t\treturn \"\";\n\t}\n\n\t// Detect the longest substring from the matrix.\n\tlet longestSubstring = \"\";\n\n\twhile (substringMatrix[longestSubstringRow][longestSubstringColumn] > 0) {\n\t\t//\twhile (substringMatrix[longestSubstringRow][longestSubstringColumn] > 0 &&\tlongestSubstringRow <= 2) {\n\t\tlongestSubstring = s1[longestSubstringColumn - 1] + longestSubstring;\n\t\tlongestSubstringRow -= 1;\n\t\tlongestSubstringColumn -= 1;\n\t}\n\n\treturn longestSubstring;\n}", "function palindromePermutation (s) {\n\n s = s.replace(/ /g, \"\"); // remove spaces\n\n let map = {};\n\n // count frequencies\n for (let i = 0; i < s.length; i++)\n if(map[s.charAt(i)]) map[s.charAt(i)]++;\n else map[s.charAt(i)] = 1;\n\n // if a palindrome length is odd, it can only have 1\n // character that occurs an odd number of times\n \n // if a palindrome length is even, it cannot have \n // any characters that occur an odd number of times\n let numAllowedOddFrequency = s.length % 2 === 0 ? 0 : 1;\n\n for (let character in map)\n // check if character freqeuncy is even or odd\n if(map[character] % 2 !== 0)\n // if frequency is odd and we still haven't encountered \n // an odd frequency, record that we have encountered an odd frequency\n if (numAllowedOddFrequency) numAllowedOddFrequency--;\n // either string length is even or odd string has multiple\n // characters with odd frequency. not a palindrome\n else return false;\n \n \n // meets requirements\n return true;\n \n}", "function substrings(str1)\n{\nvar array1 = [];\n for (var x = 0, y=1; x < str1.length; x++,y++)\n {\n array1[x]=str1.substring(x, y);\n }\nvar combi = [];\nvar temp= \"\";\nvar slent = Math.pow(2, array1.length);\n\nfor (var i = 0; i < slent ; i++)\n{\n temp= \"\";\n for (var j=0;j<array1.length;j++) {\n if ((i & Math.pow(2,j))){\n temp += array1[j];\n }\n }\n if (temp !== \"\")\n {\n combi.push(temp);\n }\n}\n console.log(combi.join(\"\\n\"));\n}", "function stringAnagrams(str, solutions = [], partial = \"\") {\n\n if (!str) {\n solutions.push(partial);\n }\n \n for (let i = 0; i < str.length; i++) {\n const leftSlice = str.slice(0, i);\n const rightSlice = str.slice(i + 1); // skips current letter\n stringAnagrams(leftSlice + rightSlice, solutions, partial + str[i]);\n }\n return solutions;\n}", "function solution(inputString) {\n let inputArr = inputString.split(\"\");\n // write your code in JavaScript (Node.js 8.9.4)\n\n //first we generate smaller and smaller windows\n //this contains the smallest and smallest result\n const result = [];\n for (let i=0; i< inputArr.length; i++) {\n let windows = toWindows(inputArr, inputArr.length - i);\n for (let w of windows) {\n let isStringBalanced = checkBalanced(w);\n if (isStringBalanced) {\n result.push(w.join(\"\"));\n }\n }\n }\n // after this loops runs, we select the non empty string\n if (result.length === 0) {\n return -1;\n }\n let string = result.reduce((a, b) => a.length <= b.length ? a : b);\n return string ? (string.length) : -1\n}", "function shortPalindrome(s) {\n let m = 1000000007;\n let first = [];\n let second = [];\n let third = [];\n for (let i = 0; i < 26; i++) {\n first[i] = 0;\n second[i] = [];\n third[i] = 0;\n for (let j = 0; j < 26; j++) {\n second[i][j] = 0;\n }\n }\n\n let count = 0;\n for (let i = 0; i < s.length; i++) {\n let current = s.charCodeAt(i) - 97;\n count = (count + third[current]) % m;\n for (let j = 0; j < 26; j++) {\n third[j] = (third[j] + second[j][current]) % m;\n }\n for (let j = 0; j < 26; j++) {\n second[j][current] = (second[j][current] + first[j]) % m;\n }\n first[current] = (first[current] + 1) % m;\n }\n return count;\n}", "function subStringDivision(){\n\tvar sum = 0;\n\tvar divisors = [11,13,17];\n\t// need to write more specific checkers for the other numbers as they can fit into numbers more than once\n\t// for example: 7 fits into 56 as 560 or 567\n\tfor(var two = 12; two < 1000; two += 2){\n\t\tvar temp = \"\";\n\t\tif( two < 99) temp += 0;\n\t\ttemp += two;\n\t\tfor(var three = contChk(temp, 3); three < 10; three += 3){\n\t\t\tvar temp3 = temp;\n\t\t\ttemp3 += three;\n\t\t\tfor(var five = contChk(temp3, 5); five < 10; five += 5){\n\t\t\t\tvar temp5 = temp3;\n\t\t\t\ttemp5 += five;\n\t\t\t\tfor(var seven = contChk(temp5, 7); seven < 10; seven += 7){\n\t\t\t\t\tvar temp7 = temp5;\n\t\t\t\t\ttemp7 += seven;\n\t\t\t\t\tfor(var j = 0; j < divisors.length; j++){\n\t\t\t\t\t\tif(contChk(temp7, divisors[j]) === false ) break;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\ttemp7 += contChk(temp7, divisors[j]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(new Set(temp7.split(\"\")).size === 9) {\n\t\t\t\t\t\tfor(var m = 0; m < 9; m++){\n\t\t\t\t\t\t\tif(temp7.indexOf(m) === -1) {\n\t\t\t\t\t\t\t\tsum += Number(m + temp7);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sum;\n}", "function scatterPalindrome(strToEvaluate) {\n // Write your code here\n}", "function solve(s){\n let countL=0;\n let countU=0\n for(let i=0; i<s.length; i++){\n if(s[i]==s[i].toLowerCase()){\n countL++\n }\n if(s[i]==s[i].toUpperCase()){\n countU++\n }\n }\n if(countU==countL) {return s.toLowerCase()}\n if(countU>countL) {return s.toUpperCase()}\n if(countU<countL) {return s.toLowerCase()}\n\n}", "function Palindrome(str) \r\n {\r\n var cstr = str.toLowerCase().replace(/[^a-zA-Z0-9]+/g,)\r\n var count = 0\r\n if ((str.length) / 2 ===0 )\r\n {\r\n\r\n }\r\n else \r\n {\r\n if(str.length ===1)\r\n {\r\n document.write(\"Entry is palindrome\")\r\n }\r\n else\r\n {\r\n count = (str.length -1 ) /2 \r\n }\r\n }\r\n for (var i = 0; i <count.length; i++) \r\n {\r\n if (str[i] != srt.slice(-1-x)[0])\r\n {\r\n document.write(\"The entry is not palindrome\")\r\n }\r\n }\r\n document.write(\"The entry is palindrome\" + \"<br>\")\r\n }", "function hisPalindrome(strIng){\n let chain = \"\";\n for(i=0; i < strIng.length; i++){\n chain += strIng[i];\n if (frase[i] == \" \"){\n\n } else {\n chain += strIng\n }\n }\n }", "function solve(str) {\n let diff = [...str].reverse('').filter((x, i) => x != str[i]).length;\n return diff == 2 || (diff == 0 && str.length % 2 == 1);\n}", "function isBeautifulString(inp) {\n let alph = \"abcdefghijklmnopqrstuvwxyz\";\n //arrange letters of input string ascending so\n //we can test whether the given letter's quantity is\n //<= that of the previous letter in the alphabet.\n let arr = inp.split(\"\").sort().join(\"\");\n //Next three lines check if input string contains consecutive\n //letters and returns false if not the case. This was added due to 'zaa'\n //fail.\n let uniq = [...new Set(arr)].join(\"\");\n let consecutiveCheck = alph.match(uniq);\n if (consecutiveCheck === null) return false;\n //Breaks sorted string into groups of the same character\n let byLet = arr.match(/([a-z])\\1*/g);\n //Gives an array of the quantities of each character in string\n let quans = byLet.map((i) => i.length);\n //Checks that the quantity of a given letter is less than or equal to\n //the preceeding letter\n let pass = quans.slice(1).map((v, i) => v <= quans[i]);\n //Checks that that's always the case\n let bigPass = pass.every((i) => i === true);\n console.log(arr);\n console.log(\"uniq\", uniq);\n console.log(\"consecutiveCheck\", consecutiveCheck);\n console.log(byLet);\n console.log(quans);\n console.log(quans.slice(1));\n console.log(pass);\n console.log(bigPass);\n console.log(\"test\", alph.split(\"\").includes(\"a\"));\n //Both cases have to be true, as 'bbc' and 'yyz' failed\n //(because there are more b's than a's given that a is not present etc.);\n return bigPass && byLet[0][0] === \"a\";\n}", "function KUniqueCharacters(str) { \nlet arr = [];\nlet longest = str[0];\n \nfor (let i=1; i<str.length; i++) {\n let table = {}\n let ans = \"\"\n let count = 0\n for (let j=i; j<str.length; j++) {\n if (table[str[j]] === undefined) { \n table[str[j]] = 1\n count++\n }\n if (count <= str[0]) {\n ans += str[j]\n }\n }\n if (ans.length > longest) {\n longest = ans.length\n arr.push(ans)\n }\n}\nreturn arr.sort(function(a,b) {return b.length-a.length})[0]\n}", "function palindromeSolution2(str){\n\treturn str.split('').every((current, index, arr)=>{\n\t\treturn (current === arr[arr.length - index - 1]);\n\t});\n}", "function longestPalindrome(phrase){\r\n}", "function solve(s){\n let initialarr = s.split(\"\")\n let lower = 0\n let higher = 0\n for(var i=0;i<s.length;i++){\n if(initialarr[i] === initialarr[i].toLowerCase()){\n lower++\n } else if(initialarr[i] === initialarr[i].toUpperCase()){\n higher++\n }\n }\n if(lower>higher | lower == higher){\n return initialarr.join(\"\").toLowerCase()\n } else if (lower<higher){\n return initialarr.join(\"\").toUpperCase()\n }\n}", "function longestPalindrome (string) {\n if (string.length === 1) return string;\n var largestPal = \"\";\n\n for(var i=0; i<string.length; i++) {\n var offset = 1;\n\n // Handle even increments\n while(string.charAt(i-offset) && string.charAt(i+offset-1) &&\n string.charAt(i-offset) === string.charAt(i+offset-1)){\n comparePals(string.slice(i-offset, i+offset));\n offset++;\n }\n\n // Handle odd increments\n while(string.charAt(i-offset) && string.charAt(i+offset) &&\n string.charAt(i-offset) === string.charAt(i+offset)){\n comparePals(string.slice(i-offset, i+offset+1));\n offset++;\n }\n }\n\n return largestPal.length ? largestPal : 'No Pals for you!';\n\n // Helper function; hoisting makes function available to code above\n function comparePals (newPal){\n if(newPal.length >= largestPal.length)\n largestPal = newPal;\n }\n}", "function constructNote(str1, str2) {\n if (str2.length < str1.length) return false;\n function freqCounter(str) {\n let obj = {};\n for (let letter of str) {\n obj[letter] = obj[letter] + 1 || 1;\n }\n return obj;\n }\n let str1Obj = freqCounter(str1);\n let str2Obj = freqCounter(str2);\n for (let key in str1Obj) {\n // if less letters in string 2 than string 1 return false\n if (!str2Obj[key] || str2Obj[key] < str1Obj[key]) {\n return false;\n }\n }\n return true;\n}", "function combinations(str)\n{\nvar array1 = [];\n for (var x = 0, y=1; x < str1.length; x++,y++) \n {\n array1[x]=str1.substring(x, y);\n }\nvar combi = [];\nvar temp= \"\";\nvar slent = Math.pow(2, array1.length);\n\nfor (var i = 0; i < slent ; i++)\n{\n temp= \"\";\n for (var j=0;j<array1.length;j++) {\n if ((i & Math.pow(2,j))){ \n temp += array1[j];\n }\n }\n if (temp !== \"\")\n {\n combi.push(temp);\n }\n}\n return combi.join(\"\\n\");\n}", "function palindromPerm(str) {\n let oddCount = 0;\n let letterCount = {};\n // iterate over the input string\n for (let i = 0; i < str.length; i++) {\n // count the frequency of each letter\n let letter = str[i];\n if (letterCount[letter] === undefined) {\n letterCount[letter] = 0;\n }\n letterCount[letter]++;\n // check the count of the current letter\n if (letterCount[letter] % 2 === 1) {\n // if it's odd, increment the odd counter\n oddCount++;\n } else {\n // if it's even, decrement the odd counter\n oddCount--;\n }\n }\n // return true if odd count is 1 or less\n return oddCount <= 1;\n}", "function LongestCommonSub_Iterative(str1, str2, m, n) {\n\n var tabulation = [];\n\n for (var i = 0; i <= m; i++) {\n for (var j = 0; j <= n; j++) {\n // initialize i=0 and j=0 rows and cols with 0, as we need these as initial state \n if (i === 0 || j === 0) {\n if (tabulation[i] === undefined) {\n tabulation[i] = [];\n }\n //takes care of populating a row with all Zero\n //Happens only for first row and first column i.e., i=0 || j=0\n tabulation[i][j] = 0;\n } else {\n if (str1.charAt(i - 1) === str2.charAt(j - 1)) {\n //If they match then its reduced to 1 + LCS( str1 - 1char, str2 - 1char)\n tabulation[i][j] = 1 + tabulation[i - 1][j - 1]\n } else {\n //If they don't match then its reduced to Max of [ LCS( str1 - 1char, str2) , LCS( str1, str2 - 1char) ] \n tabulation[i][j] = Math.max(tabulation[i - 1][j], tabulation[i][j - 1]);\n }\n }\n }\n }\n\n printLCS(str1, str2, m, n, tabulation);\n return tabulation;\n\n}", "function longestPalindrome(s) {\n var max_length = 0;\n maxLen = '';\n for (var i = 0; i < s.length; i++) {\n // we identify the substring and assign to a variable \n var subs = s.substr(i, s.length)\n for (var j = subs.length; j >= 0; j--) {\n var subStr = subs.substr(0, j);\n if (subStr.length <= 1)\n continue;\n if (isPalindrome(subStr)) {\n if (subStr.length > max_length) {\n max_length == subStr\n maxLen = subStr\n }\n }\n\n }\n }\n return maxLen;\n}", "function countSubstrings(str, cache = {}) {\n let windowSize = 1;\n let palindromeCounter = 0;\n\n while (windowSize <= str.length) {\n for (let start = 0; start + windowSize <= str.length; start++) {\n let currentSubstring = str.slice(start, start + windowSize);\n let stringIsPalindrome = cache[currentSubstring] === undefined ? isPalindrome(currentSubstring, cache) : cache[currentSubstring];\n cache[currentSubstring] = stringIsPalindrome;\n if (stringIsPalindrome) {\n palindromeCounter++;\n }\n }\n windowSize++;\n }\n\n return palindromeCounter;\n}", "function palindromePermutation(str) {\n str = str.toLowerCase();\n let hash = new Map();\n const n = str.length;\n let v = 1, spaces = 0;\n for (let i = 0; i < n; i++) {\n if (str.charCodeAt(i) === 32) {\n spaces++;\n continue;\n }\n if (hash.has(str[i])) {\n v = hash.get(str[i]) + 1;\n }\n hash.set(str[i], v);\n v = 1;\n }\n for (let [key, value] of hash) {\n if (value % 2 === 0) {\n hash.delete(key);\n }\n }\n const even = (n - spaces) % 2 === 0;\n if (even) {\n return hash.size === 0;\n }\n return hash.size === 1 && Array.from(hash.values())[0] === 1;\n}", "function isPolindromn(string) {\n \n for ( var i = 0; i < string.length; i++) {\n var pom = string[string.length -1-i];\n if (string[i]===pom) {\n var pom1 = true;\n } else {\n pom1 = false;\n }\n }\n if (pom) {\n return \"Is Polindrom\"\n } else {\n return \"IS not polindrom\"\n }\n}", "function stringAnagrams(a, b) {\n let y = a.split(\"\").sort().join(\"\"),\n z = b.split(\"\").sort().join(\"\");\n \n console.log(\n z === y \n ? a + \" and \" + b + \" are anagrams! \"\n : a + \" and \" + b + \" are not anagrams! \"\n )\n}", "function palindrome(str){\n const hash = new Map();\n let counter = 0;\n for(let i=0; i<str.length; i++){\n if(!hash.has(str[i])){\n hash.set(str[i], '');\n counter++;\n } else if(hash.has(str[i])){\n counter--;\n }\n }\n \n return str.length % 2 && counter === 1 ? true : str.length % 2 && counter === 0? true : false; \n }", "function generateLCS(stringA, stringB) {\n // obtain the lengths of both strings\n const m = stringA.length;\n const n = stringB.length;\n\n /* create a 2D array for dynamic programming approach, this will be the LCS\n table, which will yield the lengths of the LCS's for the (sub)strings, and\n backtracking along it yields the actual LCS. */\n lcsTable = []\n for (let i = 0; i < m + 1; i++) {\n lcsTable[i] = [];\n }\n\n // make the first row of the lcs table all 0's\n for (let i = 0; i < n + 1; i++) {\n lcsTable[0][i] = 0;\n }\n\n // make the first column of the lcs table all 0's\n for (let i = 0; i < m + 1; i++) {\n lcsTable[i][0] = 0;\n }\n\n // fill the rest of the lcs table\n for (let i = 1; i < m + 1; i++) {\n for (let j = 1; j < n + 1; j++) {\n if (stringA.charAt(i - 1) == stringB.charAt(j - 1)) {\n lcsTable[i][j] = lcsTable[i - 1][j - 1] + 1;\n } else {\n lcsTable[i][j] = Math.max(lcsTable[i][j - 1],\n lcsTable[i - 1][j]);\n }\n }\n }\n\n // obtain the length of the lcs\n const lcsLength = lcsTable[m][n];\n\n // backtrack along the lcs table to build the lcs string\n let lcsString = \"\";\n let cornerRow = m, cornerCol = n;\n for (let i = lcsLength; i >= 1; i--) {\n // find the next corner\n while (lcsTable[cornerRow][cornerCol - 1] == i) {\n cornerCol--;\n }\n while (lcsTable[cornerRow - 1][cornerCol] == i) {\n cornerRow--;\n }\n\n // prepend the character of that corner to the lcs string\n lcsString = stringA.charAt(cornerRow - 1) + lcsString;\n\n // decrement cornerRow and cornerCol\n cornerRow--;\n cornerCol--;\n }\n\n // return a small array containing the lcs string and its length\n return [\"\\\"\" + lcsString + \"\\\"\", lcsLength];\n}", "function palindrome(str) {\n\n let splitStr = str.split(\"\");\n let reverseStr = splitStr.reverse();\n let joinStr = reverseStr.join(\"\");\n let drome = str.split(\"\").reverse().join(\"\");\n console.log(drome,output);\n if (drome === input.value) {\n document.getElementById(\"output3\").innerHTML = \"Your string is a palidrome\";\n } else {\n document.getElementById(\"output3\").innerHTML = \"No\";\n }}", "function solve(s) {\n let subStrings = [];\n for (let index = 0; index < s.length; index++) {\n for (let index2 = index; index2 < s.length; index2++) {\n let subString = s.slice(index, index2 + 1);\n subStrings.push(subString);\n }\n }\n return subStrings.reduce((count, subStr) => {\n if (Number(subStr) % 2 === 1) {\n count += 1;\n }\n return count;\n }, 0);\n}", "function checkPalidrom(str){\n\n return str == str.split('').reverse().join('');\n \n}", "function checkIsPalindrome(inputString) {\n\n if (typeof inputString !== \"string\") {\n return \"no\";\n }\n\n // checking palindromes is kind of weird.\n // take the length of the string.\n // grab string [0] and string [n]; compare for sameness\n // iterate until floor(n/2), I guess\n // as long as the bit is true, it's a palindrome?\n\n let wordArr = inputString.split('');\n for (let i = 0; i < wordArr.length / 2; i++) {\n if (wordArr[i] !== wordArr[wordArr.length - i - 1]) {\n return \"no\";\n }\n }\n return \"yes\";\n\n}", "function isPalindrom(n){\n // let reverseN = n.split('').reverse().join('');\n // if(n === reverseN) return true;\n // return false;\n let arrN = n.split('');\n let len = arrN.length;\n for (let i = 0; i < len/2; i++){\n if(arrN[i] !== arrN[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function checkPal(){\n // plan\n // determine how to find the palindromes\n // brute:\n // go from the bottom up until your at or past number\n \n // non brute: \n // find a way to get it from above down\n // use a math equsation to find this\n \n\n}", "function solution(S) {\n if (isPrime(longestPalindrome(S).length)) { return \"YES\"; }\n return \"NO\";\n}", "function lcs(s1, s2) {\n let result = \"\";\n helper(s1.length - 1, s2.length - 1, \"\");\n return result;\n\n function helper(n, m, string) {\n if (n < 0 || m < 0) {\n if ( result.length < string.length ) result = string;\n return;\n }\n\n if (s1[n] === s2[m]) {\n helper(n - 1, m - 1, string + s1[n]);\n\n } else {\n helper(n - 1, m, string);\n helper(n, m - 1, string);\n }\n }\n}", "function isPalindromic(a) {\n let rev = a.toString().split('').reverse('').join('');\n console.log(rev)\n return a === rev ? true : false;\n}", "function isPalindromePermutation(strInput) {\n\tvar str = strInput.toLowerCase();\n\n\n\t// Find frequency of alphanumeric characters\n\tfunction frequency(strInput) {\n\t\tvar charFrequencies = {};\n\t\tvar nonAlphaCount = 0;\n\n\t\tfor (var i = 0; i < str.length; i++) {\n\t\t\tvar char = str.charAt(i);\n\n\t\t\t// Only consider alpha characters\n\t\t\tif (/[a-zA-Z]/.test( char )) {\n\t\t\t\tcharFrequencies[char] = charFrequencies[char] ? charFrequencies[char] + 1 : 1;\n\t\t\t} else {\n\t\t\t\tnonAlphaCount++;\n\t\t\t}\n\t\t}\n\n\t\treturn {charFrequencies: charFrequencies, nonAlphaCount: nonAlphaCount};\n\t}\n\n\tvar strFreq = frequency(str);\n\n\t// Find how many characters show up an odd number of times\n\tvar oddCount = 0;\n\tfor (var char in strFreq.charFrequencies) {\n\t\tif (strFreq.charFrequencies[char] % 2 !== 0) {\n\t\t\toddCount++;\n\t\t}\n\t}\n\n\t// Case 1: An even number of letters, every letter must be divisible by two\n\t// Case 2: An odd number of letters, every letter except one must be divisible by two\n\tvar adjustedStringLength = str.length - strFreq.nonAlphaCount;\n\tif ((adjustedStringLength % 2 === 0) && oddCount === 0) {\n\t\treturn true;\n\t} else if ((adjustedStringLength % 2 !== 0) && oddCount === 1) {\n\t\treturn true;\n\t}\n\treturn false;\n\n}", "function solve(a,b){\n //..\n let len = a + b;\n let str = '2';\n let strArr = [2];\n \n for (var i = 2; ; i++) {\n let flag = true;\n for (var x = 0; x < strArr.length; x++) {\n if (i % strArr[x] === 0) {\n flag = false;\n }\n }\n if (flag) {\n str += i.toString();\n strArr.push(i);\n }\n if (str.length > len) {\n break;\n }\n }\n let result = str.slice(a, len);\n return result;\n}", "anagram(string1, string2) {\n try {\n var format = /[a-zA-Z0-9]/;\n var result = false;\n /*\n *checks if strings are within the given format\n */\n if (format.test(string1) && format.test(string2)) {\n /*\n *checks if both strings are of equal length\n */\n if (string1.length == string2.length) {\n /*\n *splits the given strings and sorts them\n */\n var sort1 = string1.toString().split(\"\").sort().join(\"\");\n var sort2 = string2.toString().split(\"\").sort().join(\"\");\n result = sort1 == sort2;\n }\n else {\n console.log(\"Strings length must be of equal length\");\n }\n\n /*\n *checks if one string is an anagram of another\n */\n if (result == true) {\n // console.log(string1 + \" \" + string2);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n console.log(\"Enter only string\");\n\n }\n }\n catch (error) {\n console.log(error.message);\n }\n}", "function stringPallindrome(inpt)\r\n{\r\n\t\r\n\tvar len1=inpt.length;\r\n\t\tvar i=0;\r\n\t\tvar j=len1-1;\r\n\t\twhile(i<len1 && j>=0)\r\n\t\t{\r\n\t\t var t1,t2;\r\n\t\t t1=inpt.charAt(i);\r\n\t\t t2=inpt.charAt(j);\r\n\t\t \r\n\t\t if(t1==t2)\r\n\t\t {\r\n\t\t i++;\r\n\t\t j--;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t document.write(\"not pallindrome\");\r\n\t\t return;\r\n\t\t }\r\n\t\t \r\n\t\t}\r\n\t\tdocument.write(\"pallindrome\");\r\n}", "function findP(str) {\n const newStr = str.toLowerCase().split('')\n for (let i = 0; i < (newStr.length)/2 ; i++) {\n if (newStr[i] == newStr[newStr.length - i -1]) {\n return `${str} is a pallindrome`\n } else {\n return `${str} is not a pallindrome`\n }\n \n }\n}", "function makingAnagrams(s1, s2) {\n let charMatched = 0;\n let s1Arr = s1.split('');\n let s2Arr = s2.split('');\n let deletionCount = s1Arr.length+s2Arr.length;\n for(let i=0;i<s1Arr.length;i++){\n for(let j=0;j<s2Arr.length;j++){\n if(s1Arr[i]===s2Arr[j]){\n charMatched+=2;\n s2Arr[j] = 0;\n break;\n }\n }\n }\n return deletionCount-charMatched;\n}", "function longestPossible(s1, s2) {\n const all = (s1 + s2).split('')\n const uniqueSortedLetters = [...new Set(all)].sort()\n return uniqueSortedLetters.join('')\n}", "function makeAnagram(a, b) {\n // if(a === b) return a.length;\n \n // if(a.length > b.length){\n // for(let char of a){\n // if(b.includes(char)){\n // b.split(' ').splice(b.indexOf(char)).join('')\n // }\n // }\n // }\n // return b.length;\n\n //1 test case. \n\n// <-------------------------------------------------------------------->\n\n // if(a === b) return a.length;\n // let arrA = a.split('').sort();\n // let arrB = b.split('').sort();\n \n // if(a.length > b.length){\n // for(let char of b){\n // if(arrA.includes(char)){\n // arrA.splice(arrA.indexOf(char), 1);\n // arrB.splice(arrB.indexOf(char), 1);\n // }\n // }\n // }\n \n // if(b.length > a.length){\n // for(let char of a){\n // if(arrB.includes(char)){\n // arrA.splice(arrA.indexOf(char), 1);\n // arrB.splice(arrB.indexOf(char), 1);\n // }\n // }\n // }\n \n // return arrA.length + arrB.length;\n\n //2 test cases passed\n\n// <----------------------------------------------------------------------->\n if(a === b) return a.length;\n let arrA = a.split('').sort();\n let arrB = b.split('').sort();\n\n if(a.length > b.length || a.length === b.length){\n for(let char of b){\n if(arrA.includes(char)){\n arrA.splice(arrA.indexOf(char), 1);\n arrB.splice(arrB.indexOf(char), 1);\n }\n }\n }\n\n if(b.length > a.length){\n for(let char of a){\n if(arrB.includes(char)){\n arrA.splice(arrA.indexOf(char), 1);\n arrB.splice(arrB.indexOf(char), 1);\n }\n }\n }\n\n return arrA.length + arrB.length;\n\n // a bit slow but passed all tests. forgot to check for equal array input lengths\n}", "function isPalindrome(str, n) {\n let law = 0;\n let high = n - 1;\n\n while (high > law) {\n if (str[law++] != str[high--]) {\n return -1;\n }\n }\n return 1;\n}", "function canRearrangePalindrome(str) {\n\tvar letterCounts = {};\n\tvar letter;\n\tvar palindromeSum = 0;\n\tfor (var i = 0; i < str.length; i++) {\n\t\tletter = str[i];\n\t\tconsole.log('letter', letter);\n\t\tletterCounts[letter] = letterCounts[letter] || 0;\n\t\tconsole.log('letterCounts', letterCounts[letter]);\n\t\tletterCounts[letter]++;\n\t\tconsole.log('letterCounts++', letterCounts[letter]);\n\t}\n\tfor (var letterCount in letterCounts) {\n\t\tconsole.log('palindromeSum', palindromeSum);\n\t\tpalindromeSum += letterCounts[letterCount] % 2;\n\t\tconsole.log('palindromeSum2', palindromeSum);\n\t}\n\n\treturn palindromeSum < 2;\n}", "function lcsDynamicProg(str1,str2,m,n){\n var lengthMatrix = [];\n\n for(var i=0;i<m+1;i++){\n\t lengthMatrix[i] = [];\n }\n for(var i=0;i<m+1;i++){\n for(var j=0;j<n+1;j++){\n lengthMatrix[i][j] = 0;\n }\n }\n \n for(var i=0;i<m;i++){\n for(var j=0;j<n;j++){\n if(i==0 || j==0){\n lengthMatrix[i][j] = 0;\n }\n else if(str1[i-1] == str2[j-1]){\n lengthMatrix[i][j] = 1+lengthMatrix[i-1][j-1];\n }\n else{\n lengthMatrix[i][j] = Math.max(lengthMatrix[i-1][j], lengthMatrix[i][j-1])\n }\n }\n }\n return lengthMatrix[m][n];\n}", "function search(w1, w2)\n{\n let l1 = w1.length;\n let l2 = w2.length;\n console.log(w1, w2);\n let ch,c,maxc=0;\n let i,j;\n\n for(i=0;i<l1;i++)\n {\n ch = w1.charAt(i);\n\n for(j=0;j<l2;j++)\n {\n if(ch === w2.charAt(j))\n {\n c=1;\n tempi = i;\n tempj = j;\n\n\n while (w1.charAt(++tempi) === w2.charAt(++tempj))\n {\n c++;\n if(tempi+1>l1 || tempj+1>l2)\n {\n c--;\n break;\n }\n\n }\n\n\n }\n\n\n if(c>maxc)\n {\n maxc = c;\n }\n\n }\n }\n let perc_match = maxc/l1*100;\n console.log(perc_match)\n return perc_match;\n}", "function main() {\n var s = readLine();\n var t = readLine();\n var k = parseInt(readLine());\n\n // case 1\n\n if(s.length + t.length <= k){\n console.log(\"Yes\");\n } else{\n // keep iterating until we reach different character\n var commonLength = 0;\n while(commonLength < s.length && commonLength < t.length && s[commonLength] == t[commonLength]){\n commonLength++;\n }\n\n // Diff is the total length of each word minus the common length of each word\n var diff = s.length + t.length - 2*commonLength;\n\n // If the difference is less than k there should be enough moves; however if the diff is odd and the k is even then there are not enough moves\n // you need diff and even and k of even or diff of odd and k of odd. Testing even is easier\n if(diff <= k && diff%2 === k%2){\n console.log(\"Yes\");\n } else {\n console.log(\"No\");\n }\n\n }\n\n}", "function findPalindromes() {\n var testText = 'Each exe opens a different game,with a different level of WOW or LOL difficulty .',\n testerForCommas = 0,\n arrTest,\n loopZter = 0,\n loopZter2 = 0,\n arrayOfPolies = [],\n forwardWord = [],\n backwardWord = [],\n checkerLoop = 0,\n isTheSame = true; \n\n while (testerForCommas != -1) {\n testerForCommas = testText.indexOf(',');\n\n if (testerForCommas == (-1)) {\n break;\n }\n else {\n testText = testText.replace(',', ' ');\n }\n }\n arrTest = testText.split(' '); \n var thisTextLen = arrTest.length;\n for (loopZter = 0; loopZter < thisTextLen; loopZter += 1) {\n for (loopZter2 = 0; loopZter2 < arrTest[loopZter].length; loopZter2 += 1) {\n forwardWord.push(arrTest[loopZter][loopZter2]);\n backwardWord.unshift(arrTest[loopZter][loopZter2]);\n }\n for (checkerLoop = 0; checkerLoop < forwardWord.length; checkerLoop += 1) {\n if (forwardWord[checkerLoop] != backwardWord[checkerLoop]) {\n isTheSame = false;\n break;\n }\n }\n if (isTheSame && forwardWord.length > 1) { //making sure not to take in account the 1 letter words/symbols\n arrayOfPolies.push(arrTest[loopZter]);\n }\n else {\n isTheSame = true;\n }\n forwardWord.length = 0;\n backwardWord.length = 0;\n }\n console.log(arrayOfPolies);\n}", "function MinWindowSubstring(strArr) { \n if (strArr.length < 2) return \"\"\n \n let stringN = strArr[0]\n let stringK = strArr[1]\n let result = \"\"\n \n let stringKMap = {}\n for (let i = 0; i < stringK.length; i++) {\n let letter = stringK.charAt(i)\n \n if (stringKMap[letter] != null) {\n stringKMap[letter] = stringKMap[letter] + 1\n } else {\n stringKMap[letter] = 1\n }\n }\n \n let stringNMap = {}\n let counter = 0\n let remaining = 0\n let minLength = stringN.length + 1\n for (let i = 0; i < stringN.length; i++) {\n let letter = stringN.charAt(i)\n \n if (stringKMap[letter] != null) {\n if (stringNMap[letter] != null) {\n if (stringNMap[letter] < stringKMap[letter]) {\n counter++\n }\n \n stringNMap[letter] = stringNMap[letter] + 1\n } else {\n stringNMap[letter] = 1\n counter++\n }\n }\n \n if (counter === stringK.length) {\n let track = stringN.charAt(remaining)\n \n while ((stringNMap[track] == null) || stringNMap[track] > stringKMap[track]) {\n if (stringNMap[track] != null && stringNMap[track] > stringKMap[track]) {\n stringNMap[track] = stringNMap[track] - 1\n }\n \n remaining++\n track = stringN.charAt(remaining)\n }\n \n if (i - remaining + 1 < minLength) {\n result = stringN.substring(remaining, i + 1)\n minLength = i - remaining + 1\n }\n }\n }\n \n return result; \n }", "function s2(beginWord, endWord, wordList) {\n /* \n make forms hashmap\n '*ot': [ 'hot', 'dot', 'lot' ],\n 'h*t': [ 'hot' ],\n 'ho*': [ 'hot' ],\n 'd*t': [ 'dot' ],\n 'do*': [ 'dot', 'dog' ],\n '*og': [ 'dog', 'log', 'cog' ],\n 'd*g': [ 'dog' ],\n 'l*t': [ 'lot' ],\n 'lo*': [ 'lot', 'log' ],\n 'l*g': [ 'log' ],\n 'c*g': [ 'cog' ],\n 'co*': [ 'cog' ]\n */\n\n // time, o(nm2), o(length of wordlist * length of word * length of word)\n // word of m length, will appear in m forms (3 letter word will appear 3 times in the graph)\n // will be at most nm entries in graph\n // BETTER THAN ABOVE if length of wordlist is greater than the length of the word (ASSUMING ALL SAME LENGTH)\n\n // space, o(nm2)\n const graph = makeGraph();\n console.log(graph);\n\n function makeGraph() {\n const out = {};\n for (let i = 0; i < beginWord.length; i++) {\n const form = `${beginWord.substring(0, i)}*${beginWord.substring(i + 1)}`;\n out[form] ? out[form].push(beginWord) : (out[form] = [beginWord]);\n }\n for (let word of wordList) {\n for (let i = 0; i < word.length; i++) {\n const form = `${word.substring(0, i)}*${word.substring(i + 1)}`;\n out[form] ? out[form].push(word) : (out[form] = [word]);\n }\n }\n return out;\n }\n\n const set = new Set();\n set.add(beginWord);\n const q = [[beginWord, 0]];\n while (q.length) {\n console.log(q);\n const [word, level] = q.shift();\n if (word === endWord) return level;\n for (let i = 0; i < word.length; i++) {\n const form = `${word.substring(0, i)}*${word.substring(i + 1)}`;\n for (let nextWord of graph[form]) {\n if (!set.has(nextWord)) {\n set.add(nextWord);\n q.push([nextWord, level + 1]);\n }\n }\n }\n }\n}", "function find(str1, str2) {\n //创建存放重复内容的数组\n var all = new Array();\n //字符串转字符数组\n var str_1 = str1.split(\"\");\n var str_2 = str2.split(\"\");\n for (var i = 0; i < str_1.length; i++) {\n for (var l = 0; l < str_2.length; l++) {\n //判断是否重复\n var lo = all.length;\n all[lo] = \"\";\n //判断之后的字符串是否相同\n for (var k = 0; str_1[i + k] == str_2[l + k]; k++) {\n all[lo] = all[lo] + str_1[i + k];\n //防止数组越界,提前停止循环\n if (i + k == str_1.length-1||i+k==str_2.length-1) {\n break;\n }\n }\n }\n }\n \n var most = 0;\n var fu = new Array();\n for (var j = 0; j < all.length; j++) {\n //去除空的内容\n if (all[j] != \"\") {\n //按照大小排序(删除部分小的)\n if (all[j].split(\"\").length >= most) {\n most = all[j].split(\"\").length;\n fu[fu.length] = all[j];\n }\n }\n }\n \n //将不重复内容写到新数组\n var wu=new Array();\n for(var i=0;i<fu.length;i++){\n var c=false;\n for(var l=0;l<wu.length;l++){\n if(fu[i]==wu[l]){\n c=true;\n }\n }\n if(!c){\n wu[wu.length]=fu[i];\n }\n }\n \n //将最长的内容写到新数组\n var ml=new Array();\n //获得最后一个字符串的长度(最长)\n var longest=wu[wu.length-1].split(\"\").length;\n //长度等于最长的内容放到新数组\n for(var i=wu.length-1;i>=0;i--){\n if(wu[i].split(\"\").length==longest){\n ml[ml.length]=wu[i];\n }else{\n //提前结束循环\n break;\n }\n }\n \n return ml\n }", "function palindrome(str) {\n str = str.toLowerCase();\n const letterMap = new HashMap();\n\n for (let i = 0; i < str.length; i++) {\n // setting letterMap up based on if key exists or not -- if not, initialize it with a count of 1\n try {\n let count = letterMap.get(str[i]);\n letterMap.set(str[i], ++count);\n } catch (err) {\n letterMap.set(str[i], 1);\n }\n }\n // if str length is even, evaluate lettermap here\n if (str.length % 2 === 0) {\n for (let j = 0; j < str.length; j++) {\n const num = letterMap.get(str[j]);\n if (num % 2 !== 0) {\n return false;\n }\n }\n return true;\n } // if str length is odd, evaluate lettermap here\n else {\n let count = 0;\n for (let k = 0; k < str.length; k++) {\n const num = letterMap.get(str[k]);\n if (num % 2 !== 0) {\n count++;\n }\n }\n if (count > 1) {\n return false;\n } else {\n return true;\n }\n }\n}", "function sherlockAndAnagrams(s) {\n let count = 0;\n //글자 수\n for (let i = 1; i < s.length; i++) {\n for (let j = 0; j < s.length - i; j++) {\n const target = s.substring(j, j + i, j);\n // console.log(\"-------\");\n for (let k = 1 + j; k < s.length - i + 1; k++) {\n let compared = s.substring(k, k + i);\n if (isAnagram(target, compared)) {\n count++;\n }\n }\n }\n }\n return count;\n}", "function main() {\n //let s = readLine().toLowerCase();\n\n //let s = 'We promptly judged antique ivory buckles for the next prize'.toLowerCase();\n let s = 'We promptly judged antique ivory buckles for the prize'.toLowerCase();\n\n let mapper = 'qwertyuiopasdfghjklzxcvbnm', flag = true;\n for(let i = 0; i < mapper.length; i++) {\n if(s.indexOf(mapper.charAt(i)) == -1) {\n flag = false;\n break;\n }\n }\n\n console.log(flag ? 'pangram' : 'not pangram');\n}", "function isPalindrome(str, low, high, length) {\n let arr = str.split('').filter((e) => e != ' ')\n if (length <= 1) {\n return true;\n }\n if (arr[low] != arr[high]) {\n return false;\n } else {\n return isPalindrome(str, low + 1, high - 1, length - 2)\n }\n}", "function palindrome(str) \n{\n\n str = str.toLowerCase();\n\nlet strlength = str.length; \n \nfor (let i = 0; i < strlength/2; i++) \n{\nif (str[i] !== str[strlength - 1 - i]) \n{ \n return `${str} is not a palindrome`;\n}\n\n}\nreturn `${str} is a palindrome`;\n}", "function runProgram(input) {\n let arr = input.trim().split(\"\");\n\n // console.log(\"arr\", arr);\n\n for (let i = 1; i < arr.length - 1; i++) {\n if (arr[0] === \"?\" && arr[1] === \"a\") {\n arr[0] = \"b\";\n } else if (arr[0] === \"?\" && arr[1] !== \"a\") {\n arr[0] = \"a\";\n }\n\n if (arr[i] === \"?\") {\n if (arr[i - 1] === \"a\" || arr[i + 1] === \"a\") {\n arr[i] = \"b\";\n } else {\n arr[i] = \"a\";\n }\n }\n\n if (arr[arr.length - 1] === \"?\" && arr[arr.length - 2] === \"a\") {\n arr[arr.length - 1] = \"b\";\n } else if (arr[arr.length - 1] === \"?\" && arr[arr.length - 2] === \"b\") {\n arr[arr.length - 1] = \"a\";\n }\n }\n\n console.log(arr.join(''));\n}" ]
[ "0.7155402", "0.66556495", "0.66113365", "0.6606774", "0.6583516", "0.6570249", "0.65677315", "0.6503448", "0.6388732", "0.63594896", "0.6359126", "0.63484883", "0.63355255", "0.63210005", "0.62887496", "0.62631017", "0.6256804", "0.6254142", "0.62492234", "0.6191387", "0.6173331", "0.61657804", "0.61642826", "0.61514276", "0.61475825", "0.6123719", "0.61227983", "0.60928434", "0.6084386", "0.6063237", "0.60599184", "0.6059693", "0.6027174", "0.6024154", "0.6000682", "0.5999565", "0.59896326", "0.5984076", "0.5975244", "0.59722555", "0.5961504", "0.59576786", "0.5954889", "0.5951207", "0.59461534", "0.59437484", "0.59426653", "0.59396595", "0.59380186", "0.5931709", "0.5928637", "0.5927877", "0.5921494", "0.5911833", "0.5906879", "0.5883016", "0.5881801", "0.58755994", "0.5867706", "0.58670586", "0.5858971", "0.58584505", "0.5855946", "0.5854177", "0.5849412", "0.5849107", "0.5846951", "0.5846634", "0.5836291", "0.58335245", "0.5833488", "0.5831388", "0.582289", "0.5815236", "0.5814653", "0.5813002", "0.581206", "0.57990354", "0.5797513", "0.5788738", "0.5787941", "0.57862", "0.57836616", "0.57815397", "0.5778807", "0.5778419", "0.5776902", "0.5776074", "0.5771849", "0.5771155", "0.576467", "0.57585585", "0.57564294", "0.57559013", "0.5752155", "0.5751832", "0.5748055", "0.5744901", "0.5740795", "0.57396954" ]
0.68516505
1
OBTENER DATOS DE UN USUARIO
function getUser(req,res){ var userId = req.params.id; User.findById(userId,(err,user) => { if(err) return res.status(500).send({message: 'Error en la peticion.'}); if(!user) return res.status(404).send({message: 'Usuario inexistente.'}); followThisUser(req.user.sub,userId).then((value)=>{ return res.status(200).send({ user, following: value.following, followed: value.followed }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update(OID_USUARIO,USUARIO){\n\t\n\t/*INSERCION DE DATOS*/\n\t\n\t$(\"#txt_usuario\").val(USUARIO);\n\t\n\t$(\"#txt_usuario\").attr(\"USER\",OID_USUARIO);\n\t\n\t$(\"#btn_enviar_usuario\").text(\"Actualizar\")\n\t\t\n\t\n}//FINAL DE LA ACTUALIZACION DE UN REGISTRO", "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, identificador, prioridad, descripcion y observaciones puede modificar, el boton crear esta activo para el\n\t\t\n\t\t}\n\t\tif(tieneRol(\"programadror\")){// modificar:estimacion de tiempo y unidad dependencia responsables, todos los botones botones \n\t\t\n\t\t}\n\t}", "rellenarCampos(datos){\n this.tituloInput.value = datos.titulo;\n this.cuerpoInput.value = datos.cuerpo;\n this.idInput.value = datos.id;\n this.estado = \"editar\";\n this.cambiarEstado(this.estado);\n }", "function obtenerDatosEditar()\n {\n //OBTIENE LOS DATOS DE LA FILA CUANDO DÁ CLICK EN EL BOTON EDITAR\n $('#integrantes').on('click', '#datos .editar', function(e){\n e.preventDefault();\n id = $(this).parent().parent().attr('id');\n nombres = $(this).parent().parent().children('td:eq(0)').text();\n apellidos = $(this).parent().parent().children('td:eq(1)').text();\n parentesco = $(this).parent().parent().children('td:eq(2)').text();\n fecha_nacimiento = $(this).parent().parent().children('td:eq(3)').text();\n profesion = $(this).parent().parent().children('td:eq(4)').text();\n lugar_trabajo = $(this).parent().parent().children('td:eq(5)').text();\n tel_trabajo = $(this).parent().parent().children('td:eq(6)').text();\n salario = $(this).parent().parent().children('td:eq(7)').text();\n depende = $(this).parent().parent().children('td:eq(8)').text();\n grado = $(this).parent().parent().children('td:eq(9)').text();\n institucion = $(this).parent().parent().children('td:eq(10)').text();\n cuota = $(this).parent().parent().children('td:eq(11)').text();\n\n //CONVIERTE LA FECHA A FORMATO yyyy-MM-dd\n fechaconvert = fecha_nacimiento.replace('/', '-');\n fecha_nacimiento = fechaconvert.replace('/', '-')\n\n //ENVIA LOS DATOS A LOS INPUTS\n $('#id_integrante').val(id);\n $('#nombres_inte').val(nombres);\n $('#apellidos_inte').val(apellidos);\n $('#parentesco').val(parentesco);\n $('#fecha_naci_inte').val(fecha_nacimiento);\n $('#profesion').val(profesion);\n $('#lugar_trabajo').val(lugar_trabajo);\n $('#tel_trabajo').val(tel_trabajo);\n $('#salario').val(salario);\n $('#grado').val(grado);\n $('#institucion').val(institucion);\n $('#cuota_inte').val(cuota);\n\n if(grado != \"\" || institucion != \"\")\n {\n $('#si_integran').prop('checked', true);\n $(\"#depende\").show(1000);\n $(\"#Grado\").show(1000);\n $(\"#Institucion\").show(1000);\n $(\"#Cuota_inte\").show(1000);\n }\n else\n {\n //Sirve para resetear los radio button\n $('.estudiante').prop('checked', false);\n $('.depende').prop('checked', false);\n \n //Para que se oculten los campos\n $(\"#depende\").hide(1000);\n $(\"#Grado\").hide(1000);\n $(\"#Institucion\").hide(1000);\n $(\"#Cuota_inte\").hide(1000);\n }\n if(depende != \"\")\n {\n if(depende == \"si\")\n {\n $('#si2').prop('checked', true);\n }\n else\n {\n $('#no2').prop('checked', true);\n }\n }\n $('#modificar').show(0);\n $('#agregar').hide(0);\n $('#cancelar').show(0);\n });\n }", "function inicializareditar(datos) {\n \n tipo1informacionpersonaleditar.value = datos[0]['tipo'];\n document.getElementById('idip').value = datos[0]['id'];\n\n}", "function asignarAlumno() {\n const alumnoId = document.getElementById(\"alumnos\").value;\n document.getElementById(\"alumnoId\").value = alumnoId;\n const cursoId = document.getElementById(\"cursos\").value;\n document.getElementById(\"cursoId\").value = cursoId;\n}", "function muestraDatosUsuario(datos){\n\tconsole.log(\"datos\");\n\tvar data=eval(datos);\n\t$(\"#nombre\").val(data.nombre);\n\t$(\"#app\").val(data.apellidoP);\n\t$(\"#apm\").val(data.apellidoM);\n\t$(\"#nick\").val(data.username);\n\t$(\"#estatus\").val(data.activo);\n\t$(\"#password\").val(data.password);\n\tconsole.log(data)\n\t$(\"#rol\").val(data.rol);\n\t$(\"#idUsuario\").val(data.id);\n\t$(\"#idEjecutivo\").val(data.idEjecutivo);\n}", "function cargarEditUsr(){\n\t//debugger;\n\t// parseo los usuarios para obtener los arreglos\n\tvar usuario_nombre = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < usuario_nombre.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < usuario_nombre[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == usuario_nombre[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = usuario_nombre[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = usuario_nombre[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = usuario_nombre[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = usuario_nombre[i][j+3];\n\t\t\t\t//a la variable da5 le asigno el valor de la posicion 4\n\t\t\t\tda5 = usuario_nombre[i][j+4];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"fullName\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"user\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password\").value = da4;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password_repeat\").value = da5;\n\t\t\t}\n\t\t};\n\n\t}\n}", "function modificarCliente(){\n let cliente = new Cliente(document.getElementById('').value, document.getElementById('').value, \n document.getElementById('').value, document.getElementById('').value, document.getElementById('').value, \n document.getElementById('').value);\n\n //Actualizar registroUsuarios\n for(let i in registroUsuarios){\n if(registroUsuarios[i]== cliente.correo){\n //Aqui debo preguntar si no existe ya este cliente por el hecho que lo tomaremos como identificador unico que es el correo\n //Debo tener en cuenta los permisos a la hora de modificar, capas que un cliente puede modificarse el estado\n registroUsuarios[i].nombre = cliente.nombre;\n registroUsuarios[i].apellido = cliente.apellido;\n registroUsuarios[i].contraseña = cliente.contraseña;\n registroUsuarios[i].correo = cliente.correo;\n registroUsuarios[i].tipo = cliente.tipo;\n registroUsuarios[i].estado = cliente.estado;\n break;\n }\n }\n localStorage.setItem('Usuarios', JSON.stringify(registroUsuarios));\n\n}", "function insertardatos(n1,n2,n3){\n var nombre = obtener(n1);\n var contraseña = obtener(n2);//se obtienen los datos del formulariio\n var tipo = obtener(n3);\n if(nombre.length==0 || contraseña.length==0 ){\n //se verifica primero que todos los campos esten llenos\n nowuiDashboard.showNotification('top','center',\"<b>rellene todos los campos!</b>\",\"warning\");\n }else{\n //alert(nombre +\" \"+ contraseña +\" \"+ tipo);\n var obj = new Object;//se cre un objeto que representara un usuario\n obj[\"Nombre\"]= nombre;\n obj[\"pass\"]=contraseña;//con su nombre contraseña y tipo ademas de un esatdo que serviara para saber si esta logeado o no\n obj[\"tipo\"]=tipo;\n obj[\"Estado\"]=0;\n console.log(obj);//se imprimie en consola modo de pruebas no es necesario hacerlo\n \n var bd = firebase.database().ref(\"Usuarios\");//se inicia una instancia de la base de datos pero haciendo referencia a la tabla usuarios\n var id ;//se crea una variable para la id\n bd.once(\"value\",function(snap){ //se crea una consulta siempre se hace con el archivo que creaste la instancia en este caso bd\n //seguido de .once porque solo una consulta es no varias y como queremos nada mas revisar valores ponemos (\"value\", )y segudo de una funcion para tomar una captura de la instancia de la base de datos\n //por eso ponemos la palabra snap aunk puede ser cualquier palabra dentro de la funcion\n var aux = snap.val();//creamos una variable en este caso aux que tome los valores de la fotografia de los datos de la bd\n var n = 1;//creamos un contador para saber cuantos usuarios hay antes del que se ingresara\n for(var documento in aux){ //hacemos un for que por cada usuario en la fotografia se recorrera lo siguiente\n //OJO documento tomara los elementos dentro de usuarios osea solo los ID que representa\n console.log(documento+ \" \"+documento.substring(0,2));//datos de prueba en consola (opcional todos los que digan console.log)\n if(tipo==\"Limitado\"){ //aqui verificamos si es limitado o admin para contar solo los limitados o solo los admin\n id = \"LT\";//si es limitado los primeros digitos del id son LT\n if(documento.substring(0,2)==\"LT\"){//verificamos si el elemenot actual de la fotografia es un limitado osea que comienze su id con LT\n console.log(\"si\"+n);//opcional\n n++;//si el elemento actual es limitado entonces aumenta el contador de usuarios del mismo tipo que estamos insertando\n }\n }else{//------------------lo mismo pero para admin\n id = \"AD\";\n if(documento.substring(0,2)==\"AD\"){\n n++;\n }\n }\n //verificamos si dentro de la fotografia (aux) en el id que estamos viendo ahorita (documento) su parte del nombre es igual a la del elemento que vamos a insertar\n if(aux[documento].Nombre==obj[\"Nombre\"]){\n console.log((aux[documento].Nombre+\"--\"+obj[\"Nombre\"]));\n //si son iguales osea si ya hay un nombre igual al de elemento que pondremos \n nowuiDashboard.showNotification('top','center',\"<b>ESE USUARIO YA EXISTE!</b>\",\"danger\");\n return 0;//y se detendra la funcion\n }\n }\n //todo aqui abajo es para agregar una cantidad de 0 antes del n (representa el numero de usuario limitado o admin que sera el que se acaba de registrar)\n if(n>=10000){\n id+=\"0\"+n;\n }else if(n>=1000){\n id+=\"00\"+n;\n }else if(n>=100){\n id+=\"000\"+n;//si 3 digitos entonces 3 ceros y asi suscesivamente\n }\n else if(n>=10){\n id+=\"0000\"+n;//si es 2 digitos entonces 4 ceros\n }\n else{\n id+=\"00000\"+n;//si es de un digito el entonces 5 ceros antes\n }\n bd.child(id).set(obj);//se duce que en la instancia de la base de datos actual (vease linea N°34)\n //.child() crea un subdato que este sera el id que ya creamos y dentro de el se pondra (.set) el objeto que cotiene los datos del usuario\n\n /* alert(\"Registrado\");//se indica que se registro \n location.reload(true);//recargamos la pagina*/\n nowuiDashboard.showNotification('top','center',\"<b>REGISTRO EXITOSO!</b>\",\"success\");\n setTimeout(function(){location.reload()},3000);\n });\n // var bd = firebase.database().ref(\"Usuarios/\"+id);\n // bd.set(obj);\n }\n}", "function limpiarOrden(){\r\n document.getElementById(\"codigoOrden\").value = \"\";\r\n document.getElementById(\"FechaPedido\").value = \"\";\r\n document.getElementById(\"FechaEntrega\").value = \"\";\r\n document.getElementById(\"DescripcionOrden\").value = \"\";\r\n}", "function modificarUsuario(nome, curso, categoria){\n fs.readFile(\"./input/usuario.json\",{encoding: 'utf-8'},(err, dados) => {\n if(err){\n console.log(\"Ocorreu um erro durante a leitura!\")\n }else{\n var conteudo = JSON.parse(dados)\n\n conteudo.nome= nome\n conteudo.curso= curso\n conteudo.categoria= categoria\n \n\n fs.writeFile(\"./output/usuario.json\", JSON.stringify(conteudo), (err) => {\n if(err){\n console.log(\"Um erro ocorreu durante a escrita\")\n }\n })\n }\n })\n}", "function alIniciar(){\n usuario.email = localStorage.getItem(\"email\");\n modalContacto.usuarioEmail = localStorage.getItem(\"email\");\n modalContacto.usuarioRol = localStorage.getItem(\"rol\");\n if(modalContacto.usuarioRol == \"Periodista\"){\n usuario.rol = 1;\n } else{\n usuario.rol = 2;\n }\n modalContacto.usuarioNombre = localStorage.getItem(\"nombre\");\n modalContacto.usuarioApellido = localStorage.getItem(\"apellido\");\n modalContacto.usuarioPuntos = localStorage.getItem(\"puntaje\");\n}", "function agregar(usuario) {\n let data = {\n 'thing': usuario\n };\n\n fetch(`${baseUrl}/${groupID}/${collectionID}`, {\n 'method': 'POST',\n 'headers': {\n 'content-type': 'application/json'\n },\n 'body': JSON.stringify(data)\n }).then(res => {\n return res.json();\n }).then(dato => {\n precargarUsers();\n }).catch((error) => {\n console.log(error);\n })\n\n document.querySelector(\"#userName\").value = \"\";\n document.querySelector(\"#resetsUser\").value = \"\";\n document.querySelector(\"#viplevelUser\").value = \"\";\n document.querySelector(\"#levelUser\").value = \"\";\n }", "function atualizaDados(){\n\t\t\tatendimentoService.all($scope.data).then(function (response) {\n\t\t\t\tlimpar();\n\t\t\t\t$scope.atendimentos = response.data;\n\t\t\t\t$log.info($scope.atendimentos);\n\t\t\t}, function (error) {\n\t\t\t\t$scope.status = 'Unable to load customer data: ' + error.message;\n\t\t\t});\n\t\t\t$scope.usuario={};\n\t\t}", "crearUsuario() {\n if (this.lista_usuario.findIndex(usuario => usuario.id == this.usuario.id) === -1) {\n let calculo = (this.usuario.peso / (this.usuario.estatura * this.usuario.estatura)) * 10000;\n this.x = calculo.toFixed(2)\n this.usuario.IMC = this.x\n this.lista_usuario.push(this.usuario)\n this.usuario = {\n tipoidentificacion: \"\",\n id: \"\",\n nombres: \"\",\n apellidos: \"\",\n correo: \"\",\n peso: \"\",\n estatura: \"\",\n IMC: \"\",\n acciones: true\n };\n this.saveLocalStorage();\n this.estado = \"\"\n }\n else {\n alert('Este usuario ya se encuentra Registrado')\n }\n }", "function obtenerDatos() {\n // Obteniendo los valores de los campos\n let nombre = document.getElementById('nombre').value;\n let apellido = document.getElementById('apellido').value;\n let correo = document.getElementById('correo').value;\n let mensaje = document.getElementById('mensaje').value;\n\t\n\n // Crear el objeto de modelo\n let comentario = {}\n comentario.nombre = nombre\n comentario.apellido = apellido\n comentario.correo = correo\n comentario.mensaje = mensaje\n\t\n\n // Formas de imprimir\n //console.log(`El objeto automotor es: ${automotor}`);\n //console.log('El objeto automotor es:' + automotor);\n console.log('El objeto comentario es:', comentario);\n return comentario;\n}", "actualizarUsuario() {\n let calculo = (this.usuario.peso / (this.usuario.estatura * this.usuario.estatura)) * 10000;\n this.x = calculo.toFixed(2)\n this.usuario.IMC = this.x\n let posicion = this.lista_usuario.findIndex(\n usuario => usuario.id == this.usuario.id\n );\n this.lista_usuario.splice(posicion, 1, this.usuario);\n localStorage.setItem(posicion, this.usuario);\n this.usuario = {\n tipoidentificacion: \"\",\n id: \"\",\n nombres: \"\",\n apellidos: \"\",\n correo: \"\",\n peso: \"\",\n estatura: \"\",\n IMC: \"\",\n acciones: true\n };\n this.saveLocalStorage();\n this.enEdicion = false\n }", "function enviarSolicitud(datos){\n socket.emit(\"nuevaSolicitud\", datos, function(data){\n if(data['estado']){\n idSolicitud = data['idSolicitud'];\n buscarFleteros();//Buscamos choferes de la bd\n }else{\n alert(\"Lo sentimos, nuestro sistema no esta disponible.\")\n } \n });\n }", "function getDatos() {\n\tvar comando= {\n\t\t\tid : sessionStorage.getItem(\"idUsuario\")\n\t};\n\t\n\tvar request = new XMLHttpRequest();\t\n\trequest.open(\"post\", \"GetDatosUsuario.action\");\n\trequest.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\trequest.onreadystatechange=function() {\n\t\tif (request.readyState==4 && request.status==200) {\n\t\t\tvar respuesta=JSON.parse(request.responseText);\n\t\t\trespuesta=JSON.parse(respuesta.resultado);\n\t\t\tif (respuesta.tipo==\"error\") {\n\t\t\t\talert(\"Ocurrió un error al recuperar los datos: \" + respuesta.mensaje);\n\t\t\t} else {\n\t\t\t\tvar email=document.getElementById(\"email\")\n\t\t\t\tvar nombre=document.getElementById(\"nombre\");\n\t\t\t\tvar apellido1=document.getElementById(\"apellido1\");\n\t\t\t\tvar apellido2=document.getElementById(\"apellido2\");\n\t\t\t\tvar fechaDeAlta=document.getElementById(\"fechaDeAlta\");\n\t\t\t\tvar telefono=document.getElementById(\"telefono\");\n\t\t\t\tvar idUbicacion=document.getElementById(\"idUbicacion\");\n\t\t\t\tif (email!=null) email.value=respuesta.email;\n\t\t\t\tif (nombre!=null) nombre.value=respuesta.nombre;\n\t\t\t\tif (apellido1!=null) apellido1.value=respuesta.apellido1;\n\t\t\t\tif (apellido2!=null) apellido2.value=respuesta.apellido2;\n\t\t\t\tif (fechaDeAlta!=null) fechaDeAlta.value=respuesta.fechaDeAlta;\n\t\t\t\tif (telefono!=null) telefono.value=respuesta.telefono;\n\t\t\t\tif (idUbicacion!=null) idUbicacion.value=respuesta.idUbicacion;\n\t\t\t}\n\t\t}\n\t};\n\tvar pars=\"command=\" + JSON.stringify(comando);\n\trequest.send(pars);\n}", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "function cargardata_user() {\n let usuario = JSON.parse(localStorage.getItem(\"nombre\"));\n for (const i in usuario) {\n id = usuario[i]['codigo_usuario'];\n va +=\n usuario[i]['nombre_usuario'] + ' ' +\n usuario[i]['apellido_usuario'];\n }\n $(\"#nombre_user\").val(id);\n}", "async function getData() {\n let cleanService = await CleanServiceModel.getCleanServiceById(id);\n setDitta(cleanService.ditta);\n setEmail(cleanService.email);\n setTelefono(cleanService.numeroTel);\n setDataAssunzione((new Date(cleanService.dataAssunzione.seconds * 1000)).toLocaleString(\"it-IT\").split(\",\")[0]);\n }", "function almacenarDatos(e) {\n let nombre = document.getElementById('nombre').value;\n let tipo = document.getElementById('tipo').value;\n let monto = document.getElementById('monto').value;\n let mes = document.getElementById('mes').value;\n\n console.log(tipo)\n //objeto para listar los datos\n let dato = {\n nombre,\n tipo,\n monto,\n mes\n };\n \n //grabar en localStorage \n if(localStorage.getItem('datos') === null) {\n let datos = [];\n datos.push(dato);\n localStorage.setItem('datos', JSON.stringify(datos));\n } else {\n let datos = JSON.parse(localStorage.getItem('datos'));\n datos.push(dato);\n localStorage.setItem('datos', JSON.stringify(datos));\n }\n \n\n IngresarDatos();\n //resetear el formulario\n document.getElementById('formulario').reset();\n e.preventDefault();\n}", "function mostrarEstAlumnosParaDocente(){\r\n let contadorEjXNivel = 0;//variable para contar cuantos ejercicios planteo el docente para el nivel del alumno\r\n let contadorEntXNivel = 0;//variable para contar cuantos ejercicios de su nivel entrego el alumno\r\n let alumnoSeleccionado = document.querySelector(\"#selEstAlumnos\").value;\r\n let posicionUsuario = alumnoSeleccionado.charAt(1);\r\n let usuario = usuarios[posicionUsuario];\r\n let nivelAlumno = usuario.nivel;\r\n for (let i = 0; i < ejercicios.length; i++){\r\n const element = ejercicios[i].Docente.nombreUsuario;\r\n if(element === usuarioLoggeado){\r\n if(ejercicios[i].nivel === nivelAlumno){\r\n contadorEjXNivel ++;\r\n }\r\n }\r\n }\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.nombreUsuario;\r\n if(element === usuario.nombreUsuario){\r\n if(entregas[i].Ejercicio.nivel === nivelAlumno){\r\n contadorEntXNivel++;\r\n }\r\n }\r\n }\r\n document.querySelector(\"#pMostrarEstAlumnos\").innerHTML = `El alumno ${usuario.nombre} tiene ${contadorEjXNivel} ejercicios planteados para su nivel (${nivelAlumno}) sobre los cuales a realizado ${contadorEntXNivel} entrega/s. `;\r\n}", "function obtenerValoresObservacionFinal(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT o_observacion FROM puertas_valores_finales WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0; x < resultSet.rows.length; x++) {\n $(\"#text_observacion_final\").val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function editarChamba(){\n\t//debugger;\n\t// le asigno a una variable el nombre con el que estan guardados las chambas\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"chambas\";\n\t// parsea el nombre que se obtuvo para obtener los arreglos \n\tvar listChamba =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// busca el id que esta actualmente y se lo asigna a la variable modificar\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t//obtener id\n\t\t\t\tvar nn = document.getElementById(\"numero\").value;\n\t\t\t// obtener el cliente\n\t\t\tvar c = document.getElementById(\"cliente\").value;\n\t\t\t// obtener la descripcion\n\t\t\tvar d = document.getElementById(\"description\").value;\n\t\t\t// obtener la fecha\n\t\t\tvar f = document.getElementById(\"fecha\").value;\n\t\t\t// obtener las notas\n\t\t\tvar n = document.getElementById(\"notas\").value;\n\t\t\t// pregunto que si el cliente es vacio o nulo\n\t\t\tif(c == \"\" || c == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de cliente vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si la descripcion es vacia o nula\n\t\t\t}else if(d == \"\" || d == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de descripcion vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si la fecha es vacia o nula\n\t\t\t}else if(f == \"\" || f == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de fecha vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si las notas son vacias o nulas\n\t\t\t}else if(n == \"\" || n == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de notas vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no es asi\n\t\t\t}else{\n\t\t\t\t// le digo que el elemento actual en la posicion 0 es igual a el id\n\t\t\t\tlistChamba[i][j] = nn;\n\t\t\t\t// la posicion 1 es igual al cliente\n\t\t\t\tlistChamba[i][j+1] = c;\n\t\t\t\t// la posicion 2 es igual a la descripcion\n\t\t\t\tlistChamba[i][j+2] = d;\n\t\t\t\t// la posicion 3 es igual a la fecha\n\t\t\t\tlistChamba[i][j+3] = f;\n\t\t\t\t// la posicion 4 es igual a las notas\n\t\t\t\tlistChamba[i][j+4] = n;\n\t\t\t\t// le vuelvo a insertar los arreglos con el actual modificado\n\t\t\t\tlocalStorage[usuario_nombre] = JSON.stringify(listChamba);\n\t\t\t\t// muestro un mensaje para que el usuario sepa que fue modificado\n\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\tlocation.href = \"Chambas Administration.html\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n};\n}", "function deletaDados() {\n $entradaDeTexto.value = '';\n $usuarioInArray = [];\n $entradaDeTexto.focus();\n }", "function accion() {\n var datos = new Array();\n // document.getElementById(\"oculto\").removeAttribute(\"hidden\")\n\t\n\tlet peticion=new XMLHttpRequest();\n peticion.onreadystatechange=function(){\n if(this.readyState==4){\n\t\t\tdatos=JSON.parse(this.responseText);\n\t\t\tdocument.getElementById(\"id_tipo\").value=datos[\"id_tipo\"];\n\t\t\tdocument.getElementById('nombre').value=datos[\"nombre\"];\n\t\t\tdocument.getElementById(\"nuevo\").innerText=\"Modificando una tipo de la tabla\"\n\t\n \n }};\n peticion.open('GET', url_server+'obtenerRegistro/'+this.value);\n\tpeticion.send();\n\tbtn= document.getElementById('guardarTipo')\n btn.removeAttribute(\"value\")\n\tbtn.setAttribute(\"value\", \"Modificar\")\n \n}", "function inObjektUmwandeln(){\r\n\t//kleine notiz\r\n\tconsole.log('inObjektUmwandeln() geladen');\r\n\tvar datum = new Date();\r\n\t\r\n\teingabeDaten.Vorname = formElementsText[0].value;\r\n\teingabeDaten.Nachname = formElementsText[1].value;\r\n\teingabeDaten.Email = formEmail.value;\r\n\teingabeDaten.Text = formTextArea.value;\r\n\r\n\teingabeDaten.Datum = datum.getDate() + \".\" + (datum.getMonth() + 1) + \".\" + datum.getFullYear() + \" um \" + datum.getHours() + \":\" + datum.getMinutes() + \" Uhr\";\r\n}", "function mostrarUsuario(idsuscriptor){\n $(\"#idsuscriptor_usuario\").val(idsuscriptor);\n\n $.post(\"views/ajax/admin_panel.php?op=mostrarAdmin\", {\n idsuscriptor: idsuscriptor\n }, function(data, status) {\n data = JSON.parse(data);\n\n mostrarformUsuario(true);\n //Como estan definidos los campos en la base de datos\n $(\"#idusuario_suscriptor\").val(data.idusuario_suscriptor);\n $(\"#nombre_completo\").val(data.nombre_completo);\n $(\"#email\").val(data.email);\n\n });\n\n\n}", "function AgregarUsuario(admin)\n{ \n var form;\n form='<div class=\"EntraDatos\">';\n form+='<table>';\n form+='<thead>';\n form+='<tr><th colspan=\"2\">'; \n form+='Nuevo Usuario'; \n form+='</th></tr>'; \n form+='</thead>'; \n form+='<tbody>';\n form+='<tr>';\n form+='<td width=\"50%\">'; \n form+='<label>Cédula de Identidad:</label>';\n form+='<input type=\"text\" id=\"CI\" class=\"Editable\" tabindex=\"1000\" title=\"Introduzca el Número de Cédula\"/>';\n form+='<input type=\"button\" onclick=\"javascript:BuscarUsuario()\" tabindex=\"1001\" title=\"Buscar\" value=\"Buscar\"/>';\n form+='</td>';\n form+='<td>';\n form+='<label>Correo Electrónico:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Correo\" title=\"Correo Electrónico\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='</tr>';\n form+='<tr>';\n form+='<td>';\n form+='<label>Nombre:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Nombre\" title=\"Nombre\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='<td>';\n form+='<label>Apellido:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Apellido\" title=\"Apellido\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='</tr>'; \n form+='<tr>';\n form+='<td colspan=\"2\">';\n form+='<input type=\"hidden\" id=\"id_unidad\" />'; \n form+='<label>Unidad Administrativa:</label>';\n form+='<center><input type=\"text\" class=\"Campos Editable\" id=\"Unidad\" title=\"Unidad Administrativa\" tabindex=\"1002\"/></center>';\n form+='</td>'; \n form+='</tr>';\n form+='<tr>';\n form+='<td>';\n form+='<label>Nivel de Usuario:</label>';\n form+='<select class=\"Campos Editable\" id=\"Nivel\" title=\"Seleccione el Nivel del Usuario\" tabindex=\"1003\">';\n form+='<option selected=\"selected\" value=\"0\">[Seleccione]</option>';\n form+='</select>';\n form+='</td>';\n form+='<td>';\n if (admin==1)\n {\n form+='<label>Rol de Usuario:</label>';\n form+='<div class=\"ToggleBoton\" onclick=\"javascript:ToggleBotonAdmin()\" title=\"Haga clic para cambiar\">';\n form+='<img id=\"imgAdmin\" src=\"imagenes/user16.png\"/>';\n form+='</div>';\n form+='<span id=\"spanAdmin\">&nbsp;Usuario Normal</span>'; \n }\n form+='<input type=\"hidden\" id=\"hideAdmin\" value=\"f\" />'; \n form+='</td>';\n form+='</tr>'; \n form+='</tbody>';\n \n form+='<tfoot>';\n form+='<tr><td colspan=\"2\">';\n form+='<div class=\"BotonIco\" onclick=\"javascript:GuardarUsuario()\" title=\"Guardar Usuario\">';\n form+='<img src=\"imagenes/guardar32.png\"/>&nbsp;'; \n form+='Guardar';\n form+= '</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n form+='<div class=\"BotonIco\" onclick=\"javascript:CancelarModal()\" title=\"Cancelar\">';\n form+='<img src=\"imagenes/cancel.png\"/>&nbsp;';\n form+='Cancelar';\n form+= '</div>';\n form+='</td></tr>';\n form+='</tfoot>';\n form+='</table>'; \n form+='</div>';\n $('#VentanaModal').html(form);\n $('#VentanaModal').show(); \n $('#CI').focus();\n \n selector_autocompletar(); \n}", "function cambiarDatosDeUsuarioEnElSitio(){\n\tvar mail=document.getElementById(\"formUserEmail\").value;\n\tvar firstName=document.getElementById(\"formUserFirstName\").value;\n\tvar lastName=document.getElementById(\"formUserLastName\").value;\n\tvar nickname=document.getElementById(\"formUserNick\").value;\n\tif(mail.length < 1 || firstName.length < 1 || lastName.length < 1 || nickname.length < 1 ){\n\t\t\tvar camposVacios=\"\";\n\t\t\tif(mail.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Correo electrónico</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (firstName.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Nombre</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (lastName.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Apellido</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (nickname.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Apodo</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\t// Termina el tipo de mensaje\n\t\t\tavisoEmergenteJugaPlay(\"<span class='trn'>Campos vacíos</span>\",camposVacios);\n\treturn false ;\n\t}// Si paso es que los campos estan bien\n\tvar json=JSON.stringify({ \"user\": { \"first_name\": firstName,\"last_name\": lastName, \"email\": mail, \"nickname\":nickname } });\n\tif(startLoadingAnimation()==true){\n\tmensajeAlServidorConContenidoRegistro(json);}\n}", "function accionModificar() {\n\tvar opcionMenu = get(\"formulario.opcionMenu\");\n\tvar oidPlantilla = null;\n\tvar numPlantilla = null;\n\tvar oidParamGrales = null;\n\tvar filaMarcada = null;\n\tvar codSeleccionados = null;\n\tvar datos = null;\t\n\n\tlistado1.actualizaDat();\n\tdatos = listado1.datos;\n\tcodSeleccionados = listado1.codSeleccionados();\n\n\tif (codSeleccionados.length > 1) {\n GestionarMensaje('8');\n\t\treturn;\n\t}\n\n\tif ( codSeleccionados.length < 1)\t{\n GestionarMensaje('4');\n\t\treturn;\n\t}\n\n\t// Obtengo el índice de la fila marcada (en este punto, solo una estará marcada)\n\tvar filaMarcada = listado1.filaSelecc;\n\n\t// Obtengo el oid de Param. Generales (oid del valor seleccionado, está al final de la lista por el tema del ROWNUM)\n\toidParamGrales = datos[filaMarcada][9]; \n\n\t// Obtengo Oid de la Entidad PlantillaConcurso (AKA Numero de Plantilla);\n\tnumPlantilla = datos[filaMarcada][3];\n\n\tvar oidVigenciaConcurso = datos[filaMarcada][10]; \n\tvar oidEstadoConcurso = datos[filaMarcada][11]; \n\tvar noVigencia = get(\"formulario.noVigencia\");\n\tvar estConcuAprobado = get(\"formulario.estConcuAprobado\");\n\n\tif((parseInt(oidVigenciaConcurso) == parseInt(noVigencia)) && \t\t\n\t(parseInt(oidEstadoConcurso)!=parseInt(estConcuAprobado))) {\n\t\tvar obj = new Object();\n\t\t// Seteo los valores obtenidos. \n\t\tobj.oidConcurso = oidParamGrales;\n\t\tobj.oidPlantilla = numPlantilla;\n\t\tobj.opcionMenu = opcionMenu;\n\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\taccionBuscar();\n\t}\n\telse {\n\t\tvar indDespacho = datos[filaMarcada][12];\n\t\tif (oidVigenciaConcurso == '1' && parseInt(indDespacho) == 0) {\n\t\t\tif (GestionarMensaje('3385')) {\n\t\t\t\tvar obj = new Object();\n\t\t\t\t// Seteo los valores obtenidos. \n\t\t\t\tobj.oidConcurso = oidParamGrales;\n\t\t\t\tobj.oidPlantilla = numPlantilla;\n\t\t\t\tobj.opcionMenu = opcionMenu;\n\t\t\t\tobj.oidVigenciaConcurso = oidVigenciaConcurso;\n\t\t\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\t\t\taccionBuscar();\n\t\t\t}\t\n\t\t}\n\t\telse {\n\t\t\t//El concurso seleccionado no puede ser modificado\n\t\t\tGestionarMensaje('INC052');\n\t\t}\n\t}\n}", "function alumnoRegistro(){\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n if(perfil === 2){\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML =\r\n `<label for=\"selListaDocentes\">Elija docente: </label><select id=\"selListaDocentes\"> \r\n </select>`;\r\n for (let i = 0; i < usuarios.length; i++) {\r\n const element = usuarios[i];\r\n if(element.perfil === \"docente\"){\r\n document.querySelector(\"#selListaDocentes\").innerHTML +=\r\n `<option value=\"${element.nombreUsuario}\">${element.nombre} (${element.nombreUsuario}) </option>`\r\n }\r\n }\r\n }else{\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML = \"\";//Esta funcion corre cada vez que hay alguien selecciona un perfil en el formulario de registro, si cambia para otro que no sea alumno (2) viene aca y elimina el <select> de docente\r\n }\r\n}", "function identificarData(codigo, tipoCodigo) {\n codigo = codigo.replace(/[^0-9]/g, '');\n const tipoBoleto = identificarTipoBoleto(codigo);\n\n let fatorData = '';\n let dataBoleto = new Date();\n\n dataBoleto.setFullYear(1997);\n dataBoleto.setMonth(9);\n dataBoleto.setDate(7);\n dataBoleto.setHours(23, 54, 59);\n\n if (tipoCodigo === 'CODIGO_DE_BARRAS') {\n if (tipoBoleto == 'BANCO') {\n fatorData = codigo.substr(5, 4)\n\n dataBoleto.setDate(dataBoleto.getDate() + Number(fatorData));\n dataBoleto.setTime(dataBoleto.getTime() + dataBoleto.getTimezoneOffset() - (3) * 60 * 60 * 1000);\n var dataBoletoform = dataBoleto.getDate() + \"/\" + (dataBoleto.getMonth() + 1) + \"/\" + dataBoleto.getFullYear()\n\n return dataBoletoform;\n } else {\n dataBoleto = null\n\n return dataBoleto;\n }\n } else if (tipoCodigo === 'LINHA_DIGITAVEL') {\n if (tipoBoleto == 'BANCO') {\n fatorData = codigo.substr(33, 4)\n dataBoleto.setDate(dataBoleto.getDate() + Number(fatorData));\n dataBoleto.setTime(dataBoleto.getTime() + dataBoleto.getTimezoneOffset() - (3) * 60 * 60 * 1000);\n var dataBoletoform = dataBoleto.getDate() + \"/\" + (dataBoleto.getMonth() + 1) + \"/\" + dataBoleto.getFullYear()\n\n return dataBoletoform;\n } else {\n dataBoleto = null\n\n return dataBoleto;\n }\n }\n}", "function recuperarDatosPunto(){\n vm.nuevoPtoInteres.nombre = vm.nombrePunto;\n vm.nuevoPtoInteres.lat = latPuntoCreacion;\n vm.nuevoPtoInteres.lon = lonPuntoCreacion;\n vm.nuevoPtoInteres.idTipo = vm.tipoSeleccionado.id;\n console.log(\" Datos del nuevo punto de interes.\");\n console.log(vm.nuevoPtoInteres);\n }", "function iniciar(){\r\n\tlocalStorage.clear();\r\n\tvar boton= document.getElementById('btnenviar');\r\n\tif(boton.addEventListener){\r\n\t\tboton.addEventListener(\"click\",function(){\r\n\t\t\tvar nuevousuario= new User(document.frmregistro.nombres.value, document.frmregistro.apellidos.value, document.frmregistro.correo.value, document.frmregistro.contra.value, document.frmregistro.confirm_contra.value, document.frmregistro.departamento.value, document.frmregistro.municipio.value, document.frmregistro.colonia.value, document.frmregistro.calle_pasaje.value, document.frmregistro.num_casa.value, document.frmregistro.pregunta.value, document.frmregistro.DUI.value, document.frmregistro.NIT.value, document.frmregistro.num_cel.value, document.frmregistro.fecha.value);\r\n\t\t\tnuevousuario.comprobar();\r\n\t\t},false);\r\n\t}\r\n}", "function datos(numero1, numero2, secuencia) {\r\n this.numero_1 = numero1;\r\n this.numero_2 = numero2;\r\n this.secuencia = secuencia;\r\n}", "function mostraAlunos() {\n var id = sessionStorage.getItem(\"idUser\");\n var idDisc = sessionStorage.getItem(\"idDisciplina\");\n var alunos = true;\n query = \"SELECT explicando.user_id as idExplicando, explicando.nome as nomeExplicando FROM explicando, explicando_tem_explicador, explicador WHERE explicando.user_id = explicando_tem_explicador.explicando_user_id AND explicando_tem_explicador.explicador_user_id = explicador.user_id AND explicando_tem_explicador.explicador_user_id = '\" + id + \"' AND explicando_tem_explicador.disciplina_id = '\" + idDisc + \"'\";\n console.log(query);\n connectDataBase();\n connection.query(query, function (err, result) {\n if (err) {\n console.log(err);\n } else {\n result.forEach((explicando) => {\n console.log(explicando);\n if (alunos != false) {\n document.getElementById(\"conteudo\").appendChild(document.createTextNode(\"Selecione o aluno:\"));\n }\n alunos = false;\n //CARD:\n var explic = document.createElement(\"div\");\n explic.value = explicando.user_id;\n explic.setAttribute(\"class\", \"wd-100 mb-1\");\n\n //NOME ALUNO:\n var nome = document.createElement(\"button\");\n nome.setAttribute(\"class\", \"card border-left-info shadow h-100 py-0 w-100\");\n var nomeAux = document.createElement(\"div\");\n nomeAux.setAttribute(\"class\", \"card-body w-100\");\n var nomeAux2 = document.createElement(\"div\");\n nomeAux2.setAttribute(\"class\", \"text-x font-weight-bold text-danger text-uppercase mb-1\");\n nomeAux2.innerHTML = explicando.nomeExplicando;\n nomeAux.appendChild(nomeAux2);\n\n nome.onclick = function () {\n var edita = \"false\";\n var idSumario = null;\n var aux;\n sessionStorage.setItem(\"idExplicando\", explicando.idExplicando);\n sessionStorage.setItem(\"idDisciplina\", idDisc);\n sessionStorage.setItem(\"edita\", edita);\n sessionStorage.setItem(\"idSumario\", idSumario);\n verificaData(1);\n };\n nome.appendChild(nomeAux);\n\n explic.appendChild(nome);\n document.getElementById(\"listaAlunos\").appendChild(explic);\n });\n if (alunos != false) {\n document.getElementById(\"conteudo\").appendChild(document.createTextNode(\"Não existe alunos inscritos nesta disciplina.\"));\n }\n }\n });\n closeConnectionDataBase();\n}", "function mostrarDatos(usuarios) {\n tableBody.innerHTML = \"\";\n usuarios.forEach(u => {\n agregarFila(u);\n });\n }", "async function buscarUsuario(email){\n \n //insere os relatorios \n var resposta = await usarApi(\"GET\", \"http://localhost:8080/usuarios/cosnultaremail/\"+email); \n var usuario = JSON.parse(resposta);\n\n var idDestinatario = usuario.idUsuario;\n now = new Date();\n\n var relatorio = {\n titulo: $(\"#idTitulo\").val(),\n destinatario: idDestinatario,\n texto: $(\"#texto-area\").val(),\n dataRelatorio: now,\n fk_usuario: idUsuario\n }\n cadastrar(relatorio);\n}", "function RealizarCorte() {\r\n let date = getDate();\r\n let count = 0;\r\n let usuario = \"\";\r\n for (let i = 0; i < ventaBD.length; i++) {\r\n for (let j = 0; j < usuariosBD.length; j++) {\r\n if (ventaBD[i].id_usuario === usuariosBD[j].id) {\r\n usuario = usuariosBD[j].nombre + \" \" + usuariosBD[j].apellido;\r\n }\r\n }\r\n if (ventaBD[i].fecha === date) {\r\n count++;\r\n document.getElementById(\r\n \"tabla-corte-body\"\r\n ).innerHTML += `<tr><td>${ventaBD[i].fecha}</td><td>${ventaBD[i].id_venta}</td><td>${ventaBD[i].id_usuario}</td><td>${usuario}</td><td>$${ventaBD[i].total}</td></tr>`;\r\n }\r\n }\r\n\r\n if (count === 0) {\r\n document.getElementById(\"div-tablacorte\").style.display = \"none\";\r\n document.getElementById(\"none-alert\").style.display = \"block\";\r\n document.getElementById(\"btn-realizar-corte\").disabled = false;\r\n } else {\r\n document.getElementById(\"div-tablacorte\").style.display = \"block\";\r\n document.getElementById(\"none-alert\").style.display = \"none\";\r\n document.getElementById(\"btn-realizar-corte\").disabled = true;\r\n }\r\n}", "function actualizar_esquema_comision(){\n\t\tenviarFormulario(\"#form_esquema_comision_actualizar\", 'EsquemaComision/actualizar_esquema_comision', '#cuadro4');\n\t}", "function acceder(){\r\n limpiarMensajesError()//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombreUsuario = document.querySelector(\"#txtUsuario\").value ;\r\n let clave = document.querySelector(\"#txtClave\").value;\r\n let acceso = comprobarAcceso (nombreUsuario, clave);\r\n let perfil = \"\"; //variable para capturar perfil del usuario ingresado\r\n let i = 0;\r\n while(i < usuarios.length){\r\n const element = usuarios[i].nombreUsuario.toLowerCase();\r\n if(element === nombreUsuario.toLowerCase()){\r\n perfil = usuarios[i].perfil;\r\n usuarioLoggeado = usuarios[i].nombreUsuario;\r\n }\r\n i++\r\n }\r\n //Cuando acceso es true \r\n if(acceso){\r\n if(perfil === \"alumno\"){\r\n alumnoIngreso();\r\n }else if(perfil === \"docente\"){\r\n docenteIngreso();\r\n }\r\n }\r\n}", "function nombreCliente(){\n //obtenes el nombre del input.\n const nombre = document.querySelector('#nombre').value ;\n //Agregarlo a cita\n cita.nombre = nombre;\n}", "function Orologio(){\n const ora = new Date();\n this.giorno = ora.getDate(); \n //il metodo getDate() ritorna il giorno del mese (da 1 a 31) esempoio 20.08.2021\n //il metodo getDay() ritorna il giorno della settimana, il formato americano parte da domenica, quindi domenica ha index 0\n this.mese = ora.getMonth();\n this.anno = ora.getFullYear();\n\n this.aggiornaMese = function(){\n //array contenente il nome dei mesi\n const mesi = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'];\n return mesi[this.mese - 1]; //nel metodo getMonth() uscirà il numero del mese corrente, che corrisponderà poi al nome nel mio array di stringhe coi nomi\n }\n this.aggiornaOra = function(){\n return ora.getHours();\n }\n this.aggiornaMinuti = function(){\n return ora.getMinutes();\n }\n this.aggiornaSecondi = function(){\n return ora.getSeconds();\n }\n}", "function registro(){ \r\n limpiarMensajesError();//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombre = document.querySelector(\"#txtNombre\").value;\r\n let nombreUsuario = document.querySelector(\"#txtNombreUsuario\").value;\r\n let clave = document.querySelector(\"#txtContraseña\").value;\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n let recibirValidacion = validacionesRegistro (nombre, nombreUsuario, clave); //\r\n if(recibirValidacion && perfil != -1){ \r\n crearUsuario(nombre, nombreUsuario, clave, perfil);\r\n if(perfil === 2){\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n alumnoIngreso();\r\n }else{\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado\r\n docenteIngreso();//Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n }\r\n }\r\n if(perfil === -1){\r\n document.querySelector(\"#errorPerfil\").innerHTML = \"Seleccione un perfil\";\r\n }\r\n}", "function idAlumno() {\n const alumnoId = document.getElementById(\"alumnos\").value;\n document.getElementById(\"alumnoId\").value = alumnoId;\n}", "function carga_logica_informe_anatomia_coronaria() {\r\n\tinicializar_variables_anatomia_coronaria();\r\n\tactualizarDibujoCanvasAnatomiaCoronaria();\r\n\treiniciar_control_seleccion_lesion();\r\n\tcargar_areas_de_seleccion_arterias();\r\n\tcargar_coordenadas_de_lesiones();\r\n}", "function logear(){\n let correo = document.getElementById('correo').value;\n let usuario = $('#login_form #usuario').val();\n socket.emit('datos_usuario', { correo: correo, usuario: usuario } );\n yo = usuario;\n // id_user = socket.id;\n document.getElementById('usuarioLogeado').innerText = yo;\n}", "function mostrarVentanaInicio(){\n\t//verificar el rol\n\tif (datosUsuario[0][\"idRol\"] == 3) {\n\t\tmostrarVentanaChef1(datosUsuario[0][\"nombre\"]);\t// Invoca la ventana de Cocina y envia nombre del empleado\n\t}\n\telse if(datosUsuario[0][\"idRol\"] == 2) {\n\t\tmostrarVentanaCajero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Cajero y envia nombre del empleado\n\t}\n\telse{\n\t\tmostrarVentanaMesero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Mesero y envia nombre del empleado\n\t}\n\n}", "function Actualizar_Datos_Puntaje(){\n\tconsole.log(\"ACTUALIZAR DATOS\");\n\t// alert(\"ACTUALIZAR DATOS\");\n\t\n\t/*****AGREGAR DATOS*****/\t\n/////puntos\t\t\t\t\n\t/**************/\n\t\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Punto1.txt',Puntos1, function (err) {\n\t\tif (err) throw err; \n\t\tconsole.log('Saved! --Punto1'); \t \t});\n\t/**************/\n\t/**************/\n\t\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Punto2.txt',Puntos2, function (err) {\n\t\tif (err) throw err; \n\t\tconsole.log('Saved! --Punto2'); \t \t});\n\t/**************/\n\t/**************/\n\t\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Punto3.txt',Puntos3, function (err) {\n\t\tif (err) throw err; \n\t\tconsole.log('Saved! --Punto3'); \t \t});\n\t/**************/\n/////puntos\t\t\n//////Nombre\n\n\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Nombre1.txt',Nombre1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Nombre1');});\n\t/**************/\n\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Nombre2.txt',Nombre2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Nombre2');});\n\t/**************/\n\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Nombre3.txt',Nombre3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Nombre3');});\n\t/**************/\n//////Nombre\n///////SegundoR\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/SegundoR1.txt',SegundoR1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --SegundoR1');});\n\t\t\t/**************/\t\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/SegundoR2.txt',SegundoR2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --SegundoR2');});\n\t\t\t/**************/\t\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/SegundoR3.txt',SegundoR3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --SegundoR3');});\n\t\t\t/**************/\n///////SegundoR\n/////Hora\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Hora1.txt',Hora1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Hora1');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Hora2.txt',Hora2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Hora2');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Hora3.txt',Hora3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Hora3');});\n\t\t\t/**************/\n/////Hora\n////Min\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Min1.txt',Min1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Min1');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Min2.txt',Min2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Min2');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Min3.txt',Min3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Min3');});\n\t\t\t/**************/\n////Min\n//Seg\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Seg1.txt',Seg1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Seg1');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Seg2.txt',Seg2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Seg2');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/Seg3.txt',Seg3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --Seg3');});\n\t\t\t/**************/\n//Seg\t\t\t\n\t\t\t/*****AGREGAR DATOS*****/\n\t\t\t\t\t\t\t/*****AGREGAR DATOS EMPATE*****/\n//Epuntos\t\t\t\t\t\t\n\t/**************/\n\t\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/EPuntos1.txt',Epuntos1, function (err) {\n\t\tif (err) throw err; \n\t\tconsole.log('Saved! --EPunto1'); \t \t});\n\t/**************/\n\t/**************/\n\t\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/EPuntos2.txt',Epuntos2, function (err) {\n\t\tif (err) throw err; \n\t\tconsole.log('Saved! --EPunto2'); \t \t});\n\t/**************/\n\t/**************/\n\t\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/EPuntos3.txt',Epuntos3, function (err) {\n\t\tif (err) throw err; \n\t\tconsole.log('Saved! --EPunto3'); \t \t});\n\t/**************/\n//Epuntos\n//ENombre\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/ENombre1.txt',Enombre1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --ENombre1');});\n\t\t\t /**************/\t\n\t\t\t /**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/ENombre2.txt',Enombre2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --ENombre2');});\n\t\t\t /**************/ \n\t\t\t /**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/ENombre3.txt',Enombre3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --ENombre3');});\n\t\t\t /**************/\n//ENombre\n//ESegundoR\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/ESegundoR1.txt',ESegundoR1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --ESegundoR1');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/ESegundoR2.txt',ESegundoR2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --ESegundoR2');});\n\t\t\t/**************/\t\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/ESegundoR3.txt',ESegundoR3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --ESegundoR3');});\n\t\t\t/**************/\n//ESegundoR\n//EHora\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/EHora1.txt',Ehora1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --EHora1');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/EHora2.txt',Ehora2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --EHora2');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/EHora3.txt',Ehora3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --EHora3');});\n\t\t\t/**************/\n//EHora\n//EMin\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/EMin1.txt',Emin1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --EMin1');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/EMin2.txt',Emin2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --EMin2');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/EMin3.txt',Emin3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --EMin3');});\n\t\t\t/**************/\n//EMin\n//Esegun\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/ESeg1.txt',Eseg1, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --ESeg1');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/ESeg2.txt',Eseg2, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --ESeg2');});\n\t\t\t/**************/\n\t\t\t/**************/\n\tfs.writeFile('./Puntajes/'+DificultadEnlace+'/ESeg3.txt',Eseg3, function (err) {\n\tif (err) throw err;\n\tconsole.log('Saved! --ESeg3');});\n\t\t\t/**************/\n//Esegun\t\t\t\n\t\t\t/*****AGREGAR DATOS EMPATE*****/\n\t\t\t\n\t\n\n\t\n\t\n\t\n\n\n}", "function retornaInf() {\n const dataNascimento = new Date(document.getElementById(\"nascimento\").value);\n const idade = calculaidade(dataNascimento)\n document.getElementById(\"retorno\").innerHTML = (\"Olá \" + document.getElementById(\"nome\").value + \" seu login é \" + document.getElementById(\"email\").value + \" Você tem \" + idade + \" anos. Se define com uma pessoa do sexo \" + document.getElementById(\"selecao\").value + \" e pode usar \" + document.getElementById(\"cpf\").value + \" como senha.\")\n}", "function definirAlumnos(){\n var _carreraAlumno = \"\";\n // uso de la variable alumno \n}", "function editarCliente(){\n\t//debugger;\n\t// le asigno a una variable el nombre con el que estan guardados los clientes\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"clientes\";\n\t// parsea el nombre que se obtuvo para obtener los arreglos \n\tvar listCliente =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// busca el id que esta actualmente y se lo asigna a la variable modificar\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listCliente.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listCliente[i].length; j++) {\n\t\t\t// pregunto que si modificar es isual al id actual\n\t\t\tif(modificar == listCliente[i][j]){\n\t\t\t\t//obtener id\n\t\t\t\tvar n = document.getElementById(\"numero\").value;\n\t\t\t\t// obtener el numero de cedula\n\t\t\t\tvar c = document.getElementById(\"id\").value;\n\t\t\t\t// obtener el nombre completo\n\t\t\t\tvar fn = document.getElementById(\"full_name\").value;\n\t\t\t\t// obtener el numero de telefono\n\t\t\t\tvar t = document.getElementById(\"tell\").value;\n\t\t\t\t// pregunto que si la cedula es vacia o nula\n\t\t\t\tif(c == \"\" || c == null){\n\t\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de cedula vacio\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t// si no pregunto que si el nombre completo es vacio o nulo\n\t\t\t\t}else if(fn == \"\" || fn == null){\n\t\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t// si no pregunto que si el numero de telefono es vacio o nulo\n\t\t\t\t}else if(t == \"\" || t == null){\n\t\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de telefono vacio\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t// si no es asi\n\t\t\t\t}else{\n\t\t\t\t\t// le digo que el elemento actual en la posicion 0 es igual a el id\n\t\t\t\t\tlistCliente[i][j] = n;\n\t\t\t\t\t// la posicion 1 es igual a la cedula\n\t\t\t\t\tlistCliente[i][j+1] = c;\n\t\t\t\t\t// la posicion 2 es igual al nombre completo\n\t\t\t\t\tlistCliente[i][j+2] = fn;\n\t\t\t\t\t// la posicion 3 es igual a el numero de telefono\n\t\t\t\t\tlistCliente[i][j+3] = t;\n\t\t\t\t\t// le vuelvo a insertar los arreglos con el actual modificado\n\t\t\t\t\tlocalStorage[usuario_nombre] = JSON.stringify(listCliente);\n\t\t\t\t\t// muestro un mensaje para que el usuario sepa que fue modificado\n\t\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\t\tlocation.href = \"Clients Administration.html\";\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t};\n}", "cancelar() {\n // se borran las busquedas de usuarios y se deja la variable \"users\" en blanco //\n this.users = [], [];\n // se hace un llamado a la funcion \"getUsers()\" para volver a llenar la variable \"users\" con el conjunto de usuarios del servidor\n this.getUsers();\n }", "obtenerTodosOperarioPersona() {\n return axios.get(`${API_URL}/v1/operario/`);\n }", "function iniciareditaringresos(datos) {\n\n document.getElementById(\"idti\").value = datos[0][\"idtipoingresosganancias\"]\n document.getElementById(\"nombreingresoseditar\").value = datos[0][\"nombre\"];\n document.getElementById(\"descripcioningresoseditar\").value = datos[0][\"descripcion\"];\n document.getElementById(\"ayudaingresoseditar\").value = datos[0][\"ayuda\"];\n\n}", "function cadastrarUmaUnidade(){\n\tvar unidadeSelecionadaBDTRE = DWRUtil.getValue(\"comboUnidadeTRE\"); \n\tif(unidadeSelecionadaBDTRE==null || unidadeSelecionadaBDTRE==''){\n\t\talert(\"Selecione uma unidade a ser cadastrada.\");\n\t}else{\n\t\tvar loginGerente = DWRUtil.getValue(\"loginGerenteUnidade\");\n\t\tvar matriculaGerente = DWRUtil.getValue(\"matriculaGerente\"); \n\t\tFacadeAjax.cadastrarUnidadeSuporte(unidadeSelecionadaBDTRE,loginGerente,matriculaGerente);\n\t\tcarregarCamposUnidades();\n\t}\n}", "function setRegistrarAuditoriaDB()\n{\n showLoading()\n\n // CERRAMOS MODAL CONFIRMAR INGRESO AUDITORIA\n $('#modalConfirmarIngresarAuditoria').removeClass(\"fade\").modal('hide')\n\n //console.log(\"cont_auditorias \"+cont_auditorias)\n unidadNegocio = document.getElementById('sel_new_unidad_organizativa').value;\n unidadNegocioText = $(\"#sel_new_unidad_organizativa option:selected\").text()\n sede = document.getElementById('sel_new_sede').value;\n sedeText = $(\"#sel_new_sede option:selected\").text()\n tipoAuditoria = document.getElementById('sel_new_tipo_auditoria').value;\n tipoAuditoriaText = $(\"#sel_new_tipo_auditoria option:selected\").text()\n fechaInicio = document.getElementById('tx_date_start_new_auditoria').value;\n fechaFin = document.getElementById('tx_date_end_new_auditoria').value;\n\n fechaInicio = formatearFechaDB(fechaInicio)\n fechaFin = formatearFechaDB(fechaFin)\n\n\n if(sel_new_normas.length==2)\n normasText = sel_new_normas[0]+','+sel_new_normas[1]\n else\n normasText = sel_new_normas[0]\n\n\n console.log(\"normasText\",normasText)\n\n //normasText = normasCode\n //normasText = sel_new_normas[0]\n\n codeAuditoria = crearCodeAuditoria(sel_new_normas[0], sedeDescription)\n var created_by = getCookie(\"vtas_id_hash\"+sessionStorage.tabVisitasa);\n\n console.log(\"normasText\", normasText)\n console.log(\"sedeText\", sedeText)\n console.log(\"codeAuditoria\", codeAuditoria)\n console.log(\"created_by\", created_by)//*/\n\n\n $(\"#idNewAuditoriaModalExito\").html(codeAuditoria)\n var body ={ // **************** parametros a base de datos AUDITORIA*****************\n //Id:1, // id de la auditoria\n Description: nombre_programa_auditoria\n ,Code: codeAuditoria\n ,SedeId: sede\n ,CodeSede: sedeDescription\n ,DescriptionSede: sedeText\n ,TipoId: tipoAuditoria\n ,DescriptionAuditoria: tipoAuditoriaText\n ,UnidadNegocioId: unidadNegocio\n ,DescriptionUnidadNegocio: unidadNegocioText\n ,StatusId: 1\n ,DescriptionStatus: 'Creada'\n ,Inicio: fechaInicio\n ,Fin: fechaFin\n ,Code_Normas: normasText\n ,Created_By: created_by\n ,Created_Date: moment().format()\n ,Last_Updated_By: created_by\n ,ProgramaAuditoriaId: id_programa_auditoria\n ,StatusEvaluacionId: 0\n //,DescriptionStatusEvaluacion: '---'\n }\n\n var metodoAjax = \"POST\";\n var servicio = \"/api/Post-Auditoria-All?code=\";\n var clave = \"l/Ucgq69Kj8Yur7Se2RlCYtWga8XKfd8TuLSma8pYoGnsP/GqJO81g==\";\n var url = apiurlAuditoria+servicio+clave+\"&httpmethod=post\";\n var headers ={\n \"apikey\":constantes.apiKey,\n \"Content-Type\": \"application/json\",\n\n }\n $.ajax({\n method: \"POST\",\n url: url,\n data: JSON.stringify(body),\n headers:headers,\n crossDomain: true,\n dataType: \"json\",\n })\n .done(function(data)\n {\n console.log(\"data\", data)\n if(data.Id == '-1')\n {\n swal({\n title: \"Error\",\n text: 'No se pudo registrar la auditoria, Verifique las fechas y la norma(s).',//data.Description, //'No se pudo registrar la auditoria, Verifique las fechas y la norma(s).',\n type: \"info\",\n //timer:3000,\n showCancelButton: false,\n confirmButtonClass: \"btn-green-lime btn-rounded btn-raised btn-sm\",\n confirmButtonText: \"De acuerdo\",\n closeOnConfirm: true\n });\n\n // ABRIMOS MODAL DE REGISTRO DE AUDITORIA\n $('#newAuditoriaModal').modal('show').addClass(\"fade\");\n\n }\n else\n {\n // CERRAMOS MODAL CONFIRMAR INGRESO AUDITORIA\n $('#modalConfirmarIngresarAuditoria').removeClass(\"fade\").modal('hide')\n // ABRIMOS MODAL EXITO EN REGISTRO DE AUDITORIA\n $('#modalExitoIngresarAuditoria').modal('show').addClass(\"fade\");\n //vw_auditorias_list.tablaDivsAuditorias();\n primeraCarga=1;\n vw_auditorias_list.filtroTablaDivsAuditorias();\n //$(\"#formNewAuditoria\").reset()\n }\n\n })\n .fail(function( jqXHR, textStatus, errorThrown )\n {\n swal({\n title: \"Error\",\n text:'No se pudo registrar la auditoria, Por favor Verifique su conexión a internet y vuelva a intentarlo.',\n type: \"error\",\n timer:3000,\n showCancelButton: false,\n confirmButtonClass: \"btn-green-lime btn-rounded btn-raised btn-sm\",\n confirmButtonText: \"De acuerdo\",\n closeOnConfirm: false\n });\n\n })\n .always(function( jqXHR, textStatus, errorThrown )\n {\n console.table(jqXHR)\n hideLoading()\n });//*/\n\n}", "busqueda(termino, parametro) {\n // preparacion de variables //\n // ------ Uso de la funcion to lower case [a minusculas] para evitar confuciones en el proceso\n // ------/------ La busqueda distingue mayusculas de minusculas //\n termino = termino.toLowerCase();\n parametro = parametro.toLowerCase();\n // variable busqueda en la que se almacenara el dato de los usuarios que se buscara //\n var busqueda;\n // [Test] variable conteo para registar el numero de Usuarios que coinciden con la busqueda //\n var conteo = +0;\n // Se vacia el conjunto de objetos [users] para posteriormente rellenarlos con los usuarios que coincidan con la busqueda //\n this.users = [], [];\n // [forEach] = da un recorrido por los objetos de un conjunto en este caso, selecciona cada usuario del conjunto \"usuarios\" //\n this.usuarios.forEach(item => {\n // Bifurcador de Seleccion [switch] para detectar en que dato del usuario hacer la comparacion de busqueda //\n switch (parametro) {\n //------En caso de que se ingrese la opcion por defecto, es decir, no se haya tocado el menu de selecicon\n case 'null':\n {\n // Se hace un llamado a la funcion \"getUsers\" que carga los usuarios almacenados en el servidor //\n this.getUsers();\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Nombre\n case 'nombre':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion apellido\n case 'apellido':\n {\n console.log('entro en apellido...');\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.apellido.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion apellido: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cedula\n case 'cedula':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cedula.replace('-', '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion cedula: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cuenta\n case 'cuenta':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Buscar en Todo\n case 'todo':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase() + item.apellido.replace(/ /g, '').toLowerCase() + item.cedula.replace('-', '').toLowerCase() + item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n }\n // if (parametro == 'null') {\n // console.log('dentro de null');\n // this.getUsers();\n // this.test = 'Ingrese un Campo de busqueda!!..';\n // }\n // if (parametro == 'nombre') {\n // // preparacion de variables:\n // busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // if (busqueda.indexOf(termino, 0) >= 0) {\n // this.users.push(item);\n // conteo = conteo +1;\n // console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n // }\n // }\n // if (parametro == 'apellido') {\n // console.log('dentro de apellido');\n // }\n // if (parametro == 'cedula') {\n // console.log('dentro de cedula');\n // }\n // if (parametro == 'cuenta') {\n // console.log('dentro de cuenta');\n // }\n // if (parametro == 'todo') {\n // console.log('dentro de todo');\n // }\n });\n if (this.users.length >= 1) {\n console.log('existe algo.... Numero de Registros: ' + conteo);\n return;\n }\n else if (this.users.length <= 0) {\n this.getUsers();\n }\n }", "abrirSessao(bd, usuario, hashSenha) {\n var resLogin = [];\n var papelUsuario = \"\";\n var colunasProjetadas = [\"nomeusuario\", \"senha\", \"carteira\"];\n var nomeColunaCarteira = \"carteira\";\n\n configuracoes.tabelas.forEach(function (nomeTabela, indice) {\n var resLoginTemp = interfaceBD.select(\n bd,\n nomeTabela,\n colunasProjetadas,\n { nomeusuario: usuario, senha: hashSenha },\n 1\n );\n if (resLoginTemp != null) {\n resLogin = resLogin.concat(resLoginTemp);\n if (resLoginTemp.length && papelUsuario === \"\")\n papelUsuario = nomeTabela;\n }\n console.log(\n `A saida da tabela ${nomeTabela} foi: ${resLoginTemp}\\nE possui comprimento de ${resLoginTemp.length}`\n );\n });\n\n console.log(\n `A saida das tabelas foi: ${resLogin}\\nE possui comprimento de ${resLogin.length}`\n );\n\n if (resLogin != null && resLogin != {}) {\n if (resLogin.length > 0) {\n return {\n estado: \"aberta\",\n conteudo: resLogin,\n papelUsuario: papelUsuario,\n carteiraUsuario:\n resLogin[0][colunasProjetadas.indexOf(nomeColunaCarteira)],\n horaAbertura: new Date(),\n };\n }\n /*return ContentService.createTextOutput(\n JSON.stringify({ nome: \"isaias\" })\n ).setMimeType(ContentService.MimeType.JSON);*/\n }\n\n return { estado: \"fechada\", conteudo: [], horaAbertura: new Date() };\n }", "function guardarDatosClima(e){\n\te.preventDefault();\n\n// Selectores------------------------------------\n\n\tlet ciudadUsuario = document.getElementById(\"filtroSelect\").value;\n\tlet split = ciudadUsuario.split(\",\");\n\tlet city = split[0];\n\tlet longitud = split[1];\n\tlet latitud = split[2];\n\n\t// console.log(split);\n\n\t// let ciudadUsuario = document.getElementById(\"filtroSelect\").value;\n\t// const ClimaUsuario = new Clima(city, 18, \"Parcialmente Nublado\", fechaTexto(fecha));\n\t// Url de conexion api concatenando el valor de la ciudad\n\tconst url = 'https://api.openweathermap.org/data/2.5/weather?q='+city+'&units=metric&lang=sp&appid=509a71114c79dce7fe4e067058ed0286';\n\t// console.log(url);\n\n// Selectores------------------------------------\n\n\t// ClimaDefinido.push(ClimaUsuario);\n\n\t// Imprime en mi id=ciudad lo que traiga mi Valor de ciudadUsuario\n\tciudad.textContent = city;\n\n\t// API CLIMA Openweathermap ---------------------\n\t\n\t// Conexion por fetch y agregar variables que se van a utilizar\n\n\tfetch(url).then(response => response.json())\n\t.then(data => {\n\n\t\t// console.log(url);\n\t\tlet nombreCiudadData = data['name'];\n\t\tlet idClima = data['id'];\n\n\t\tlet temperatura = data['main']['temp'];\n\t\tlet sensacionTermica = data['main']['feels_like'];\n\t\tlet humedadClima = data['main']['humidity'];\n\t\tlet temperaturaMinima = data['main']['temp_min'];\n\t\tlet temperaturaMaxima = data['main']['temp_max'];\n\n\t\tlet statusClima = data['weather'];\n\t\tlet statusClimaDescripcion = data['weather'][0]['description'];\n\t\tlet iconClimaDescripcion = data['weather'][0]['icon'];\n\n\t\tlet vientoClima = data['wind']['speed'];\n\t\t\n\n\t\t// Imprimir los datos del clima - dependiendo de la respuesta del usuario\n\t\tgradosClima.textContent = Math.round(temperatura);\n\t\tfactorClima.textContent = statusClimaDescripcion;\n\t\tclimaMax.textContent = `${Math.round(temperaturaMaxima)} °C /`;\n\t\tclimaMin.textContent = `${Math.round(temperaturaMinima)} °C`;\n\t\tviento.textContent = `${vientoClima} km/h`;\n\t\tsensacionTer.textContent = `${Math.round(sensacionTermica)} °C`;\n\t\thumedad.textContent = `${humedadClima} %`;\n\n\t\t// jQuery Animación de Imagen del Clima\n\n\t\t$(function mostrarImagen() { \n\t\t\t// console.log(iconClimaDescripcion);\n\t\t\t$(\"#imagenClima\").attr(\"src\",`http://openweathermap.org/img/wn/${iconClimaDescripcion}@2x.png`);\n\t\t});\n\t})\n\t.catch(error => alert(\"Nombre de la ciudad Invalido\"));\n\n\t// API CLIMA Openweathermap ---------------------\n\n\t// Resetear pagina despues de 2 minutos ---------\n\n\tsetTimeout(function(){\n\t\twindow.location.reload(1);\n\t}, 60000);\n\n\t// Resetear pagina despues de 2 minutos ---------\n\n\t// Funcion Clima 7 Days -------------------------\n\n\tfunction clima7Dias(){\n\n\t\tconst url7Days = 'https://api.openweathermap.org/data/2.5/onecall?lat='+latitud+'&lon='+longitud+'&units=metric&lang=sp&exclude=current,minutely,hourly,alerts&appid=509a71114c79dce7fe4e067058ed0286';\n\n\t\tfetch(url7Days).then(response => response.json())\n\t\t.then(data => {\n\n\t\t\tconsole.log(url7Days);\n\n\t\t\tlet daily = data['daily'];\n\t\t\tlet tomorrow = data['daily'][0];\n\t\t\tlet tomorrowTemp = data['daily'][0]['temp'];\n\t\t\t// console.log(tomorrowTemp);\n\t\t\tlet tomorrowTempMin = data['daily'][0]['temp']['min'];\n\t\t\t// console.log(tomorrowTempMin);\n\t\t\tlet tomorrowTempMax = data['daily'][0]['temp']['max'];\n\t\t\t// console.log(tomorrowTempMax);\n\n\t\t\tlet iconClimaTomorrowDescripcion = data['daily'][0]['weather'][0]['icon'];\n\t\t\t// console.log(iconClimaTomorrowDescripcion);\n\n\t\t\tlet postTomorrowTempMin = data['daily'][1]['temp']['min'];\n\t\t\t// console.log(postTomorrowTempMin);\n\t\t\tlet postTomorrowTempMax = data['daily'][1]['temp']['max'];\n\t\t\t// console.log(postTomorrowTempMax);\n\n\t\t\tlet iconClimaPostTomorrowDescripcion = data['daily'][1]['weather'][0]['icon'];\n\t\t\t// console.log(iconClimaPostTomorrowDescripcion);\n\n\t\t\t// Imprimir los datos del clima - dependiendo de la respuesta del usuario\n\n\t\t\ttempMaxTomorrow.textContent = `${Math.round(tomorrowTempMax)} °C /`;\n\t\t\ttempMinTomorrow.textContent = `${Math.round(tomorrowTempMin)} °C`;\n\n\t\t\ttempMaxPostTomorrow.textContent = `${Math.round(postTomorrowTempMax)} °C /`;\n\t\t\ttempMinPostTomorrow.textContent = `${Math.round(postTomorrowTempMin)} °C`;\n\t\t\t// Imprimir los datos del clima - dependiendo de la respuesta del usuario\n\n\t\t\t$(function mostrarImagenSiguientesDias() { \n\t\t\t\t// console.log(iconClimaDescripcion);\n\t\t\t\t$(\"#imagenClimaMañana\").attr(\"src\",`http://openweathermap.org/img/wn/${iconClimaTomorrowDescripcion}@2x.png`);\n\t\n\t\t\t\t$(\"#imagenClimaPostMañana\").attr(\"src\",`http://openweathermap.org/img/wn/${iconClimaPostTomorrowDescripcion}@2x.png`);\n\t\t\t});\n\t\t\t\n\t\t})\n\t\t.catch(error => alert(\"Nombre de la ciudad Invalido\"));\n\n\t\t// API CLIMA Openweathermap ---------------------\n\n\t}\n\n\tclima7Dias();\n\n\t// Funcion Clima 7 Days -------------------------\n}", "function inicializarCampos() {\r\n document.querySelector('#tipo').value = vehiculos[0].tipo;\r\n document.querySelector('#marca').value = vehiculos[0].marca;\r\n document.querySelector('#modelo').value = vehiculos[0].modelo;\r\n document.querySelector('#patente').value = vehiculos[0].patente;\r\n document.querySelector('#anio').value = vehiculos[0].anio;\r\n document.querySelector('#precio').value = vehiculos[0].precio;\r\n if (document.querySelector('#tipo').value == \"auto\") {\r\n document.querySelector('#capacidadBaul').value = vehiculos[0].capacidadBaul;\r\n }\r\n else if (document.querySelector('#tipo').value == \"camioneta\") {\r\n document.querySelector('#capacidadCarga').value = vehiculos[0].capacidadCarga;\r\n }\r\n}", "function cadastrarDespesa() {\n\n let ano = document.getElementById('ano')\n let mes = document.getElementById('mes')\n let dia = document.getElementById('dia')\n let tipo = document.getElementById('tipo')\n let descricao = document.getElementById('descricao')\n let valor = document.getElementById('valor')\n\n //atruir os valores dos inputs instanciando o objeto Despesa\n let despesa = new Despesa(\n ano.value,\n mes.value,\n dia.value,\n tipo.value,\n descricao.value,\n valor.value\n )\n\n //Validacão\n if(despesa.validarDados()) {\n //Executar o método de gravação na instancia do objeto bd\n bd.gravar(despesa) \n\n //cor do header\n let header = document.getElementById('headerRegistro')\n header.classList.add(\"text-success\")\n\n //Conteudo do cabeçalho\n document.getElementById('tituloRegistro').innerHTML = 'Registrado com sucesso!'\n\n //Conteudo do corpo\n document.getElementById('corpoRegistro').innerHTML = 'Seus dados foram salvos.'\n\n //Botão cor\n let btn = document.getElementById('btnRegistro')\n btn.classList.add(\"btn-success\")\n\n //Botao Conteudo\n btn.innerHTML = 'Finalizar'\n\n //dialog de sucesso\n $('#registraDespesa').modal('show')\n\n //reset\n ano.value = ''\n mes.value = ''\n dia.value = ''\n tipo.value = ''\n descricao.value = ''\n valor.value = ''\n \n } else {\n //dialog de erro\n $('#registraDespesa').modal('show')\n \n //Cabeçalho cor\n let header = document.getElementById('headerRegistro')\n header.classList.add(\"text-danger\")\n\n //Conteudo do cabeçalho\n document.getElementById('tituloRegistro').innerHTML = 'Erro no registro!'\n\n //Conteudo do corpo\n document.getElementById('corpoRegistro').innerHTML = 'Dados vazios ou incorretos.'\n\n //Botão cor\n let btn = document.getElementById('btnRegistro')\n btn.classList.add(\"btn-danger\")\n\n //Botao Conteudo\n btn.innerHTML = 'Refazer'\n \n }\n\n}", "function onObligatorioNOrdenes() {\n\t// Si obligatorio activar la obligatoriedad de los relacionados.\n\tif (get(FORMULARIO + '.ObligatorioNOrdenes') == 'S') {\n\t\tset(FORMULARIO + '.ObligatorioPeriodoInicio', 'S');\t\t\n\t\tset(FORMULARIO + '.ObligatorioPeriodoFin', 'S');\n\t}\t\t\n}", "function modificarUsuarioVertodos(\n id,\n nombreusuario,\n emailusuario,\n userStatus,\n passusuario\n) {\n $(\"#nombreup2Todos\").val(nombreusuario);\n $(\"#newemailUpTodos\").val(emailusuario);\n $(\"#checkUpTodos\").val(userStatus);\n $(\"#idusuarioUpTodos\").val(id);\n $(\"#pass2UpTodos\").val(passusuario);\n}", "function cadastrarSolicitante(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tvar notSolicitante = DWRUtil.getValue(\"comboUnidadesNaoSolicitantes\");\n\tif((notSolicitante==null ||notSolicitante=='')){\n\t\talert(\"Selecione uma unidade do TRE.\");\n\t}else{\n\t\tFacadeAjax.adicionaUnidadeSolicitante(unidade,notSolicitante);\n\t\tcarregaUnidadesSolicitantes()\t\n\t}\t\n}", "function editarDatos(parId, parTipo, parIden, parfechaIni, parfechaFin, parCuando, parEmpleado) {\n document.getElementById(\"tipo\").value = parTipo;\n document.getElementById(\"iden\").value = parIden\n document.getElementById(\"fechaIni\").value = parfechaIni;\n document.getElementById(\"fechaFin\").value = parfechaFin;\n document.getElementById(\"cuando\").value = parCuando;\n document.getElementById(\"empleado\").value = parEmpleado;\n $(\"#guardar\").css(\"display\", \"none\");\n $(\".linea\").attr(\"disabled\", true);\n $(\"#act\").append(\"<button class='btn btn-info my-3' id='actualizar'>Guardar</button>\");\n $(\"#actualizar\").on(\"click\", function () {\n var userRef = db.collection(\"usuarios\").doc(parId);\n tipos = document.getElementById(\"tipo\").value;\n idens = document.getElementById(\"iden\").value;\n fechaInis = document.getElementById(\"fechaIni\").value;\n fechaFins = document.getElementById(\"fechaFin\").value;\n cuandos = document.getElementById(\"cuando\").value;\n empleados == document.getElementById(\"empleado\").value;\n\n if (tipos.trim() === \"\" || idens.trim() === \"\" || fechaInis.trim() === \"\" || fechaFins.trim() === \"\" || cuandos.trim() === \"\" || empleados.trim() === \"\") {\n alert(\"Todos los datos son obligatorios.\");\n return false;\n } else {\n return userRef.update({\n tipo: document.getElementById(\"tipo\").value,\n iden: document.getElementById(\"iden\").value,\n fechaIni: document.getElementById(\"fechaIni\").value,\n fechaFin: document.getElementById(\"fechaFin\").value,\n cuando: document.getElementById(\"cuando\").value,\n empleado: document.getElementById(\"empleado\").value\n })\n .then(function () {\n console.log(\"Usuario actualizado correctamente.\");\n document.getElementById(\"tipo\").value = \"\";\n document.getElementById(\"iden\").value = \"\";\n document.getElementById(\"fechaIni\").value = \"\";\n document.getElementById(\"fechaFin\").value = \"\";\n document.getElementById(\"cuando\").value = \"\";\n document.getElementById(\"empleado\").value = \"\";\n $(\"#guardar\").css(\"display\", \"inline\");\n $(\".linea\").attr(\"disabled\", false);\n $(\"#act\").empty();\n })\n .catch(function (error) {\n // The document probably doesn't exist.\n console.error(\"Error actualizando datos: \", error);\n });\n }\n })\n}", "function logitudRespuestas(){\n\t\tdatalong=[];\n\t\tfor(var _i=0;_i<longitudEncuesta.length;_i++){\n\t\t\tdatalong.push(\"\");\n\t\t}\n\t\tAlloy.Globals.respuestasUsuario=datalong;\n\t}", "function verCliente(seleccionado) {\n var table = $('#lista_cliente').DataTable();\n var celda = $(seleccionado).parent();\n var rowData = table.row(celda).data();\n var id = rowData['id'];\n var nombre = rowData['nombre_cliente'];\n var nit = rowData['ci_nit'];\n var telefono = rowData['telefono'];\n var direccion = rowData['direccion'];\n var email = rowData['correo'];\n var fecha_nacimiento = rowData['fecha_nacimiento'];\n\n\n $('#ver_ci').val(nit);\n $('#ver_telefono').val(telefono);\n $('#ver_nombre').val(nombre);\n $('#ver_direccion').val(direccion);\n $('#ver_email').val(email);\n $('#ver_fecha_nacimiento').val(fecha_nacimiento);\n\n}", "function cargarEditCha(){\n\t//debugger;\n\t// le asigno a la variable el nombre donde se guardan las chambas\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"chambas\";\n\t// parseo la variable para obtener los arreglos\n\tvar listChamba =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = listChamba[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = listChamba[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = listChamba[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = listChamba[i][j+3];\n\t\t\t\t//a la variable da5 le asigno el valor de la posicion 4\n\t\t\t\tda5 = listChamba[i][j+4];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"cliente\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"description\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"fecha\").value = da4;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"notas\").value = da5;\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t};\n\t\n}", "function CrearNota() {\n var id = document.getElementById(\"idArticulo\").value; //Obtiene el valor de Clave\n var FechaRecibo = document.getElementById(\"FechaRecibo\").value; //Obtiene el valor de Clave\n var Recibe = document.getElementById(\"Recibe\").value; //Obtiene el valor de Clave\n var ProductoSalida = document.getElementById(\"ProductoSalida\").value; //Obtiene el valor de Clave\n var Cantidad = document.getElementById(\"Cantidad\").value; //Obtiene el valor de Clave\n var Ubicacion = document.getElementById(\"Ubicacion\").value; //Obtiene el valor de Clave\n\n var OCCOmpras = document.getElementById(\"OCCOmpras\").value; //Obtiene el valor de Clave\n var OT = document.getElementById(\"OT\").value; //Obtiene el valor de Clave\n var POCliente = document.getElementById(\"POCliente\").value; //Obtiene el valor de Clave\n var ENS = document.getElementById(\"ENS\").value; //Obtiene el valor de Clave\n\n var Arreglo = [id, OCCOmpras, OT, ProductoSalida, POCliente, ENS, Cantidad, Ubicacion, FechaRecibo, Recibe];\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 if (Condicion == true) { //si todos los campos estan llenos avanza\n var TablaAlmacen = document.getElementById('TablaSalidas').getElementsByTagName('tbody')[0];\n // inserta una fila al final de la tabla\n var newRow = TablaAlmacen.insertRow(TablaAlmacen.rows.length);\n let indice = (TablaAlmacen.rows.length + 1);\n newRow.setAttribute(\"id\", \"fila\" + indice); //se asigna id al incrementar cada fila +1 para contar el encabezado\n for (var x = 0; x < Arreglo.length; x++) {\n\n // inserta una celda en el indice 0\n var newCell = newRow.insertCell(x);\n // adjuntar el texto al nodo\n var newText = document.createTextNode(Arreglo[x]);\n newCell.appendChild(newText);\n if (x == 7) { //Si termina de registrar datos crear el boton\n var newCell = newRow.insertCell(8); //CREAR CELDA onclick=\"CrearNota()\"\n newCell.innerHTML = '<button id=\"' + x + '\" class=\"btn btn-danger\" name=\"btn\" onclick=\"EliminarFila(' + indice + ')\"> <i class=\"far fa-minus-square\"></i> </button>';\n }\n }\n //document.getElementById(\"RegistroSalida\").reset();\n document.getElementById(\"ProductoSalida\").value = \"\";\n document.getElementById(\"Cantidad\").value = \"\";\n }\n}", "function dadosCadastro() {\n\tif (localStorage.cont) {\n localStorage.cont = Number(localStorage.cont)+1;\n } else {\n localStorage.cont = 1;\n }\n var nomeCompleto=document.getElementById(\"nomeCompleto\").value;\n var cpf=document.getElementById(\"cpf\").value;\n var rg=document.getElementById(\"rg\").value;\n var orgaoEmissor=document.getElementById(\"orgaoEmissor\").value;\n\n //formatação da data\n var dtNascimento=document.getElementById(\"dtNascimento\").value;\n var data = new Date(dtNascimento);\n\t var dataFormatada = data.toLocaleDateString('pt-br', {timeZone: 'UTC'});\n\t//final formatação\n\n var rua=document.getElementById(\"rua\").value;\n var numeroDaCasa=document.getElementById(\"numeroDaCasa\").value;\n \tvar bairro=document.getElementById(\"bairro\").value;\n \tvar cidade=document.getElementById(\"cidade\").value;\n \tvar estado=document.getElementById(\"estado\").value;\n \tvar cep=document.getElementById(\"cep\").value;\n \tvar telefone=document.getElementById(\"telefone\").value;\n \tvar celular=document.getElementById(\"celular\").value;\n \tvar celular2=document.getElementById(\"celular2\").value;\n \tvar materiaParaEnsinar=Number(document.getElementById(\"materiaParaEnsinar\").value);\n \tvar totalMaterias=[\"matematica\",\"portugues\",\"geo\"];\n \tvar anosEnsinando=document.getElementById(\"anosEnsinando\").value;\n \tvar cadastroEmail=document.getElementById(\"cadastroEmail\").value;\n var cadastroSenha=document.getElementById(\"cadastroSenha\").value;\n localStorage.setItem(\"nomeCompleto_\"+localStorage.cont,nomeCompleto);\n\t localStorage.setItem(\"cpf_\"+localStorage.cont,cpf);\n localStorage.setItem(\"rg_\"+localStorage.cont,rg);\n\t localStorage.setItem(\"orgaoEmissor_\"+localStorage.cont,orgaoEmissor);\n\t localStorage.setItem(\"dtNascimento_\"+localStorage.cont,dtNascimento);\n\t localStorage.setItem(\"rua_\"+localStorage.cont,rua);\n\t localStorage.setItem(\"numeroDaCasa_\"+localStorage.cont,numeroDaCasa);\n\t localStorage.setItem(\"bairro_\"+localStorage.cont,bairro);\n\t localStorage.setItem(\"cidade_\"+localStorage.cont,cidade);\n\t localStorage.setItem(\"estado_\"+localStorage.cont,estado);\n\t localStorage.setItem(\"cep_\"+localStorage.cont,cep);\n\t localStorage.setItem(\"telefone_\"+localStorage.cont,telefone);\n\t localStorage.setItem(\"celular_\"+localStorage.cont,celular);\n\t localStorage.setItem(\"celular2_\"+localStorage.cont,celular2); \n \tlocalStorage.setItem(\"materiaParaEnsinar_\"+localStorage.cont,totalMaterias[0]);\n\t localStorage.setItem(\"anosEnsinando_\"+localStorage.cont,anosEnsinando);\n\t localStorage.setItem(\"email_\"+localStorage.cont,cadastroEmail);\n\t localStorage.setItem(\"senha_\"+localStorage.cont,cadastroSenha);\n}", "function cargarDatos(data){\n Notificate({\n tipo: 'success',\n titulo: 'Consulta exitosa.',\n descripcion: 'El paciente se encuentra registrado.'\n });\n var estadoPaciente = data[0].descripcionEstadoPaciente;\n var PNombre = data[0].primerNombre;\n var SNombre=data[0].segundoNombre;\n var PApellido=data[0].primerApellido;\n var SApellido =data[0].segundoApellido;\n var Ciudad=data[0].ciudadResidencia;\n var Barrio=data[0].barrioResidencia;\n var Direccion = data [0].direccion;\n var Correo = data[0].correoElectronico;\n var TelFijo = data[0].telefonoFijo;\n var InfoTelefono = TelFijo.split(\"-\");\n var TelMovil = data [0].telefonoMovil;\n var idPaciente =data [0].idPaciente;\n\n var ConfirmacionD=\n {\n \"Estado\":btoa(estadoPaciente),\n \"Barrio\":btoa(Barrio),\n \"Ciudad\":btoa(Ciudad),\n \"Correo\":btoa(Correo),\n \"Direccion\":btoa(Direccion),\n \"PrimerApellido\":btoa(PApellido),\n \"PrimerNombre\":btoa(PNombre),\n \"SegundoApellido\":btoa(SApellido),\n \"SegundoNombre\":btoa(SNombre),\n \"Telefono\":btoa(TelFijo),\n \"Celular\":btoa(TelMovil),\n \"idPac\":btoa(idPaciente)\n }\n localStorage.setItem(\"InformacionPaciente\",JSON.stringify(ConfirmacionD));\n\n $(\".NombrePaciente\").html(PNombre+\" \"+PApellido);\n $(\"#SltEstadoPaciente\").html(\"<option selected='selected' value='1'>\"+estadoPaciente+\"</option>\");\n //para seleccionar por defecto un valor se agrega el selected y esta function\n $(\".select\").select2();\n $(\"#txtPrimerNombre\").val(PNombre);\n $(\"#txtSegundoNombre\").val(SNombre);\n $(\"#txtPrimerApellido\").val(PApellido);\n $(\"#txtSegundoApellido\").val(SApellido);\n $(\"#txtCiudadResidencia\").val(Ciudad);\n $(\"#txtBarrioResidencia\").val(Barrio);\n $(\"#txtDireccion\").val(Direccion);\n $(\"#txtCorreo\").val(Correo);\n $(\"#txtTelefono\").val(InfoTelefono[0]);\n $(\"#txtExtTelefonoCita3\").val(InfoTelefono[1]);\n $(\"#txtTelefonoCelular\").val(TelMovil);\n $(\"#txtidPaciente\").val(idPaciente);\n}", "function criaUser() {\r\n var Usuarios = {\r\n email: formcliente.email.value,\r\n nome: formcliente.nome.value,\r\n pontos: formcliente.pontos.value,\r\n senha: formcliente.senha.value,\r\n sexo : formcliente.sexo.value\r\n };\r\n addUser(Usuarios);\r\n}", "function carregaUnidadesSolicitantes(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tcarregarListaNaoSolicitantes();\n\tcarregarListaSolicitantes();\n}", "function leerTexto(e){\n // console.log(e.target.value);\n datos[e.target.id] = e.target.value;\n}", "function inicializartipos(datos) {\n \n let editartiposif = document.getElementById('tipo1informacionpersonaleditar');\n let id;\n let tipo;\n \n datos[0]['idtipodireccionseccional'] ? tipo = \"Dirección Seccional\" : tipo = \"Actividad Economica\";\n\n editartiposif.innerHTML = `\n <option selected=\"true\" disabled=\"disabled\" class=\"noselected\">Seleccione el tipo de ${tipo}</option>`;\n datos.forEach(tipos => {\n tipos['idtipodireccionseccional'] ? id = tipos['idtipodireccionseccional'] : id = tipos['idtipoactividad'];\n editartiposif.innerHTML += `<option value=\"${id}\">${tipos['nombre']}</option>`;\n });\n\n}", "function append_client(datos){\n\t\t$('.t-body').empty();\n\t\t$.each(datos, function(index, data){\n\t\t\tif (data.clave_credito) {\n\t\t\t\t$('.t-body').append(\n\t\t\t\t\t\"<tr>\"+\n\t\t\t\t\t\t\"<th class='text-center'>\"+ pad(data.id_cliente,4) + \"</th>\"+\n\t\t\t\t\t\t\"<td>\"+ data.nombre + \" \" + data.ape_paterno + \" \" + data.ape_materno + \"</td>\"+\n\t\t\t\t\t\t\"<td>\"+ data.curp + \"</td>\"+\n\t\t\t\t\t\t\"<td>\"+ data.estado_civil + \"</td>\"+\n\t\t\t\t\t\t\"<td class='text-center'><button type='button' class='btn BtnOrange btn-xs view-credito' value='\"+ data.id_cliente +\"'><span class='icon icon-eye'></span> Ver</button></td>\"+\n\t\t\t\t\t\"</tr>\"\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t}", "function limpiaCajasAuxiliares(idOrden, contador){\n\tdocument.getElementById('cantidadIAux'+idOrden+contador).value = '';\n\tdocument.getElementById('numeroCarga'+idOrden+contador).value = '';\n}", "function cargarEditClie(){\n\t// le asigno a la variable el nombre donde se guardan los clientes\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"clientes\";\n\t// parseo la variable para obtener los arreglos\n\tvar listChamba =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = listChamba[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = listChamba[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = listChamba[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = listChamba[i][j+3];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"id\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"full_name\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"tell\").value = da4;\n\t\t\t}\n\t\t};\n\t};\n\t\n}", "function agregarClientes(){\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"clientes\";\n\tvar arreglo = JSON.parse(localStorage.getItem(usuario_nombre));\n\t//debugger;\n\tvar numeroClientes = document.getElementById(\"numero\").value;\n\tvar id = document.getElementById(\"id\").value;\n\tvar full_name = document.getElementById(\"full_name\").value;\n\tvar telephone = document.getElementById(\"tell\").value;\n\tvar modify;\n\tvar dilete;\n\tif(id == \"\" || id == null){\n\t\talert(\"No puede dejar el campo de cedula vacio\");\n\t}else if(full_name == \"\" || full_name == null){\n\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t}else if(telephone == \"\" || telephone == null){\n\t\talert(\"No puede dejar el campo de telefono vacio\");\n\t}else{\n\t\tclientes = [];\n\t\tif(arreglo == null){\n\t\t\tarreglo = [];\n\t\t\tclientes.push(document.getElementById(\"numero\").value,document.getElementById(\"id\").value,\n\t\t\t\tdocument.getElementById(\"full_name\").value,document.getElementById(\"tell\").value);\n\t\t\tarreglo.push(clientes);\n\t\t\tlocalStorage[usuario_nombre] = JSON.stringify(arreglo);\n\t\t\t$(\"#mensaje\").show();\n\t\t\talert(\"Se guardó correctamente\");\n\t\t\tlocation.reload();\n\t\t}else{\n\t\t\tarreglo.push(clientes);\n\t\t\tclientes.push(document.getElementById(\"numero\").value,document.getElementById(\"id\").value,\n\t\t\t\tdocument.getElementById(\"full_name\").value,document.getElementById(\"tell\").value);\n\t\t\tlocalStorage[usuario_nombre] = JSON.stringify(arreglo);\n\t\t\t$(\"#mensaje\").show();\n\t\t\talert(\"Se guardó correctamente\");\n\t\t\tlocation.reload();\n\t\t}\n\t}\n}", "function modificarEstudiante(id_estudiante,nombre){\n\tgrupoestudiante.id_estudiante=id_estudiante;\n\tgrupoestudiante.nombre=nombre;\n\t\n\t$(\"#CampoidEstu2\").val(grupoestudiante.id_estudiante);\n\t$(\"#CampoEstudiante2\").val(grupoestudiante.nombre);\n}", "function informacionUsuarios(){\n $.ajax({\n url: \"https://localhost:3000/volvo/api/GU/GU_GESTION_USUARIOS\",\n headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')},\n data: {\n \"accion\" : 'SELECT',\n \"idEstadoUsuario\" : $('#selectEstadoUsuario').val(),\n \"idAreaTrabajo\" : $('#selectAreaTrabajo').val()\n\n },\n dataType: \"json\",\n method: \"POST\",\n success: function(respuesta){\n if(respuesta.output.pcodigoMensaje == 0){\n for(i=0; i < respuesta.data.length; i++){\n $('#bodyTable').append(`\n <tr>\n <th>\n <input type=\"checkbox\" id=\"${respuesta.data[i].idUsuario}\" value=\"${respuesta.data[i].idUsuario}\" style=\"width:10px; height:100%;\"/> \n <label for=\"${respuesta.data[i].idUsuario}\"></label>\n </th>\n <td style=\"width:15px; text-align:center;\">${respuesta.data[i].idUsuario}</td>\n <td id=\"${'nombrePersona'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombrePersona}</td>\n <td id=\"${'nombreUsuario'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombreUsuario}</td>\n <td id=\"${'correoElectronico'+respuesta.data[i].idUsuario}\">${respuesta.data[i].correoElectronico}</td>\n <td id=\"${'numeroTelefono'+respuesta.data[i].idUsuario}\">${respuesta.data[i].numeroTelefono}</td>\n <td id=\"${'areaTrabajo'+respuesta.data[i].idUsuario}\">${respuesta.data[i].AreaTrabajo}</td>\n </tr>`\n );\n }\n }\n }\n });\n}", "'ofertas.insert'(oferta) {\n \n // Seguridad para la acción.\n if (! this.userId) {\n throw new Meteor.Error('[Ofertas] Usuario No Autorizado');\n }\n\n let o_id = new Meteor.Collection.ObjectID();\n oferta[\"_id\"] = o_id;\n\n //Ejecutar la accion en la base de datos sobre la colleccion.\n Ofertas.insert(oferta);\n }", "function mostrarComentarios() {\n console.log(comentarios);\n for (let i = 0; i < comentarios.length; i++) {\n let tdComentario = document.createElement('td');\n tdComentario.innerText = comentarios[i].comentario;\n let tdValoracion = document.createElement('td');\n tdValoracion.innerText = comentarios[i].valoracion;\n let tdUsuario = document.createElement('td');\n tdUsuario.innerText = comentarios[i].email;\n let tr = document.createElement('tr');\n container.appendChild(tr);\n // creo el boton de eliminar comentario\n let btnEliminarComentario = document.createElement('input');\n //le digo al input que sea un boton asi no se me refresca la pagina al apretarlo\n btnEliminarComentario.setAttribute('type', \"button\")\n btnEliminarComentario.setAttribute('value', 'ELIMINAR')\n btnEliminarComentario.addEventListener('click', (e) => {\n eliminarComentario(comentarios[i].id_comentario);\n })\n console.log(comentarios[i].id_comentario);\n tr.appendChild(tdComentario);\n tr.appendChild(tdValoracion);\n tr.appendChild(tdUsuario);\n tr.appendChild(btnEliminarComentario);\n }\n}", "function actualizarRegistos() {\n\n /* Obtiene el texto y lo modifica */\n var registros = document.getElementById(\"registros\").textContent;\n registros = contador_registros + \" de \" + agenda.length;\n document.getElementById(\"registros\").textContent = registros;\n\n /* Impide aumentar los registos si no existen en la Agenda */\n var max = document.getElementById(\"ver\");\n max.setAttribute(\"max\", agenda.length);\n\n /* Si nos movemos entre los diferentes registros, tambien cambiamos el valor del Imput 'ver' */\n ver.value = contador_registros;\n\n /* Al cargar la Agenda muestra por defecto e contacto indicado en la variable contador, en este caso la posicion 0 */\n document.getElementById(\"nombre\").value = agenda[contador_registros].nombre;\n document.getElementById(\"apellidos\").value = agenda[contador_registros].apellidos;\n document.getElementById(\"telefono\").value = agenda[contador_registros].telefono;\n document.getElementById(\"fecha\").value = agenda[contador_registros].fecha;\n}", "function actualizar_datos(id, texto,columna){\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: \"php/actualizar.php\",\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tdata: {id: id, texto: texto, columna: columna},\n\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\tobtener_datos();\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t}", "function bajaUsuarioSeleccionado(usuario, nFila) { \n \n //Activamos el spinner. Obtenemos de la tabla -> la fila -> la columna 2 y accedemos al boton\n $('#tablaUsuarios tr:nth-child('+nFila+') td:eq(2) button').toggleClass('active');\n\n //Creamos un objeto para almacenar los valores\n var operacion = new FormData();\n operacion.append('operacion', 'bajaUsuario');\n operacion.append(\"usuario\", usuario);\n\n //Creamos la solicitud AJAX\n //Especificamos la action a ejecutar\n var url = \"OperacionesUsuario\";\n var solicitud = new XMLHttpRequest();\n solicitud.addEventListener('load', mostrar);\n solicitud.open(\"POST\", url, true);\n solicitud.send(operacion); \n}", "function botaoFecharVoltar() {\n \n if(document.querySelector('#tituloCaixa').style.color == 'rgb(0, 185, 0)') {\n\n // limpa campos do usuario\n document.querySelector('.campoAno').value = ''\n document.querySelector('.campoMes').value = ''\n document.querySelector('#dia').value = ''\n document.querySelector('.campoTipo').value = ''\n document.querySelector('#descricao').value = ''\n document.querySelector('#valor').value = ''\n }\n \n document.querySelector('.secaoCaixa').style.display = 'none'\n}", "async function busca() {\n try {\n const doc = await daoAlumno.doc(id).get();\n if (doc.exists) {\n const data = doc.data();\n forma.foto_file.src = await urlStorage(id);\n forma.matricula.value = data.matricula || \"\";\n forma.nombre.value = data.nombre || \"\";\n forma.correo.value = data.correo || \"\";\n forma.status.value = data.status || \"\";\n forma.telefono.value = data.telefono || \"\";\n forma.fecha.value = data.fecha || \"\";\n forma.addEventListener(\"submit\", guarda);\n forma.eliminar.addEventListener(\"click\", elimina(data.correo));\n } else {\n throw new Error(\"No se encontró.\");\n }\n } catch (e) {\n muestraError(e);\n muestraUsuarios();\n }\n}", "function cargarUsuarioPersistente(){\n\tvar db = obtenerBD();\n\tvar query = 'SELECT * FROM Usuario';\n\tdb.transaction(\n\t\tfunction(tx){\n\t\t\ttx.executeSql(\n\t\t\t\tquery, \n\t\t\t\t[], \n\t\t\t\tfunction (tx, resultado){\n\t\t\t\t\tvar CantFilas = resultado.rows.length;\t\t\t\t\t\n\t\t\t\t\tif (CantFilas > 0){\n\t\t\t\t\t\tIdUsuario = resultado.rows.item(0).ID;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tNomUsuario = resultado.rows.item(0).Nombre;\n\t\t\t\t\t\tPassword = resultado.rows.item(0).Password;\n\t\t\t\t\t\tIsAdmin = resultado.rows.item(0).IsAdmin;\n\t\t\t\t\t\tlogin();\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}, \n\t\t\t\terrorBD\n\t\t\t);\n\t\t},\n\t\terrorBD\n\t);\n}", "function MostrarRegistro(){\n // declaramos una variable para guardar los datos\n var listaregistro=Mostrar();\n // selecciono el tbody de la tabla donde voy a guardar\n tbody=document.querySelector(\"#tbRegistro tbody\");\n tbody.innerHTML=\"\";\n // agregamos las columnas que se registren\n for(var i=0; i<listaregistro.length;i++){\n // declaramos una variable para la fila\n var fila=tbody.insertRow(i);\n // declaramos variables para los titulos\n var titulonombre=fila.insertCell(0);\n var tituloprecio=fila.insertCell(1);\n var titulocategoria=fila.insertCell(2);\n var titulocantidad=fila.insertCell(3);\n // agregamos los valores\n titulonombre.innerHTML=listaregistro[i].nombre;\n tituloprecio.innerHTML=listaregistro[i].precio;\n titulocategoria.innerHTML=listaregistro[i].categoria\n titulocantidad.innerHTML=listaregistro[i].cantidad;\n tbody.appendChild(fila);\n }\n}", "function userStudent() {\n //Chiedo i dati\n let userName = prompt(\"Inserisci il nome\");\n let userSurname = prompt(\"Inserisci il cognome\");\n let userEta = parseInt(prompt(\"Inserisci l'età\"));\n //Creo oggetto per l'utente\n userInfo = {};\n userInfo.nome = userName;\n userInfo.cognome = userSurname;\n userInfo.eta = userEta;\n}", "function crearDatosInspector(){\n\tprobar_conexion_red();\n\tvar codigo=$('#txt_codigo').val();\n\tvar nombre_usuario=$('#txt_nombre_usuario').val();\n\tvar cedula=$('#txt_cedula').val();\n\tvar nombre=$('#txt_nombre').val();\n\tvar apellido=$('#txt_apellido').val();\n\tvar correo=$('#txt_correo').val();\n\tvar rol=$('#txt_rol').val();\n\t\n\tif (cedula!=\"\" && nombre!=\"\" && apellido!=\"\" && correo!=\"\" && rol!=\"\"){\n\t\tif (codigo != \"Procesando, espere por favor...\") {\n\t\t\t$.post('http://www.montajesyprocesos.com/inspeccion/servidor/php/crear_inspector.php',{\n\t\t\t\tCaso:'Crear',\n\t\t\t\tId: codigo,\n\t\t\t\tUsuario: nombre_usuario,\n\t\t\t\tCedula: cedula,\n\t\t\t\tNombre: nombre,\n\t\t\t\tApellido: apellido,\n\t\t\t\tCorreo: correo,\n\t\t\t\tRol: rol\n\t\t\t},function(e){\t\t\t\t\t\t\n window.localStorage.setItem('codigo_inspector', codigo); //se crea la variable persistente del codigo del inspector\n crearTablaUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol);\n addItemUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol); //agregamos el usario a la BD\n crearTablaConsecutivoAscensores();\n addItemConsecutivoAscensores(codigo, 0);\n crearTablaConsecutivoEscalerasAndenes();\n addItemConsecutivoEscalerasAndenes(codigo, 0);\n crearTablaConsecutivoPuertas();\n addItemConsecutivoPuertas(codigo, 0);\n\t\t\t});\t\n\t\t} else {\n if (numeroUsuarios > 0) {\n if(navigator.notification && navigator.notification.alert){\n navigator.notification.alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema!\", null, \"Montajes & Procesos M.P SAS\", \"Ok :)\");\n location.href='../websites/crear_inspector.html';\n }else{\n alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema! :)\");\n location.href='../websites/crear_inspector.html';\n } \n }\n\t\t}\t\n\t}\n}", "actualizarNombre(id, nombre) {\n for (let usuario of this.lista) {\n if (usuario.id === id) {\n usuario.nombre = nombre;\n break;\n }\n //de la lista en cada interaccicon la variable \n //usuario va a ser el elmento de cada intereaccion\n }\n }", "function buscarClienteOnClick(){\n if ( get('formulario.accion') != 'clienteSeleccionado' ) {\n // var oid;\n // var obj = new Object();\n var whnd = mostrarModalSICC('LPBusquedaRapidaCliente','',new Object());//[1] obj);\n if(whnd!=null){\n \n //[1] }else{\n /* posicion N°\n 0 : oid del cliente\n 1 : codigo del cliente\n 2 : Nombre1 del cliente\n 3 : Nombre2 del cliente\n 4 : apellido1 del cliente\n 5 : apellido2 del cliente */\n \n var oid = whnd[0];\n var cod = whnd[1];\n //[1] var nombre1 = whnd[2];\n //[1] var nombre2 = whnd[3];\n //[1] var apellido1 = whnd[4]; \n //[1] var apellido2 = whnd[5]; \n \n // asigno los valores a las variables y campos corresp.\n set(\"frmFormulario.hOidCliente\", oid);\n set(\"frmFormulario.txtCodigoCliente\", cod);\n \n } \n }\n }", "function getUsuarioActivo(nombre){\n return{\n uid: 'ABC123',\n username: nombre\n\n }\n}", "function verUsuarios() {\n\n borrarMarca();\n borrarMarcaCalendario();\n\n let contenedor = document.createElement(\"div\");\n contenedor.setAttribute('class', 'container-fluid');\n contenedor.setAttribute('id', 'prueba');\n let titulo = document.createElement(\"h1\");\n titulo.setAttribute('class', 'h3 mb-2 text-gray-800');\n let textoTitulo = document.createTextNode('GESTIÓN DE USUARIOS');\n let parrafoTitulo = document.createElement(\"p\");\n parrafoTitulo.setAttribute('class', 'mb-4');\n let textoParrafo = document.createTextNode('AÑADE PACIENTES O ELIMINA LOS USUARIOS CREADOS');\n let capa1 = document.createElement(\"div\");\n capa1.setAttribute('class', 'card shadow mb-4');\n let capa2 = document.createElement(\"div\");\n capa2.setAttribute('class', 'card-header py-3');\n let tituloCapas = document.createElement(\"h6\");\n tituloCapas.setAttribute('class', 'm-0 font-weight-bold text-primary');\n let textoTituloCapas = document.createTextNode('Información de Usuarios');\n let cuerpo = document.createElement(\"div\");\n cuerpo.setAttribute('class', 'card-body');\n let tablaResponsiva = document.createElement(\"div\");\n tablaResponsiva.setAttribute('class', 'table-responsive');\n let tablas = document.createElement(\"table\");\n tablas.setAttribute('class', 'table table-bordered');\n tablas.setAttribute('id', 'dataTable');\n tablas.setAttribute('width', '100%');\n tablas.setAttribute('cellspacing', '0');\n\n let principal = document.getElementsByClassName(\"marca\");\n principal[0].appendChild(contenedor);\n contenedor.appendChild(titulo);\n titulo.appendChild(textoTitulo);\n contenedor.appendChild(parrafoTitulo);\n parrafoTitulo.appendChild(textoParrafo);\n contenedor.appendChild(capa1);\n capa1.appendChild(capa2);\n capa2.appendChild(tituloCapas);\n tituloCapas.appendChild(textoTituloCapas);\n capa1.appendChild(cuerpo);\n cuerpo.appendChild(tablaResponsiva);\n tablaResponsiva.appendChild(tablas);\n\n let httpRequest = new XMLHttpRequest();\n httpRequest.open('POST', '../consultas_ajax.php', true);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n document.getElementById('dataTable').innerHTML = httpRequest.responseText;\n }\n }\n };\n httpRequest.send('verUsuarios=');\n}" ]
[ "0.62166774", "0.6138539", "0.61281127", "0.6019733", "0.5966991", "0.5945727", "0.5904028", "0.5897167", "0.5886799", "0.582947", "0.581208", "0.58022004", "0.57783204", "0.57666874", "0.576256", "0.57545966", "0.5752809", "0.57515603", "0.5738582", "0.57380193", "0.5722475", "0.5711567", "0.5694034", "0.56783783", "0.5674339", "0.56723994", "0.56618416", "0.5658227", "0.56571615", "0.5646164", "0.5640059", "0.56248665", "0.5611295", "0.5598629", "0.55916065", "0.5589669", "0.5588966", "0.5581484", "0.55793095", "0.5578618", "0.5575205", "0.5565019", "0.5562727", "0.5547464", "0.5546119", "0.5535237", "0.55286825", "0.5522505", "0.551806", "0.55144846", "0.5512038", "0.5510338", "0.5505678", "0.5502286", "0.54950213", "0.5489802", "0.5481404", "0.5480794", "0.5477486", "0.5474032", "0.5465741", "0.5463709", "0.5460734", "0.5453125", "0.54531145", "0.5447536", "0.5432857", "0.54276687", "0.5426045", "0.5423964", "0.54238045", "0.5422547", "0.5409436", "0.5407532", "0.5406621", "0.54061216", "0.5403328", "0.5398574", "0.53876114", "0.5385897", "0.53829455", "0.53821635", "0.5371342", "0.5367892", "0.5366588", "0.5364711", "0.53641856", "0.5360985", "0.5358415", "0.5350654", "0.53505695", "0.5349112", "0.5348392", "0.5347664", "0.5347652", "0.53475094", "0.53461206", "0.5340502", "0.5336364", "0.53347754", "0.5333224" ]
0.0
-1
EDITAR DATOS DE USUARIO
function updateUser(req,res){ var userId = req.params.id; var update = req.body; //BORRAR LA PROPIEDAD PASSWORD. delete update.password; if(userId != req.user.sub){ return res.status(500).send({message: 'No tienes permiso para actualizar los datos del usuario.'}); } User.find({$or:[ {email: update.email.toLowerCase()}, {nick: update.nick.toLowerCase()} ]}).exec((err,users)=>{ var user_isset = false; users.forEach((user)=>{ if(user && user._id != userId) user_isset = true; }); if(user_isset) return res.status(404).send({message: 'Dato en uso.'}); User.findByIdAndUpdate(userId,update,{new:true},(err,userUpdated)=>{ if(err) return res.status(500).send({message: 'Error en la peticion.'}); if(!userUpdated) return res.status(404).send({message: 'No se ha podido actualizar el usuario'}); return res.status(200).send({user: userUpdated}); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update(OID_USUARIO,USUARIO){\n\t\n\t/*INSERCION DE DATOS*/\n\t\n\t$(\"#txt_usuario\").val(USUARIO);\n\t\n\t$(\"#txt_usuario\").attr(\"USER\",OID_USUARIO);\n\t\n\t$(\"#btn_enviar_usuario\").text(\"Actualizar\")\n\t\t\n\t\n}//FINAL DE LA ACTUALIZACION DE UN REGISTRO", "function obtenerDatosEditar()\n {\n //OBTIENE LOS DATOS DE LA FILA CUANDO DÁ CLICK EN EL BOTON EDITAR\n $('#integrantes').on('click', '#datos .editar', function(e){\n e.preventDefault();\n id = $(this).parent().parent().attr('id');\n nombres = $(this).parent().parent().children('td:eq(0)').text();\n apellidos = $(this).parent().parent().children('td:eq(1)').text();\n parentesco = $(this).parent().parent().children('td:eq(2)').text();\n fecha_nacimiento = $(this).parent().parent().children('td:eq(3)').text();\n profesion = $(this).parent().parent().children('td:eq(4)').text();\n lugar_trabajo = $(this).parent().parent().children('td:eq(5)').text();\n tel_trabajo = $(this).parent().parent().children('td:eq(6)').text();\n salario = $(this).parent().parent().children('td:eq(7)').text();\n depende = $(this).parent().parent().children('td:eq(8)').text();\n grado = $(this).parent().parent().children('td:eq(9)').text();\n institucion = $(this).parent().parent().children('td:eq(10)').text();\n cuota = $(this).parent().parent().children('td:eq(11)').text();\n\n //CONVIERTE LA FECHA A FORMATO yyyy-MM-dd\n fechaconvert = fecha_nacimiento.replace('/', '-');\n fecha_nacimiento = fechaconvert.replace('/', '-')\n\n //ENVIA LOS DATOS A LOS INPUTS\n $('#id_integrante').val(id);\n $('#nombres_inte').val(nombres);\n $('#apellidos_inte').val(apellidos);\n $('#parentesco').val(parentesco);\n $('#fecha_naci_inte').val(fecha_nacimiento);\n $('#profesion').val(profesion);\n $('#lugar_trabajo').val(lugar_trabajo);\n $('#tel_trabajo').val(tel_trabajo);\n $('#salario').val(salario);\n $('#grado').val(grado);\n $('#institucion').val(institucion);\n $('#cuota_inte').val(cuota);\n\n if(grado != \"\" || institucion != \"\")\n {\n $('#si_integran').prop('checked', true);\n $(\"#depende\").show(1000);\n $(\"#Grado\").show(1000);\n $(\"#Institucion\").show(1000);\n $(\"#Cuota_inte\").show(1000);\n }\n else\n {\n //Sirve para resetear los radio button\n $('.estudiante').prop('checked', false);\n $('.depende').prop('checked', false);\n \n //Para que se oculten los campos\n $(\"#depende\").hide(1000);\n $(\"#Grado\").hide(1000);\n $(\"#Institucion\").hide(1000);\n $(\"#Cuota_inte\").hide(1000);\n }\n if(depende != \"\")\n {\n if(depende == \"si\")\n {\n $('#si2').prop('checked', true);\n }\n else\n {\n $('#no2').prop('checked', true);\n }\n }\n $('#modificar').show(0);\n $('#agregar').hide(0);\n $('#cancelar').show(0);\n });\n }", "function editar(id,nome,email){\n $(\"#id\").val(id);\n $(\"#nome\").val(nome);\n $(\"#email\").val(email);\n $(\"#servico\").val('alteracao');\n\n // ACAO DE MOVIMENTO DAS TELAS\n janelaCadastro(true,'edit');\n}", "rellenarCampos(datos){\n this.tituloInput.value = datos.titulo;\n this.cuerpoInput.value = datos.cuerpo;\n this.idInput.value = datos.id;\n this.estado = \"editar\";\n this.cambiarEstado(this.estado);\n }", "function editarChamba(){\n\t//debugger;\n\t// le asigno a una variable el nombre con el que estan guardados las chambas\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"chambas\";\n\t// parsea el nombre que se obtuvo para obtener los arreglos \n\tvar listChamba =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// busca el id que esta actualmente y se lo asigna a la variable modificar\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t//obtener id\n\t\t\t\tvar nn = document.getElementById(\"numero\").value;\n\t\t\t// obtener el cliente\n\t\t\tvar c = document.getElementById(\"cliente\").value;\n\t\t\t// obtener la descripcion\n\t\t\tvar d = document.getElementById(\"description\").value;\n\t\t\t// obtener la fecha\n\t\t\tvar f = document.getElementById(\"fecha\").value;\n\t\t\t// obtener las notas\n\t\t\tvar n = document.getElementById(\"notas\").value;\n\t\t\t// pregunto que si el cliente es vacio o nulo\n\t\t\tif(c == \"\" || c == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de cliente vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si la descripcion es vacia o nula\n\t\t\t}else if(d == \"\" || d == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de descripcion vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si la fecha es vacia o nula\n\t\t\t}else if(f == \"\" || f == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de fecha vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si las notas son vacias o nulas\n\t\t\t}else if(n == \"\" || n == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de notas vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no es asi\n\t\t\t}else{\n\t\t\t\t// le digo que el elemento actual en la posicion 0 es igual a el id\n\t\t\t\tlistChamba[i][j] = nn;\n\t\t\t\t// la posicion 1 es igual al cliente\n\t\t\t\tlistChamba[i][j+1] = c;\n\t\t\t\t// la posicion 2 es igual a la descripcion\n\t\t\t\tlistChamba[i][j+2] = d;\n\t\t\t\t// la posicion 3 es igual a la fecha\n\t\t\t\tlistChamba[i][j+3] = f;\n\t\t\t\t// la posicion 4 es igual a las notas\n\t\t\t\tlistChamba[i][j+4] = n;\n\t\t\t\t// le vuelvo a insertar los arreglos con el actual modificado\n\t\t\t\tlocalStorage[usuario_nombre] = JSON.stringify(listChamba);\n\t\t\t\t// muestro un mensaje para que el usuario sepa que fue modificado\n\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\tlocation.href = \"Chambas Administration.html\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n};\n}", "function cargarEditUsr(){\n\t//debugger;\n\t// parseo los usuarios para obtener los arreglos\n\tvar usuario_nombre = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < usuario_nombre.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < usuario_nombre[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == usuario_nombre[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = usuario_nombre[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = usuario_nombre[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = usuario_nombre[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = usuario_nombre[i][j+3];\n\t\t\t\t//a la variable da5 le asigno el valor de la posicion 4\n\t\t\t\tda5 = usuario_nombre[i][j+4];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"fullName\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"user\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password\").value = da4;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password_repeat\").value = da5;\n\t\t\t}\n\t\t};\n\n\t}\n}", "function Editar(){\n const inputIdSalon = document.getElementById(\"idsalon\").value;\n const inputUbicacion = document.getElementById(\"ubicacion\").value;\n const inputCapacidad = document.getElementById(\"capacidad\").value;\n const inputNombreSalon = document.getElementById(\"nombresalon\").value;\n objClaveMateria = {\n \"IdSalon\": inputIdSalon,\n \"Ubicacion\": inputUbicacion,\n \"NombreClave\": inputNombreSalon,\n \"Capacidad\": inputCapacidad\n }\n fetch(uri,{\n method: 'PUT',\n headers:{\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(objClaveMateria)\n })\n .then(response => response.text())\n .then(data => Mensaje(data))\n .catch(error => console.error('Unable to Editar Item.',error ,objClaveMateria));\n}", "function editaus(){\n //obtengo los valores de el formulario y los agregamos a una variable\nconst usua = \"'\"+$('input:text[name=nomusuedit]').val()+\"'\"//\n\nconst idusua = \"'\"+$('input:text[name=idusedit]').val()+\"'\"//\n\nconst pass = \"'\"+$('input:password[name=passedit]').val()+\"'\"//\n\nconst email = \"'\"+$('input:text[name=emailedit]').val()+\"'\"//\n\nconst nomus = \"'\"+$('input:text[name=nombedit]').val()+\"'\"//\n\nconst apepat = \"'\"+$('input:text[name=apepatedit]').val()+\"'\"//\n\nconst apemat = \"'\"+$('input:text[name=apematedit]').val()+\"'\" //\n\nconst dir = \"'\"+$('input:text[name=diredit]').val()+\"'\"//\n\nconst telf = \"'\"+$('input:text[name=telfedit]').val()+\"'\"//\n\nconst rfc = \"'\"+$('input:text[name=rfcedit]').val()+\"'\"//\n\n\n\n\n\n\nlet query12 = \"UPDATE `usuario` SET `nom_usu` = \"+nomus+\", `apemat_usu` = \"+apemat+\", `apepat_usu` =\"+apepat+ \", `rfc` =\" + rfc +\", `tel` =\" +telf+\", `email` =\"+email+\", `usu` =\" +usua+\", `con` =\" +pass+\", `dir_usu` =\" +dir+ \"WHERE `usuario`.`id_usu` =\"+ idusua;\n\n//se crea la constante con el query que se ejecutara en la bdd\n\n\nconsole.log(query12)\n\n/*\n// let query4 = \"INSERT INTO `productos` (`sku_pro`, `nom`, `mar`, `mod`, `cost`, `desc`, `exist`) VALUES ('1120','consola','nintendo','switch','7000','nueva','3');\";\n\nINSERT INTO `productos` (`sku_pro`, `nom`, `mar`, `mod`, `cost`, `desc`, `exist`) VALUES ('1120','consola','nintendo','sw','' '','');*/\n\n\n\n\n //Funcion para ejecutar el query y nos devuelba el resultado o el error\n connection.query(query12, function(err, rows, fields){\n if(err){\n console.log(\"Error en la consulta\")\n console.log(err)\n return\n }\n\n\n\n});\n alert(\"Usuario editado correctamente\")\nlocation.href='usuariosad.html';\n\n//se llama a la funcion que borrara los datos de la tupla auxiliar de la bdd\nborr(idusua);\n\n\n}", "function editCreator(creator_data) {\n conn.query('UPDATE Creator_Data SET password=$1, name=$2, street_address=$3, '\n + 'city=$4, state=$5, zipcode=$6 WHERE email=$7',\n [\n creator_data.password,\n creator_data.name,\n creator_data.street_address,\n creator_data.city,\n creator_data.state,\n creator_data.zipcode,\n creator_data.email\n ]).on('error', console.error);\n}", "function asignarAlumno() {\n const alumnoId = document.getElementById(\"alumnos\").value;\n document.getElementById(\"alumnoId\").value = alumnoId;\n const cursoId = document.getElementById(\"cursos\").value;\n document.getElementById(\"cursoId\").value = cursoId;\n}", "function modificarUsuario(nome, curso, categoria){\n fs.readFile(\"./input/usuario.json\",{encoding: 'utf-8'},(err, dados) => {\n if(err){\n console.log(\"Ocorreu um erro durante a leitura!\")\n }else{\n var conteudo = JSON.parse(dados)\n\n conteudo.nome= nome\n conteudo.curso= curso\n conteudo.categoria= categoria\n \n\n fs.writeFile(\"./output/usuario.json\", JSON.stringify(conteudo), (err) => {\n if(err){\n console.log(\"Um erro ocorreu durante a escrita\")\n }\n })\n }\n })\n}", "function editarCliente(){\n\t//debugger;\n\t// le asigno a una variable el nombre con el que estan guardados los clientes\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"clientes\";\n\t// parsea el nombre que se obtuvo para obtener los arreglos \n\tvar listCliente =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// busca el id que esta actualmente y se lo asigna a la variable modificar\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listCliente.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listCliente[i].length; j++) {\n\t\t\t// pregunto que si modificar es isual al id actual\n\t\t\tif(modificar == listCliente[i][j]){\n\t\t\t\t//obtener id\n\t\t\t\tvar n = document.getElementById(\"numero\").value;\n\t\t\t\t// obtener el numero de cedula\n\t\t\t\tvar c = document.getElementById(\"id\").value;\n\t\t\t\t// obtener el nombre completo\n\t\t\t\tvar fn = document.getElementById(\"full_name\").value;\n\t\t\t\t// obtener el numero de telefono\n\t\t\t\tvar t = document.getElementById(\"tell\").value;\n\t\t\t\t// pregunto que si la cedula es vacia o nula\n\t\t\t\tif(c == \"\" || c == null){\n\t\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de cedula vacio\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t// si no pregunto que si el nombre completo es vacio o nulo\n\t\t\t\t}else if(fn == \"\" || fn == null){\n\t\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t// si no pregunto que si el numero de telefono es vacio o nulo\n\t\t\t\t}else if(t == \"\" || t == null){\n\t\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de telefono vacio\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t// si no es asi\n\t\t\t\t}else{\n\t\t\t\t\t// le digo que el elemento actual en la posicion 0 es igual a el id\n\t\t\t\t\tlistCliente[i][j] = n;\n\t\t\t\t\t// la posicion 1 es igual a la cedula\n\t\t\t\t\tlistCliente[i][j+1] = c;\n\t\t\t\t\t// la posicion 2 es igual al nombre completo\n\t\t\t\t\tlistCliente[i][j+2] = fn;\n\t\t\t\t\t// la posicion 3 es igual a el numero de telefono\n\t\t\t\t\tlistCliente[i][j+3] = t;\n\t\t\t\t\t// le vuelvo a insertar los arreglos con el actual modificado\n\t\t\t\t\tlocalStorage[usuario_nombre] = JSON.stringify(listCliente);\n\t\t\t\t\t// muestro un mensaje para que el usuario sepa que fue modificado\n\t\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\t\tlocation.href = \"Clients Administration.html\";\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t};\n}", "function setDadosModalEditarProfessor(cod,nome,usuario,senha,email) { \n $('#editarcod').val(cod);\n $('#editarnome').val(nome);\n $('#editarusuario').val(usuario);\n $('#editarsenha').val(senha);\n $('#editaremail').val(email);\n Materialize.updateTextFields();\n}", "function modificarEstudiante(id_estudiante,nombre){\n\tgrupoestudiante.id_estudiante=id_estudiante;\n\tgrupoestudiante.nombre=nombre;\n\t\n\t$(\"#CampoidEstu2\").val(grupoestudiante.id_estudiante);\n\t$(\"#CampoEstudiante2\").val(grupoestudiante.nombre);\n}", "function editar(key_empleado,cedula,apellido,email, nombre, telefono){\n \n const dbRef_empleados = firebase.database().ref('empleados/' + key_empleado);\n var refnuevo = dbRef_empleados.set({\n cedula: cedula,\n apellido: apellido,\n email: email,\n nombre: nombre,\n telefono: telefono\n });\n alert(\"Guardado con éxito.\");\n}", "function modificarUsuario(\n id,\n nombreusuario,\n emailusuario,\n userStatus,\n passusuario\n) {\n $(\"#nombreup2\").val(nombreusuario);\n $(\"#newemailUp\").val(emailusuario);\n $(\"#checkUp\").val(userStatus);\n $(\"#idusuarioUp\").val(id);\n $(\"#pass2Up\").val(passusuario);\n}", "function alterarCadastro()\r\n{\r\n\t//checa de o browser consegue trabalhar com indexeDB\r\n\tif(!indexedDB)\r\n\t{\r\n\t\tconsole.log(\"Seu navegador não suporta indexedDB.\");\r\n\t\treturn;\t\t\r\n\t}\r\n\r\n\t//abre o pseudo banco (ou cria, caso não exista)\r\n\tlet request=indexedDB.open(\"usersDB\",2);\r\n\r\n\t//se IndexedDB der erro\r\n\trequest.onerror = (event) => {alert(\"Erro ao utilizar IndexedDB.\");};\r\n\r\n\t//cria o schema do banco\r\n\trequest.onupgradeneeded = (event) => \r\n\t{ \r\n\t\tlet db=request.result;\r\n\t\tlet store=db.createObjectStore(\"users\", {keyPath: \"email\"});\r\n\t};\r\n\t\r\n\t//realiza os operacoes no pseudobanco \r\n\trequest.onsuccess = (event) => \r\n\t{\r\n\t\tlet db=request.result;\r\n\t\tlet tx=db.transaction(\"users\", \"readwrite\");\r\n\t\tlet store=tx.objectStore(\"users\");\t\r\n\t\t\r\n\t\t//se browser suporta storage\r\n\t\tif (typeof(Storage) !== \"undefined\") \r\n\t\t{\r\n\t\t\tlet atualiza = store.openCursor();\t\t\t\t\t//abre cursor para atualizar\r\n\t\t\tatualiza.onsuccess = (event) => \r\n\t\t\t{\r\n\t\t\t\tlet cursor = event.target.result;\r\n\t\t\t\tif(cursor) {\r\n\t\t\t\t\tif(cursor.value.email == logado) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlet dados = cursor.value;\t\t\t\t//recupera dados no banco\r\n\t\t\t\t\t\t//console.log(dados);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tlet nome=document.getElementById(\"nome\").value;\r\n\t\t\t\t\t\tlet email=document.getElementById(\"email\").value;\r\n\t\t\t\t\t\tlet telefone=document.getElementById(\"telefone\").value;\r\n\t\t\t\t\t\tlet endereco=document.getElementById(\"endereco\").value;\r\n\t\t\t\t\t\tlet cidade=document.getElementById(\"cidade\").value;\r\n\t\t\t\t\t\tlet estado=document.getElementById(\"estado\").value;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//se alguma dos inputs estiverem vazios, nao alterar nada no banco\r\n\t\t\t\t\t\tif(nome!==\"\")\r\n\t\t\t\t\t\t\tdados.nome = nome;\r\n\t\t\t\t\t\t//if(email!==\"\") \r\n\t\t\t\t\t\t//{\r\n\t\t\t\t\t\t\t//dados.email = email;\r\n\t\t\t\t\t\t\t//localStorage.setItem(\"atualLogado\", email); //troca email logado tb\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(telefone!==\"\")\r\n\t\t\t\t\t\t\tdados.telefone = telefone;\r\n\t\t\t\t\t\tif(endereco!==\"\")\r\n\t\t\t\t\t\t\tdados.endereco = endereco;\r\n\t\t\t\t\t\tif(cidade!==\"\")\r\n\t\t\t\t\t\t\tdados.cidade = cidade;\r\n\t\t\t\t\t\tif(estado!==\"\")\r\n\t\t\t\t\t\t\tdados.estado = estado;\r\n\t\t\t\t\t\tif(nome==\"\" && (email==\"\" || email == logado) && telefone==\"\" && endereco==\"\" && cidade==\"\" && estado==\"\") \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Pelo menos um dos campos devem ser preechidos\");\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//atualiza banco\r\n\t\t\t\t\t\tconsole.log(\"Novo nome: \"+dados.nome);\r\n\t\t\t\t\t\tlet atualizaBD = cursor.update(dados);\r\n\t\t\t\t\t\tatualizaBD.onsuccess = () => {alert(\"Os dados foram atualizados com sucesso\" + dados.nome);};\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tatualizaBD.onerror = () => {alert(\"Não foi possível atualizar o Banco de Dados\");};\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//nao encontrou ninguem com o email logado, no banco\r\n\t\t\t\t\telse {alert(\"Não foi possível encontrar o usuário do email \"+logado);}\r\n\t\t\t\t}\r\n\t\t\t\t//nao conseguiu reabrir o banco para o update\r\n\t\t\t\telse {alert(\"Não foi possível reabrir o banco;\");}\t\r\n\t\t\t\tcursor.continue();\r\n\t\t\t};\t\t\t\r\n\t\t}\r\n\t\telse {alert(\"Seu navegador não suporte Local Storage\");}\r\n\r\n\t\t//encerra banco\r\n\t\ttx.oncomplete = () => {db.close();}\t\r\n\t};\r\n}", "function editaData( campo, evt )\r\n{\r\n retornaEstadosTeclas( evt );\r\n tecla = retornaKeyCode( evt );\r\n //verifica se usuário digitou tecla de atalho para inserir data atual no campo.\r\n if( tecla == 104 || tecla == 72 ) // 104 = h, 72 = H\r\n {\r\n hoje = new Date(dataServidor);\r\n dataDeHoje = ( ( hoje.getDate( ) + 100 ).toString( ) ).substring( 1, 3 ) + \"/\";\r\n dataDeHoje += ( ( hoje.getMonth( ) + 101 ).toString( ) ).substring( 1, 3 ) + \"/\";\r\n dataDeHoje += hoje.getFullYear( );\r\n campo.value = dataDeHoje;\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //se campo estiver preenchido, aciona atalhos para somar e subtrair dias da data.\r\n if( campo.value.length == 10 )\r\n {\r\n //Se o usuario digitar Shift + '+', acrescenta 30 dias a data\r\n if( shift && tecla == 43 )\r\n {\r\n campo.value = operaData( campo.value, 30 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //Se o usuario digitar '+', acrescenta 1 dia a data\r\n else if( tecla == 43 )\r\n {\r\n campo.value = operaData( campo.value, 1 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //Se o usuario digitar Shift + '-', subtrai 30 dias da data\r\n if( shift && tecla == 45 )\r\n {\r\n campo.value = operaData( campo.value, -30 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //Se o usuario digitar '-', subtrai 1 dia da data\r\n else if( tecla == 45 )\r\n {\r\n campo.value = operaData( campo.value, -1 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n }\r\n mascara( campo, evt, \"99/99/9999\" );\r\n}", "function editarDatos(parId, parTipo, parIden, parfechaIni, parfechaFin, parCuando, parEmpleado) {\n document.getElementById(\"tipo\").value = parTipo;\n document.getElementById(\"iden\").value = parIden\n document.getElementById(\"fechaIni\").value = parfechaIni;\n document.getElementById(\"fechaFin\").value = parfechaFin;\n document.getElementById(\"cuando\").value = parCuando;\n document.getElementById(\"empleado\").value = parEmpleado;\n $(\"#guardar\").css(\"display\", \"none\");\n $(\".linea\").attr(\"disabled\", true);\n $(\"#act\").append(\"<button class='btn btn-info my-3' id='actualizar'>Guardar</button>\");\n $(\"#actualizar\").on(\"click\", function () {\n var userRef = db.collection(\"usuarios\").doc(parId);\n tipos = document.getElementById(\"tipo\").value;\n idens = document.getElementById(\"iden\").value;\n fechaInis = document.getElementById(\"fechaIni\").value;\n fechaFins = document.getElementById(\"fechaFin\").value;\n cuandos = document.getElementById(\"cuando\").value;\n empleados == document.getElementById(\"empleado\").value;\n\n if (tipos.trim() === \"\" || idens.trim() === \"\" || fechaInis.trim() === \"\" || fechaFins.trim() === \"\" || cuandos.trim() === \"\" || empleados.trim() === \"\") {\n alert(\"Todos los datos son obligatorios.\");\n return false;\n } else {\n return userRef.update({\n tipo: document.getElementById(\"tipo\").value,\n iden: document.getElementById(\"iden\").value,\n fechaIni: document.getElementById(\"fechaIni\").value,\n fechaFin: document.getElementById(\"fechaFin\").value,\n cuando: document.getElementById(\"cuando\").value,\n empleado: document.getElementById(\"empleado\").value\n })\n .then(function () {\n console.log(\"Usuario actualizado correctamente.\");\n document.getElementById(\"tipo\").value = \"\";\n document.getElementById(\"iden\").value = \"\";\n document.getElementById(\"fechaIni\").value = \"\";\n document.getElementById(\"fechaFin\").value = \"\";\n document.getElementById(\"cuando\").value = \"\";\n document.getElementById(\"empleado\").value = \"\";\n $(\"#guardar\").css(\"display\", \"inline\");\n $(\".linea\").attr(\"disabled\", false);\n $(\"#act\").empty();\n })\n .catch(function (error) {\n // The document probably doesn't exist.\n console.error(\"Error actualizando datos: \", error);\n });\n }\n })\n}", "function EditUserModal(Name, LastName, UserName, Rol, Id) {\n \n //asociamos los textbox con sus respetivos valores provenientes de la base de datos.\n document.getElementsByName('userName')[0].value = UserName;\n document.getElementsByName('name')[0].value = Name;\n document.getElementsByName('lastName')[0].value = LastName;\n document.getElementById('userType')[0].value = Rol;\n idDeleteUpdate = document.getElementsByName('idHidden')[0].value = Id;\n}", "function modificarCliente(){\n let cliente = new Cliente(document.getElementById('').value, document.getElementById('').value, \n document.getElementById('').value, document.getElementById('').value, document.getElementById('').value, \n document.getElementById('').value);\n\n //Actualizar registroUsuarios\n for(let i in registroUsuarios){\n if(registroUsuarios[i]== cliente.correo){\n //Aqui debo preguntar si no existe ya este cliente por el hecho que lo tomaremos como identificador unico que es el correo\n //Debo tener en cuenta los permisos a la hora de modificar, capas que un cliente puede modificarse el estado\n registroUsuarios[i].nombre = cliente.nombre;\n registroUsuarios[i].apellido = cliente.apellido;\n registroUsuarios[i].contraseña = cliente.contraseña;\n registroUsuarios[i].correo = cliente.correo;\n registroUsuarios[i].tipo = cliente.tipo;\n registroUsuarios[i].estado = cliente.estado;\n break;\n }\n }\n localStorage.setItem('Usuarios', JSON.stringify(registroUsuarios));\n\n}", "function actualizar_datos(id, texto,columna){\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: \"php/actualizar.php\",\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tdata: {id: id, texto: texto, columna: columna},\n\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\tobtener_datos();\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t}", "function setDadosModalEditarCurso(cod,nome) { \n $('#editarcod').val(cod);\n $('#editarnome').val(nome);\n Materialize.updateTextFields();\n}", "function cargarEditClie(){\n\t// le asigno a la variable el nombre donde se guardan los clientes\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"clientes\";\n\t// parseo la variable para obtener los arreglos\n\tvar listChamba =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = listChamba[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = listChamba[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = listChamba[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = listChamba[i][j+3];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"id\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"full_name\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"tell\").value = da4;\n\t\t\t}\n\t\t};\n\t};\n\t\n}", "function modificarUsuarioVertodos(\n id,\n nombreusuario,\n emailusuario,\n userStatus,\n passusuario\n) {\n $(\"#nombreup2Todos\").val(nombreusuario);\n $(\"#newemailUpTodos\").val(emailusuario);\n $(\"#checkUpTodos\").val(userStatus);\n $(\"#idusuarioUpTodos\").val(id);\n $(\"#pass2UpTodos\").val(passusuario);\n}", "function editarRegistro(datos, id_Reg, tipo) {\n const cantidad = Number(document.getElementById('cantidad').value);\n const ost = document.getElementById('ost').value;\n const siga = document.getElementById('siga').value;\n const servicio = document.getElementById('servicio').value;\n const detalle = document.getElementById('observaciones').value;\n const idRegistrador = document.getElementById('idRegistrador').value;\n const pesoTotal = document.getElementById('total').innerHTML;\n const nuevoIdAct = document.getElementById('ddlActividades').value;\n\n if(cantidad === ''){\n mostrarMensaje('error', 'Debe indicar una cantidad');\n document.getElementById(\"cantidad\").focus();\n } else if(cantidad === 0){\n mostrarMensaje('error', 'La cantidad no puede ser igual a 0');\n document.getElementById(\"cantidad\").focus();\n }else {\n Swal.fire({\n title: '¿Está seguro?',\n text: 'Se editará el consecutivo ' + (id_Reg.length === 1 ? datos.consecutivo : datos.consecutivo + ' y sus asociados'),\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Si, editarlo'\n }).then((result) => {\n if (result.value) {\n // Se definen los datos que se van a enviar al fetch\n const data = new FormData();\n data.append('id_Reg', id_Reg);\n data.append('ost', ost);\n data.append('siga', siga);\n data.append('numServicio', servicio);\n data.append('cantidad', cantidad);\n data.append('pesoTotal', pesoTotal);\n data.append('observaciones', detalle);\n data.append('idRegistrador', idRegistrador);\n data.append('nuevoIdAct', nuevoIdAct);\n data.append('tipo', tipo);\n\n // Conexión del fetch al archivo php\n fetch('inc/modelos/modelo-registro.php', {\n method: 'POST',\n body: data\n })\n .then(respuestaExitosa) // Respuesta exitosa llama la función\n .catch(mostrarError); // Respuesta negativa llama la función\n\n // Si la ejecución del AJAX es correcta se verifica la respuesta\n function respuestaExitosa(response){\n if(response.ok) { // Si la respuesta en ok se llama la función para mostrar los resultados\n response.json().then(mostrarResultado);\n } else { // Si la respuesta no es ok se muestra el error\n mostrarError('status code: ' + response.status);\n }\n }\n\n // Se muestran los resultados devueltos en el JSON\n function mostrarResultado(respuesta){\n \n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Modificación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la modificación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al modificar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }\n\n // Muestra el error si el AJAX no se ejecuta o la respuesta no es ok\n function mostrarError(err){\n console.log('Error', err);\n }\n }\n })\n \n }\n}", "function editar(){\r\n //El objeto que almacena los parámetros que se mandarán en la solicitud PHP.\r\n var parametros = new FormData();\r\n //Especificamos la función en el servidor.\r\n parametros.append(\"fn\", \"mod\");\r\n \r\n //Agregamos el parámetro del ID si el usuario que esté abriendo la página va a editar una cuenta ajena.\r\n parametros.append(\"id\", (id == null ? \"\" : id));\r\n \r\n //Se agregan los nuevos datos básicos a la petición.\r\n var datos_validos =\r\n agregar_parametro(parametros, \"apellido_paterno\", \"ap_p\", \"Apellido paterno\") &&\r\n agregar_parametro(parametros, \"apellido_materno\", \"ap_m\", \"Apellido materno\") &&\r\n agregar_parametro(parametros, \"nombre\", \"nb\", \"Nombre(s)\") &&\r\n agregar_parametro(parametros, \"correo\", \"cr\", \"Correo electrónico\");\r\n if(!datos_validos)\r\n return;\r\n \r\n //Se agregan la nueva contraseña a la petición, si sufrió modificaciones.\r\n if(document.getElementById(\"contrasena\").value != \"\"){\r\n if(document.getElementById(\"contrasena\").value == document.getElementById(\"contrasena_confirmacion\").value)\r\n parametros.append(\"ps\", document.getElementById(\"contrasena\").value);\r\n else{\r\n alert(\"Las contraseñas no coinciden.\");\r\n return;\r\n }\r\n } else {\r\n document.getElementById(\"contrasena_confirmacion\").value = \"\";\r\n aplicar_cambio_contrasena();\r\n }\r\n \r\n //Se agregan los nueva foto de perfil a la petición, si se desea cambiar.\r\n if(document.getElementById(\"foto\").files.length !== 0){\r\n if(document.getElementById('foto').files[0].size < 10485760)\r\n parametros.append(\"ft\", document.getElementById('foto').files[0]);\r\n else{\r\n alert(\"La imagen es demasiado grande\");\r\n return;\r\n }\r\n }\r\n \r\n if(document.getElementById(\"datos_jugador\") !== null){\r\n //Se agregan los datos exclusivos de los jugadores a la petición, si la cuenta a modificar es de ese tipo.\r\n var datos_validos =\r\n agregar_parametro(parametros, \"nacimiento\", \"nc\", \"Fecha de nacimiento\") &&\r\n agregar_parametro(parametros, \"telefono\", \"tel\", \"Número de teléfono\") &&\r\n agregar_parametro(parametros, \"sangre\", \"sg\", \"Tipo de sangre\") &&\r\n agregar_parametro(parametros, \"facebook\", \"fb\", \"Enlace/link al perfil de Facebook\") &&\r\n agregar_parametro(parametros, \"twitter\", \"tw\", \"Enlace/link a la página de Twitter\") &&\r\n agregar_parametro(parametros, \"instagram\", \"ig\", \"Enlace/link a la página de Instagram\");\r\n \r\n if(!datos_validos)\r\n return;\r\n \r\n //Agregamos enfermedades a la petición.\r\n var tmp = [];\r\n $(\"input:checkbox[name='enfermedad']:checked\").each(function (index, i) {\r\n tmp.push($(i).val());\r\n });\r\n parametros.append(\"en\", JSON.stringify(tmp));\r\n \r\n //Agregamos alergias a la petición.\r\n tmp = [];\r\n $(\"input:checkbox[name='alergia']:checked\").each(function (index, i) {\r\n tmp.push($(i).val());\r\n });\r\n parametros.append(\"al\", JSON.stringify(tmp));\r\n \r\n //Agregamos las otras enfermedades a la petición.\r\n if(document.getElementById(\"ch_otras_enf\").checked){\r\n if(!agregar_parametro(parametros, \"tx_otras_enf\", \"ot_en\", \"Otras enfermedades\"))\r\n return;\r\n } else {\r\n parametros.append(\"ot_en\", \"\");\r\n }\r\n \r\n //Agregamos las otras alergias a la petición.\r\n if(document.getElementById(\"ch_otras_alg\").checked){\r\n if(!agregar_parametro(parametros, \"tx_otras_alg\", \"ot_al\", \"Otras alergias\"))\r\n return;\r\n } else {\r\n parametros.append(\"ot_al\", \"\");\r\n }\r\n }\r\n \r\n //Mostramos el modal mientras se guardan los cambios.\r\n $(\"#modal-footer\").hide();\r\n $(\"#modal-title\").html(\"Aplicando cambios...\");\r\n $(\"#modal-body\").html(\"<center><img src='../modelo/img/RC_IF_CARGANDO.gif'></center>\");\r\n $('#modal').modal({backdrop: 'static', keyboard: false});\r\n \r\n //Se hace la petición para guardar los cambios y el resultado se muestra en pantalla.\r\n $.ajax({\r\n url: \"../controlador/SRV_CUENTAS.php\",\r\n data: parametros,\r\n type: \"POST\",\r\n dataType: 'text',\r\n processData: false,\r\n contentType: false,\r\n async: false,\r\n success: function (respuesta) {\r\n $(\"#modal-title\").html(\"Terminado\");\r\n $(\"#modal-body\").html(\"<center>Cuenta modificada correctamente.<br><a href='javascript:irAPaginaDeDetalles();'>Volver a la página de detalles.</a></center>\");\r\n $(\"#modal-footer\").show();\r\n },\r\n error: function (xhr, status) {\r\n $(\"#modal-title\").html(\"Error\");\r\n $(\"#modal-body\").html((xhr.status == 500 ? xhr.responseText : \"Error de servidor (\" + xhr.status + \" \" + status + \").\"));\r\n $(\"#modal-footer\").show();\r\n }\r\n });\r\n}", "function editarUsers(){\n\t//debugger;\n\t// variable que obtengo el arreglo donde estan guardados los usuarios\n\tvar listChamba = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// obtengo el id para poder modificar el elemento actual\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos de los usuarios\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si el modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si si es igual obtener id\n\t\t\t\tvar n = document.getElementById(\"numero\").value;\n\t\t\t// obtener el nombre completo\n\t\t\tvar fn = document.getElementById(\"fullName\").value;\n\t\t\t// obtener el nombre de usuario\n\t\t\tvar u = document.getElementById(\"user\").value;\n\t\t\t// obtener la contraseña\n\t\t\tvar p = document.getElementById(\"password\").value;\n\t\t\t// obtener la contraseña repetida\n\t\t\tvar pr = document.getElementById(\"password_repeat\").value;\n\t\t\t// pregunto si las contraseñas son vacias o nulas\n\t\t\tif(fn == \"\" || fn == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no, pregunto que si el nombre de usuario es vacio o nulo\n\t\t\t}else if(u == \"\" || u == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre de usuario vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no \n\t\t\t}else{\n\t\t\t\t// pregunto que si nas contraseñas son iguales\n\t\t\t\tif(p == pr){\n\t\t\t\t\t// si es asi, le digo que elemento actual en la posicion 0 es igual al id\n\t\t\t\t\tlistChamba[i][j] = n;\n\t\t\t\t\t// la posicion 1 es igual al nombre completo\n\t\t\t\t\tlistChamba[i][j+1] = fn;\n\t\t\t\t\t// la posicion 2 es igual a el nombre de usuario\n\t\t\t\t\tlistChamba[i][j+2] = u;\n\t\t\t\t\t// la posicion 3 es igual a la contraseña\n\t\t\t\t\tlistChamba[i][j+3] = p;\n\t\t\t\t\t// y la posicion 4 es igual a la contraseña repetida\n\t\t\t\t\tlistChamba[i][j+4] = pr;\n\t\t\t\t\t// agrego la modificacion al localstorage\n\t\t\t\t\tlocalStorage['usuarios'] = JSON.stringify(listChamba);\n\t\t\t\t\t// muestro el mensaje para que se de cuenta el usuario que fue modificado\n\t\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\t\tlocation.href = \"ver_usuarios.html\";\n\t\t\t\t\t// si no fuera asi\n\t\t\t\t}else{\n\t\t\t\t\t// muestro el mensaje de error porque las contraseñas son diferentes\n\t\t\t\t\talert(\"No puede modificar el usuario porque las contraseñas son diferentes\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n};\n}", "function editarCompetencia(req, res) {\n var idCompetencia = req.params.id;\n var nuevoNombre = req.body.nombre === '' ? null : req.body.nombre;\n var peticionSql = 'UPDATE competencia SET nombre = ? WHERE id = ?';\n conexionBaseDeDatos.query(peticionSql, [nuevoNombre, idCompetencia], function(error, resultado, campos) {\n if(error) {\n console.log('El campo NOMBRE no puede estar en blanco', error.message);\n return res.status(422).send('El campo NOMBRE no puede estar en blanco');\n }\n if(!idCompetencia) {\n console.log('La competencia no existe');\n return res.status(404).send('La competencia no existe');\n }\n console.log('Se actualizó el nombre de la competencia Nº ' + idCompetencia + ' por ' + nuevoNombre);\n res.status(200).send('Se actualizó el nombre de la competencia por ' + nuevoNombre);\n })\n}", "function editarIndicador(id_indicador, descripcion){\n //console.log(id_indicador);\n //console.log(descripcion);\n var detalle=$('#editarDetalleIndicador');\n var id=$('#editarIdIndicador'); \n detalle.text(descripcion);\n id.val(id_indicador);\n}", "function editarClienteAdmin(req, res) {\n var idUsuario = req.params.idUsuario;\n var params = req.body;\n\n delete params.password;\n\n Usuario.findById(idUsuario, (err, usuarioEncontrado)=>{\n if(err) return res.status(500).send({ mensaje: 'Error en la petición del usuario' })\n if(!usuarioEncontrado) return res.status(500).send({ mensaje: 'Error en obtener los datos' })\n if(usuarioEncontrado.rol == 'ROL_ADMIN'){\n return res.status(500).send({ mensaje: 'No tiene permiso para editar a otros administradores.' })\n } else{\n if(params.usuario){\n Usuario.find({ $or: [\n { usuario: params.usuario }\n ]}).exec((err, usuarioExistente)=>{\n if(err) return res.status(500).send({ mensaje: 'Error en la petición del usuario.' })\n\n if (usuarioExistente && usuarioExistente.length >= 1) {\n return res.status(500).send({ mensaje: 'El usuario ya existe' })\n } else{\n if(params.rol){\n if(params.rol == 'ROL_CLIENTE' || params.rol == 'ROL_ADMIN'){\n Usuario.findByIdAndUpdate(idUsuario, params, { new: true }, (err, usuarioActualizado)=>{\n if (err) return res.status(500).send({ mensaje: 'Error en la peticion' });\n if(!usuarioActualizado) return res.status(500).send({ mensaje: 'No se ha podido actualizar al usuario' })\n return res.status(200).send({ usuarioActualizado })\n })\n }else{\n return res.status(200).send({mensaje: 'El rol debe ser escrito como ROL_ADMIN o ROL_CLIENTE' })\n }\n }else{\n delete params.rol;\n Usuario.findByIdAndUpdate(idUsuario, params, { new: true }, (err, usuarioActualizado)=>{\n if (err) return res.status(500).send({ mensaje: 'Error en la peticion' });\n if(!usuarioActualizado) return res.status(500).send({ mensaje: 'No se ha podido actualizar al usuario' })\n return res.status(200).send({ usuarioActualizado })\n })\n }\n }\n })\n }else{\n delete params.usuario;\n if(params.rol){\n if(params.rol == 'ROL_CLIENTE' || params.rol == 'ROL_ADMIN'){\n Usuario.findByIdAndUpdate(idUsuario, params, { new: true }, (err, usuarioActualizado)=>{\n if (err) return res.status(500).send({ mensaje: 'Error en la peticion' });\n if(!usuarioActualizado) return res.status(500).send({ mensaje: 'No se ha podido actualizar al usuario' })\n return res.status(200).send({ usuarioActualizado })\n })\n }else{\n return res.status(200).send({mensaje: 'El rol debe ser escrito como ROL_ADMIN o ROL_CLIENTE' })\n }\n }else{\n delete params.rol;\n Usuario.findByIdAndUpdate(idUsuario, params, { new: true }, (err, usuarioActualizado)=>{\n if (err) return res.status(500).send({ mensaje: 'Error en la peticion' });\n if(!usuarioActualizado) return res.status(500).send({ mensaje: 'No se ha podido actualizar al usuario' })\n return res.status(200).send({ usuarioActualizado })\n })\n }\n } \n }\n })\n\n \n}", "function setDadosModalEditarDisciplina(cod,nome) { \n $('#editarcod').val(cod);\n $('#editarnome').val(nome);\n Materialize.updateTextFields();\n}", "function atualizaDados(){\n\t\t\tatendimentoService.all($scope.data).then(function (response) {\n\t\t\t\tlimpar();\n\t\t\t\t$scope.atendimentos = response.data;\n\t\t\t\t$log.info($scope.atendimentos);\n\t\t\t}, function (error) {\n\t\t\t\t$scope.status = 'Unable to load customer data: ' + error.message;\n\t\t\t});\n\t\t\t$scope.usuario={};\n\t\t}", "function editarCampaniaFirebase(){\n var keyCampaniaEditar = this.getAttribute(\"data-campania\");\n refCampaniaEditar = refCampanias.child(keyCampaniaEditar);\n refCampaniaEditar.once(\"value\", function(snap){\n var datos = snap.val();\n document.getElementById(\"codigo\").value = datos.codigo; \n document.getElementById(\"nombre_campania\").value = datos.nombre_campania; \n document.getElementById(\"fecha_inicio\").value = datos.fecha_inicio; \n document.getElementById(\"fecha_fin\").value = datos.fecha_fin; \n });\n document.getElementById(\"boton-enviar-campania\").value = UPDATE;\n modo = UPDATE;\n}", "async editar(req, res) {\n await db(\"resposta\")\n .where({ idresposta: req.params.idresposta })\n .update(req.body)\n .then(() => res.status(200).send({ Status: \"Editado com sucesso!!\" }))\n .catch(() => res.status(400).send({ status: \"ERRO\" }));\n }", "function setDadosModalEditarAluno(id,nome,matricula) { \n $('#editarid').val(id);\n $('#editarnome').val(nome);\n $('#editarmatricula').val(matricula);\n Materialize.updateTextFields();\n}", "editarUser(user) {\n user = JSON.parse(user);\n this.user = user;\n this.onEdit = true;\n this.cedulaWarning = true;\n }", "function idAlumno() {\n const alumnoId = document.getElementById(\"alumnos\").value;\n document.getElementById(\"alumnoId\").value = alumnoId;\n}", "function cargarEditCha(){\n\t//debugger;\n\t// le asigno a la variable el nombre donde se guardan las chambas\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"chambas\";\n\t// parseo la variable para obtener los arreglos\n\tvar listChamba =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = listChamba[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = listChamba[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = listChamba[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = listChamba[i][j+3];\n\t\t\t\t//a la variable da5 le asigno el valor de la posicion 4\n\t\t\t\tda5 = listChamba[i][j+4];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"cliente\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"description\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"fecha\").value = da4;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"notas\").value = da5;\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t};\n\t\n}", "setUserClienteData(req, res) {\n // PASSWORD DATA\n let jsonData = req.body;\n // CONNECTING TO THE DATABASE\n pool.connect()\n // ON SUCCESS => CONNECTED\n .then(client => {\n // UPDATE QUERY\n client.query(\"UPDATE tbCliente SET nomeUser = $1, nomeCliente = $2, emailCliente = $3, dataNascimento = $4, enderecoDoCliente = $5, latCliente = $6, lngCliente = $7, telefoneCliente = $8 WHERE idCliente = $9\", [jsonData.user_name, jsonData.name, jsonData.email, jsonData.dataNascimento, jsonData.address, jsonData.lat, jsonData.lng, jsonData.telefone, jsonData.id])\n // ON SUCCESS\n .then(() => {\n // RESPONSE OK 200\n res.status(200).json({ title: 'Dados atualizados', message: 'Seus dados foram atualizados com sucesso.' })\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }))\n // DISCONNECTING TO THE DATABASE\n client.release();\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }));\n }", "function muestraDatosUsuario(datos){\n\tconsole.log(\"datos\");\n\tvar data=eval(datos);\n\t$(\"#nombre\").val(data.nombre);\n\t$(\"#app\").val(data.apellidoP);\n\t$(\"#apm\").val(data.apellidoM);\n\t$(\"#nick\").val(data.username);\n\t$(\"#estatus\").val(data.activo);\n\t$(\"#password\").val(data.password);\n\tconsole.log(data)\n\t$(\"#rol\").val(data.rol);\n\t$(\"#idUsuario\").val(data.id);\n\t$(\"#idEjecutivo\").val(data.idEjecutivo);\n}", "function editarempresa(req,res){\n\n\tlet empresaid = req.params.id_empresa;\n\tlet empresa = new Empresa(\n\t\t\n\t\treq.body.nombre_empresa,\n\t\treq.body.id_status\n\t\t\n\t\t);\n\n\tCONN('empresa').where('id_empresa',empresaid).update({nombre_empresa:req.body.nombre_empresa,id_status:req.body.id_status}).then(editarnombre =>{\n\t\tconsole.log(editarnombre);\n\t\tif(!editarnombre){\n\t\t\tres.status(500).send({resp: 'Error',error:'los datos no se actualizaron'});\n\t\t}else{\n\t\t\tCONN('empresa').where('id_empresa',empresaid).select().then(nombre =>{\n\t\t\t\tif (!nombre){\n\t\t\t\t\tres.status(500).send({resp: 'Error', error:'error en la consulta'});\n\t\t\t\t}else{\n\t\t\t\t\tres.status(200).send({resp:'Actualizacion de datos correcta',nombre: nombre});\n\n\t\t\t\t}\n\t\t\t}).catch(error =>{\n\t\t\t\tres.status(500).send({resp: 'error',\n\t\t\t\terror: `${error}`});\n\t\t\t});\n\t\t}\n\t})\n}", "atualizaNome() //controler\r\n {\r\n this._elemento.textContent = `[${this._idade}] ${this._nome}`;\r\n }", "async function editMatrikel() {\n try {\n\n CheckMatrikelNrFormat();\n\n // get Userinfo to fill out the missing variables in put requests\n const current = await api.get(`/users/${sessionStorage.getItem('id')}`);\n\n const requestBody = JSON.stringify({\n name: current.data.name,\n username: current.data.username,\n matrikelNr: matrikelNr\n });\n\n // Edit is sent to backend\n await api.put(`/users/${sessionStorage.getItem('id')}`, requestBody);\n\n } catch (error) {\n alert(`Something went wrong while editing the user: \\n${handleError(error)}`);\n }\n }", "function inicializareditar(datos) {\n \n tipo1informacionpersonaleditar.value = datos[0]['tipo'];\n document.getElementById('idip').value = datos[0]['id'];\n\n}", "function editMockData() {\n let settings = { username: 'Prospero', passoword: '1611', theme: 0 };\n updateSettings(settings);\n}", "function modificado(t) {\n datos();\n}", "function changedUsuarioValue(item) {\n $scope.WorkCliente.IdUsuario = item.IdUsuario;\n }", "function editarInvoice(){\n\t//debugger;\n\t// le asigno a una variable el nombre con el que estan guardados los invoices\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"invoices\";\n\t// parsea el nombre que se obtuvo para obtener los arreglos \n\tvar listInvoice =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// busca el id que esta actualmente y se lo asigna a la variable modificar\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listInvoice.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listInvoice[i].length; j++) {\n\t\t\t// pregunto que si modificar es isual al id actual\n\t\t\tif(modificar == listInvoice[i][j]){\n\t\t\t\t//si es asi obtener id\n\t\t\t\tvar n = document.getElementById(\"numero\").value;\n\t\t\t// obtener el cliente\n\t\t\tvar c = document.getElementById(\"cliente\").value;\n\t\t\t// obtener la descripcion\n\t\t\tvar d = document.getElementById(\"description\").value;\n\t\t\t// obtener la fecha\n\t\t\tvar f = document.getElementById(\"fecha\").value;\n\t\t\t// obtener las monto\n\t\t\tvar m = document.getElementById(\"monto\").value;\n\t\t\t// pregunto que si el cliente es vacio o nulo\n\t\t\tif(c == \"\" || c == null){\n\t\t\t\t// si es asi muetro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de cliente vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no, pregunto que si la descripcion es vacia o nula\n\t\t\t}else if(d == \"\" || d == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de descripcion vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si la fecha es vacia o nula\n\t\t\t}else if(f == \"\" || f == null){\n\t\t\t\t// si es asi se muestra un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de fecha vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no, pregunto que si es monto es vacio o nulo\n\t\t\t}else if(m == \"\" || m == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de monto vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no es asi\n\t\t\t}else{\n\t\t\t\t// le digo que el elemento actual en la posicion 0 es igual a el id\n\t\t\t\tlistInvoice[i][j] = n;\n\t\t\t\t// la posicion 1 es igual a el cliente\n\t\t\t\tlistInvoice[i][j+1] = c;\n\t\t\t\t// la posicion 2 es igual a la descripcion\n\t\t\t\tlistInvoice[i][j+2] = d;\n\t\t\t\t// la posicion 3 es igual a la fecha\n\t\t\t\tlistInvoice[i][j+3] = f;\n\t\t\t\t// la posicion 4 es igual al monto\n\t\t\t\tlistInvoice[i][j+4] = m;\n\t\t\t\t// le vuelvo a insertar los arreglos con el actual modificado\n\t\t\t\tlocalStorage[usuario_nombre] = JSON.stringify(listInvoice);\n\t\t\t\t// muestro un mensaje para que el usuario sepa que fue modificado\n\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\tlocation.href = \"Invoices Administration.html\";\n\t\t\t}\n\t\t}\n\t};\n};\n}", "function editar(tipo){\n\tvar nombre = document.getElementById(\"editar\"+tipo).value;\n\tvar id = document.getElementById(\"id\"+tipo).value;\n\t//procesa la edicion\n\tlocation.replace(\"control/admonAtributos.php?accion=edit&nombre=\"+nombre+\"&tipo=\"+tipo+\"&id=\"+id);\n\t}", "function editarTarjeta(datos) {\n\t\treturn `\n\t\t\t<div class=\"editar\">\n\t\t\t\t<div class=\"informacion\">\n\t\t\t\t\t<div class=\"id\">${datos.id}</div>\n\t\t\t\t\t<div class=\"nombre data\">\n\t\t\t\t\t\t<input type=\"text\" value=\"${datos.nombre}\"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"fecha data\">\n\t\t\t\t\t\t<input type=\"text\" value=\"${datos.fecha}\"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"doctor data\">\n\t\t\t\t\t\t<input type=\"text\" value=\"${datos.doctor}\"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"pruebas data\">\n\t\t\t\t\t\t<input type=\"text\" value=\"${datos.pruebas}\"/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"send-wraper flex-c\">\n\t\t\t\t\t<input type=\"submit\" value=\"Enviar\" class=\"put-btn\"/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\t}", "function editar_todo(indice,todos){\n const mod_titulo = document.getElementById('mod-titulo')\n mod_titulo.value = todos[indice].titulo\n const mod_descripcion = document.getElementById('mod-descripcion')\n mod_descripcion.value = todos[indice].descripcion\n const btn_modificar = document.getElementById('modificar')\n btn_modificar.addEventListener('click',async ()=>{\n const model = document.getElementById('model')\n model.style.display = 'none'\n let url = window.origin+'/modificar_todo'\n let todo = todos[indice]\n todo.titulo = mod_titulo.value\n todo.descripcion = mod_descripcion.value\n let data = await fetch(url,{\n method: 'PUT',\n credentials: 'include',\n cache: 'no-cache',\n body: JSON.stringify(todo),\n headers: new Headers({\n 'content-type':'application/json'\n })\n })\n render()\n })\n}", "function editarEmpresa(req,res) {\n var idEmpresa = req.params.idEmpresa;\n var params = req.body;\n if(req.user.rol!='Rol_Admin'){\n return res.status(500).send({mensaje: 'No posees los permisos nesesarios para actualizar esta Empresa.'})\n }\n Empresa.findByIdAndUpdate(idEmpresa, params, { new: true }, (err,empresaActualizado)=>{\n if(err) return res.status(500).send({mensaje: 'Error en la peticion'});\n if(!empresaActualizado) return res.status(500).send({mensaje: 'No se ha podido actualizar esta Empresa'});\n return res.status(200).send({empresaActualizado}); \n })\n}", "alteraUsuario(usuario, body) {\n return new Promise((resolve, reject) => {\n this.bd.run('UPDATE USUARIOS SET NOME = (?), SENHA = (?) WHERE EMAIL = (?)' \n , [body.nome, body.senha, usuario]\n , (err) => {\n if (err) {\n reject('Falha ao modificar usuario')\n } else {\n resolve('Usuario modificado com sucesso')\n }\n })\n\n\n })\n\n }", "function editarFormulario(){\n //Trae la grid para poder actualizar al editar\n listadoCamposFormulario = Ext.getCmp('listadoCamposFormulario');\n if (listadoCamposFormulario.getSelectionModel().hasSelection()) {\n var row = listadoCamposFormulario.getSelectionModel().getSelection()[0];\n \n\n encontrado=1;\n if(ventana==null) \n ventana = Ext.create ('App.miVentanaBanco');\n\n // Precarga el nombre e id seleccionados\n Ext.getCmp('nombreBanco').setValue(row.get('nombre'));\n Ext.getCmp('idBanco').setValue(row.get('id'));\n\n\n ventana.show();\n \n }\n }", "function Editar(pos){\r\n var Placa = document.getElementById(\"placa\");\r\n var Color = document.getElementById(\"color\");\r\n var Ano = document.getElementById(\"ano\");\r\n var Capacidad = document.getElementById(\"capacidad\");\r\n var Cilindraje= document.getElementById(\"cilindraje\");\r\n var Chasis = document.getElementById(\"chasis\");\r\n var Zona = document.getElementById(\"zona\");\r\n var Valor = document.getElementById(\"valor\");\r\n var Fecha = document.getElementById(\"fecha\");\r\n var Email = document.getElementById(\"email\");\r\n var Tel = document.getElementById(\"tel\");\r\n var Direccion = document.getElementById(\"direccion\");\r\n\r\n document.getElementById(\"btn\").hidden = true;\r\n document.getElementById(\"btn_editar\").hidden = false;\r\n\tPlaca.value = vec[pos].placa;\r\n\tColor.value = vec[pos].color;\r\n\tAno.value = vec[pos].Anyo;\r\n\tCapacidad.value = vec[pos].capacidad;\r\n\tCilindraje.value = vec[pos].cilindraje;\r\n\tChasis.value \t = vec[pos].chasis;\r\n\tZona.value \t = vec[pos].zona;\r\n\tValor.value \t = vec[pos].valor;\r\n\tFecha.value = vec[pos].fecha;\r\n\tEmail.value = vec[pos].correo;\r\n\tTel.value\t = vec[pos].tele;\r\n\tDireccion.value = vec[pos].dir;\r\n}", "function escribir() {\n const escribe = document.getElementById(\"escribe\");\n const vtaconvenio =\n \" where NumActoVenta = \" +\n NumActoVenta.value +\n \" and CodIdVentaConvenio =\" +\n CodIdVentaConvenio.value +\n \" and CorrPrestacion =\" +\n CorrPrestacion.value +\n \";\" +\n \"\\n\" +\n \"\\n\";\n const bonoprestacion =\n \" where NumActoVenta = \" +\n NumActoVenta.value +\n \" and CodIdVentaConvenio =\" +\n CodIdVentaConvenio.value +\n \" and FolioBono = \" +\n FolioBono.value +\n \" and CorrPrestacion =\" +\n CorrPrestacion.value +\n \";\";\n const prestacion = document.getElementById(\"prestaciones\").value;\n const option = options.find((opt) => opt.value === prestacion);\n let texto = \"Selecciona una Prestacion\";\n\n if (option) {\n texto =\n \"update trprestacionventaconvenio set CodIdPrestacionCertificador = \" +\n option.codIdPrestacionCertificador +\n \", CodPrestacionCertificador = '\" +\n option.codPrestacionCertificador +\n \"', CodIdPrestacionHomologo = \" +\n option.codIdPrestacionHomologo +\n \", CodItemFinanciador = \" +\n option.codItemFinanciador +\n vtaconvenio +\n \"update trbonoprestaciones set CodIdPrestacionCertificador = \" +\n option.codIdPrestacionCertificador +\n bonoprestacion;\n }\n\n escribe.innerText = texto;\n}", "async edit(req, res) {\n const _id = req.user._id\n\n const user = await User.findOne({_id: _id})\n\n if (!req.body.dataNasc || !req.body.nome || !req.body.endereco || !req.body.cpf) {\n return res.status(400).send('Campo(s) obrigatório(s) vazio(s)!')\n }\n\n user.nome = req.body.nome\n user.cpf = req.body.cpf\n user.dataNasc = req.body.dataNasc\n user.endereco = req.body.endereco\n \n //biografia opcional\n if (req.body.biografia) {\n user.biografia = req.body.biografia\n }\n\n //condicional para verificar se o email de confirmacao precisa ser reenviado\n if (req.body.email) {\n const emailAlreadyExists = await User.findOne({email: req.body.email})\n \n if (emailAlreadyExists) {\n return res.status(400).send(\"Email já cadastrado!\")\n }\n\n user.email = req.body.email\n user.verificado = false\n \n const novoTokenVerificacao = Math.random().toString(36).slice(2)\n user.tokenVerificacao = novoTokenVerificacao\n sendEmail(req.body.email, novoTokenVerificacao)\n }\n\n const savedUser = await user.save()\n return res.json({completo: true})\n }", "function update() {\n var restikoId = localStorage.getItem(\"id\");\n getValueFromForm()\n base('RESTIKO').update([{\n \"id\": restikoId,\n \"fields\": {\n \"Date\": date,\n \"Ce que j'ai fait\": fait,\n \"Ce que j'ai appris\": appris,\n \"Ce que j'ai aimé\": aime,\n \"Ce que j'ai utilisé de nouveaux\": nouveau,\n \"Problématiques rencontrées\": problem,\n \"Quels sont les objectifs ?\": objectif,\n \"Qu'est-ce qui m'a manqué ?\": manque,\n \"Qu'est-ce que tu ferais à la place du formateur ?\": formateur,\n \"Personne (Initiales)\": {\n \"id\": \"usrVA8D2T1b8KxCEw\",\n \"email\": \"[email protected]\",\n \"name\": \"FONG Tea\"\n },\n \"Objectif atteint ou pas\": succes,\n \"Field 13\": rating\n }\n }], function (err, records) {\n if (err) {\n console.error(err);\n return;\n }\n });\n setTimeout(function () {\n window.location = \"list.html\";\n }, 500);\n }", "function alterFuncionario(funcionario, nome_usuario, callback){\n db.connect(function(err, client, done){\n db.checkConnectionError(err, callback);\n\n if(nome_usuario == undefined || nome_usuario == null)\n nome_usuario = funcionario.nome_usuario;\n\n var query = client.query({\n text: 'UPDATE funcionario SET nome_usuario = $11, nome = $2, end_rua = $3, ' +\n 'end_complemento = $4, end_cidade = $5, end_estado = $6, telefone_1 = $7, ' +\n 'telefone_2 = $8, salario = $9, cargo = $10 WHERE nome_usuario = $1',\n values: [funcionario.nome_usuario, funcionario.nome, funcionario.end_rua,\n funcionario.end_complemento, funcionario.end_cidade, funcionario.end_estado,\n funcionario.telefone_1, funcionario.telefone_2, funcionario.salario,\n funcionario.cargo, nome_usuario],\n name: 'alter_funcionario'\n });\n query.on('row', function(row, result) {\n result.addRow(row);\n });\n query.on('error', function(error) {\n db.checkQueryError(error, client, done, callback);\n });\n query.on('end', function(result) {\n done();\n console.log('funcionario ' + funcionario.nome_usuario + ' alterado com sucesso');\n funcionario.nome_usuario = nome_usuario;\n callback(null, funcionario);\n });\n });\n}", "function editarsitio(sitio_rtn){\n var url = \"?action=adminsitio\"\n $.ajax({\n url: url,\n type: 'POST', //metodo de la peticion\n dataType: 'json',//tipo de dato de la respuesta\n data: {rtn_sitio: sitio_rtn,function:\"consultar\"},\n success: function(respuesta){\n if (respuesta.data) {\n $(\"input[name=id_editar]\").val(respuesta.data.id_sitio);\n $(\"input[name=nombre_editar]\").val(respuesta.data.nombre_sitio);\n $(\"input[name=rtn_editar]\").val(respuesta.data.rtn);\n $(\"select[name=tipos_editar]\").val(respuesta.data.tipo_id);\n $(\"input[name=fecha_editar]\").val(respuesta.data.fecha_otorgamiento_rtn);\n $(\"input[name=rif_editar]\").val(respuesta.data.rif);\n $(\"input[name=telefono_editar]\").val(respuesta.data.telefono_sitio);\n $(\"input[name=correo_editar]\").val(respuesta.data.email);\n $(\"input[name=facebook_editar]\").val(respuesta.data.facebook);\n $(\"input[name=instagram_editar]\").val(respuesta.data.instagram);\n $(\"input[name=web_editar]\").val(respuesta.data.sitioweb);\n $(\"input[name=licencia_editar]\").val(respuesta.data.num_licencia);\n $(\"input[name=latitud_editar]\").val(respuesta.data.latitud);\n $(\"input[name=longitud_editar]\").val(respuesta.data.longitud);\n $(\"select[name=estado_editar]\").val(respuesta.data.estado_id);\n $(\"select[name=estatus_editar]\").val(respuesta.data.estatus);\n $(\"input[name=habitacion_editar]\").val(respuesta.data.num_habitacion);\n $(\"input[name=licencia_editar]\").val(respuesta.data.num_licencia);\n $(\"input[name=direccion_editar]\").val(respuesta.data.direccion_sitio);\n $(\"textarea[name=descripcion_editar]\").val(respuesta.data.descripcion);\n\n var estado_id=respuesta.data.estado_id\n ciudades(estado_id, $(\".ciudades_editar\"), respuesta.data.ciudad_id );\n $('#modal-modificar').modal(\"show\")\n }else{\n alert(\"error\")\n }\n },\n error: function() {\n console.log(\"No se ha podido obtener la información\");\n }\n })\n}", "function setAdminUnico(){\n\tdocument.getElementById(\"8__VAL_C2\").value = 14265;\n\t\n}", "function updateUserData(){\n var new_name = document.getElementById('name_change').value;\n if (new_name == \"\"){\n new_name = name;\n }\n var new_jobs = document.getElementById('jobs_change').value;\n if (new_jobs == \"\"){\n new_jobs = jobs;\n }\n var new_contact = document.getElementById('contact_change').value;\n if (new_contact == \"\"){\n new_contact = contact;\n }\n var new_tjm = document.getElementById('tjm_change').value;\n if (new_tjm == \"\"){\n new_tjm = tjm;\n }\n writeUserData(userId, new_name, new_jobs, new_contact, new_tjm);\n}", "function editar(){\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"php/editar.php\",\n\t\tdata: {\t'id':$('#modalModificar').find('#id').val(),\n\t\t\t\t'nombre':$('#modalModificar').find('#nombre').val(),\n\t\t\t\t'apellido':$('#modalModificar').find('#apellido').val(),\n\t\t\t\t'fecha':$('#modalModificar').find('#fecha').val(),\n\t\t\t\t'correo':$('#modalModificar').find('#correo').val(),\n\t\t\t\t'sexo':$('#modalModificar').find('#sexo').val()},\n\t\t\t\t\n\t\tsuccess: function (resp) {\n\t\t\tif(resp == 1){\n\t\t\t\talertify.success('Modificado Correctamente...');\n\t\t\t\tloadData();\n\t\t\t}else{\n\t\t\t\talertify.error('Ha ocurrido un error...');\n\t\t\t}\n\t\t}\n\t});\n}", "function accionModificar() {\n\tvar opcionMenu = get(\"formulario.opcionMenu\");\n\tvar oidPlantilla = null;\n\tvar numPlantilla = null;\n\tvar oidParamGrales = null;\n\tvar filaMarcada = null;\n\tvar codSeleccionados = null;\n\tvar datos = null;\t\n\n\tlistado1.actualizaDat();\n\tdatos = listado1.datos;\n\tcodSeleccionados = listado1.codSeleccionados();\n\n\tif (codSeleccionados.length > 1) {\n GestionarMensaje('8');\n\t\treturn;\n\t}\n\n\tif ( codSeleccionados.length < 1)\t{\n GestionarMensaje('4');\n\t\treturn;\n\t}\n\n\t// Obtengo el índice de la fila marcada (en este punto, solo una estará marcada)\n\tvar filaMarcada = listado1.filaSelecc;\n\n\t// Obtengo el oid de Param. Generales (oid del valor seleccionado, está al final de la lista por el tema del ROWNUM)\n\toidParamGrales = datos[filaMarcada][9]; \n\n\t// Obtengo Oid de la Entidad PlantillaConcurso (AKA Numero de Plantilla);\n\tnumPlantilla = datos[filaMarcada][3];\n\n\tvar oidVigenciaConcurso = datos[filaMarcada][10]; \n\tvar oidEstadoConcurso = datos[filaMarcada][11]; \n\tvar noVigencia = get(\"formulario.noVigencia\");\n\tvar estConcuAprobado = get(\"formulario.estConcuAprobado\");\n\n\tif((parseInt(oidVigenciaConcurso) == parseInt(noVigencia)) && \t\t\n\t(parseInt(oidEstadoConcurso)!=parseInt(estConcuAprobado))) {\n\t\tvar obj = new Object();\n\t\t// Seteo los valores obtenidos. \n\t\tobj.oidConcurso = oidParamGrales;\n\t\tobj.oidPlantilla = numPlantilla;\n\t\tobj.opcionMenu = opcionMenu;\n\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\taccionBuscar();\n\t}\n\telse {\n\t\tvar indDespacho = datos[filaMarcada][12];\n\t\tif (oidVigenciaConcurso == '1' && parseInt(indDespacho) == 0) {\n\t\t\tif (GestionarMensaje('3385')) {\n\t\t\t\tvar obj = new Object();\n\t\t\t\t// Seteo los valores obtenidos. \n\t\t\t\tobj.oidConcurso = oidParamGrales;\n\t\t\t\tobj.oidPlantilla = numPlantilla;\n\t\t\t\tobj.opcionMenu = opcionMenu;\n\t\t\t\tobj.oidVigenciaConcurso = oidVigenciaConcurso;\n\t\t\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\t\t\taccionBuscar();\n\t\t\t}\t\n\t\t}\n\t\telse {\n\t\t\t//El concurso seleccionado no puede ser modificado\n\t\t\tGestionarMensaje('INC052');\n\t\t}\n\t}\n}", "function editar(obj){\n fetch(URL_BASE+obj)\n .then(response => response.json()) \n .then(json => {\n console.log(json)\n id.value = json[0].ID\n nome.value= json[0].NOME\n email.value = json[0].EMAIL\n tipo.value = json[0].TIPO\n\n })\n \n}", "async function actualizarCurso3(id){ \n const resultado = await Curso.findByIdAndUpdate(id,{ \n $set: { \n autor: 'Juan Solis',\n publicado: false\n }\n },/*Con este {new: true} se muestran los datos actualizados \n sin el se muestran los datos antes de actualizar*/ {new: true});\n console.log(resultado);\n}", "actualizarUsuario() {\n let calculo = (this.usuario.peso / (this.usuario.estatura * this.usuario.estatura)) * 10000;\n this.x = calculo.toFixed(2)\n this.usuario.IMC = this.x\n let posicion = this.lista_usuario.findIndex(\n usuario => usuario.id == this.usuario.id\n );\n this.lista_usuario.splice(posicion, 1, this.usuario);\n localStorage.setItem(posicion, this.usuario);\n this.usuario = {\n tipoidentificacion: \"\",\n id: \"\",\n nombres: \"\",\n apellidos: \"\",\n correo: \"\",\n peso: \"\",\n estatura: \"\",\n IMC: \"\",\n acciones: true\n };\n this.saveLocalStorage();\n this.enEdicion = false\n }", "function verCliente(seleccionado) {\n var table = $('#lista_cliente').DataTable();\n var celda = $(seleccionado).parent();\n var rowData = table.row(celda).data();\n var id = rowData['id'];\n var nombre = rowData['nombre_cliente'];\n var nit = rowData['ci_nit'];\n var telefono = rowData['telefono'];\n var direccion = rowData['direccion'];\n var email = rowData['correo'];\n var fecha_nacimiento = rowData['fecha_nacimiento'];\n\n\n $('#ver_ci').val(nit);\n $('#ver_telefono').val(telefono);\n $('#ver_nombre').val(nombre);\n $('#ver_direccion').val(direccion);\n $('#ver_email').val(email);\n $('#ver_fecha_nacimiento').val(fecha_nacimiento);\n\n}", "function btnMostraEditarLocalizacion(id){\n\n $(\"#headerLocalizacion\").html('<i class=\"fa fa-edit\"></i> ACTUALIZAR LOCALIZACION PREDIO');\n $('#formLocalizacion')[0].reset();//limpiar formulario\n $.get('localizacionpredio/'+id+'/edit', function (data) {\n $('#name').val(data.name);\n $('#indice').val(data.indice);\n });\n\n $(\"#btnLocalizacion\").attr('class','btn btn-warning');\n $(\"#method_localizacion\").val('PUT');\n $(\"#formLocalizacion\").attr('action','localizacionpredio/'+id);//fijamos laruta para editar window.location.protocol+'//'+window.location.host+'/closet/'+id);\n $(\"#btnLocalizacion\").html('<i class=\"fa fa-save\"></i> Actualizar ');\n $(\"#formModaLocalizacion\").modal('show');\n }", "actualizarNombre(id, nombre) {\n for (let usuario of this.lista) {\n if (usuario.id === id) {\n usuario.nombre = nombre;\n break;\n }\n //de la lista en cada interaccicon la variable \n //usuario va a ser el elmento de cada intereaccion\n }\n }", "function modificar_programas(id) {\n\t\t$('#obj_codigo, #obj_nombre').html('');\n\t\t$('#obj_nombre').html('<span class=\"editable\" name=\"x\" id=\"edit_nombre\"></span>');\n\t\t$('#obj_codigo').html('<span class=\"editable\" name=\"y\" id=\"edit_codigo\"></span>');\n\t\t$.ajax({\n\t\t\turl: 'data/programas/app.php',\n\t\t\ttype: 'post',\n\t\t\tdataType:'json',\n\t\t\tdata: {consultar_datos_programas:'asjkef', id: id},\n\t\t\tsuccess: function (data) {\n\t\t\t\t$(\"#edit_nombre\").text(data['nombre'])\t\t\t\n\t\t\t\t$(\"#edit_codigo\").text(data['codigo'])\n\t\t\t\tconsole.log(data);\n\t\t\t\t$('#modal-actualizar').modal('show');\n\t\t\t\t$('#edit_nombre').editable({\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\tname: 'actualizar_nombre_programas',\n\t\t\t\t\tvalue: data['nombre'],\n\t\t\t\t\tpk:id,\n\t\t\t\t\turl:'data/programas/app.php',\n\t\t\t\t\tvalidate:function(value){\t\t \n\t\t\t\t \tif(value=='') return 'Campo Requerido Ingrese Nombre';\n\t\t\t\t },\n\t\t\t\t success:function(data){\n\t\t\t\t \tllenar_tabla_programas()\n\t\t\t\t \tvar json = jQuery.parseJSON(data);\n\t\t\t\t \tif (json['valid']!='true') {\n\t\t\t\t \t\t$.gritter.add({\n\t\t\t\t\t\t\t\ttitle: 'Proceso No Modificado',\n\t\t\t\t\t\t\t\ttext: 'Porvafor Verifique que sus Datos esten llenos',\n\t\t\t\t\t\t\t\tclass_name: 'gritter-error',\n\t\t\t\t\t\t\t\ttime:2000\n\t\t\t\t\t\t\t});\n\t\t\t\t \t}\n\t\t\t\t \tif (json['valid']=='true') {\n\t\t\t\t \t\t$.gritter.add({\n\t\t\t\t\t\t\t\ttitle: 'Proceso Modificado Correctamente',\n\t\t\t\t\t\t\t\ttext: 'Sus Datos han sido Modificados de forma Correcta',\n\t\t\t\t\t\t\t\tclass_name: 'gritter-success',\n\t\t\t\t\t\t\t\ttime:2000\n\t\t\t\t\t\t\t});\t\n\t\t\t\t \t}\n\t\t\t\t }\n\t\t\t });\n\t\t\t //para actualizar los datos de codigo de Programas\n\t\t \t$('#edit_codigo').editable({\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\tname: 'actualizar_codigo_programas',\n\t\t\t\t\tvalue: data['codigo'],\n\t\t\t\t\tpk:id,\n\t\t\t\t\turl:'data/programas/app.php',\n\t\t\t\t\tvalidate:function(value){\t\t \n\t\t\t\t \tif(value=='') return 'Campo Requerido Ingrese Nombre';\n\t\t\t\t },\n\t\t\t\t success:function(data){\n\t\t\t\t \tllenar_tabla_programas()\n\t\t\t\t \tvar json = jQuery.parseJSON(data);\n\t\t\t\t \tif (json['valid']!='true') {\n\t\t\t\t \t\t$.gritter.add({\n\t\t\t\t\t\t\t\ttitle: 'Proceso No Modificado',\n\t\t\t\t\t\t\t\ttext: 'Porvafor Verifique que sus Datos esten llenos',\n\t\t\t\t\t\t\t\tclass_name: 'gritter-error',\n\t\t\t\t\t\t\t\ttime:2000\n\t\t\t\t\t\t\t});\n\t\t\t\t \t}\n\t\t\t\t \tif (json['valid']=='true') {\n\t\t\t\t \t\t$.gritter.add({\n\t\t\t\t\t\t\t\ttitle: 'Proceso Modificado Correctamente',\n\t\t\t\t\t\t\t\ttext: 'Sus Datos han sido Modificados de forma Correcta',\n\t\t\t\t\t\t\t\tclass_name: 'gritter-success',\n\t\t\t\t\t\t\t\ttime:2000\n\t\t\t\t\t\t\t});\t\n\t\t\t\t \t}\n\t\t\t\t }\n\t\t\t });\n\t\t\t}\n\t\t});\n\t}", "function editarObjetivo(id_objetivo, descripcion){\n var detalle=$('#editarDetalleObjetivo');\n var id=$('#editarIdObjetivo'); \n detalle.text(descripcion);\n id.val(id_objetivo);\n}", "function actualizarUsuario(req, res) {\n // localhost:3000/api/editar/:id\n var usuarioId = req.params.id;\n var nuevosDatosUsuario = req.body;\n\n Usuario.findByIdAndUpdate(usuarioId, nuevosDatosUsuario, (err, usuarioActualizado) => {\n if (err) {\n res.status(500).send({ message: \"Error en el servidor\" });\n } else {\n if (!usuarioActualizado) {\n res.status(200).send({ message: \"No fue posible actualizar tus datos\" });\n } else {\n res.status(200).send({\n message: \"Usuario Actualizado\",\n usuario: nuevosDatosUsuario\n });\n }\n }\n });\n}", "function setIndiceEdite(Nojoueur) {\r\n\tvar arguments = \"nojoueur=\" + Nojoueur;\r\n\trequest(\"POST\", \"admin.php?methode=INDICE_edite\", false, setData, arguments ); /*pas d'AJAX asynchrone, car manipulation sur champ*/\r\n\t/*champ date*/\r\n\t$(function() {\r\n\t\t$( \"#Datedebut\" ).datepicker({ numberOfMonths: 3, showButtonPanel: true});\r\n\t\t$( \"#Datefin\" ).datepicker({ numberOfMonths: 3, showButtonPanel: true});\r\n\t});\r\n\t/*champ heure*/\r\n\t$('#Heuredebut').timepicker({hourText: 'Heures', minuteText: 'Minutes', amPmText: ['Matin', 'Aprem'], timeSeparator: ':'});\r\n\t$('#Heurefin').timepicker({hourText: 'Heures', minuteText: 'Minutes', amPmText: ['Matin', 'Aprem'], timeSeparator: ':'});\r\n\t/*champ commentaire avec editeur HTML*/\r\n\t$(document).ready(function() {\r\n $(\"#Libelle\").cleditor()[0].focus();\r\n\t});\r\n}", "function editar(valorId) {\n\n\n var urls = \"https://jsonplaceholder.typicode.com/users/\" + valorId\n\n\n $.ajax({\n type: \"GET\",\n url: urls,\n data: \"\",\n contentType: \"application/Json; charset=utf-8\",\n dataType: 'Json',\n\n\n success: function (r) {\n\n\n // for (i in r) {\n // if (id != valorId) {\n\n // $(\"#cuerpo\").append('<tr><th scope=\"row\">'+r[i].id+'</th><td>'+r[i].name+'</td><td>'+r[i].username+'</td><td>'+r[i].email+'</td><td>'+r[i].phone+'</td><th scope=\"col\" class=\"text-primary\" id=\"\"><a href=\"javascript:pasarVariables('+r[i].id+')\">Editar</a> </th><th scope=\"col\" class=\"text-primary\"><a href=\"javascript:eliminar('+r[i].id+')\">Eliminar</a> </th></tr>')\n // }\n // id+=1;\n\n // }\n\n var idMax = r.id;\n var nombres = r.name;\n var usuarios = r.username;\n var correos = r.email;\n var telefonos = r.phone;\n\n \n $(\"#iDUsuario\").val(idMax);\n $(\"#nombres\").val(nombres);\n $(\"#usernames\").val(usuarios);\n $(\"#correos\").val(correos);\n $(\"#telefonos\").val(telefonos);\n $(\"#iDUsuario\").prop('disable', true);\n $(\"#id02\").css(\"display\", \"inline\");\n\n\n\n\n },\n error: function (r) {\n\n\n },\n failure: function (r) {\n\n }\n });\n}", "function editarId(id) {\n $.ajax({\n type: 'POST',\n data: \"id=\" + id,\n url: '../controllers/autor/autorObtenerID.php',\n cache: false,\n success: function (r) {\n r = JSON.parse(r);\n $('#txtided').val(r['id_autor']);\n $('#txtnombreaued').val(r['nombre']);\n $('#txtemailaued').val(r['email']);\n $('#selectestadoaued').val(r['estado']);\n $('#selectpaisaued').val(r['pais']);\n }\n });\n}", "function modificar_user(identidad) {\n\tcargando('Obteniedo información del usuario')\n\tenvio = { codigo: identidad }\n\t$.ajax({\n\t\tmethod: \"POST\",\n\t\turl: \"/admin-cliente/editar-cliente\",\n\t\tdata: envio\n\t}).done((datos) => {\n\t\tif (datos != 'Error') {\n\t\t\tno_cargando()\n\t\t\tasignar('txtnombre', datos.nombre)\n\t\t\tasignar('txtedad', datos.edad)\n\t\t\tasignar('txtsector', datos.sector)\n\t\t\tasignar('txtcedula', datos.cedula)\n\t\t\tasignar('txttelefono', datos.telefono)\n\t\t\tasignar('textdireccion', datos.direccion)\n\t\t\tasignar('txtmail', datos.username)\n\t\t\tvar opciones = document.getElementsByClassName('listado_referidos')\n\t\t\tfor (var i = 0; i < opciones.length; i++) {\n\t\t\t\topciones[i].removeAttribute('selected')\n\t\t\t}\n\t\t\tfor (var i = 0; i < opciones.length; i++) {\n\t\t\t\tif (datos.referido == opciones[i].value)\n\t\t\t\t\topciones[i].setAttribute('selected', '')\n\t\t\t}\n\t\t\t$('#modal-modificar-user').modal()\n\t\t} else {\n\t\t\tno_cargando()\n\t\t\tswal('Error', 'Ha ocurrido un error inesperado', 'error')\n\t\t}\n\t})\n}", "function editMensualidad(index) {\r\n //Modal edit\r\n $('#editMensualidad').modal('toggle');\r\n\r\n //Nodos tabla\r\n var id_new_mensualidad = index.parentNode.parentNode.cells[0].textContent;\r\n var new_mensualidad_descripcion = index.parentNode.parentNode.cells[1].textContent;\r\n var new_mensualidad_total = index.parentNode.parentNode.cells[2].textContent;\r\n var new_mensualidad_fecha = index.parentNode.parentNode.cells[3].textContent;\r\n var new_mensualidad_tipo = index.parentNode.parentNode.cells[4].textContent;\r\n\r\n //Pego en el formulario\r\n document.getElementById('id_new_mensualidad').value = id_new_mensualidad;\r\n document.getElementById('new_mensualidad_descripcion').value = new_mensualidad_descripcion;\r\n document.getElementById('new_mensualidad_total').value = new_mensualidad_total;\r\n document.getElementById('new_mensualidad_fecha').value = new_mensualidad_fecha;\r\n document.getElementById('new_mensualidad_tipo').value = new_mensualidad_tipo;\r\n}", "function caricaDatiProfilo(utente) {\n $(\"#nomeModProfilo\").val(utente.nome);\n $(\"#cognomeModProfilo\").val(utente.cognome);\n $(\"#dataNascitaModProfilo\").val(formattazioneData(new Date(utente.dataNascita).toDateString()));\n $(\"#mailModProfilo\").val(utente.mail);\n $(\"#gestFotoModProfilo\").val(\"attuale\");\n $('#gestFotoModProfilo').selectpicker('refresh');\n $(\"#telModProfilo\").val(utente.telefono);\n $(\"#usernameModProfilo\").val(utente.user);\n $(\"#btnModProfilo\").on(\"click\", gestModifica);\n}", "function editData(number) {\n var data = tableDataDB.filter((data) => data.number == number);\n var newName = prompt(\"masukkan nama\", data.first_name);\n var newAddress = prompt(\"masukkan alamat\", data.address);\n var newGender = prompt(\"masukan gender\", data.gender);\n var newHobby = prompt(\"masukkan hobi\", data.hobby);\n var newReligion = prompt(\"masukkan agama\", data.religion);\n tableDataDB = tableDataDB.map((data) => {\n if (data.number == number) {\n return {\n first_name: newName || data.name,\n address: newAddress || data.address,\n gender: newGender || data.gender,\n hobby: newHobby || data.hobby,\n religion: newReligion || data.religion,\n number: number,\n };\n }\n return data;\n });\n refreshTableData(tableDataDB);\n}", "function UpdatedUsuario(Id){\n /* Realiza conexión con el servidor */\n var vId = Id;\n var vurl = \"\";\n var vurl = \"../../datos/controller/contactosController.php\";\n if(vId != 0){\n $.ajax({\n data: {\"accion\":\"single\", \"pId\":vId},\n type: \"POST\",\n datatype: \"json\",\n url: vurl,\n })\n .done(function(data){\n if (data.success) {\n $('#modal-UpdatedUser').modal({keyboard: false});\n $(\"#txtStatusup option[value=\"+ data.Status +\"]\").attr(\"selected\",true);\n $('#txtDocup').val(data.Cedula);\n $('#txtNameup').val(data.Nombre_completo);\n $('#txtDirup').val(data.Direccion);\n $('#txtTelup').val(data.Celular);\n $('#txtEmlup').val(data.Email);\n $('#txtProgramaup').val(data.Programa);\n $('#txtComentup').val(data.Mensaje);\n $('#txtOrigenup').val(data.Origen_Campana);\n $('#txtIdup').val(vId);\n }\n })\n .fail(function(){\n alert(\"Ha ocurrido un problema\");\n });\n }\n }", "function fntEditUsuario(idpersona){\n\t// let btnEditUsuario = document.querySelectorAll('.btnEditUsuario');\n\t// btnEditUsuario.forEach(function(btnEditUsuario){\n\t// \tbtnEditUsuario.addEventListener('click', function(){\n\n\t\t\tdocument.querySelector('#titleModal').innerHTML = \"Actualizar Usuario\";\n\t\t\tdocument.querySelector('.modal-header').classList.replace('headerRegister', 'headerUpdate');\n\t\t\tdocument.querySelector('#btnActionForm').classList.replace('btn-primary', 'btn-info');\n\t\t\tdocument.querySelector('#btnText').innerHTML = \"Actualizar\";\n\n\t\t\t// let idpersona = this.getAttribute('us');\n\t\t\tvar idpersona = idpersona;\n\t\t\tlet request = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');\n\t\t\tlet ajaxUrl = base_url+'/Usuarios/getUsuario/'+idpersona;\n\t\t\trequest.open(\"GET\", ajaxUrl, true);\n\t\t\trequest.send();\n\t\t\trequest.onreadystatechange = function(){\n\n\t\t\t\tif (request.readyState == 4 && request.status == 200) {\n\t\t\t\t\tlet objData = JSON.parse(request.responseText);\n\n\t\t\t\t\tif (objData.status) {\n\t\t\t\t\t\tdocument.querySelector('#idUsuario').value = objData.data.idpersona;\n\t\t\t\t\t\tdocument.querySelector('#txtIdentificacion').value = objData.data.identificacion;\n\t\t\t\t\t\tdocument.querySelector('#txtNombre').value = objData.data.nombres;\n\t\t\t\t\t\tdocument.querySelector('#txtApellido').value = objData.data.apellidos;\n\t\t\t\t\t\tdocument.querySelector('#txtTelefono').value = objData.data.telefono;\n\t\t\t\t\t\tdocument.querySelector('#txtEmail').value = objData.data.email_user;\n\t\t\t\t\t\tdocument.querySelector('#listRolid').value = objData.data.idrol;\n\t\t\t\t\t\t$('#listRolid').selectpicker('render');\n\n\t\t\t\t\t\tif (objData.data.status == 1) {\n\t\t\t\t\t\t\tdocument.querySelector('#listStatus').value = 1;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdocument.querySelector('#listStatus').value = 2;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$('#listStatus').selectpicker('render');\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$('#modalFormUsuario').modal('show');\n\t\t\t}\n\n\n\t\t// });\n\t// });\n}", "function cargarEditInv(){\n\t// le asigno a la variable el nombre donde se guardan los invoices\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"invoices\";\n\t// parseo la variable para obtener los arreglos\n\tvar listChamba =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = listChamba[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = listChamba[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = listChamba[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = listChamba[i][j+3];\n\t\t\t\t//a la variable da5 le asigno el valor de la posicion 4\n\t\t\t\tda5 = listChamba[i][j+4];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"cliente\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"description\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"fecha\").value = da4;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"monto\").value = da5;\n\t\t\t}\n\t\t};\n\t};\n\t\n}", "function UpdateUsuario(req, res){\n if (req.usuario.rol === 1 || req.usuario.nombre === req.body.nombre) {\n const idUsuario = req.params.idUsuario;\n const usuario = {\n nombre: req.body.nombre,\n edad: req.body.edad,\n email: req.body.email,\n pass: sha512(req.body.pass),\n rol: req.body.rol || 2\n };\n conn('Usuario').where('idUsuario', idUsuario).update(usuario).then(result => {\n if (result != 0) {\n res.status(200).send({\n succes: true,\n resp: \"Usuario actualizado correctamente\",\n data: result\n });\n }\n else{\n res.status(500).send({\n succes: false,\n resp: \"No se actualizó ningun usuario\"\n });\n }\n }).catch(error => {\n res.status(500).send({\n succes: false,\n resp: \"Error al actualizar el usuario\",\n error: `${error}`,\n user: user,\n params: req.body\n });\n });\n } else {\n res.status(500).send({\n succes: false,\n resp: \"No tiene permisos para actualizar el usaurio\"\n });\n }\n}", "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"Email:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"Yeni \\u015fifre:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"Tekrar yeni \\u015fifre:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"Eski \\u015fifre: :\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Yeni avatar:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"max. boyut :\");\r\n\t\r\n allElements = document.getElementsByTagName('TD');\r\n tmp = allElements[19]\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Citizen/,\"Vatanda\\u015f\");\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"Profil d\\u00fczenle\"]});\r\n}", "function editTableModificarDescuento() {\n var nameTable = \"ModificarDescuento\";\n var nameCols = crearListaColumnas();\n var activaAdd = true;\n var activaDelete = true;\n\n return buildTableTools(nameTable, nameCols, activaAdd, activaDelete);\n}", "async function updateCampeoes(dados){\n const conn = await connect();\n const sql = 'UPDATE Campeoes SET nomeCampeao =? WHERE id_jog=? AND idcampeao=?';\n const values = [dados.nomeCampeao,dados.idjog,dados.idcampeao]\n return await conn.query(sql, values);\n}", "function editarLote(valor) {\n localStorage.setItem(\"cod_lote\", jsonFinal[valor].cod_lote);\n localStorage.setItem(\"cnpj\", jsonFinal[valor].cnpj);\n localStorage.setItem(\"contrato\", jsonFinal[valor].contrato);\n localStorage.setItem(\"dt_inicio_vig\", jsonFinal[valor].dt_inicio_vig);\n localStorage.setItem(\"dt_final_vig\", jsonFinal[valor].dt_final_vig);\n localStorage.setItem(\"dt_reajuste\", jsonFinal[valor].dt_reajuste);\n window.location.href = \"./gerenciaLote.html\";\n}", "function leerTexto(e){\n // console.log(e.target.value);\n datos[e.target.id] = e.target.value;\n}", "function limpiarOrden(){\r\n document.getElementById(\"codigoOrden\").value = \"\";\r\n document.getElementById(\"FechaPedido\").value = \"\";\r\n document.getElementById(\"FechaEntrega\").value = \"\";\r\n document.getElementById(\"DescripcionOrden\").value = \"\";\r\n}", "function accion() {\n var datos = new Array();\n // document.getElementById(\"oculto\").removeAttribute(\"hidden\")\n\t\n\tlet peticion=new XMLHttpRequest();\n peticion.onreadystatechange=function(){\n if(this.readyState==4){\n\t\t\tdatos=JSON.parse(this.responseText);\n\t\t\tdocument.getElementById(\"id_tipo\").value=datos[\"id_tipo\"];\n\t\t\tdocument.getElementById('nombre').value=datos[\"nombre\"];\n\t\t\tdocument.getElementById(\"nuevo\").innerText=\"Modificando una tipo de la tabla\"\n\t\n \n }};\n peticion.open('GET', url_server+'obtenerRegistro/'+this.value);\n\tpeticion.send();\n\tbtn= document.getElementById('guardarTipo')\n btn.removeAttribute(\"value\")\n\tbtn.setAttribute(\"value\", \"Modificar\")\n \n}", "function editar_direccion(cod_dir){\n\n\tvar sector=document.getElementById('cod_sector').value;\n\tvar cod_dir_usu=cod_dir;\n\t\n if($(\"#nom_dir_usu\").val()=='' || $(\"#dir_dir_usu\").val()=='' || sector==''){\n\t\tSwal.fire(\"Error!\", \"Tienes Campos Vacios\", \"warning\");\n\n\t\t\treturn false;\n }else{\n\t\n\t\t\t\tvar dataString = 'nom_dir_usu='+$(\"#nom_dir_usu\").val()+'&&dir_dir_usu='+$(\"#dir_dir_usu\").val()+'&&sector='+sector+'&&cod_dir_usu='+cod_dir_usu+'&&accion=modificar_direccion';\n\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\turl:\"../../backend/controlador/usuario/usuario.php\",\n\t\t\t\t\t\tdata:dataString,\n\t\t\t\t\t\tsuccess:function(r){\n\t\t\n\t\t\t \t\t\tSwal.fire({\n\t\t\t\t\t\t\t\t\t position: 'top-end',\n\t\t\t\t\t\t\t\t\t icon: 'success',\n\t\t\t\t\t\t\t\t\t title: 'Dirección Actualizada',\n\t\t\t\t\t\t\t\t\t showConfirmButton: false,\n\t\t\t\t\t\t\t\t\t timer: 1500\n\t\t\t\t\t\t\t});\n\t\t \t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\n\n}", "function abreModalEditarOferta(row, data) {\n $(row).children('td').eq(0).click(function(event) {\n $('#editar-nome').val(data.descricao);\n $('#editar-status').val(data.status);\n $('#editar-data-inicio').val(data.dataInicio);\n $('#editar-data-fim').val(data.dataFim);\n $('#editar-data-inicio').val(data.dataInicio);\n $('#editar-produto').val(data.produto.descricao);\n $('#editar-valor').val(data.preco);\n $('#modal-editar-oferta').modal('show');\n salvar($('#editar-oferta'), data.ofertaId);\n });\n}", "static modifyC(req, res) {\n const { titulo,grupo } = req.body\n return Cuadernos\n .findByPk(req.params.id)\n .then((data) => {\n data.update({ \n titulo: titulo || data.titulo,\n grupo: grupo || data.grupo\n })\n .then(update => {\n res.status(200).send({\n success: true,\n message: 'Cuaderno actualizado',\n data: { \n titulo: titulo || update.titulo,\n grupo: grupo || update.grupo\n }\n })\n })\n .catch(error => res.status(400).send({\n success: false,\n message: 'Actualizacion Fallida',\n error}));\n })\n .catch(error => res.status(400).send(error));\n }", "async function editName() {\n try {\n // get Userinfo to fill out the missing variables in put requests\n const current = await api.get(`/users/${sessionStorage.getItem('id')}`);\n\n const requestBody = JSON.stringify({\n name: name,\n username: current.data.username,\n matrikelNr: current.data.matrikelNr\n });\n\n // Edit is sent to backend\n await api.put(`/users/${sessionStorage.getItem('id')}`, requestBody);\n\n } catch (error) {\n alert(`Something went wrong while editing the user: \\n${handleError(error)}`);\n }\n }", "function edit_rowAnswer_table(no)\n{\n\t// Cambia el style para que se haga dinámico la muestra de botones \n document.getElementById(\"answer_edit_button\"+no).style.display=\"none\";\n document.getElementById(\"answer_save_button\"+no).style.display=\"inline\";\n // Se obtienen los elementos de la respuesta al hacerle click editar \n var Answer=document.getElementById(\"Answer_row_Answer\"+no);\n var Irony=document.getElementById(\"Answer_row_Irony\"+no);\n var Formal=document.getElementById(\"Answer_row_Formal\"+no);\n var Humor=document.getElementById(\"Answer_row_Humor\"+no);\n // se cambian los campos el interior de los campos <td> creando un elemento input\n var Answer_data=Answer.innerHTML;\n Answer.innerHTML=\"<input type='text' class='form-control' placeholder='Editar respuesta' id='Answer_text\"+no+\"' value='\"+Answer_data+\"'>\";\n var Irony_data=Irony.innerHTML;\n Irony.innerHTML=\"<input type='text' class='form-control' placeholder='Editar ironía' id='Irony_text\"+no+\"' value='\"+Irony_data+\"'>\";\n var Formal_data=Formal.innerHTML;\n Formal.innerHTML=\"<input type='text' class='form-control' placeholder='Editar formalidad' id='Formal_text\"+no+\"' value='\"+Formal_data+\"'>\";\n var Humor_data=Humor.innerHTML;\n Humor.innerHTML=\"<input type='text' class='form-control' placeholder='Editar Humor' id='Humor_text\"+no+\"' value='\"+Humor_data+\"'>\";\n}", "function obtenerActividad(seleccionado){\n var table = $('#lista-actividad').DataTable();\n var celda = $(seleccionado).parent();\n var rowData = table.row(celda).data();\n var id = rowData['id'];\n var nombre = rowData['nombre_actividad'];\n var direccion = rowData['direccion'];\n var telefono = rowData['telefono'];\n var email = rowData['email'];\n var celular = rowData['celular'];\n var ciudad = rowData['ciudad'];\n\n\n $('#id-actividad').val(id);\n $('#nombre-actividad').val(nombre);\n $('#direccion-actividad').val(direccion);\n $('#telefono-actividad').val(telefono);\n $('#email-actividad').val(email);\n $('#celular-actividad').val(celular);\n $('#ciudad-actividad').val(ciudad);\n}", "function editardireccion(req,res){\n\n\tlet direccionid = req.params.id_direccion;\n\tlet direccion = new Address(\n\t\treq.body.id_colonia,\n\t\treq.body.id_alcaldia,\n\t\treq.body.id_estado,\n\t\treq.body.calle,\n\t\treq.body.numero_int,\n\t\treq.body.numero_ext,\n\t\treq.body.codigo_postal,\n\t\treq.body.alcaldia,\n\t\treq.body.estado,\n\t\treq.body.colonia\n\t\t);\n\n\tCONN('direccion_empresa').where('id_direccion',direccionid).update(direccion).then(editardireccion =>{\n\t\tconsole.log(editardireccion);\n\t\tif(!editardireccion){\n\t\t\tres.status(500).send({resp: 'Error',error:'los datos no se actualizaron'});\n\t\t}else{\n\t\t\tCONN('direccion_empresa').where('id_direccion',direccionid).select().then(direccion =>{\n\t\t\t\tif (!direccion){\n\t\t\t\t\tres.status(500).send({resp: 'Error', error:'error en la consulta'});\n\t\t\t\t}else{\n\t\t\t\t\tres.status(200).send({resp:'Actualizacion de datos correcta',direccion: direccion});\n\n\t\t\t\t}\n\t\t\t}).catch(error =>{\n\t\t\t\tres.status(500).send({resp: 'error',\n\t\t\t\terror: `${error}`});\n\t\t\t});\n\t\t}\n\t})\n}", "function abrirModalAlterar(dados) {\n $(\"#modalAlterar\").modal()\n\n const id = document.getElementById(\"alterarId\")\n const nome = document.getElementById(\"alterarNome\")\n const valor = document.getElementById(\"alterarValor\")\n\n id.innerText = dados.id\n nome.value = dados.nome\n valor.value = dados.valor\n\n\n adicionalSelecionadaAlterar = dados\n}", "async function editUsername() {\n try {\n // get Userinfo to fill out the missing variables in put requests\n const current = await api.get(`/users/${sessionStorage.getItem('id')}`);\n\n const requestBody = JSON.stringify({\n name: current.data.name,\n username: username,\n matrikelNr: current.data.matrikelNr\n });\n\n // Edit is sent to backend\n await api.put(`/users/${sessionStorage.getItem('id')}`, requestBody);\n\n } catch (error) {\n alert(`Something went wrong while editing the user: \\n${handleError(error)}`);\n }\n }" ]
[ "0.71161467", "0.6595686", "0.6566247", "0.6560221", "0.6471203", "0.64489746", "0.64330935", "0.64026713", "0.63998234", "0.63783574", "0.6361469", "0.6346078", "0.630046", "0.6284485", "0.62642616", "0.62503034", "0.62378746", "0.6194338", "0.61874884", "0.61743945", "0.61535823", "0.6143363", "0.6143232", "0.61307174", "0.6107844", "0.6107409", "0.60939455", "0.60821956", "0.60756296", "0.6063434", "0.6042635", "0.60408735", "0.6035151", "0.6029855", "0.60236794", "0.6020314", "0.6001698", "0.6001364", "0.5996884", "0.59861356", "0.59839755", "0.5980788", "0.5979886", "0.59542286", "0.5946283", "0.5944347", "0.5927551", "0.59237295", "0.592253", "0.5917227", "0.5870624", "0.5869466", "0.5858856", "0.5858194", "0.5857129", "0.584621", "0.58448327", "0.5842717", "0.5841731", "0.58404183", "0.58217275", "0.58198565", "0.58179", "0.58098197", "0.5795547", "0.5783745", "0.5773155", "0.5772787", "0.57690865", "0.5760115", "0.57568043", "0.57499117", "0.5746822", "0.574548", "0.5744243", "0.57251894", "0.57250154", "0.57238686", "0.57200056", "0.5719834", "0.5717024", "0.57148665", "0.57130486", "0.57086015", "0.5705439", "0.57004684", "0.5698345", "0.56880265", "0.56829005", "0.5681609", "0.56790406", "0.56769305", "0.5671001", "0.56703615", "0.56591725", "0.56559736", "0.56544584", "0.56481874", "0.56448656", "0.5643882", "0.56422913" ]
0.0
-1
SUBIR IMAGEN PARA EL USUARIO.
function uploadImage(req,res){ var userId = req.params.id; if(req.files){ var file_path = req.files.image.path; var file_split = file_path.split('\\'); var file_name = file_split[2]; var ext_split = file_name.split('\.'); var file_ext = ext_split[1]; if(userId != req.user.sub){ return removeFilesOfUploads(res,file_path,'No tienes permiso para actualizar los datos del usuario.'); } if(file_ext == 'jpg' || file_ext == 'png' || file_ext == 'jpeg' || file_ext == 'gif'){ //SUBIR/ACTUALIZAR IMAGEN. User.findByIdAndUpdate(userId,{image: file_name},{new:true},(err,userUpdated)=>{ if(err) return res.status(500).send({message: 'Error en la peticion.'}); if(!userUpdated) return res.status(404).send({message: 'No se ha podido actualizar el usuario'}); return res.status(200).send({user: userUpdated}); }); } else{ return removeFilesOfUploads(res,file_path,'Extension invalida.'); } } else{ return res.status(200).send({message: 'No se ha cargado correctamente la imagen.'}) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acceder(usuario){\n console.log(`2. ${usuario} Ahora puedes acceder`)\n entrar();\n}", "function iniciar() {\n cuerpoTablaUsuario = document.getElementById('cuerpoTablaUsuario'); \n divRespuesta = document.getElementById('divRespuesta');\n var botonAlta = document.getElementById('botonAlta');\n botonAlta.addEventListener('click', altaUsuario); \n}", "function arrancaServidor(requiere, respuesta) {\n console.log(\"Alguien se ah conectado\");\n respuesta.writeHead(200,{\"Content-Type\":\"text/html\"}); // le digo que le enviare informacion de tipo html al servidor\n respuesta.write(\"<h1>El servidor funciona correctamente en el puerto 8888</h1>\");\n respuesta.end();\n}", "function logear(){\n let correo = document.getElementById('correo').value;\n let usuario = $('#login_form #usuario').val();\n socket.emit('datos_usuario', { correo: correo, usuario: usuario } );\n yo = usuario;\n // id_user = socket.id;\n document.getElementById('usuarioLogeado').innerText = yo;\n}", "function iniciar() {\n \n }", "function selUsuario(datosUsuario){\n datos = datosUsuario.split(\"-\");\n idPersona = datos[0];\n loginUsuario = datos[1];\n idSistema=$('idSistema').value;//idSistema de la ventana de buscador de personas\n var url = '../../ccontrol/control/control.php';\n var data = 'p1=listaDetallePermiso&p2=' + idSistema + '&p3=' + idPersona;\n new Ajax.Request (url,\n {method : 'get',\n parameters : data,\n onLoading : function(transport){est_cargador(1);},\n onComplete : function(transport){est_cargador(0);\n Windows.close(\"Div_buscador3\");\n $('contenido_detalle').innerHTML=transport.responseText;\n $('login_usuario').value=loginUsuario;\n $('idpersona').value=idPersona;\n $('nombre_formulario_permiso').value='';\n $('nombre_formulario_permiso').focus();\n }\n }\n )\n}", "function contrata(){\n url = '..\\\\negocio\\\\registrar-contrato.php';\n adjunto = {'id_usuario': id_usuario,\n 'tipo_usuario': tipo_usuario,\n 'nombre_servicio': document.getElementById('salida_nombre').innerHTML};\n $.post(url, adjunto)\n .done(function(respuesta){\n if(respuesta > 0){//debe ser el id del contrato----------------OJO!!\n alert('ENHORABUENA! ya has contratado el servicio.');\n }else {\n alert('LO SENTIMOS NO has podido contratar el servicio.');\n }\n desactivar_contratar(respuesta);\n mostrar_contratos_en_vigor();//OJO esta debe ser la última sentencia\n });\n}", "function inviaMessaggioUtente(){\n var text_user=($('.send').val());\n if (text_user) { //la dicitura cosi senza condizione, stà a dire text_user=0\n templateMsg = $(\".template-message .new-message\").clone()\n templateMsg.find(\".text-message\").text(text_user);\n templateMsg.find(\".time-message\").text(ora);\n templateMsg.addClass(\"sendbyUser\");\n $(\".conversation\").append(templateMsg);\n $(\".send\").val(\"\");\n setTimeout(stampaMessaggioCpu, 2000);\n\n var pixelScroll=$('.containChat')[0].scrollHeight;\n $(\".containChat\").scrollTop(pixelScroll);\n }\n }", "function registrar_pantalla(conexion)\n{\n\tconexion.send(json_msj({type:'screen_conect'}));\n}", "function iniciar() {\n function arrancaServidor(requiere, respuesta) {\n console.log(\"Alguien de ha conectado al servidor\");\n respuesta.writeHead(200, { \"Content-TYpe\": \"text/html\" });\n respuesta.write(\"<h1>El servidor funciona correctamente</h1>\");\n respuesta.end();\n\n }\n /**La creacion del servidor tambien desde estar dentro de la funcion */\n servidor.createServer(arrancaServidor).listen(8080);\n}", "function usuario(variable){\n alert(prompt(\"cual es su nombre?\") + \" \" + \"si decea cambia de usuario solo desinstale su app y vuelva a registrarla, por el momento no tenemos la opcion de \\\"volver a registrarse\\\"\");\n }", "function iniciar() {\n\tcrearEscena();\n\tcrearCamara();\n\tcrearLuces();\n\tcrearMundo();\n\tcrearCohete();\n\n\tmensaje = document.getElementById('mensaje');\t\n\tciclo();\n}", "function comprobar_sesion() {\n console.log(\"Comprobar login\");\n $.ajax({\n url: \"php/peticiones/comprobar_sesion.php\",\n type: \"POST\",\n dataType: \"json\",\n success: function(data) {\n if (data.Res == \"OK\") {\n NombreUsuario = data.Nombre;\n }\n },\n error: function(err) {\n console.log(\"Error sucedido en la peticion ajax, Funcion que falla comprobar_sesion()\");\n errorServ(err, \"sesion.js: comprobar_sesion()\");\n }\n });\n}", "function connexionPanierControl(){\n\tconsole.log('tata');\n\tcliendGood();\n\tmdpControl();\n\temailControl();\n}", "function bajaUsuarioSeleccionado(usuario, nFila) { \n \n //Activamos el spinner. Obtenemos de la tabla -> la fila -> la columna 2 y accedemos al boton\n $('#tablaUsuarios tr:nth-child('+nFila+') td:eq(2) button').toggleClass('active');\n\n //Creamos un objeto para almacenar los valores\n var operacion = new FormData();\n operacion.append('operacion', 'bajaUsuario');\n operacion.append(\"usuario\", usuario);\n\n //Creamos la solicitud AJAX\n //Especificamos la action a ejecutar\n var url = \"OperacionesUsuario\";\n var solicitud = new XMLHttpRequest();\n solicitud.addEventListener('load', mostrar);\n solicitud.open(\"POST\", url, true);\n solicitud.send(operacion); \n}", "function escreveConteudo(){}", "async function auth() {\r\nclient.logger.level = 'warn'\r\nconsole.log(banner.string)\r\nclient.on('qr', qr => {\r\n console.log(color(time,\"white\"),color('[','white'),color('∆','red'),color(']','white'),color('Subscribete','white'),color('YOU','red'),color('TUBE','white'),color('Confu_Mods','yellow'))\r\n})\r\n\r\nfs.existsSync('./session.json') && client.loadAuthInfo('./session.json')\r\nclient.on('connecting', () => {\r\n\tconsole.log(color(time,\"white\"),color(\"[ESTADO]\",\"green\"), \"Conectando xd...\")\r\n})\r\nclient.on('open', () => {\r\n\tconsole.log(color(time,\"white\"),color(\"[ESTADO]\", \"green\"), \"Conectado :3\")\r\n})\r\nawait client.connect({timeoutMs: 30*1000})\r\nfs.writeFileSync('./session.json', JSON.stringify(client.base64EncodedAuthInfo(), null, '\\t'))\r\n}", "function cambiarDatosDeUsuarioEnElSitio(){\n\tvar mail=document.getElementById(\"formUserEmail\").value;\n\tvar firstName=document.getElementById(\"formUserFirstName\").value;\n\tvar lastName=document.getElementById(\"formUserLastName\").value;\n\tvar nickname=document.getElementById(\"formUserNick\").value;\n\tif(mail.length < 1 || firstName.length < 1 || lastName.length < 1 || nickname.length < 1 ){\n\t\t\tvar camposVacios=\"\";\n\t\t\tif(mail.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Correo electrónico</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (firstName.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Nombre</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (lastName.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Apellido</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (nickname.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Apodo</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\t// Termina el tipo de mensaje\n\t\t\tavisoEmergenteJugaPlay(\"<span class='trn'>Campos vacíos</span>\",camposVacios);\n\treturn false ;\n\t}// Si paso es que los campos estan bien\n\tvar json=JSON.stringify({ \"user\": { \"first_name\": firstName,\"last_name\": lastName, \"email\": mail, \"nickname\":nickname } });\n\tif(startLoadingAnimation()==true){\n\tmensajeAlServidorConContenidoRegistro(json);}\n}", "iniciarSesion() {\n this.presentLoadingA();\n this.Servicios.userState().subscribe((user) => {\n this.Servicios.iniciarsesion(this.account.email, this.account.password).then(res => {\n this.cargandoA.dismiss();\n this.Servicios.getUsuario(user.uid).subscribe(res => {\n const UsuarioA = res.payload.val();\n console.log(UsuarioA);\n if (UsuarioA !== undefined) {\n this.account.email = \"\";\n this.account.password = \"\";\n console.log(UsuarioA.admin);\n if (UsuarioA.admin == true) {\n this.navCtrl.navigateRoot('/admin');\n }\n else {\n this.navCtrl.navigateRoot('/mainmenu');\n }\n }\n else {\n console.log(\"Error al iniciar\");\n }\n });\n this.storage.set('log', 'si');\n }).catch(err => {\n this.cargandoA.dismiss();\n console.log(\"Error al iniciar\");\n });\n });\n }", "function correo() {\n\tgetSubscribedUsers( function(obj) {\n\t\tvar users = obj;\n\t\tusers.forEach(function(user){\n\t\t\t// setup email data with unicode symbols\n\t\t\tvar mail = user.email;\n\t\t\tvar name = user.user_name;\n\t\t\tvar hmks = importanceOrderHmks(user.hmk, 7);\n\t\t\tvar subj = name+', tienes '+hmks.length+' tareas para esta semana!';\n\t\t\tconst list = hmks.map(hmk => \"<li>\"+hmk.name+\" (importancia: \"+hmk.importance+\")</li>\");\n\t\t\tconst hmklist = '<ol>' + list.join('') + '</ol>';\n\t\t\tvar msg = \"<h1>Hola \"+name+\"!</h1><h2>Tienes \"+hmks.length+\" tareas para esta semana.</h2> \\\n\t\t\t<p> A continuación te presentamos el orden en el cual te sugerimos hacerlas:</p>\"+hmklist;\n\t\t\tsendMail(mail, subj, msg);\n\t\t});\n\t});\n}", "function ricaricaContiPerCausale(){\n var selectCausaleEP = $(\"#uidCausaleEP\");\n $.postJSON(baseUrl + \"_ottieniListaConti.do\", {\"causaleEP.uid\": selectCausaleEP.val()})\n .then(function(data) {\n if(impostaDatiNegliAlert(data.errori, alertErrori)) {\n return;\n }\n aggiornaDatiScritture (data);\n });\n }", "function usuario(){\n\tvar nombreDelUsuario = document.getElementById(\"user\");\n\tasignarNombre(nombreDelUsuario);\n}", "function mostrarInicio(usuario,permiso) {\n\tconsole.log('Mostramos Inicio');\n\n\tlet url = \"http://localhost:3000/usuario\";\n\n\tlet promise = llamadaAjax(\"GET\",url);\n\n\tpromise.then((data) => {\n\t\tconsole.log('Obteniendo datos.');\n\n\t\tconsole.log(data);\n\t\t//let json_temp={\"User Data\":JSON.parse(data)};\n\t\t//printUsuarios(json_temp,\"#logged\");\n\n\t\tif(permiso===\"Admin\"){\n\t\t\tprintUsuarios({\"usuarios\":JSON.parse(data)},\"#usuarios\");\n\t\t}\n\n\t\tgenerarCola(usuario,permiso);\n\n\t}, (error) => {\n\t\tconsole.log('Promesa rechazada.');\n\t\tconsole.log(error.message);\n\t\tdocument.querySelector(\"#salida\").textContent = \"Se ha producido un error\";\n\t});\n\n}", "function obtieneLogueo(){\n $.ajax({\n url: \"vista/user/registro_user/traeFormLogin.html\",\n method: \"POST\",\n success: function (data) {\n $(\"#ventanaModal\").html(data)\n }\n })\n }", "function SeleccionarUsuario($scope, ServiciosUsuarios) {\n $scope.usuarios = ServiciosUsuarios.usuarios;\n\n $scope.guardar_usuario = function(user) {\n ServiciosUsuarios.SeleccionarUsuario(user);\n ServiciosUbicacion.Geolocalizar();\n };\n \n //SERVICIOS INICIO\n $scope.$on('UsuarioElegido', function() {\n $scope.usuario = ServiciosUsuarios.usuario;\n }); \n //SERVICIOS FIN \n }", "function seleccionarUnidad(){\r\n\t\t\tdocument.formularioRegistro.action = 'SeleccionarUnidadNegocio.action';\r\n\t\t\tdocument.formularioRegistro.submit();\r\n\t\t}", "function seleccionarUnidad(){\r\n\t\t\tdocument.formularioRegistro.action = 'SeleccionarUnidadNegocio.action';\r\n\t\t\tdocument.formularioRegistro.submit();\r\n\t\t}", "function mostrarBienvenidaUsuario() {\n $(\"#pHome\").html(`Hola, ${usuarioLogueado.nombre}!`);\n}", "function enviarSolicitud(datos){\n socket.emit(\"nuevaSolicitud\", datos, function(data){\n if(data['estado']){\n idSolicitud = data['idSolicitud'];\n buscarFleteros();//Buscamos choferes de la bd\n }else{\n alert(\"Lo sentimos, nuestro sistema no esta disponible.\")\n } \n });\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n client.subscribe(\"[email protected]/IoT\");\r\n enviarInfo(\"00:00/00:00/0/0/0/0\")\r\n \r\n}", "procesarControles(){\n\n }", "function iniciar(){\r\n\tlocalStorage.clear();\r\n\tvar boton= document.getElementById('btnenviar');\r\n\tif(boton.addEventListener){\r\n\t\tboton.addEventListener(\"click\",function(){\r\n\t\t\tvar nuevousuario= new User(document.frmregistro.nombres.value, document.frmregistro.apellidos.value, document.frmregistro.correo.value, document.frmregistro.contra.value, document.frmregistro.confirm_contra.value, document.frmregistro.departamento.value, document.frmregistro.municipio.value, document.frmregistro.colonia.value, document.frmregistro.calle_pasaje.value, document.frmregistro.num_casa.value, document.frmregistro.pregunta.value, document.frmregistro.DUI.value, document.frmregistro.NIT.value, document.frmregistro.num_cel.value, document.frmregistro.fecha.value);\r\n\t\t\tnuevousuario.comprobar();\r\n\t\t},false);\r\n\t}\r\n}", "function iniciarSesion(dataUsuario) {\n usuarioLogueado = new Usuario(dataUsuario.data._id, dataUsuario.data.nombre, dataUsuario.data.apellido, dataUsuario.data.email, dataUsuario.data.direccion, null);\n tokenGuardado = dataUsuario.data.token;\n localStorage.setItem(\"AppUsuarioToken\", tokenGuardado);\n navegar('home', true, dataUsuario);\n}", "function mostrarUsuario(idsuscriptor){\n $(\"#idsuscriptor_usuario\").val(idsuscriptor);\n\n $.post(\"views/ajax/admin_panel.php?op=mostrarAdmin\", {\n idsuscriptor: idsuscriptor\n }, function(data, status) {\n data = JSON.parse(data);\n\n mostrarformUsuario(true);\n //Como estan definidos los campos en la base de datos\n $(\"#idusuario_suscriptor\").val(data.idusuario_suscriptor);\n $(\"#nombre_completo\").val(data.nombre_completo);\n $(\"#email\").val(data.email);\n\n });\n\n\n}", "function verificaSubOK(idRuna){\n\tif(idRuna != null){\n\t\tsendDataComm(idRuna);\n\t}\n\telse openFBbox(context_ssi+\"boxes/community/login/verifica_ok_nomail.shtml\");\n\n\tsetInterval(function(){\n\t\t//\tcerca il cookie per capire quando e' completata la richiesta di updateUserData lato TamTamy\n\t\t// dal momento che non e' possibile intercettarne la callback visto che e' un 302\n\t\tif (checkCookieCor(\"rcsUpdateProfileTamTamy\") && checkCookieCor(\"communityLoginPersistence\")){\n\t\t\tdeleteCookie(\"rcsUpdateProfileTamTamy\",\"/\",\".corriere.it\");\n\t\t\tdeleteCookie(\"rcsLogin\",\"/\",\".corriere.it\");\n\t\t}\n\t},\n\t1000);\n\n\t//callOmnitureTracing('event48','COR/Registrazione/Step2','Corriere');\n\tcallOmnitureTracing('event48','COR/Registrazione/Step4 Argomenti','Corriere');\n}", "function escribiendo(){\n socket.emit(\"escribiendo\",{ escribiendo: true, id: usuarioChat.usuario.id });\n \n}", "async function buscarUsuario(email){\n \n //insere os relatorios \n var resposta = await usarApi(\"GET\", \"http://localhost:8080/usuarios/cosnultaremail/\"+email); \n var usuario = JSON.parse(resposta);\n\n var idDestinatario = usuario.idUsuario;\n now = new Date();\n\n var relatorio = {\n titulo: $(\"#idTitulo\").val(),\n destinatario: idDestinatario,\n texto: $(\"#texto-area\").val(),\n dataRelatorio: now,\n fk_usuario: idUsuario\n }\n cadastrar(relatorio);\n}", "function mostrarAsignarNivel(){ // Cuando toque el boton \"asignar nivel\" voy a ver la seccion (Asignar nivel a alumnos)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#divMostrarTablaXDocente\").innerHTML = \"\"; //limpio tabla por posible interaccion anterior\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"block\"; // muestro asignar nivel\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}", "function main () \n {\n // Definicion de variables antes de las funciones\n let oDom = {\n // Declaramos los botones\n eBotonSaludar : document.querySelector('#btnSaludar'),\n eBotonBorrar : document.querySelector('#btnBorrar'),\n // Para recoger el valor\n eInputName : document.querySelector('#inpName'),\n // Para mostrar algo en el html\n eOutSaludo : document.querySelector('#outSaludo')\n }\n\n /**\n * \n * Manejador del evento click del boton \n */\n function saludar()\n {\n // Recojo el valor introducido por el usuario\n let user = oDom.eInputName.value\n // Saco en el html, en la etiqueta output introduzco el valor que teniamos en console antes\n oDom.eOutSaludo.innerHTML = `Hola ${user}` // Podria poner un parrafo = `<p>Hola ${user}</p>`\n console.log(user)\n //console.log(`Hola ${user}`)\n }\n\n /**\n * Metodo borrar y manejador del evento del boton borrar\n */\n function borrar()\n {\n oDom.eInputName.value = ''\n oDom.eOutSaludo.innerHTML = ''\n }\n \n oDom.eBotonSaludar.addEventListener('click', saludar)\n oDom.eBotonBorrar.addEventListener('click', borrar)\n }", "function cadastrarSolicitante(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tvar notSolicitante = DWRUtil.getValue(\"comboUnidadesNaoSolicitantes\");\n\tif((notSolicitante==null ||notSolicitante=='')){\n\t\talert(\"Selecione uma unidade do TRE.\");\n\t}else{\n\t\tFacadeAjax.adicionaUnidadeSolicitante(unidade,notSolicitante);\n\t\tcarregaUnidadesSolicitantes()\t\n\t}\t\n}", "busqueda(termino, parametro) {\n // preparacion de variables //\n // ------ Uso de la funcion to lower case [a minusculas] para evitar confuciones en el proceso\n // ------/------ La busqueda distingue mayusculas de minusculas //\n termino = termino.toLowerCase();\n parametro = parametro.toLowerCase();\n // variable busqueda en la que se almacenara el dato de los usuarios que se buscara //\n var busqueda;\n // [Test] variable conteo para registar el numero de Usuarios que coinciden con la busqueda //\n var conteo = +0;\n // Se vacia el conjunto de objetos [users] para posteriormente rellenarlos con los usuarios que coincidan con la busqueda //\n this.users = [], [];\n // [forEach] = da un recorrido por los objetos de un conjunto en este caso, selecciona cada usuario del conjunto \"usuarios\" //\n this.usuarios.forEach(item => {\n // Bifurcador de Seleccion [switch] para detectar en que dato del usuario hacer la comparacion de busqueda //\n switch (parametro) {\n //------En caso de que se ingrese la opcion por defecto, es decir, no se haya tocado el menu de selecicon\n case 'null':\n {\n // Se hace un llamado a la funcion \"getUsers\" que carga los usuarios almacenados en el servidor //\n this.getUsers();\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Nombre\n case 'nombre':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion apellido\n case 'apellido':\n {\n console.log('entro en apellido...');\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.apellido.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion apellido: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cedula\n case 'cedula':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cedula.replace('-', '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion cedula: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cuenta\n case 'cuenta':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Buscar en Todo\n case 'todo':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase() + item.apellido.replace(/ /g, '').toLowerCase() + item.cedula.replace('-', '').toLowerCase() + item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n }\n // if (parametro == 'null') {\n // console.log('dentro de null');\n // this.getUsers();\n // this.test = 'Ingrese un Campo de busqueda!!..';\n // }\n // if (parametro == 'nombre') {\n // // preparacion de variables:\n // busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // if (busqueda.indexOf(termino, 0) >= 0) {\n // this.users.push(item);\n // conteo = conteo +1;\n // console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n // }\n // }\n // if (parametro == 'apellido') {\n // console.log('dentro de apellido');\n // }\n // if (parametro == 'cedula') {\n // console.log('dentro de cedula');\n // }\n // if (parametro == 'cuenta') {\n // console.log('dentro de cuenta');\n // }\n // if (parametro == 'todo') {\n // console.log('dentro de todo');\n // }\n });\n if (this.users.length >= 1) {\n console.log('existe algo.... Numero de Registros: ' + conteo);\n return;\n }\n else if (this.users.length <= 0) {\n this.getUsers();\n }\n }", "function rankeaUsuario(colectionItemName,numItem,resultado,usuarioRankea,usuarioRankeado) {\n\tajax = new XMLHttpRequest();\n\tstyleStarts(colectionItemName,numItem,resultado);\n\t\n\tvar estrellas = id(resultado).value;\n\tvar variables = \"&estrellas=\" + estrellas;\n\tvariables += \"&usuarioRankea=\" + usuarioRankea;\n\tvariables += \"&usuarioRankeado=\" + usuarioRankeado;\n\tvariables += \"&esAjax=\" + true;\n\t\n\tajax.open(\"POST\", \"BuscarInformacionFormularios?metodoDeBusqueda=7\" + variables, true);\n\tajax.send(\"\");\n}", "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, identificador, prioridad, descripcion y observaciones puede modificar, el boton crear esta activo para el\n\t\t\n\t\t}\n\t\tif(tieneRol(\"programadror\")){// modificar:estimacion de tiempo y unidad dependencia responsables, todos los botones botones \n\t\t\n\t\t}\n\t}", "function arrancaServidor(requiere, respuesta){\n\t\tvar ruta = url.parse(requiere.url).pathname; //capturar aquello que ponga en la url e introducirlo en una variable 'ruta'\n\n\t\tconsole.log(\"Hola consola, alguien se ha conectado\"); // cada vez que alguien se conecte al servidor web se verá este mensaje en la consola\n\t\t//ese mensaje aparecerá 2 veces en la consola, porque el navegador suele enviar 2 peticiones, una para el favicon y otra para la página web en sí.\n\n\t\tenrutar(ruta, manejador);\t//le paso a la funcion el path de la url donde estoy parado\n\n\t\trespuesta.writeHead(200, {\"Content-Type\":\"text/html\"});\n\t\trespuesta.write(\"<h1>El servidor funciona correctamente</h1>\"); // Se verá en el navegador\n\t\trespuesta.end();\n\t}", "function inicializaInterfaz(){\n $.ajax({\n url:'tipoUsuario.php',//SE CONULSTA EL TIPO DE USUARIO DEL USUARIO QUE INICIÓ SESIÓN\n data:{},\n method:'POST',\n dataType:'json',\n async:false,\n success:function(data){\n tipo_usuario=data;\n if(data=='Inhabilitado'){//SE DESPLIEGA CONTENIDO PARA USUARIO \"INHABILITADO\"\n $('#mensaje-superior').text(\"Su cuenta está inhabilitada\");\n $('#espere').text(\"No tiene acceso a ninguna funcionalidad del sitema\");\n $('#loading-contenedor').show();\n $('#map').css({'z-index':'-1'});\n $('.boton').not('.btn-7').remove();\n $('.btn-7').css({'margin-top':'400px'}).show();\n \n }if(data=='Operador'){//SE DESPLIEGA CONTENIDO PARA USUARIO \"OPERADOR\"\n $('.btn-2').remove();\n $('.btn-4').remove(); \n $('.btn-5').remove();\n $('.controles').css({'margin-top':'60vh'}); \n }\n }\n \n \n });\n \n \n}", "function acceder(){\r\n limpiarMensajesError()//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombreUsuario = document.querySelector(\"#txtUsuario\").value ;\r\n let clave = document.querySelector(\"#txtClave\").value;\r\n let acceso = comprobarAcceso (nombreUsuario, clave);\r\n let perfil = \"\"; //variable para capturar perfil del usuario ingresado\r\n let i = 0;\r\n while(i < usuarios.length){\r\n const element = usuarios[i].nombreUsuario.toLowerCase();\r\n if(element === nombreUsuario.toLowerCase()){\r\n perfil = usuarios[i].perfil;\r\n usuarioLoggeado = usuarios[i].nombreUsuario;\r\n }\r\n i++\r\n }\r\n //Cuando acceso es true \r\n if(acceso){\r\n if(perfil === \"alumno\"){\r\n alumnoIngreso();\r\n }else if(perfil === \"docente\"){\r\n docenteIngreso();\r\n }\r\n }\r\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenid@ \" + nombreUsuario;\n}", "function correccion(){\r\n\tir_a(ID_FORM, URL_CORRECCION);\r\n}", "function mostrarVentanaInicio(){\n\t//verificar el rol\n\tif (datosUsuario[0][\"idRol\"] == 3) {\n\t\tmostrarVentanaChef1(datosUsuario[0][\"nombre\"]);\t// Invoca la ventana de Cocina y envia nombre del empleado\n\t}\n\telse if(datosUsuario[0][\"idRol\"] == 2) {\n\t\tmostrarVentanaCajero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Cajero y envia nombre del empleado\n\t}\n\telse{\n\t\tmostrarVentanaMesero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Mesero y envia nombre del empleado\n\t}\n\n}", "function update(OID_USUARIO,USUARIO){\n\t\n\t/*INSERCION DE DATOS*/\n\t\n\t$(\"#txt_usuario\").val(USUARIO);\n\t\n\t$(\"#txt_usuario\").attr(\"USER\",OID_USUARIO);\n\t\n\t$(\"#btn_enviar_usuario\").text(\"Actualizar\")\n\t\t\n\t\n}//FINAL DE LA ACTUALIZACION DE UN REGISTRO", "function buscarClienteOnClick(){\n if ( get('formulario.accion') != 'clienteSeleccionado' ) {\n // var oid;\n // var obj = new Object();\n var whnd = mostrarModalSICC('LPBusquedaRapidaCliente','',new Object());//[1] obj);\n if(whnd!=null){\n \n //[1] }else{\n /* posicion N°\n 0 : oid del cliente\n 1 : codigo del cliente\n 2 : Nombre1 del cliente\n 3 : Nombre2 del cliente\n 4 : apellido1 del cliente\n 5 : apellido2 del cliente */\n \n var oid = whnd[0];\n var cod = whnd[1];\n //[1] var nombre1 = whnd[2];\n //[1] var nombre2 = whnd[3];\n //[1] var apellido1 = whnd[4]; \n //[1] var apellido2 = whnd[5]; \n \n // asigno los valores a las variables y campos corresp.\n set(\"frmFormulario.hOidCliente\", oid);\n set(\"frmFormulario.txtCodigoCliente\", cod);\n \n } \n }\n }", "function cargarNombreEnPantalla() {\n if (loggedIn) {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + usuarioLogeado.nombre;\n }\n}", "function saludarUsuario(nombreUsuario){\n\n console.log(\"Buenas tardes \"+nombreUsuario);\n\n}", "function iniciarJugadores(pUser) {\r\n\t\tuserId = parseInt(pUser);\r\n\t\tif(pUser == 1){\r\n\t\t\tMASTER = true;\r\n\t\t\tconnected = true;\r\n\t\t\tmessageGeneral = \"Waiting Opponents. MASTER. Online: \" + (numUsuarios) + \"/\" +maxSess;\r\n\t\t\t\r\n\t\t\tlocalPlayer = new LocalPlayer(1);\r\n\t\t\t\r\n\t\t\tfunction anim() {\r\n\t\t\t\tloop();\r\n\t\t\t\trequestAnimFrame(anim);\r\n\t\t\t}\r\n\t\t\tanim();\r\n\t\t} else {\r\n\t\t\tMASTER = false;\r\n\t\t\tconnected = true;\t\t\t\r\n\t\t\t\r\n\t\t\tlocalPlayer = new LocalPlayer(pUser);\t\r\n\t\t\tvar count = userId;\r\n\t\t\twhile(count>1){\r\n\t\t\t\tcount -= 1;\r\n\t\t\t\tplayers[count] = new Enemy(count);\t\t\t\t\r\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tfunction anim() {\r\n\t\t\t\tloop();\r\n\t\t\t\trequestAnimFrame(anim);\r\n\t\t\t}\r\n\t\t\tanim();\r\n\t\t\t\r\n\t\t\tif (pUser == maxSess) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//The last\r\n\t\t\t\tpriorWriteAction(MEN_TYPE_BEGIN + SEP + userId + SEP + MEN_ULTIMO);\t\t\t//START GAME ALL JOINED\r\n\t\t\t} else {\r\n\t\t\t\tpriorWriteAction(MEN_TYPE_BEGIN + SEP + userId + SEP + MEN_CONECTADO);\t\t//I log and I say to others\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tnumUsuarios = parseInt(pUser);\r\n\t\t\tmessageGeneral = \"Waiting Opponents. Online: \" + (numUsuarios) + \"/\" +maxSess;\t\t\t\r\n\t\t}\r\n\t}", "async function ExibeConteudo() {\r\n const response = await fetch('http://192.168.0.103/sites/apprefeicao/lista.php?tabela=conteudo_prato');\r\n const json = await response.json();\r\n\r\n setConteudo(() => json);\r\n }", "function Salir( unreg ) { \n\t\tif ( network_ok()==false ){ \n\t\t\t\tclearInfo();\n\t\t\t\tchange_to('login');\n\t\t} else {\n\t\t\t\tif (IdU !== \"\" && IdS !== \"\") { \n\t\t\t\t\t$.post( def_url + '/actions.php', { a:'exit', idu: IdU, ids: IdS }, function(respuesta) { \n\t\t\t\t\t\tif (respuesta == \"0\") { \n\t\t\t\t\t\t\tclearInfo(); \n\t\t\t\t\t\t\tpush_unregister(); \n\t\t\t\t\t\t\tchange_to('login'); \n\t\t\t\t\t\t} else { change_to('login'); } \n\t\t\t\t\t}); \n\t\t\t\t} else { change_to('login'); } \t\t\n\t\t}\n}", "function cargarNombreEnPantalla() {\n\tdocument.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function getDatos() {\n\tvar comando= {\n\t\t\tid : sessionStorage.getItem(\"idUsuario\")\n\t};\n\t\n\tvar request = new XMLHttpRequest();\t\n\trequest.open(\"post\", \"GetDatosUsuario.action\");\n\trequest.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\trequest.onreadystatechange=function() {\n\t\tif (request.readyState==4 && request.status==200) {\n\t\t\tvar respuesta=JSON.parse(request.responseText);\n\t\t\trespuesta=JSON.parse(respuesta.resultado);\n\t\t\tif (respuesta.tipo==\"error\") {\n\t\t\t\talert(\"Ocurrió un error al recuperar los datos: \" + respuesta.mensaje);\n\t\t\t} else {\n\t\t\t\tvar email=document.getElementById(\"email\")\n\t\t\t\tvar nombre=document.getElementById(\"nombre\");\n\t\t\t\tvar apellido1=document.getElementById(\"apellido1\");\n\t\t\t\tvar apellido2=document.getElementById(\"apellido2\");\n\t\t\t\tvar fechaDeAlta=document.getElementById(\"fechaDeAlta\");\n\t\t\t\tvar telefono=document.getElementById(\"telefono\");\n\t\t\t\tvar idUbicacion=document.getElementById(\"idUbicacion\");\n\t\t\t\tif (email!=null) email.value=respuesta.email;\n\t\t\t\tif (nombre!=null) nombre.value=respuesta.nombre;\n\t\t\t\tif (apellido1!=null) apellido1.value=respuesta.apellido1;\n\t\t\t\tif (apellido2!=null) apellido2.value=respuesta.apellido2;\n\t\t\t\tif (fechaDeAlta!=null) fechaDeAlta.value=respuesta.fechaDeAlta;\n\t\t\t\tif (telefono!=null) telefono.value=respuesta.telefono;\n\t\t\t\tif (idUbicacion!=null) idUbicacion.value=respuesta.idUbicacion;\n\t\t\t}\n\t\t}\n\t};\n\tvar pars=\"command=\" + JSON.stringify(comando);\n\trequest.send(pars);\n}", "async function onSaludarAwait () {\n let datos = []\n datos = await msgAfterTimeout('Juanito', 'Pepito', 3500)\n let saludo = [`Hola ${datos[1]}!`]\n let quienSoy = datos[0].toUpperCase()\n console.log(saludo)\n datos = await msgAfterTimeout (quienSoy, saludo, 500)\n console.log (`${datos[1]}, soy ${datos[0]}`)\n \n }", "function jsdomEndpointAccedi(req, res, urlFile, mail, password) {\r\n database.selectUtente(mail, password, function(giocatoreTemp) {\r\n if (giocatoreTemp != null) {\r\n giocatore = giocatoreTemp;\r\n database.terminaConnessione();\r\n let data = fs.readFileSync(\"./html/\" + urlFile);\r\n let mioJsdom = new JSDOM(data);\r\n let tagAccedi = mioJsdom.window.document.getElementById(\"Accedi\");\r\n tagAccedi.innerHTML = \"Benvenuto \" + giocatore.getUsername();\r\n let tagHumburger = mioJsdom.window.document.getElementById(\"AccediHumburger\");\r\n tagHumburger.innerHTML = \"Benvenuto \" + giocatore.getUsername();\r\n res.send(mioJsdom.window.document.documentElement.outerHTML);\r\n } else {\r\n let ritorno = fs.readFileSync(\"./html/accedi.html\");\r\n res.send(ritorno.toString());\r\n }\r\n });\r\n}", "function callInicioSocket() {\r\n\tconsole.log(\"Peticion Inicio # \" + MAIN_SERVER_UDP_PORT + \" # \" + APP_ID);\r\n\t\r\n\tvar ab = str2ab(INICIO + \";\" + APP_ID);\r\n\tsocketUdp.write(socks.socketId, ab, writeComplete);\r\n}", "function iniciar_Sesion()\n{\n\t// obtiene el nombre del usuario\n\tvar nombre_usuario = document.getElementById(\"user\").value;\n\t// obtiene la contraseña del usuario\n\tvar contrasenna = document.getElementById(\"password\").value;\n\t// pregunta si el nombre es admin y la contraseña es $uperadmin para saber si es el administrador\n\tif(nombre_usuario === \"admin\" && contrasenna === \"$uper4dmin\"){\n\t\t// si es asi validar va a decir que el que va a iniciar sesion es el administrador\n\t\tvalidar = \"Entra como administracion\";\n\t\t// entonces el usuario actual va a ser admin\n\t\tuser_actual = 'Admin';\n\t\t// se va al localstorage y guarda el usuario actual para saber quien fue el que entró\n\t\tlocalStorage.setItem(\"Usuario_Actual\",user_actual);\n\t\t// si no fuera así\n\t}else{\n\t\t// se va a la funcion donde valida si el usuario existe o no y si existe cual es\n\t\tvalidacion();\n\t}\n\t// si validar fuera igual a nulo\n\tif(validar === null){\n\t\t// se muestra un mensaje donde le indica que lo debe crear primero entonces no puede iniciar sesion\n\t\talert(\"Debe crearlo primero antes de iniciar sesion\");\n\t\t// si validar fuera que entra coo administrador\n\t}else if(validar === \"Entra como administracion\"){\n\t\t// entonces entra como administrador\n\t\tlocation.href=\"tablero-de-instrucciones.html\";\n\t\t// muestra un mensaje de bienvenida\n\t\talert(\"BIENVENIDO\");\n\t\t// si validar fuera que entra como particular\n\t}else if(validar === \"Entra como particular\"){\n\t\t// entonces se valida el nombre de usuario para saber quien es.\n\t\tuser_actual = document.getElementById(\"user\").value;\n\t\t//lo guarda en el localstorage\n\t\tlocalStorage.setItem(\"Usuario_Actual\", user_actual);\n\t\t// entra como particular\n\t\tlocation.href=\"tablero-de-instrucciones.html\";\n\t\t// muestra un mensaje de bienvenida\n\t\talert(\"BIENVENIDO\");\n\t}\n\n}", "handleWebMessage(message) {\n console.log('Mensaje desde Web: ' + message);\n if (message === 'estado'){\n this.verificarEstado();\n return;\n }\n serverClient.publish('Espino/commands', message);\n }", "function cargarNombreEnPantalla() \n{\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function paginaPrincipal (){\r\n document.querySelector(\"#auxLanding\").style.display = \"block\"; //Muestro nuevamente botones de registro\r\n document.querySelector(\"#bodyHome\").style.display = \"block\"; //Muestro portada de pagina\r\n document.querySelector(\"#h1TitBienvenida\").innerHTML = `Bienvenidos a Escuela De Música`; //reescribo para cuando se ejecute cierre de sesion\r\n document.querySelector(\"#registro\").style.display = \"none\"; //Oculto el formulario\r\n document.querySelector(\"#pagPrincipal\").style.display = \"none\"; //Oculto boton pagina principal\r\n document.querySelector(\"#ingreso\").style.display = \"none\"; //Oculto formulario de ingreso\r\n document.querySelector(\"#homeAlumno\").style.display = \"none\"; //Oculto interfaz alumno\r\n document.querySelector(\"#homeDocente\").style.display = \"none\"; //Oculto interfaz docente\r\n document.querySelector(\"#navAlumno\").style.display = \"none\"; //Oculto nav alumno\r\n document.querySelector(\"#navDocente\").style.display = \"none\"; //Oculto nav docente\r\n document.querySelector(\"#auxUsuario\").style.display = \"none\"; //Oculto div auxiliar de usuarios\r\n}", "function enviarComentario() {\n\tif (ValidarDatosObligatorios()) {\n\t\tvar token = ObtenerToken();\n\n\t\tvar dataJSON = {\n\t\t\tSolicitudId: $(\"#txtSolicitudId\").val(),\n\t\t\tRespuesta: $(\"#txtComentarioNuevo\").val(),\n\t\t}\n\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: urlPQRS + \"Solicitudes/Respuesta\",\n\t\t\tbeforeSend: function (request) {\n\t\t\t\trequest.setRequestHeader(\"Authorization\", token);\n\t\t\t},\n\t\t\tdata: JSON.stringify(dataJSON),\n\t\t\tcrossDomain: true,\n\t\t\tcontentType: 'application/json',\n\t\t\tdataType: 'json',\n\t\t\tasync: false,\n\t\t\tsuccess: function (data) {\n\t\t\t\tif (data != null) {\n\t\t\t\t\tdocument.getElementById(\"mensajeResultados\").innerHTML = data.Mensaje;\n\t\t\t\t\t$(\"#mensajeResultadosContainer\").removeClass('hidden');\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\n\t\t\t\t$(\"#txtComentario\").val('');\n\n\t\t\t},\n\t\t\terror: function (data) {\n\t\t\t\tdocument.getElementById(\"mensajeResultados\").innerHTML = 'Se presentó un error';\n\t\t\t\t$(\"#mensajeResultadosContainer\").removeClass('hidden');\n\t\t\t},\n\t\t});\n\t}\n}", "function registro(){ \r\n limpiarMensajesError();//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombre = document.querySelector(\"#txtNombre\").value;\r\n let nombreUsuario = document.querySelector(\"#txtNombreUsuario\").value;\r\n let clave = document.querySelector(\"#txtContraseña\").value;\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n let recibirValidacion = validacionesRegistro (nombre, nombreUsuario, clave); //\r\n if(recibirValidacion && perfil != -1){ \r\n crearUsuario(nombre, nombreUsuario, clave, perfil);\r\n if(perfil === 2){\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n alumnoIngreso();\r\n }else{\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado\r\n docenteIngreso();//Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n }\r\n }\r\n if(perfil === -1){\r\n document.querySelector(\"#errorPerfil\").innerHTML = \"Seleccione un perfil\";\r\n }\r\n}", "conver_un_usuario(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const { nom } = req.params;\n const { id } = req.params;\n const usuarios = yield pool.query('SELECT cod_usuario, mensaje.cod_usuario_destinatario as cod_destinatario, mensaje.cod_usuario_remitente, usuario.nombre as nom_destinatario, usuario.correo FROM proyecto_ionic.mensaje inner join usuario on usuario.cod_usuario = mensaje.cod_usuario_destinatario and usuario.nombre !=? or usuario.cod_usuario = mensaje.cod_usuario_remitente and usuario.nombre !=? where cod_usuario_destinatario =? or cod_usuario_remitente =? group by usuario.nombre', [nom, nom, id, id]);\n if (usuarios.length > 0) {\n return res.json(usuarios);\n }\n else {\n res.status(404).json({ text: 'No existen conversaciones' });\n }\n });\n }", "function notificacionIndividual(idusuario, titulo, cuerpo) {\n // Busco las suscripciones del usuario\n Usuario.findOne({ _id: idusuario }).then((usuario) => {\n const allSubscriptions = usuario.suscripciones;\n console.log(\"suscripciones\", allSubscriptions);\n notificar(allSubscriptions, titulo, cuerpo);\n });\n}", "function get_sucursal(){\n\tvar ids=sessionStorage.getItem(\"id\");\n\tvar idd=JSON.parse(ids);\n\tvar parametros = {\n \"id\" : idd.id,\n \"user\": idd.nombre,\n \"suc\": idd.s\n \t};\n\t$.ajax({\n\t\t/*paso los paramentros al php*/\n\t\tdata:parametros,\n\t\turl: 'getsucursal.php',\n\t\ttype:'post',\n\t\t/*defino el tipo de dato de retorno*/\n\t\tdataType:'json',\n\t\t/*funcion de retorno*/\n\t\tsuccess: function(data){\n\t\t\t/*Agrego el numero de sucursal y los datos respectivos en la etiqueta para mostrar al usuario \n\t\t\tla sucursal en la que se esta registrando el nuevo usuario*/\n\t\t\tvar cadenaP=data['name']+\" \"+data['dir'];\n\t\t\t$(\"#suc\").val(data['id']);\n\t\t\t$(\"#label_suc\").html(cadenaP);\n\t\t}\n\t});\n}", "function abrirHorario() {\n\t\t$.ajax({\n\t\t\turl : '/acmuniandes_hor/_php/hor_core.php',\n\t\t\tdataType : 'json',\n\t\t\tdata : {\n\t\t\t\t'tipsol' : '7',\n\t\t\t},\n\t\t\ttype : 'POST',\n\t\t\tsuccess : function(response) {\n\t\t\t\tif(response) {\n\t\t\t\t\tif(response.redirect) {\n\t\t\t\t\t\t// data.redirect contains the string URL to redirect to\n\t\t\t\t\t\tdocument.location = response.redirect;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\thorarioActual = new Horario(response);\n\t\t\t\t\t\tfor(var key in horarioActual.cursos){\n\t\t\t\t\t\t\tsel = \"p\"+key;\n\t\t\t\t\t\t\thorarioActual.cursos[key].id = \"p\"+key;\n\t\t\t\t\t\t\thorarioActual.cursos[key].persistido = true;\n\t\t\t\t\t\t\tagregarCursoCalendar(horarioActual.cursos[key], false, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thorarioActual = new Horario();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "constructor() {\n //vamos a poner un setTimeout para que no arranque ni bien el usuario pulsa el boton\n this.inicializar();\n this.generarSecuencia();\n setTimeout(this.siguienteNivel,500);\n }", "function get(conseguirUnUsuario) {\n return $http.get(urlServer + '/' + conseguirUnUsuario.id)\n }", "function enviar() {\n const formulario = document.getElementById('formulario');\n \n formulario.addEventListener('submit', (e) => {\n const correoValue = correo.value.trim();\n const contraseñaValue = contraseña.value.trim();\n \n e.preventDefault();//evita que se envien los datos y se refresque la pagina\n \n if (correoValue === \"\") {\n alert(\"Correo vacio\");\n }if (contraseñaValue === \"\") {\n alert(\"Contraseña vacia\")\n }\n \n if (campos.correo && campos.contraseña) {\n //Enviar AJAX\n buscarUsuario(formulario);\n \n //Iniciar sessión\n\n //Cargando\n document.querySelector('#cargando').classList.remove('invisible');//Logo de carga\n document.querySelector('#loguearse').classList.add('invisible');//Esconde el texto del boton\n }else{\n alert(\"No se pudo iniciar sesión\");\n }\n \n }); \n}", "function saludar()\n {\n // Recojo el valor introducido por el usuario\n let user = oDom.eInputName.value\n // Saco en el html, en la etiqueta output introduzco el valor que teniamos en console antes\n oDom.eOutSaludo.innerHTML = `Hola ${user}` // Podria poner un parrafo = `<p>Hola ${user}</p>`\n console.log(user)\n //console.log(`Hola ${user}`)\n }", "function mostrarDevoluciones(){ // Cuando toque el boton \"devoluciones\" voy a ver la seccion (hacer devoluciones)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; // habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; // oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto tabla\r\n document.querySelector(\"#divDevoluciones\").style.display = \"block\"; // muestro redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}", "async function serverResponse(estado, respuesta) {\n\n if (estado === 400) {\n mensajeError(\"El email o la contraseña no son validos\"); // muestra elemento HTML \n } else {\n console.log(respuesta) \n // Guarda en el Storage el token y el id \n localStorage.setItem('token', respuesta.token)\n // localStorage.setItem('id-usuario', respuesta.id)\n\n mensajeSuccess(respuesta.msg); // Muestra elemento HTML\n \n await peticionRedireccionamiento() // Redirecciona al Home\n\n }\n }", "function rankeaObraUsuario(colectionItemName,numItem,resultado,usuarioRankea,obraRankeada) {\n\tajax = new XMLHttpRequest();\n\tstyleStarts(colectionItemName,numItem,resultado);\n\t\n\tvar estrellas = id(resultado).value;\n\tvar variables = \"&estrellas=\" + estrellas;\n\tvariables += \"&idUsuario=\" + usuarioRankea;\n\tvariables += \"&idObra=\" + obraRankeada;\n\tvariables += \"&esAjax=\" + true;\n\t\n\tajax.open(\"POST\", \"BuscarInformacionFormularios?metodoDeBusqueda=10\" + variables, true);\n\tajax.send(\"\");\n}", "function trocarCliente() {\n\n //seta como vazio os atributos do cliente seleciado\n idCliente = 0;\n nomeCliente = \"\";\n\n //apaga o input criado na \"function selecionarCliente\"\n document.getElementById('idCliente').remove();\n \n document.getElementById('listagemDeCliente').style.display = ''; //habilita a tabela de listagem do cliente\n document.getElementById('confirmacaoCliente').style.display = 'none'; //desabilita a confirmação da etapa 1\n document.getElementById('confirmacaoCliente').style.display = 'none'; //desabilita a confirmação da etapa 1\n\n //como está trocando de cliente , as crianças serão outras , então limpa tudo que é relacionado as crianças (etapa2)\n if(countEtapa2 !== 0){\n document.getElementById(\"tbodyAniversariantes\").innerHTML=\"\";\n document.getElementById('tabelaAniversariante').style.display = 'none'; //desabilita a tabela de listagem de criança\n countEtapa2 = 0;\n } \n \n //apaga os inputs das crianças caso tiver\n for(var i = 0; i < quantidadeCrianca2; i++){\n var existeInputCrianca = document.getElementById('idCrianca'+(i+1)); \n if(existeInputCrianca !== null){\n document.getElementById('idCrianca'+(i+1)).remove(); \n }\n \n }\n \n //limpando/zerando as variaveis relacionadas a criança\n quantidadeCrianca = 0;\n quantidadeCriancaBotaoRemover = 0;\n quantidadeCrianca2 = 0;\n textoConfirmacaoCrianca = \"\";\n listaNomeCrianca = [];\n possuiCrianca = 0;\n }", "function start() {\n if (sessionStorage.getItem(\"usuarioSessionStore\") === null) {\n datos.innerHTML = `Participante no registrado... tenga en cuenta`;\n }else{\n createNombre();\n }\n}", "function userConnect()\n {\n $.ajax({\n // On définit l'URL appelée\n url: 'http://localhost/tchat/API/index.php',\n // On définit la méthode HTTP\n type: 'GET',\n // On définit les données qui seront envoyées\n data: {\n action: 'userAdd',\n userNickname: $('#userNickname').val()\n },\n // l'équivalent d'un \"case\" avec les codes de statut HTTP\n statusCode: {\n // Si l'utilisateur est bien créé\n 201: function (response) {\n // On stocke l'identifiant récupéré dans la variable globale userId\n window.userId = response.userId;\n // On masque la fenêtre, puis on rafraichit la liste de utilisateurs\n // (à faire...)\n },\n // Si l'utilisateur existe déjà\n 208: function (response) {\n // On fait bouger la fenêtre de gauche à droite\n // et de droite à gauche 3 fois\n // (à faire...)\n }\n }\n })\n }", "function pegaNomeUsuario(numeroUsuario) {\n let nomeUsuario = rs.question(`Digite o nome do usuário ${numeroUsuario}: \\n`)\n return nomeUsuario\n}", "function reglas(){\n console.log(`Bienvenido ${nombreJugador}. Las reglas son las siguientes: \\n\n -Sumaras 1 punto por cada letra acertada.\n -Si contestas \"pasapalabra\", podras responder esa pregunta en la proxima ronda.\n -CUIDADO!! Si dejas en blanco y presionas OK, se considera como errada.\n -Puedes escribir \"END\" para finalizar el juego en el momento que quieras.\n Muchas suerte ${nombreJugador}. Y recuerda...no hagas trampa, porque lo sabremos ¬¬`)\n }", "function soloUsuario(e) {\n tecla = (document.all) ? e.keyCode : e.which;\n if (tecla == 8) return true;\n patron = /^([A-Za-zÑñáéíóúÁÉÍÓÚ0-9]+)$/;\n\n te = String.fromCharCode(tecla);\n return patron.test(te);\n}", "function mostrarVentanaCajero(){\n\tnav = 20;\n\tvar nombre = datosUsuario[0][\"nombre\"];\n\tvar txt= forPantallaCajero('Cajero', nombre);\n\t$('#contenedor').html(txt);\n\t$('#contenedor').append(cargarModal());//Agrega HTML del formulario modal\n\tvar parametros ={\"opc\": nav};\n\tejecutarAjax(parametros, nav);\n}", "function loginauthor () {\n var xhr = httpIo.httpGet(\"/api/guest\", function (data, object) {\n console.log(\"game connect suLayaess!!\");\n // console.log(data);\n Laya.beimi.user.id = JSON.parse(data).token.userid;\n connectService();\n }, function () {\n console.log(\"game connect fail !!\");\n });\n\n}", "function agregar(usuario) {\n let data = {\n 'thing': usuario\n };\n\n fetch(`${baseUrl}/${groupID}/${collectionID}`, {\n 'method': 'POST',\n 'headers': {\n 'content-type': 'application/json'\n },\n 'body': JSON.stringify(data)\n }).then(res => {\n return res.json();\n }).then(dato => {\n precargarUsers();\n }).catch((error) => {\n console.log(error);\n })\n\n document.querySelector(\"#userName\").value = \"\";\n document.querySelector(\"#resetsUser\").value = \"\";\n document.querySelector(\"#viplevelUser\").value = \"\";\n document.querySelector(\"#levelUser\").value = \"\";\n }", "function obtenerUsuario(idUsuario, username){\n\t//console.log(\"OBTENER DATOS\");\n\t//console.log(idUsuario);\n\t//console.log(username);\n\t$.ajax({\n\t\tsync:true,\n\t\tdata: {\n\t\t\t\"id\" : idUsuario,\n\t\t\t\"username\" : username,\n\t},\n\tdataType:'json',\n\turl: '../../mvc/usuario/obtenerusuarioconrolesbyid',\n\ttype: 'post',\t\t\n\tbeforeSend: function () {\t\n\t},\n\tsuccess: function (response) {\n\t\t//console.log(\"RESPONSE\")\n\t\t//console.log(response)\n\t\tmuestraDatosUsuario(response);\t\n\t\t},\t\n\terror: function (response) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t$(\"#resultadoGuardar\").html(\"Error\");\n\t\t//console.log(\"RESPONSE ERROR\")\n\t\t//console.log(response)\n\t\t}\t\t\n\t});\t\t\n}", "function buscarFlete(){\n\n $('#fatalClose').unbind(\"click\").click(function(){\n $('#modalSolicitud').modal('hide'); \n socket.disconnect();\n });\n\n socket.socket.reconnect();\n start = 0;\n var datos={\"idUsuario\" : idU,\"origen\" : $('#start').val(), \"destino\" : $('#end').val(), \"cargar\" : $('#slider-flip-C').val(), \"descargar\" : $('#slider-flip-D').val(), \"comentario\" : $('#textarea').val()};\n\t\t$('#modalSolicitud').modal({\n\t\t show: true,\n\t\t backdrop: false,\n\t\t keyboard: false\n\t\t});\t\t\n \n //Chofer finaliza la transaccion\n socket.on('finalizaFlete', function(data){\n $('#modalFin').modal({\n backdrop: false,\n keyboard: false,\n show: true\n });\n $('#btnFin').css('display','none');\n finalizarFlete(data,\"Ha finalizado!\",false); \n });\n\n\t\tenviarSolicitud(datos);\n\n }", "function CaricamentoIscrizioni() {\r\n\t\t\t// posiziono il cursore sul campo di ricerca Cognome\r\n\t\t\tsetTimeout(\"document.getElementById(\\\"txtCognome\\\").focus();\", 1);\t\t\t\t// la setTimeout serve a farlo funzionare con FF\r\n\t\t\t// carico la drop down dei luoli se è vuota\r\n\t\t\tvar RuoloIscritto = document.getElementById(\"RuoloIscritto\");\r\n\t\t\tif (RuoloIscritto.length == 0) {\r\n\t\t\t\t$.post(\"rpc_ruolo.php\", {queryString: \"\"}, function(data){\r\n\t\t\t\t\tif (data.length > 0) {\r\n\t\t\t\t\t\t$('#RuoloIscritto').html(data);\r\n\t\t\t\t\t\tRuoloIscritto.selectedIndex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t// imposto la dropdown degli eventi\r\n\t\t\tddlEventi = document.getElementById(\"Evento\");\r\n\t\t\tddlEventi.style.backgroundColor=ddlEventi.options[ddlEventi.selectedIndex].style.backgroundColor;\r\n\t\t\treturn;\r\n \t\t}", "run({ accion, socket, Socket, leccionId, paraleloId, fechaInicioTomada, tiempoEstimado, usuarioId }) {\n // limpiarlos por si acaso el moderador envia dos veces la misma peticion\n const existeInterval = intervals.some(leccion => leccionId == leccion.leccionId)\n const existeTimeout = timeouts.some(leccion => leccionId == leccion.leccionId)\n socket.join(`${paraleloId}`) // cada vez que realiza una de las acciones de debe agregar al profesor al room del paralelo\n if (existeInterval)\n intervals = intervals.filter(inicial => { if (inicial.leccionId == leccionId) {clearInterval(inicial.interval)} return inicial.leccionId !=leccionId })\n if (existeTimeout) { // si comento esto, se crean 3?\n timeouts = timeouts.filter(inicial => { if (inicial.leccionId == leccionId) {clearTimeout(inicial.timeout)} return inicial.leccionId != leccionId })\n }\n if (accion === 'comenzar') {\n logger.info(`moderador-comenzar usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n } else if (accion === 'aumentarTiempo') {\n logger.info(`moderados-aumentarTiempo usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}`)\n } else if (accion === 'continuar') {\n logger.info(`moderador-continuar usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoPausado+TiempoRestante: ${tiempoEstimado}`)\n } else if (accion === 'reconectarModerador') {\n logger.info(`moderador-reconectarModerador usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoPausado+TiempoRestante: ${tiempoEstimado}`)\n }\n const CURRENT_TIME = moment(moment().tz('America/Guayaquil').format())\n const FECHA_INICIO = moment(fechaInicioTomada)\n const FECHA_FIN = FECHA_INICIO.add(tiempoEstimado, 's')\n intervalId = setInterval(() => {\n let fechaFinLeccion = FECHA_FIN.subtract(1, 's')\n let tiempoRestante = moment.duration(fechaFinLeccion.diff(CURRENT_TIME)).format('h:mm:ss')\n // console.log(tiempoRestante)\n Socket.in(`${paraleloId}`).emit(EMIT.TIEMPO_RESTANTE, tiempoRestante)\n if (!CURRENT_TIME.isBefore(fechaFinLeccion)) {\n intervals = intervals.filter(inicial => { if (inicial.leccionId == leccionId) {clearInterval(inicial.interval)} return inicial.leccionId !=leccionId })\n Socket.in(`${paraleloId}`).emit(EMIT.LECCION_TERMINADA)\n Socket.in(`${paraleloId}`).emit(EMIT.TIEMPO_RESTANTE, 0)\n logger.info(`moderador-leccion-termino usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n }\n }, 1000)\n intervalId.ref()\n\n const SEGUNDOS_FIN = parseInt(moment.duration(FECHA_FIN.clone().add(5, 's').diff(CURRENT_TIME), 'seconds').format('ss'), 10) // si no termina con setInterval, despues de 5 segundos terminara con setTimeout\n timeoutId = 1 // prueba\n // timeoutId = setTimeout(() => {\n // if (intervalExiste(intervals, leccionId)) {\n // intervals = intervals.filter(inicial => { if (inicial.leccionId == leccionId) {clearInterval(inicial.interval)} return inicial.leccionId !=leccionId })\n // Socket.in(`${paraleloId}`).emit(EMIT.LECCION_TERMINADA)\n // logger.info(`moderador-leccion-termino-setTimeout usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n // } else {\n // logger.info(`moderador-leccion-termino-setInterval usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n // }\n // timeouts = timeouts.filter(inicial => { if (inicial.leccionId == leccionId) {clearTimeout(inicial.timeouts)} return inicial.leccionId !=leccionId })\n // }, SEGUNDOS_FIN)\n intervals.push({ leccionId, interval: intervalId, usuarioId })\n timeouts.push({ leccionId, timeout: timeoutId, usuarioId })\n if (accion === 'comenzar') {\n Socket.in(`${paraleloId}`).emit(EMIT.EMPEZAR_LECCION) // este solo sirve cuando los estudiantes estan en \"ingresar-codigo\"\n }\n }", "function ocultarLoginRegistro() {\n /* Oculta uno de los Divs: Login o Registro, según cuál link se haya clickeado */\n var clickeado = $(this).attr(\"alt\");\n var itemClickeado = $(\"#\" + \"div\" + clickeado);\n itemClickeado.removeClass(\"hidden\").siblings(\"div\").addClass(\"hidden\");\n $(\"#txt\" + clickeado + \"Nombre\").focus();\n $(\"#div\" + clickeado + \"Mensaje\").html(\"\");\n }", "function voltarEtapa5() {\n \n msgTratamentoEtapa6.innerHTML = \"\";\n \n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"5º Etapa - Valores Adicionais & Desconto\";\n\n document.getElementById('inserirValorAdicional').style.display = ''; //habilita a etapa 5\n document.getElementById('inserirDespesas').style.display = 'none'; //desabilita a etapa 6\n }", "function principal() {\n choquecuerpo();\n choquepared();\n dibujar();\n movimiento();\n \n if(cabeza.choque (comida)){\n comida.colocar();\n cabeza.meter();\n } \n}", "function respuesta(e){\n e=JSON.parse(e);\n if(e[0]=='username'){\n alert(\"usuario en uso, escoge otro.\");\n }else if(e[0]=='email'){\n \n alert(\"email en uso, escoge otro.\");\n }else{\n self.close();\n alert(\"Tu solicitud fué enviada, espera un correo para continuar.\");\n \n }\n \n}", "function connexion(){\n $.ajax({\n url : \"login.php\",\n type : \"POST\",\n data : {\n pseudo : $(\"#pseudo\").val(),\n mdp : $(\"#mdp\").val()\n },\n datatype : \"html\",\n success : function(data){\n console.log(data);\n if (data == \"fail\"){\n alert(\"Mot de passe ou identifiant incorrect(s) !\");\n formulaire();\n } else if (data == \"admin\") {\n alert(\"Bienvenue \" + $(\"#pseudo\").val());\n $(\"main\").text(\"\");\n document.location.href=\"admin.html\";\n } else {\n user_pseudo = $(\"#pseudo\").val();\n alert(\"Bienvenue \" + $(\"#pseudo\").val());\n $(\".slogan\").html(\"Elle est pour <strong>\" + $(\"#pseudo\").val() + \"</strong>\");\n $(\"main\").text(\"\");\n let recup1 = JSON.parse(httprequest.responseText);\n $(\"header\").append(recup1[2]);\n $(\"main\").append(recup1[3]);\n //console.log(recup1[3]);\n \n $(\"#affiche_emprunt\").click(function(){\n \n $(\"main\").append(recup1[4]);\n userPosition();\n });\n $(\"#deco\").click(function(){\n deco();\n });\n }\n }\n });\n}", "function login() {\n // connect to OOCSI server running on IP and port 9000\n if($('#input').val().length > 0) {\n username = $('#input').val();\n OOCSI.connect(\"ws://oocsi.id.tue.nl/ws\", username);\n } else {\n OOCSI.connect(\"ws://oocsi.id.tue.nl/ws\");\n }\n // subscribe to the channel \"colorChange\"\n OOCSI.subscribe(\"myChannel\", receivedMessages);\n // optional logging to console\n // OOCSI.logger(function(msg) {console.log(msg)});\n // announce me in channel\n OOCSI.send(\"myChannel\", {message: \"Hi, I just joined the chat!\"});\n setTimeout(function() {\n if(OOCSI.isConnected()) {\n loggedIn = true;\n // print log in success\n var b = $('<p></p>').addClass('me').text('>> logged in as ' + username);\n $('#output').append(b);\n $('#output').show();\n // reset input field\n $('#input').val('');\n // relabel login/send button\n $('#submit').text('send');\n }\n }, 200);\n // test\n setTimeout(function() {\n OOCSI.call('addition.addnineteen2', {value: 2}, 5000, function(data) {\n console.log(data)\n });\n }, 2000);\n}", "function cadastrarUmaUnidade(){\n\tvar unidadeSelecionadaBDTRE = DWRUtil.getValue(\"comboUnidadeTRE\"); \n\tif(unidadeSelecionadaBDTRE==null || unidadeSelecionadaBDTRE==''){\n\t\talert(\"Selecione uma unidade a ser cadastrada.\");\n\t}else{\n\t\tvar loginGerente = DWRUtil.getValue(\"loginGerenteUnidade\");\n\t\tvar matriculaGerente = DWRUtil.getValue(\"matriculaGerente\"); \n\t\tFacadeAjax.cadastrarUnidadeSuporte(unidadeSelecionadaBDTRE,loginGerente,matriculaGerente);\n\t\tcarregarCamposUnidades();\n\t}\n}", "function obtenerPermisosUsuario(){\n\n\t\tvar user = $('select#usuario').val();\n\t\tvar table = $('select#tabla').val();\n\n\t\t$.ajax({\n\n\t\t\tdata: { user: usuario, \n\t\t\t\t\tpass: pasword,\n\t\t\t\t\tagencia: agencia,\n\t\t\t\t\tusuario: user,\n\t\t\t\t\ttabla: table},\n\t\t\t\t\turl: 'http://apirest/permisos/tabla/',\n\t\t\t\t\ttype: 'POST',\n\n\t\t\tsuccess: function(data, status, jqXHR) {\n\t\t\t\tconsole.log(data);\n\n\t\t\t\tif(data.message == 'Autentication Failure'){\n\t\t\t\t\tmostrarMensaje(\"No estas autorizado para la gestión de permisos\",\"../../index.php\");\n\t\t\t\t}else if(data.message == 'OK'){\n\t\t\t\t\tmostrarPermisos(data);\n\t\t\t\t}else{\n\t\t\t\t\tmostrarMensajePermisos(\"No estas autorizado para añadir/eliminar permisos a ese usuario\");\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\terror: function (jqXHR, status) { \n\t\t\t\tmostrarMensaje(\"Fallo en la petición al Servicio Web\",\"../../index.php\");\n\t\t\t}\n\t\t\t\n\t\t});\n\n\t}", "processMessage(session) {\n\n let messageText = session.message.text;\n let sender = session.message.address.conversation.id;\n let name=session.message.user.name;\n let username=name.toLowerCase();\n let roletest=\"\";\n console.log(session.message.user.name);\n\n if (messageText && sender) {\n\n console.log(sender, messageText);\n\n if (!this._sessionIds.has(sender)) {\n this._sessionIds.set(sender, uuid.v1());\n }\n\n let apiaiRequest = this._apiaiService.textRequest(messageText,\n {\n sessionId: this._sessionIds.get(sender),\n originalRequest: {\n data: session.message,\n source: \"skype\"\n }\n });\n\n //Gerer la reponse\n apiaiRequest.on('response', (response) => {\n if (this._botConfig.devConfig) {\n console.log(sender, \"Recevoir api.ai reponse\");\n }\n //verifier l'autorisation\n db.any(`SELECT name,role FROM role WHERE name='${username}'`)\n .then(data1=>{\n let role;\n try{\n role=data1[0].role;\n }catch (e) {\n role=\"\";\n }\n //Si le bot a compris la demande\n if (SkypeBot.isDefined(response.result) && SkypeBot.isDefined(response.result.fulfillment)) {\n let responseText = response.result.fulfillment.speech;\n let responseMessages = response.result.fulfillment.messages;\n let intentName=response.result.metadata.intentName;\n let responses;\n let text=\"\";\n let projet;\n let fonction;\n let personne;\n let jalon;\n let doc;\n let sujet;\n\n //Traiter la reponse pour chaque intent dans l'api.ai\n //Demande un nom.\n if(intentName===\"projet_fonction\") {\n let fonction1 = response.result.parameters.fonction1;\n let fonction2 = response.result.parameters.fonction2;\n let fonction3 = response.result.parameters.fonction3;\n let projet1 = response.result.parameters.projet1;\n let projet2 = response.result.parameters.projet2;\n let projet3 = response.result.parameters.projet3;\n if (fonction2 === \"\" && fonction3 === \"\") {\n fonction = fonction1;\n } else if (fonction3 === \"\") {\n fonction = fonction1 + \" \" + fonction2;\n } else {\n fonction = fonction1 + \" \" + fonction2 + \" \" + fonction3;\n }\n if (projet2 === \"\" && projet3 === \"\") {\n projet = projet1;\n } else if (projet3 === \"\") {\n projet = projet1 + \" \" + projet2;\n } else {\n projet = projet1 + \" \" + projet2 + \" \" + projet3;\n }\n fonction=fonction.toLowerCase();\n projet=projet.toLowerCase();\n db.any(`SELECT personne FROM projet WHERE projet='${projet}' AND fonction='${fonction}'`)\n .then(data => {\n console.log(data);\n for (var i in data){\n text=text+data[i].personne+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Demande les personnes qui travaillent sur un projet et ces fonctions\n else if(intentName===\"projet\"){\n let projet1=response.result.parameters.projet1;\n let projet2=response.result.parameters.projet2;\n let projet3=response.result.parameters.projet3;\n if (projet2===\"\" && projet3===\"\"){\n projet=projet1;\n }else if (projet3===\"\"){\n projet=projet1+\" \"+projet2;\n }else {\n projet=projet1+\" \"+projet2+\" \"+projet3;\n }\n projet=projet.toLowerCase();\n db.any(`SELECT personne,fonction FROM projet WHERE projet='${projet}'`)\n .then(data => {\n for (var i in data){\n text=text+\"La personne: \"+data[i].personne+\" et ca fonction: \"+data[i].fonction+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Demande le role d'un personne\n else if (intentName===\"personne\"){\n let prenom=response.result.parameters.prenom1;\n let nom=response.result.parameters.nom1;\n personne=prenom+\" \"+nom;\n personne=personne.toLowerCase();\n db.any(`SELECT projet,fonction FROM projet WHERE personne='${personne}'`)\n .then(data => {\n for (var i in data){\n text=text+\"Le projet: \"+data[i].projet+\" et ca fonction: \"+data[i].fonction+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Afficher les données dans la table projet\n else if (intentName===\"list\" && role) {\n let table=response.result.parameters.table1;\n table=table.toLowerCase();\n db.any(config.selectAll)\n .then(data => {\n for (var i in data){\n text=text+\"Le projet: \"+data[i].projet+\" et la fonction: \"+data[i].fonction+\" et le prenom nom: \"+data[i].personne+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Si je suis pas un admin\n else if(intentName===\"list\" && !role){\n this.doRichContentResponse(session,config.messageAccess);\n }\n //Demande d'un signifie\n else if (intentName===\"signifie\"){\n let syno=response.result.parameters.syno1;\n syno=syno.toLowerCase();\n db.any(`SELECT def FROM synonyme WHERE synonyme='${syno}'`)\n .then(data => {\n for (var i in data){\n text=text+data[i].def+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Demande une date\n else if (intentName===\"date\"){\n let jalon1 = response.result.parameters.date1;\n let jalon2 = response.result.parameters.date2;\n let jalon3 = response.result.parameters.date3;\n let projet1 = response.result.parameters.nom1;\n let projet2 = response.result.parameters.nom2;\n let projet3 = response.result.parameters.nom3;\n if (jalon2 === \"\" && jalon3 === \"\") {\n jalon = jalon1;\n } else if (jalon3 === \"\") {\n jalon = jalon1 + \" \" + jalon2;\n } else {\n jalon = jalon1 + \" \" + jalon2 + \" \" + jalon3;\n }\n if (projet2 === \"\" && projet3 === \"\") {\n projet = projet1;\n } else if (projet3 === \"\") {\n projet = projet1 + \" \" + projet2;\n } else {\n projet = projet1 + \" \" + projet2 + \" \" + projet3;\n }\n jalon=jalon.toLowerCase();\n projet=projet.toLowerCase();\n db.any(`SELECT date FROM date WHERE nomprojet='${projet}' AND jalon='${jalon}'`)\n .then(data => {\n for (var i in data){\n text=text+data[i].date+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Ajoute une valeure dans la table projet\n else if (intentName===\"insert\" && role){\n let projet1=response.result.parameters.projet1;\n let projet2=response.result.parameters.projet2;\n let projet3=response.result.parameters.projet3;\n let fonction1 = response.result.parameters.fonction1;\n let fonction2 = response.result.parameters.fonction2;\n let fonction3 = response.result.parameters.fonction3;\n let prenom=response.result.parameters.prenom1;\n let nom=response.result.parameters.nom1;\n if (fonction2 === \"\" && fonction3 === \"\") {\n fonction = fonction1;\n } else if (fonction3 === \"\") {\n fonction = fonction1 + \" \" + fonction2;\n } else {\n fonction = fonction1 + \" \" + fonction2 + \" \" + fonction3;\n }\n if (projet2 === \"\" && projet3 === \"\") {\n projet = projet1;\n } else if (projet3 === \"\") {\n projet = projet1 + \" \" + projet2;\n } else {\n projet = projet1 + \" \" + projet2 + \" \" + projet3;\n }\n personne=prenom+\" \"+nom;\n personne=personne.toLowerCase();\n fonction=fonction.toLowerCase();\n projet=projet.toLowerCase();\n if (personne===\"\" || fonction===\"\" || projet===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n db.any(`SELECT personne FROM projet WHERE projet='${projet}' AND fonction='${fonction}' AND personne='${personne}'`)\n .then(data2 =>{\n for (var i in data2){\n text=data2[i].personne;\n }\n if(text===''){\n db.any(`INSERT INTO projet (projet,fonction,personne) VALUES ('${projet}','${fonction}','${personne}')`)\n .then(data=>{\n this.doRichContentResponse(session,responseText);\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n } else{\n this.doRichContentResponse(session,config.messageDoneesExistent);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n })\n }\n }\n //Si je suis pas un admin\n else if (intentName==='insert' && !role){\n this.doRichContentResponse(session,config.messageAccess);\n }\n //Delete une valeure dans la table projet\n else if (intentName==='delete' && role){\n let projet1=response.result.parameters.projet1;\n let projet2=response.result.parameters.projet2;\n let projet3=response.result.parameters.projet3;\n let prenom=response.result.parameters.prenom1;\n let nom=response.result.parameters.nom1;\n let fonction1 = response.result.parameters.fonction1;\n let fonction2 = response.result.parameters.fonction2;\n let fonction3 = response.result.parameters.fonction3;\n if (projet2 === \"\" && projet3 === \"\") {\n projet = projet1;\n } else if (projet3 === \"\") {\n projet = projet1 + \" \" + projet2;\n } else {\n projet = projet1 + \" \" + projet2 + \" \" + projet3;\n }\n if (fonction2 === \"\" && fonction3 === \"\") {\n fonction = fonction1;\n } else if (fonction3 === \"\") {\n fonction = fonction1 + \" \" + fonction2;\n } else {\n fonction = fonction1 + \" \" + fonction2 + \" \" + fonction3;\n }\n personne=prenom+\" \"+nom;\n personne=personne.toLowerCase();\n projet=projet.toLowerCase();\n fonction=fonction.toLowerCase();\n if (fonction===\"\" && personne===\" \"){\n db.any(`DELETE FROM projet WHERE projet='${projet}'`)\n .then(data=>{\n this.doRichContentResponse(session,responseText);\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n } else if (fonction===\"\"){\n db.any(`DELETE FROM projet WHERE projet='${projet}' AND personne='${personne}'`)\n .then(data=>{\n this.doRichContentResponse(session,responseText);\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n } else {\n db.any(`DELETE FROM projet WHERE projet='${projet}' AND fonction='${fonction}' AND personne='${personne}'`)\n .then(data=>{\n this.doRichContentResponse(session,responseText);\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n })\n }\n }\n //Si je suis pas un admin\n else if (intentName==='delete' && !role){\n this.doRichContentResponse(session,config.messageAccess);\n }\n //Demande une documentation\n else if (intentName==='documentation'){\n doc=response.result.parameters.doc1;\n doc=doc.toLowerCase();\n db.any(`SELECT chemin FROM doc WHERE nom='${doc}'`)\n .then(data=>{\n for (var i in data){\n text=text+data[i].chemin;\n }\n if(text===''){\n this.doRichContentResponse(session,config.messageError);\n }else{\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n })\n }\n //Demande les referents sur un sujet\n else if(intentName==='referents'){\n sujet=response.result.parameters.sujet1;\n sujet=sujet.toLowerCase();\n db.any(`SELECT contact FROM referents WHERE sujet='${sujet}'`)\n .then(data=>{\n for(var i in data){\n text=text+data[i].contact;\n }\n if(text===''){\n this.doRichContentResponse(session,config.messageError);\n }else{\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n })\n }\n //Si api.ai a compris la demande\n else if (SkypeBot.isDefined(responseText)) {\n this.doRichContentResponse(session,responseText);\n } else {\n console.log(sender, 'Recevoir message vide');\n }\n } else {\n console.log(sender, 'Recevoir resulta vide');\n }\n\n })\n .catch(error =>{\n console.log('ERROR1:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n\n\n });\n\n apiaiRequest.on('error', (error) => {\n console.error(sender, 'Error quand essayer de connecter avec api.ai', error);\n });\n\n apiaiRequest.end();\n } else {\n console.log('Message vide');\n }\n }", "function criarAluno() {\n inputAluno();\n console.log('CREATE aluno!! \\n');\n}" ]
[ "0.60534275", "0.58435017", "0.5732763", "0.57257634", "0.5681522", "0.56619763", "0.5659426", "0.5646196", "0.56385493", "0.5631666", "0.5605583", "0.55857545", "0.55813664", "0.5574059", "0.55618525", "0.5542288", "0.55407715", "0.5535551", "0.552066", "0.55182624", "0.5508079", "0.5483068", "0.5482821", "0.54812664", "0.54752374", "0.5473117", "0.5473117", "0.5462112", "0.5459003", "0.5451024", "0.54489017", "0.54408777", "0.54396725", "0.5436393", "0.5434221", "0.5426094", "0.5424477", "0.54166967", "0.5411877", "0.54101783", "0.54011804", "0.53921217", "0.53915316", "0.5388869", "0.5385055", "0.5380502", "0.5374502", "0.5372397", "0.53684396", "0.53654563", "0.53638154", "0.5357804", "0.5357589", "0.5338648", "0.5337478", "0.533423", "0.53247607", "0.53156865", "0.5309908", "0.53098047", "0.5304839", "0.529852", "0.5294524", "0.52913254", "0.5285944", "0.5284145", "0.52768445", "0.52700216", "0.5267638", "0.52674705", "0.526327", "0.52616084", "0.52578026", "0.5253688", "0.5238954", "0.5238074", "0.52353686", "0.5233343", "0.52331054", "0.52278644", "0.5221246", "0.5218148", "0.521309", "0.5212059", "0.52119625", "0.52101076", "0.5208683", "0.52063495", "0.52049285", "0.519213", "0.5189461", "0.51890814", "0.51839054", "0.5182361", "0.51755", "0.5175104", "0.5169467", "0.51660484", "0.51658756", "0.5163493", "0.51629573" ]
0.0
-1
Remove HTML tags from string.
function stripHtmlTags(str) { str = toString_1["default"](str); return str.replace(/<[^>]*>/g, ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripHtmlTags(str){\n\t str = toString(str);\n\n\t return str.replace(/<[^>]*>/g, '');\n\t }", "function cleanHtml(string){\n var regex = /(<([^>]+)>)/ig;\n \n return string.replace(regex, \"\")\n}", "function htmlStrip(string) {\n\n var output = string.replace(/<(.*?)>/g, '');\n return output;\n\n}", "function rmHtmlTags(str){\n if(typeof str !== 'string'){\n throw new Error(\"parameter should be a string\");\n }\n let regex= /<[a-zA-Z/]*>/g;\n return str.replace(regex, \"\");\n \n \n}", "function strip_HTML(str) {\n var findHtml = /<(.|\\n)*?>/gi;\n return str.replace(findHtml,\"\");\n}", "function stripTags(s) {return s.replace(/<\\/?[^>]+>/gi, '');}", "function removeHtmlTag(text) {\n\tlet TagRegExp = /<[^<>]+\\/?>/g;\n\treturn text.replace(TagRegExp, '');\n}", "function removeTags(html) {\n var text = html.replace(/<[^>]*>/g, '\\n');\n text = text.replace(/^\\s*[\\r\\n]/gm,\"\");\n return text;\n}", "function strip_tags(str) {\n //remove HTML tags\n str = str.replace(/<\\/?[^>]+(>|$)/g, \"\");\n\n //remove tab, new line, return\n str = str.replace(/(\\t|\\n|\\r)/gm, \"\");\n\n //remove empty spaces from start and end of text\n str = str.trim();\n\n return str;\n}", "function stripTags(aString)\n{\n return aString.replace(/<[^>]*>/g, \"\");\n}", "function stripTags(srcString)\r\n{\r\n return decodeHTML(srcString).replace(new RegExp(\"> <\", \"g\"), \"><\")\r\n .replace(new RegExp(\"><\", \"g\"), \">\\r\\n<\")\r\n .replace(new RegExp(\"(^<[\\\\s\\\\S]+?>)\", \"gm\"), \"\")\r\n .replace(new RegExp(\"\\r\", \"g\"), \"\")\r\n .replace(new RegExp(\"\\n{2,}\", \"g\"), \"\\n\\n\")\r\n .replace(new RegExp(\"</pre>\", \"g\"), \"\")\r\n .replace(new RegExp(\"</h3>\", \"g\"), \"\")\r\n .replace(new RegExp(\"</font>\", \"g\"), \"\");\r\n}", "function stripHtml(str) {\n if (str === null || str === \"\") return false;\n else str = str.toString();\n return str.replace(/<[^>]*>/g, \"\");\n }", "function strip_tags(aString)\n{\n\treturn aString.replace(/<[^>]*>/g,\"\");\n}", "function untag( s) {\r\n return s.replace( /<(..*?)>/g, '');\r\n}", "function striptags(html) { // quick and dirty, don't reuse (\"Lame\" according to TJ)\n return String(html).replace(/<\\/?([^>]+)>/g, '');\n}", "function stripTags(text) {\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\n}", "function stripHTML(){\n\tvar re = /<\\S[^><]*>/g;\n\treturn arguments[0].replace(re, \"\");\n}", "function cut_out_tags(value) {\n return value.replace(/<.+>/g, \"\");\n}", "function removeTags(text) {\n\t//return text ? text.replace(tagsRegex, \"\") : text;\n\treturn text ? text.replace(/<p>/, \"\").replace(/<\\p>/, \"\") : text;\n}", "function strip(html)\n {\n html = html.replace(/<b>/g, \"\");\n html = html.replace(/<\\/b>/g, \"\");\n html = html.replace(/<(?:.|\\n)*?>/gm, \"\");\n return html;\n }", "function stripHtml(str, originalOpts) {\n // const\n // ===========================================================================\n const start = Date.now();\n const definitelyTagNames = new Set([\"!doctype\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"base\", \"bdi\", \"bdo\", \"blockquote\", \"body\", \"br\", \"button\", \"canvas\", \"caption\", \"cite\", \"code\", \"col\", \"colgroup\", \"data\", \"datalist\", \"dd\", \"del\", \"details\", \"dfn\", \"dialog\", \"div\", \"dl\", \"doctype\", \"dt\", \"em\", \"embed\", \"fieldset\", \"figcaption\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"head\", \"header\", \"hgroup\", \"hr\", \"html\", \"iframe\", \"img\", \"input\", \"ins\", \"kbd\", \"keygen\", \"label\", \"legend\", \"li\", \"link\", \"main\", \"map\", \"mark\", \"math\", \"menu\", \"menuitem\", \"meta\", \"meter\", \"nav\", \"noscript\", \"object\", \"ol\", \"optgroup\", \"option\", \"output\", \"param\", \"picture\", \"pre\", \"progress\", \"rb\", \"rp\", \"rt\", \"rtc\", \"ruby\", \"samp\", \"script\", \"section\", \"select\", \"slot\", \"small\", \"source\", \"span\", \"strong\", \"style\", \"sub\", \"summary\", \"sup\", \"svg\", \"table\", \"tbody\", \"td\", \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"time\", \"title\", \"tr\", \"track\", \"ul\", \"var\", \"video\", \"wbr\", \"xml\"]);\n const singleLetterTags = new Set([\"a\", \"b\", \"i\", \"p\", \"q\", \"s\", \"u\"]);\n const punctuation = new Set([\".\", \",\", \"?\", \";\", \")\", \"\\u2026\", '\"', \"\\u00BB\"]); // \\u00BB is &raquo; - guillemet - right angled quote\n // \\u2026 is &hellip; - ellipsis\n // we'll gather opening tags from ranged-pairs here:\n\n const rangedOpeningTags = []; // we'll put tag locations here\n\n const allTagLocations = [];\n let filteredTagLocations = []; // variables\n // ===========================================================================\n // records the info about the suspected tag:\n\n let tag = {};\n\n function resetTag() {\n tag = {\n attributes: []\n };\n }\n\n resetTag(); // records the beginning of the current whitespace chunk:\n\n let chunkOfWhitespaceStartsAt = null; // records the beginning of the current chunk of spaces (strictly spaces-only):\n\n let chunkOfSpacesStartsAt = null; // temporary variable to assemble the attribute pieces:\n\n let attrObj = {}; // marker to store captured href, used in opts.dumpLinkHrefsNearby.enabled\n\n let hrefDump = {\n tagName: \"\",\n hrefValue: \"\",\n openingTagEnds: undefined\n }; // used to insert extra things when pushing into ranges array\n\n let stringToInsertAfter = \"\"; // state flag\n\n let hrefInsertionActive = false; // marker to keep a note where does the whitespace chunk that follows closing bracket end.\n // It's necessary for opts.trimOnlySpaces when there's closing bracket, whitespace, non-space\n // whitespace character (\"\\n\", \"\\t\" etc), whitspace, end-of-file. Trim will kick in and will\n // try to trim up until the EOF, be we'll have to pull the end of trim back, back to the first\n // character of aforementioned non-space whitespace character sequence.\n // This variable will tell exactly where it is located.\n\n let spacesChunkWhichFollowsTheClosingBracketEndsAt = null; // functions\n // ===========================================================================\n\n function existy(x) {\n return x != null;\n }\n\n function isStr(something) {\n return typeof something === \"string\";\n }\n\n function treatRangedTags(i, opts, rangesToDelete) {\n\n if (Array.isArray(opts.stripTogetherWithTheirContents) && (opts.stripTogetherWithTheirContents.includes(tag.name) || opts.stripTogetherWithTheirContents.includes(\"*\"))) {\n // it depends, is it opening or closing range tag:\n // We could try to distinguish opening from closing tags by presence of\n // slash, but that would be a liability for dirty code cases where clash\n // is missing. Better, instead, just see if an entry for that tag name\n // already exists in the rangesToDelete[].\n\n if (Array.isArray(rangedOpeningTags) && rangedOpeningTags.some(obj => obj.name === tag.name && obj.lastClosingBracketAt < i)) {\n // if (tag.slashPresent) { // closing tag.\n // filter and remove the found tag\n\n for (let y = rangedOpeningTags.length; y--;) {\n if (rangedOpeningTags[y].name === tag.name) {\n // we'll remove from opening tag's opening bracket to closing tag's\n // closing bracket because whitespace will be taken care of separately,\n // when tags themselves will be removed.\n // Basically, for each range tag there will be 3 removals:\n // opening tag, closing tag and all from opening to closing tag.\n // We keep removing opening and closing tags along whole range\n // because of few reasons: 1. cases of broken/dirty code, 2. keeping\n // the algorithm simpler, 3. opts that control whitespace removal\n // around tags.\n // 1. add range without caring about surrounding whitespace around\n // the range // also, tend filteredTagLocations in the output - tags which are to be\n // deleted with contents should be reported as one large range in\n // filteredTagLocations - from opening to closing - not two ranges\n /* istanbul ignore else */\n\n if (opts.stripTogetherWithTheirContents.includes(tag.name) || opts.stripTogetherWithTheirContents.includes(\"*\")) {\n filteredTagLocations = filteredTagLocations.filter(([from, upto]) => (from < rangedOpeningTags[y].lastOpeningBracketAt || from >= i + 1) && (upto <= rangedOpeningTags[y].lastOpeningBracketAt || upto > i + 1));\n }\n\n let endingIdx = i + 1;\n\n if (tag.lastClosingBracketAt) {\n endingIdx = tag.lastClosingBracketAt + 1;\n }\n filteredTagLocations.push([rangedOpeningTags[y].lastOpeningBracketAt, endingIdx]);\n /* istanbul ignore else */\n\n if (punctuation.has(str[i]) && opts.cb) {\n opts.cb({\n tag: tag,\n deleteFrom: rangedOpeningTags[y].lastOpeningBracketAt,\n deleteTo: i + 1,\n insert: null,\n rangesArr: rangesToDelete,\n proposedReturn: [rangedOpeningTags[y].lastOpeningBracketAt, i, null]\n }); // null will remove any spaces added so far. Opening and closing range tags might\n // have received spaces as separate entities, but those might not be necessary for range:\n // \"text <script>deleteme</script>.\"\n } else if (opts.cb) {\n opts.cb({\n tag: tag,\n deleteFrom: rangedOpeningTags[y].lastOpeningBracketAt,\n deleteTo: i,\n insert: \"\",\n rangesArr: rangesToDelete,\n proposedReturn: [rangedOpeningTags[y].lastOpeningBracketAt, i, \"\"]\n });\n } // 2. delete the reference to this range from rangedOpeningTags[]\n // because there might be more ranged tags of the same name or\n // different, overlapping or encompassing ranged tags with same\n // or different name.\n\n\n rangedOpeningTags.splice(y, 1); // 3. stop the loop\n\n break;\n }\n }\n } else {\n // opening tag.\n rangedOpeningTags.push(tag);\n }\n }\n }\n\n function calculateWhitespaceToInsert(str2, // whole string\n currCharIdx, // current index\n fromIdx, // leftmost whitespace edge around tag\n toIdx, // rightmost whitespace edge around tag\n lastOpeningBracketAt, // tag actually starts here (<)\n lastClosingBracketAt // tag actually ends here (>)\n ) {\n let strToEvaluateForLineBreaks = \"\";\n\n if (Number.isInteger(fromIdx) && fromIdx < lastOpeningBracketAt) {\n strToEvaluateForLineBreaks += str2.slice(fromIdx, lastOpeningBracketAt);\n }\n\n if (Number.isInteger(toIdx) && toIdx > lastClosingBracketAt + 1) {\n // limit whitespace that follows the tag, stop at linebreak. That's to make\n // the algorithm composable - we include linebreaks in front but not after.\n const temp = str2.slice(lastClosingBracketAt + 1, toIdx);\n\n if (temp.includes(\"\\n\") && isOpeningAt(toIdx, str2)) {\n strToEvaluateForLineBreaks += \" \";\n } else {\n strToEvaluateForLineBreaks += temp;\n }\n }\n\n if (!punctuation.has(str2[currCharIdx]) && str2[currCharIdx] !== \"!\") {\n const foundLineBreaks = strToEvaluateForLineBreaks.match(/\\n/g);\n\n if (Array.isArray(foundLineBreaks) && foundLineBreaks.length) {\n if (foundLineBreaks.length === 1) {\n return \"\\n\";\n }\n\n if (foundLineBreaks.length === 2) {\n return \"\\n\\n\";\n } // return three line breaks maximum\n\n\n return \"\\n\\n\\n\";\n } // default spacer - a single space\n\n\n return \" \";\n } // default case: space\n\n\n return \"\";\n }\n\n function calculateHrefToBeInserted(opts) {\n if (opts.dumpLinkHrefsNearby.enabled && hrefDump.tagName && hrefDump.tagName === tag.name && tag.lastOpeningBracketAt && (hrefDump.openingTagEnds && tag.lastOpeningBracketAt > hrefDump.openingTagEnds || !hrefDump.openingTagEnds)) {\n hrefInsertionActive = true;\n }\n\n if (hrefInsertionActive) {\n const lineBreaks = opts.dumpLinkHrefsNearby.putOnNewLine ? \"\\n\\n\" : \"\";\n stringToInsertAfter = `${lineBreaks}${hrefDump.hrefValue}${lineBreaks}`;\n }\n }\n\n function isOpeningAt(i, customStr) {\n if (customStr) {\n return customStr[i] === \"<\" && customStr[i + 1] !== \"%\";\n }\n\n return str[i] === \"<\" && str[i + 1] !== \"%\";\n }\n\n function isClosingAt(i) {\n return str[i] === \">\" && str[i - 1] !== \"%\";\n } // validation\n // ===========================================================================\n\n\n if (typeof str !== \"string\") {\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_01] Input must be string! Currently it's: ${(typeof str).toLowerCase()}, equal to:\\n${JSON.stringify(str, null, 4)}`);\n }\n\n if (originalOpts && !isObj(originalOpts)) {\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_02] Optional Options Object must be a plain object! Currently it's: ${(typeof originalOpts).toLowerCase()}, equal to:\\n${JSON.stringify(originalOpts, null, 4)}`);\n } // eslint-disable-next-line consistent-return\n\n\n function resetHrefMarkers() {\n // reset the hrefDump\n if (hrefInsertionActive) {\n hrefDump = {\n tagName: \"\",\n hrefValue: \"\",\n openingTagEnds: undefined\n };\n hrefInsertionActive = false;\n }\n } // prep opts\n // ===========================================================================\n\n\n const opts = { ...defaults,\n ...originalOpts\n };\n\n if (Object.prototype.hasOwnProperty.call(opts, \"returnRangesOnly\")) {\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_03] opts.returnRangesOnly has been removed from the API since v.5 release.`);\n } // filter non-string or whitespace entries from the following arrays or turn\n // them into arrays:\n\n\n opts.ignoreTags = prepHopefullyAnArray(opts.ignoreTags, \"opts.ignoreTags\");\n opts.onlyStripTags = prepHopefullyAnArray(opts.onlyStripTags, \"opts.onlyStripTags\"); // let's define the onlyStripTagsMode. Since opts.onlyStripTags can cancel\n // out the entries in opts.onlyStripTags, it can be empty but this mode has\n // to be switched on:\n\n const onlyStripTagsMode = !!opts.onlyStripTags.length; // if both opts.onlyStripTags and opts.ignoreTags are set, latter is respected,\n // we simply exclude ignored tags from the opts.onlyStripTags.\n\n if (opts.onlyStripTags.length && opts.ignoreTags.length) {\n opts.onlyStripTags = without(opts.onlyStripTags, ...opts.ignoreTags);\n }\n\n if (!isObj(opts.dumpLinkHrefsNearby)) {\n opts.dumpLinkHrefsNearby = { ...defaults.dumpLinkHrefsNearby\n };\n } // Object.assign doesn't deep merge, so we take care of opts.dumpLinkHrefsNearby:\n\n\n opts.dumpLinkHrefsNearby = defaults.dumpLinkHrefsNearby;\n\n if (originalOpts && Object.prototype.hasOwnProperty.call(originalOpts, \"dumpLinkHrefsNearby\") && existy(originalOpts.dumpLinkHrefsNearby)) {\n /* istanbul ignore else */\n if (isObj(originalOpts.dumpLinkHrefsNearby)) {\n opts.dumpLinkHrefsNearby = { ...defaults.dumpLinkHrefsNearby,\n ...originalOpts.dumpLinkHrefsNearby\n };\n } else if (originalOpts.dumpLinkHrefsNearby) {\n // checking to omit value as number zero\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_04] Optional Options Object's key dumpLinkHrefsNearby was set to ${typeof originalOpts.dumpLinkHrefsNearby}, equal to ${JSON.stringify(originalOpts.dumpLinkHrefsNearby, null, 4)}. The only allowed value is a plain object. See the API reference.`);\n }\n }\n\n if (!opts.stripTogetherWithTheirContents) {\n opts.stripTogetherWithTheirContents = [];\n } else if (typeof opts.stripTogetherWithTheirContents === \"string\" && opts.stripTogetherWithTheirContents.length) {\n opts.stripTogetherWithTheirContents = [opts.stripTogetherWithTheirContents];\n }\n\n const somethingCaught = {};\n\n if (opts.stripTogetherWithTheirContents && Array.isArray(opts.stripTogetherWithTheirContents) && opts.stripTogetherWithTheirContents.length && !opts.stripTogetherWithTheirContents.every((el, i) => {\n if (!(typeof el === \"string\")) {\n somethingCaught.el = el;\n somethingCaught.i = i;\n return false;\n }\n\n return true;\n })) {\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_05] Optional Options Object's key stripTogetherWithTheirContents was set to contain not just string elements! For example, element at index ${somethingCaught.i} has a value ${somethingCaught.el} which is not string but ${(typeof somethingCaught.el).toLowerCase()}.`);\n } // prep the opts.cb\n\n if (!opts.cb) {\n opts.cb = ({\n rangesArr,\n proposedReturn\n }) => {\n if (proposedReturn) {\n rangesArr.push(...proposedReturn);\n }\n };\n } // if the links have to be on a new line, we need to increase the allowance for line breaks\n // in Ranges class, it's the ranges-push API setting opts.limitLinebreaksCount\n // see https://www.npmjs.com/package/ranges-push#optional-options-object\n\n const rangesToDelete = new Ranges({\n limitToBeAddedWhitespace: true,\n limitLinebreaksCount: 2\n }); // TODO: it's chummy - ranges will be unreliable if initial str has changed\n // use ranges-ent-decode\n\n if (!opts.skipHtmlDecoding) {\n while (str !== decode(str, {\n scope: \"strict\"\n })) {\n // eslint-disable-next-line no-param-reassign\n str = decode(str, {\n scope: \"strict\"\n });\n }\n } // step 1.\n // ===========================================================================\n\n\n for (let i = 0, len = str.length; i < len; i++) { // catch the first ending of the spaces chunk that follows the closing bracket.\n // -------------------------------------------------------------------------\n // There can be no space after bracket, in that case, the result will be that character that\n // follows the closing bracket.\n // There can be bunch of spaces that end with EOF. In that case it's fine, this variable will\n // be null.\n\n if (Object.keys(tag).length > 1 && tag.lastClosingBracketAt && tag.lastClosingBracketAt < i && str[i] !== \" \" && spacesChunkWhichFollowsTheClosingBracketEndsAt === null) {\n spacesChunkWhichFollowsTheClosingBracketEndsAt = i;\n } // catch the closing bracket of dirty tags with missing opening brackets\n // -------------------------------------------------------------------------\n\n\n if (isClosingAt(i)) { // tend cases where opening bracket of a tag is missing:\n\n if ((!tag || Object.keys(tag).length < 2) && i > 1) { // traverse backwards either until start of string or \">\" is found\n\n for (let y = i; y--;) {\n\n if (str[y - 1] === undefined || isClosingAt(y)) {\n const startingPoint = str[y - 1] === undefined ? y : y + 1;\n const culprit = str.slice(startingPoint, i + 1); // Check if the culprit starts with a tag that's more likely a tag\n // name (like \"body\" or \"article\"). Single-letter tag names are excluded\n // because they can be plausible, ie. in math texts and so on.\n // Nobody uses puts comparison signs between words like: \"article > \",\n // but single letter names can be plausible: \"a > b\" in math.\n\n if (str !== `<${trim(culprit.trim(), \"/>\")}>` && // recursion prevention\n [...definitelyTagNames].some(val => trim(culprit.trim().split(/\\s+/).filter(val2 => val2.trim()).filter((_val3, i3) => i3 === 0), \"/>\").toLowerCase() === val) && stripHtml(`<${culprit.trim()}>`, opts).result === \"\") {\n /* istanbul ignore else */\n if (!allTagLocations.length || allTagLocations[allTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n allTagLocations.push([startingPoint, i + 1]);\n }\n /* istanbul ignore else */\n\n\n if (!filteredTagLocations.length || filteredTagLocations[filteredTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n filteredTagLocations.push([startingPoint, i + 1]);\n }\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, startingPoint, i + 1, startingPoint, i + 1);\n let deleteUpTo = i + 1;\n\n if (str[deleteUpTo] && !str[deleteUpTo].trim()) {\n for (let z = deleteUpTo; z < len; z++) {\n if (str[z].trim()) {\n deleteUpTo = z;\n break;\n }\n }\n }\n opts.cb({\n tag: tag,\n deleteFrom: startingPoint,\n deleteTo: deleteUpTo,\n insert: whiteSpaceCompensation,\n rangesArr: rangesToDelete,\n proposedReturn: [startingPoint, deleteUpTo, whiteSpaceCompensation]\n });\n }\n\n break;\n }\n }\n }\n } // catch slash\n // -------------------------------------------------------------------------\n\n\n if (str[i] === \"/\" && !(tag.quotes && tag.quotes.value) && Number.isInteger(tag.lastOpeningBracketAt) && !Number.isInteger(tag.lastClosingBracketAt)) {\n tag.slashPresent = i;\n } // catch double or single quotes\n // -------------------------------------------------------------------------\n\n\n if (str[i] === '\"' || str[i] === \"'\") {\n if (tag.nameStarts && tag.quotes && tag.quotes.value && tag.quotes.value === str[i]) {\n // 1. finish assembling the \"attrObj{}\"\n attrObj.valueEnds = i;\n attrObj.value = str.slice(attrObj.valueStarts, i);\n tag.attributes.push(attrObj); // reset:\n\n attrObj = {}; // 2. finally, delete the quotes marker, we don't need it any more\n\n tag.quotes = undefined; // 3. if opts.dumpLinkHrefsNearby.enabled is on, catch href\n\n let hrefVal;\n\n if (opts.dumpLinkHrefsNearby.enabled && // eslint-disable-next-line\n tag.attributes.some(obj => {\n if (obj.name && obj.name.toLowerCase() === \"href\") {\n hrefVal = `${opts.dumpLinkHrefsNearby.wrapHeads || \"\"}${obj.value}${opts.dumpLinkHrefsNearby.wrapTails || \"\"}`;\n return true;\n }\n })) {\n hrefDump = {\n tagName: tag.name,\n hrefValue: hrefVal,\n openingTagEnds: undefined\n };\n }\n } else if (!tag.quotes && tag.nameStarts) {\n // 1. if it's opening marker, record the type and location of quotes\n tag.quotes = {};\n tag.quotes.value = str[i];\n tag.quotes.start = i; // 2. start assembling the attribute object which we'll dump into tag.attributes[] array:\n\n if (attrObj.nameStarts && attrObj.nameEnds && attrObj.nameEnds < i && attrObj.nameStarts < i && !attrObj.valueStarts) {\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds);\n }\n }\n } // catch the ending of the tag name:\n // -------------------------------------------------------------------------\n\n\n if (tag.nameStarts !== undefined && tag.nameEnds === undefined && (!str[i].trim() || !characterSuitableForNames(str[i]))) {\n // 1. mark the name ending\n tag.nameEnds = i; // 2. extract the full name string\n\n tag.name = str.slice(tag.nameStarts, tag.nameEnds + (\n /* istanbul ignore next */\n !isClosingAt(i) && str[i] !== \"/\" && str[i + 1] === undefined ? 1 : 0));\n\n if ( // if we caught \"----\" from \"<----\" or \"---->\", bail:\n str[tag.nameStarts - 1] !== \"!\" && // protection against <!--\n !tag.name.replace(/-/g, \"\").length || // if tag name starts with a number character\n /^\\d+$/.test(tag.name[0])) {\n tag = {};\n continue;\n }\n\n if (isOpeningAt(i)) {\n // process it because we need to tackle this new tag\n calculateHrefToBeInserted(opts); // calculateWhitespaceToInsert() API:\n // str, // whole string\n // currCharIdx, // current index\n // fromIdx, // leftmost whitespace edge around tag\n // toIdx, // rightmost whitespace edge around tag\n // lastOpeningBracketAt, // tag actually starts here (<)\n // lastClosingBracketAt // tag actually ends here (>)\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, tag.leftOuterWhitespace, i, tag.lastOpeningBracketAt, i); // only on pair tags, exclude the opening counterpart and closing\n // counterpart if whole pair is to be deleted\n\n if (opts.stripTogetherWithTheirContents.includes(tag.name) || opts.stripTogetherWithTheirContents.includes(\"*\")) {\n /* istanbul ignore next */\n\n filteredTagLocations = filteredTagLocations.filter(([from, upto]) => !(from === tag.leftOuterWhitespace && upto === i));\n } // console.log(\n // `1011 ${`\\u001b[${32}m${`PUSH`}\\u001b[${39}m`} [${\n // tag.leftOuterWhitespace\n // }, ${i}] to filteredTagLocations`\n // );\n // filteredTagLocations.push([tag.leftOuterWhitespace, i]);\n\n\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: i,\n insert: `${whiteSpaceCompensation}${stringToInsertAfter}${whiteSpaceCompensation}`,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, i, `${whiteSpaceCompensation}${stringToInsertAfter}${whiteSpaceCompensation}`]\n });\n resetHrefMarkers(); // also,\n\n treatRangedTags(i, opts, rangesToDelete);\n }\n } // catch beginning of an attribute value\n // -------------------------------------------------------------------------\n\n\n if (tag.quotes && tag.quotes.start && tag.quotes.start < i && !tag.quotes.end && attrObj.nameEnds && attrObj.equalsAt && !attrObj.valueStarts) {\n attrObj.valueStarts = i;\n } // catch rare cases when attributes name has some space after it, before equals\n // -------------------------------------------------------------------------\n\n\n if (!tag.quotes && attrObj.nameEnds && str[i] === \"=\" && !attrObj.valueStarts && !attrObj.equalsAt) {\n attrObj.equalsAt = i;\n } // catch the ending of the whole attribute\n // -------------------------------------------------------------------------\n // for example, <a b c> this \"c\" ends \"b\" because it's not \"equals\" sign.\n // We even anticipate for cases where whitespace anywhere between attribute parts:\n // < article class = \" something \" / >\n\n\n if (!tag.quotes && attrObj.nameStarts && attrObj.nameEnds && !attrObj.valueStarts && str[i].trim() && str[i] !== \"=\") {\n // if (!tag.attributes) {\n // tag.attributes = [];\n // }\n tag.attributes.push(attrObj);\n attrObj = {};\n } // catch the ending of an attribute's name\n // -------------------------------------------------------------------------\n\n\n if (!tag.quotes && attrObj.nameStarts && !attrObj.nameEnds) {\n\n if (!str[i].trim()) {\n attrObj.nameEnds = i;\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds);\n } else if (str[i] === \"=\") {\n /* istanbul ignore else */\n\n if (!attrObj.equalsAt) {\n attrObj.nameEnds = i;\n attrObj.equalsAt = i;\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds);\n }\n } else if (str[i] === \"/\" || isClosingAt(i)) {\n attrObj.nameEnds = i;\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds); // if (!tag.attributes) {\n // tag.attributes = [];\n // }\n\n tag.attributes.push(attrObj);\n attrObj = {};\n } else if (isOpeningAt(i)) { // TODO - address both cases of onlyPlausible\n\n attrObj.nameEnds = i;\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds); // if (!tag.attributes) {\n // tag.attributes = [];\n // }\n\n tag.attributes.push(attrObj);\n attrObj = {};\n }\n } // catch the beginning of an attribute's name\n // -------------------------------------------------------------------------\n\n\n if (!tag.quotes && tag.nameEnds < i && !str[i - 1].trim() && str[i].trim() && !`<>/!`.includes(str[i]) && !attrObj.nameStarts && !tag.lastClosingBracketAt) {\n attrObj.nameStarts = i;\n } // catch \"< /\" - turn off \"onlyPlausible\"\n // -------------------------------------------------------------------------\n\n\n if (tag.lastOpeningBracketAt !== null && tag.lastOpeningBracketAt < i && str[i] === \"/\" && tag.onlyPlausible) {\n tag.onlyPlausible = false;\n } // catch character that follows an opening bracket:\n // -------------------------------------------------------------------------\n\n\n if (tag.lastOpeningBracketAt !== null && tag.lastOpeningBracketAt < i && str[i] !== \"/\" // there can be closing slashes in various places, legit and not\n ) {\n // 1. identify, is it definite or just plausible tag\n if (tag.onlyPlausible === undefined) {\n if ((!str[i].trim() || isOpeningAt(i)) && !tag.slashPresent) {\n tag.onlyPlausible = true;\n } else {\n tag.onlyPlausible = false;\n }\n } // 2. catch the beginning of the tag name. Consider custom HTML tag names\n // and also known (X)HTML tags:\n\n\n if (str[i].trim() && tag.nameStarts === undefined && !isOpeningAt(i) && str[i] !== \"/\" && !isClosingAt(i) && str[i] !== \"!\") {\n tag.nameStarts = i;\n tag.nameContainsLetters = false;\n }\n } // Catch letters in the tag name. Necessary to filter out false positives like \"<------\"\n\n\n if (tag.nameStarts && !tag.quotes && str[i].toLowerCase() !== str[i].toUpperCase()) {\n tag.nameContainsLetters = true;\n } // catch closing bracket\n // -------------------------------------------------------------------------\n\n\n if ( // it's closing bracket\n isClosingAt(i) && //\n // precaution against JSP comparison\n // kl <c:when test=\"${!empty ab.cd && ab.cd > 0.00}\"> mn\n // ^\n // we're here, it's false ending\n //\n notWithinAttrQuotes(tag, str, i)) {\n\n if (tag.lastOpeningBracketAt !== undefined) {\n // 1. mark the index\n tag.lastClosingBracketAt = i; // 2. reset the spacesChunkWhichFollowsTheClosingBracketEndsAt\n\n spacesChunkWhichFollowsTheClosingBracketEndsAt = null; // 3. push attrObj into tag.attributes[]\n\n if (Object.keys(attrObj).length) { // if (!tag.attributes) {\n // tag.attributes = [];\n // }\n\n tag.attributes.push(attrObj);\n attrObj = {};\n } // 4. if opts.dumpLinkHrefsNearby.enabled is on and we just recorded an href,\n\n\n if (opts.dumpLinkHrefsNearby.enabled && hrefDump.tagName && !hrefDump.openingTagEnds) {\n // finish assembling the hrefDump{}\n hrefDump.openingTagEnds = i; // or tag.lastClosingBracketAt, same\n }\n }\n } // catch the ending of the tag\n // -------------------------------------------------------------------------\n // the tag is \"released\" into \"rApply\":\n\n\n if (tag.lastOpeningBracketAt !== undefined) {\n\n if (tag.lastClosingBracketAt === undefined) {\n\n if (tag.lastOpeningBracketAt < i && !isOpeningAt(i) && ( // to prevent cases like \"text <<<<<< text\"\n str[i + 1] === undefined || isOpeningAt(i + 1)) && tag.nameContainsLetters) { // find out the tag name earlier than dedicated tag name ending catching section:\n // if (str[i + 1] === undefined) {\n\n tag.name = str.slice(tag.nameStarts, tag.nameEnds ? tag.nameEnds : i + 1).toLowerCase(); // submit tag to allTagLocations\n\n /* istanbul ignore else */\n\n if (!allTagLocations.length || allTagLocations[allTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n allTagLocations.push([tag.lastOpeningBracketAt, i + 1]);\n }\n\n if ( // if it's an ignored tag\n opts.ignoreTags.includes(tag.name) || // or just plausible and unrecognised\n tag.onlyPlausible && !definitelyTagNames.has(tag.name)) {\n tag = {};\n attrObj = {};\n continue;\n } // if the tag is only plausible (there's space after opening bracket) and it's not among\n // recognised tags, leave it as it is:\n\n if ((definitelyTagNames.has(tag.name) || singleLetterTags.has(tag.name)) && (tag.onlyPlausible === false || tag.onlyPlausible === true && tag.attributes.length) || str[i + 1] === undefined) {\n calculateHrefToBeInserted(opts);\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, tag.leftOuterWhitespace, i + 1, tag.lastOpeningBracketAt, tag.lastClosingBracketAt);\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: i + 1,\n insert: `${whiteSpaceCompensation}${stringToInsertAfter}${whiteSpaceCompensation}`,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, i + 1, `${whiteSpaceCompensation}${stringToInsertAfter}${whiteSpaceCompensation}`]\n });\n resetHrefMarkers(); // also,\n\n treatRangedTags(i, opts, rangesToDelete);\n }\n /* istanbul ignore else */\n\n if (!filteredTagLocations.length || filteredTagLocations[filteredTagLocations.length - 1][0] !== tag.lastOpeningBracketAt && filteredTagLocations[filteredTagLocations.length - 1][1] !== i + 1) { // filter out opening/closing tag pair because whole chunk\n // from opening's opening to closing's closing will be pushed\n\n if (opts.stripTogetherWithTheirContents.includes(tag.name) || opts.stripTogetherWithTheirContents.includes(\"*\")) { // get the last opening counterpart of the pair\n // iterate rangedOpeningTags from the, pick the first\n // ranged opening tag whose name is same like current, closing's\n\n let lastRangedOpeningTag;\n\n for (let z = rangedOpeningTags.length; z--;) {\n /* istanbul ignore else */\n if (rangedOpeningTags[z].name === tag.name) {\n lastRangedOpeningTag = rangedOpeningTags[z];\n }\n }\n /* istanbul ignore else */\n\n\n if (lastRangedOpeningTag) {\n filteredTagLocations = filteredTagLocations.filter(([from]) => from !== lastRangedOpeningTag.lastOpeningBracketAt);\n filteredTagLocations.push([lastRangedOpeningTag.lastOpeningBracketAt, i + 1]);\n } else {\n /* istanbul ignore next */\n filteredTagLocations.push([tag.lastOpeningBracketAt, i + 1]);\n }\n } else {\n // if it's not ranged tag, just push it as it is to filteredTagLocations\n filteredTagLocations.push([tag.lastOpeningBracketAt, i + 1]);\n }\n }\n }\n } else if (i > tag.lastClosingBracketAt && str[i].trim() || str[i + 1] === undefined) { // case 2. closing bracket HAS BEEN met\n // we'll look for a non-whitespace character and delete up to it\n // BUT, we'll wipe the tag object only if that non-whitespace character\n // is not a \">\". This way we'll catch and delete sequences of closing brackets.\n // part 1.\n\n let endingRangeIndex = tag.lastClosingBracketAt === i ? i + 1 : i;\n\n if (opts.trimOnlySpaces && endingRangeIndex === len - 1 && spacesChunkWhichFollowsTheClosingBracketEndsAt !== null && spacesChunkWhichFollowsTheClosingBracketEndsAt < i) {\n endingRangeIndex = spacesChunkWhichFollowsTheClosingBracketEndsAt;\n } // if it's a dodgy suspicious tag where space follows opening bracket, there's an extra requirement\n // for this tag to be considered a tag - there has to be at least one attribute with equals if\n // the tag name is not recognised. // submit tag to allTagLocations\n\n /* istanbul ignore else */\n\n if (!allTagLocations.length || allTagLocations[allTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n allTagLocations.push([tag.lastOpeningBracketAt, tag.lastClosingBracketAt + 1]);\n }\n\n if (!onlyStripTagsMode && opts.ignoreTags.includes(tag.name) || onlyStripTagsMode && !opts.onlyStripTags.includes(tag.name)) {\n // ping the callback with nulls:\n opts.cb({\n tag: tag,\n deleteFrom: null,\n deleteTo: null,\n insert: null,\n rangesArr: rangesToDelete,\n proposedReturn: null\n }); // don't submit the tag onto \"filteredTagLocations\"\n // then reset:\n tag = {};\n attrObj = {}; // continue;\n } else if (!tag.onlyPlausible || // tag name is recognised and there are no attributes:\n tag.attributes.length === 0 && tag.name && (definitelyTagNames.has(tag.name.toLowerCase()) || singleLetterTags.has(tag.name.toLowerCase())) || // OR there is at least one equals that follow the attribute's name:\n tag.attributes && tag.attributes.some(attrObj2 => attrObj2.equalsAt)) {\n // submit tag to filteredTagLocations\n\n /* istanbul ignore else */\n if (!filteredTagLocations.length || filteredTagLocations[filteredTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n filteredTagLocations.push([tag.lastOpeningBracketAt, tag.lastClosingBracketAt + 1]);\n } // if this was an ignored tag name, algorithm would have bailed earlier,\n // in stage \"catch the ending of the tag name\".\n\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, tag.leftOuterWhitespace, endingRangeIndex, tag.lastOpeningBracketAt, tag.lastClosingBracketAt); // calculate optional opts.dumpLinkHrefsNearby.enabled HREF to insert\n\n stringToInsertAfter = \"\";\n hrefInsertionActive = false;\n calculateHrefToBeInserted(opts);\n let insert;\n\n if (isStr(stringToInsertAfter) && stringToInsertAfter.length) {\n insert = `${whiteSpaceCompensation}${stringToInsertAfter}${\n /* istanbul ignore next */\n whiteSpaceCompensation === \"\\n\\n\" ? \"\\n\" : whiteSpaceCompensation}`;\n } else {\n insert = whiteSpaceCompensation;\n }\n\n if (tag.leftOuterWhitespace === 0 || !right(str, endingRangeIndex - 1)) {\n insert = \"\";\n } // pass the range onto the callback function, be it default or user's\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: endingRangeIndex,\n insert,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, endingRangeIndex, insert]\n });\n resetHrefMarkers(); // also,\n\n treatRangedTags(i, opts, rangesToDelete);\n } else {\n tag = {};\n } // part 2.\n\n\n if (!isClosingAt(i)) {\n tag = {};\n }\n }\n } // catch an opening bracket\n // -------------------------------------------------------------------------\n\n\n if (isOpeningAt(i) && !isOpeningAt(i - 1) && !`'\"`.includes(str[i + 1]) && (!`'\"`.includes(str[i + 2]) || /\\w/.test(str[i + 1])) && //\n // precaution JSP,\n // against <c:\n !(str[i + 1] === \"c\" && str[i + 2] === \":\") && // against <fmt:\n !(str[i + 1] === \"f\" && str[i + 2] === \"m\" && str[i + 3] === \"t\" && str[i + 4] === \":\") && // against <sql:\n !(str[i + 1] === \"s\" && str[i + 2] === \"q\" && str[i + 3] === \"l\" && str[i + 4] === \":\") && // against <x:\n !(str[i + 1] === \"x\" && str[i + 2] === \":\") && // against <fn:\n !(str[i + 1] === \"f\" && str[i + 2] === \"n\" && str[i + 3] === \":\") && //\n // kl <c:when test=\"${!empty ab.cd && ab.cd < 0.00}\"> mn\n // ^\n // we're here, it's false alarm\n notWithinAttrQuotes(tag, str, i)) { // cater sequences of opening brackets \"<<<<div>>>\"\n\n if (isClosingAt(right(str, i))) {\n // cater cases like: \"<><><>\"\n continue;\n } else { // 1. Before (re)setting flags, check, do we have a case of a tag with a\n // missing closing bracket, and this is a new tag following it.\n\n if (tag.nameEnds && tag.nameEnds < i && !tag.lastClosingBracketAt) {\n\n if (tag.onlyPlausible === true && tag.attributes && tag.attributes.length || tag.onlyPlausible === false) { // tag.onlyPlausible can be undefined too\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, tag.leftOuterWhitespace, i, tag.lastOpeningBracketAt, i);\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: i,\n insert: whiteSpaceCompensation,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, i, whiteSpaceCompensation]\n }); // also,\n\n treatRangedTags(i, opts, rangesToDelete); // then, for continuity, mark everything up accordingly if it's a new bracket:\n\n tag = {};\n attrObj = {};\n }\n } // 2. if new tag starts, reset:\n\n\n if (tag.lastOpeningBracketAt !== undefined && tag.onlyPlausible && tag.name && !tag.quotes) {\n // reset:\n tag.lastOpeningBracketAt = undefined;\n tag.name = undefined;\n tag.onlyPlausible = false;\n }\n\n if ((tag.lastOpeningBracketAt === undefined || !tag.onlyPlausible) && !tag.quotes) {\n tag.lastOpeningBracketAt = i;\n tag.slashPresent = false;\n tag.attributes = []; // since 2.1.0 we started to care about not trimming outer whitespace which is not spaces.\n // For example, \" \\t <a> \\n \". Tag's whitespace boundaries should not extend to string\n // edges but until \"\\t\" on the left and \"\\n\" on the right IF opts.trimOnlySpaces is on.\n\n if (chunkOfWhitespaceStartsAt === null) {\n tag.leftOuterWhitespace = i;\n } else if (opts.trimOnlySpaces && chunkOfWhitespaceStartsAt === 0) {\n // if whitespace extends to the beginning of a string, there's a risk it might include\n // not only spaces. To fix that, switch to space-only range marker:\n\n /* istanbul ignore next */\n tag.leftOuterWhitespace = chunkOfSpacesStartsAt || i;\n } else {\n tag.leftOuterWhitespace = chunkOfWhitespaceStartsAt;\n } // tag.leftOuterWhitespace =\n // chunkOfWhitespaceStartsAt === null ? i : chunkOfWhitespaceStartsAt; // tend the HTML comments: <!-- --> or CDATA: <![CDATA[ ... ]]>\n // if opening comment tag is detected, traverse forward aggressively\n // until EOL or \"-->\" is reached and offset outer index \"i\".\n\n if (`${str[i + 1]}${str[i + 2]}${str[i + 3]}` === \"!--\" || `${str[i + 1]}${str[i + 2]}${str[i + 3]}${str[i + 4]}${str[i + 5]}${str[i + 6]}${str[i + 7]}${str[i + 8]}` === \"![CDATA[\") { // make a note which one it is:\n\n let cdata = true;\n\n if (str[i + 2] === \"-\") {\n cdata = false;\n }\n let closingFoundAt;\n\n for (let y = i; y < len; y++) {\n\n if (!closingFoundAt && cdata && `${str[y - 2]}${str[y - 1]}${str[y]}` === \"]]>\" || !cdata && `${str[y - 2]}${str[y - 1]}${str[y]}` === \"-->\") {\n closingFoundAt = y;\n }\n\n if (closingFoundAt && (closingFoundAt < y && str[y].trim() || str[y + 1] === undefined)) {\n let rangeEnd = y;\n\n if (str[y + 1] === undefined && !str[y].trim() || str[y] === \">\") {\n rangeEnd += 1;\n } // submit the tag\n\n /* istanbul ignore else */\n\n\n if (!allTagLocations.length || allTagLocations[allTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n allTagLocations.push([tag.lastOpeningBracketAt, closingFoundAt + 1]);\n }\n /* istanbul ignore else */\n\n\n if (!filteredTagLocations.length || filteredTagLocations[filteredTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n filteredTagLocations.push([tag.lastOpeningBracketAt, closingFoundAt + 1]);\n }\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, y, tag.leftOuterWhitespace, rangeEnd, tag.lastOpeningBracketAt, closingFoundAt);\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: rangeEnd,\n insert: whiteSpaceCompensation,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, rangeEnd, whiteSpaceCompensation]\n }); // offset:\n\n i = y - 1;\n\n if (str[y] === \">\") {\n i = y;\n } // resets:\n\n\n tag = {};\n attrObj = {}; // finally,\n\n break;\n }\n }\n }\n }\n }\n } // catch whitespace\n // -------------------------------------------------------------------------\n\n\n if (!str[i].trim()) {\n // 1. catch chunk boundaries:\n if (chunkOfWhitespaceStartsAt === null) {\n chunkOfWhitespaceStartsAt = i;\n\n if (tag.lastOpeningBracketAt !== undefined && tag.lastOpeningBracketAt < i && tag.nameStarts && tag.nameStarts < tag.lastOpeningBracketAt && i === tag.lastOpeningBracketAt + 1 && // insurance against tail part of ranged tag being deleted:\n !rangedOpeningTags.some( // eslint-disable-next-line no-loop-func\n rangedTagObj => rangedTagObj.name === tag.name)) {\n tag.onlyPlausible = true;\n tag.name = undefined;\n tag.nameStarts = undefined;\n }\n }\n } else if (chunkOfWhitespaceStartsAt !== null) { // 1. piggyback the catching of the attributes with equal and no value\n\n if (!tag.quotes && attrObj.equalsAt > chunkOfWhitespaceStartsAt - 1 && attrObj.nameEnds && attrObj.equalsAt > attrObj.nameEnds && str[i] !== '\"' && str[i] !== \"'\") {\n /* istanbul ignore else */\n if (isObj(attrObj)) {\n tag.attributes.push(attrObj);\n } // reset:\n\n\n attrObj = {};\n tag.equalsSpottedAt = undefined;\n } // 2. reset whitespace marker\n\n\n chunkOfWhitespaceStartsAt = null;\n } // catch spaces-only chunks (needed for outer trim option opts.trimOnlySpaces)\n // -------------------------------------------------------------------------\n\n\n if (str[i] === \" \") {\n // 1. catch spaces boundaries:\n if (chunkOfSpacesStartsAt === null) {\n chunkOfSpacesStartsAt = i;\n }\n } else if (chunkOfSpacesStartsAt !== null) {\n // 2. reset the marker\n chunkOfSpacesStartsAt = null;\n } // log all\n // ------------------------------------------------------------------------- // console.log(\n // `${`\\u001b[${33}m${`chunkOfSpacesStartsAt`}\\u001b[${39}m`} = ${JSON.stringify(\n // chunkOfSpacesStartsAt,\n // null,\n // 4\n // )}`\n // ); // console.log(\n // `${`\\u001b[${33}m${`chunkOfWhitespaceStartsAt`}\\u001b[${39}m`} = ${JSON.stringify(\n // chunkOfWhitespaceStartsAt,\n // null,\n // 4\n // )}`\n // );\n } // trim but in ranges\n // first tackle the beginning on the string\n\n if (str && ( // if only spaces were meant to be trimmed,\n opts.trimOnlySpaces && // and first character is a space\n str[0] === \" \" || // if normal trim is requested\n !opts.trimOnlySpaces && // and the first character is whitespace character\n !str[0].trim())) {\n\n for (let i = 0, len = str.length; i < len; i++) {\n if (opts.trimOnlySpaces && str[i] !== \" \" || !opts.trimOnlySpaces && str[i].trim()) {\n rangesToDelete.push([0, i]);\n break;\n } else if (!str[i + 1]) {\n // if end has been reached and whole string has been trimmable\n rangesToDelete.push([0, i + 1]);\n }\n }\n }\n\n if (str && ( // if only spaces were meant to be trimmed,\n opts.trimOnlySpaces && // and last character is a space\n str[str.length - 1] === \" \" || // if normal trim is requested\n !opts.trimOnlySpaces && // and the last character is whitespace character\n !str[str.length - 1].trim())) {\n for (let i = str.length; i--;) {\n if (opts.trimOnlySpaces && str[i] !== \" \" || !opts.trimOnlySpaces && str[i].trim()) {\n rangesToDelete.push([i + 1, str.length]);\n break;\n } // don't tackle end-to-end because it would have been already caught on the\n // start-to-end direction loop above.\n\n }\n } // last correction, imagine we've got text-whitespace-tag.\n // That last part \"tag\" was removed but \"whitespace\" in between is on the left.\n // We need to trim() that too if applicable.\n // By now we'll be able to tell, is starting/ending range array touching\n // the start (index 0) or end (str.length - 1) character indexes, and if so,\n // their inner sides will need to be trimmed accordingly, considering the\n // \"opts.trimOnlySpaces\" of course.\n\n\n const curr = rangesToDelete.current();\n\n if ((!originalOpts || !originalOpts.cb) && curr) {\n // check front - the first range of gathered ranges, does it touch start (0)\n if (curr[0] && !curr[0][0]) {\n curr[0][1]; // check the character at str[startingIdx] // manually edit Ranges class:\n\n rangesToDelete.ranges[0] = [rangesToDelete.ranges[0][0], rangesToDelete.ranges[0][1]];\n } // check end - the last range of gathered ranges, does it touch the end (str.length)\n // PS. remember ending is not inclusive, so ranges covering the whole ending\n // would go up to str.length, not up to str.length - 1!\n\n\n if (curr[curr.length - 1] && curr[curr.length - 1][1] === str.length) {\n curr[curr.length - 1][0]; // check character at str[startingIdx - 1] // remove third element from the last range \"what to add\" - because\n // ranges will crop aggressively, covering all whitespace, but they\n // then restore missing spaces (in which case it's not missing).\n // We already have tight crop, we just need to remove that \"what to add\"\n // third element.\n // hard edit:\n\n /* istanbul ignore else */\n\n if (rangesToDelete.ranges) {\n let startingIdx2 = rangesToDelete.ranges[rangesToDelete.ranges.length - 1][0];\n\n if (str[startingIdx2 - 1] && (opts.trimOnlySpaces && str[startingIdx2 - 1] === \" \" || !opts.trimOnlySpaces && !str[startingIdx2 - 1].trim())) {\n startingIdx2 -= 1;\n }\n\n const backupWhatToAdd = rangesToDelete.ranges[rangesToDelete.ranges.length - 1][2];\n rangesToDelete.ranges[rangesToDelete.ranges.length - 1] = [startingIdx2, rangesToDelete.ranges[rangesToDelete.ranges.length - 1][1]]; // for cases of opts.dumpLinkHrefsNearby\n\n if (backupWhatToAdd && backupWhatToAdd.trim()) {\n rangesToDelete.ranges[rangesToDelete.ranges.length - 1].push(backupWhatToAdd.trimEnd());\n }\n }\n }\n }\n\n const res = {\n log: {\n timeTakenInMilliseconds: Date.now() - start\n },\n result: rApply(str, rangesToDelete.current()),\n ranges: rangesToDelete.current(),\n allTagLocations,\n filteredTagLocations\n };\n return res;\n}", "function stripTags(tag, s, doc) {\n var div = doc.createElement('div');\n div.innerHTML = s;\n var tags = div.getElementsByTagName(tag);\n var i = tags.length;\n while (i--) {\n tags[i].parentNode.removeChild(tags[i]);\n }\n return div.innerHTML;\n}", "function strip_tags (str, allowed_tags) {\r\n // Strips HTML and PHP tags from a string \r\n // \r\n // version: 908.406\r\n // discuss at: http://phpjs.org/functions/strip_tags\r\n // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + improved by: Luke Godfrey\r\n // + input by: Pul\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + bugfixed by: Onno Marsman\r\n // + input by: Alex\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + input by: Marc Palau\r\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + input by: Brett Zamir (http://brett-zamir.me)\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + bugfixed by: Eric Nagel\r\n // + input by: Bobby Drake\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + bugfixed by: Tomasz Wesolowski\r\n // * example 1: strip_tags('<p>Kevin</p> <br /><b>van</b> <i>Zonneveld</i>', '<i><b>');\r\n // * returns 1: 'Kevin <b>van</b> <i>Zonneveld</i>'\r\n // * example 2: strip_tags('<p>Kevin <img src=\"someimage.png\" onmouseover=\"someFunction()\">van <i>Zonneveld</i></p>', '<p>');\r\n // * returns 2: '<p>Kevin van Zonneveld</p>'\r\n // * example 3: strip_tags(\"<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>\", \"<a>\");\r\n // * returns 3: '<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>'\r\n // * example 4: strip_tags('1 < 5 5 > 1');\r\n // * returns 4: '1 < 5 5 > 1'\r\n var key = '', allowed = false;\r\n var matches = [];\r\n var allowed_array = [];\r\n var allowed_tag = '';\r\n var i = 0;\r\n var k = '';\r\n var html = '';\r\n var replacer = function (search, replace, str) {\r\n return str.split(search).join(replace);\r\n };\r\n // Build allowes tags associative array\r\n if (allowed_tags) {\r\n allowed_array = allowed_tags.match(/([a-zA-Z0-9]+)/gi);\r\n }\r\n str += '';\r\n // Match tags\r\n matches = str.match(/(<\\/?[\\S][^>]*>)/gi);\r\n // Go through all HTML tags\r\n for (key in matches) {\r\n if (isNaN(key)) {\r\n // IE7 Hack\r\n continue;\r\n }\r\n // Save HTML tag\r\n html = matches[key].toString();\r\n // Is tag not in allowed list? Remove from str!\r\n allowed = false;\r\n // Go through all allowed tags\r\n for (k in allowed_array) {\r\n // Init\r\n allowed_tag = allowed_array[k];\r\n i = -1;\r\n if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+'>');}\r\n if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+' ');}\r\n if (i != 0) { i = html.toLowerCase().indexOf('</'+allowed_tag) ;}\r\n\r\n // Determine\r\n if (i == 0) {\r\n allowed = true;\r\n break;\r\n }\r\n }\r\n if (!allowed) {\r\n str = replacer(html, \"\", str); // Custom replace. No regexing\r\n }\r\n }\r\n return str;\r\n}", "stripHTML(htmlContent) {\n\t\tif (!htmlContent) return '';\n\t\treturn htmlContent.replace(/<[^>]*>/g, '');\n\t}", "function sanitizeHtmlToText(htmlString) {\n const temp = document.createElement('div');\n temp.innerHTML = htmlString;\n return temp.textContent || temp.innerText || '';\n}", "function strip_tags(val) {\r\n\treturn val.replace(/<\\/?[^>]+>/gi, '');\r\n}", "function _htmlToText() {\n var text = this._str;\n\n text = text\n // Remove line breaks\n .replace(/(?:\\n|\\r\\n|\\r)/ig, \" \")\n // Remove content in script tags.\n .replace(/<\\s*script[^>]*>[\\s\\S]*?<\\/script>/mig, \"\")\n // Remove content in style tags.\n .replace(/<\\s*style[^>]*>[\\s\\S]*?<\\/style>/mig, \"\")\n // Remove content in comments.\n .replace(/<!--.*?-->/mig, \"\")\n // Remove !DOCTYPE\n .replace(/<!DOCTYPE.*?>/ig, \"\");\n\n /* I scanned http://en.wikipedia.org/wiki/HTML_element for all html tags.\n I put those tags that should affect plain text formatting in two categories:\n those that should be replaced with two newlines and those that should be\n replaced with one newline. */\n var doubleNewlineTags = ['p', 'h[1-6]', 'dl', 'dt', 'dd', 'ol', 'ul', 'dir', 'address', 'blockquote', 'center', 'div', 'hr', 'pre', 'form', 'textarea', 'table'];\n\n var singleNewlineTags = ['li', 'del', 'ins', 'fieldset', 'legend','tr', 'th', 'caption', 'thead', 'tbody', 'tfoot'];\n\n for (var i = 0; i < doubleNewlineTags.length; i++) {\n var r = RegExp('</?\\\\s*' + doubleNewlineTags[i] + '[^>]*>', 'ig');\n text = text.replace(r, ' ');\n }\n\n for (var i = 0; i < singleNewlineTags.length; i++) {\n var r = RegExp('<\\\\s*' + singleNewlineTags[i] + '[^>]*>', 'ig');\n text = text.replace(r, ' ');\n }\n\n // Replace <br> and <br/> with a single newline\n text = text.replace(/<\\s*br[^>]*\\/?\\s*>/ig, ' ');\n\n text = text\n // Remove all remaining tags.\n .replace(/(<([^>]+)>)/ig, \"\")\n // Trim rightmost whitespaces for all lines\n .replace(/([^\\n\\S]+)\\n/g, \" \")\n .replace(/([^\\n\\S]+)$/, \"\")\n // Make sure there are never more than two\n // consecutive linebreaks.\n .replace(/\\n{2,}/g, \" \")\n // Remove newlines at the beginning of the text.\n .replace(/^\\n+/, \"\")\n // Remove newlines at the end of the text.\n .replace(/\\n+$/, \"\")\n // Remove HTML entities.\n .replace(/&([^;]+);/g, ' ')\n //remove all tabs and replace them with whitespace\n .replace(/\\t/g, \" \")\n //remove whitespace > 2\n .replace(/ {2,}/g, \" \");\n\n this._str = text;\n }", "function cleanHTMLContent(str){\n\tstr = str.toLowerCase();\n\tvar body_pos = str.indexOf(\"<body>\");\n\tstr = str.substring(body_pos);\n\tstr = str.replace(\"<body>\",\"<div>\");\n\tstr = str.replace(\"</body>\",\"</div>\");\n\tstr = str.replace(\"</html>\",\"\");\n\treturn str;\n}", "function removeHTMLEntities(string: string){\n\t\t\t\t\tconst parser = new DOMParser();\n\t\t\t\t\tconst dom = parser.parseFromString(\n\t\t\t\t\t\t`<!doctype html><body>${string}`, 'text/html');\n\t\t\t\t\treturn dom.getElementsByTagName('body')[0].textContent;\n\t\t\t\t\t}", "function _clearHtml(txt){\n txt = txt.replace(new RegExp('<','g'),'&#8249;');\n txt = txt.replace(new RegExp('>','g'),'&#8250;');\n return txt;\n }", "function tidy_xhtml() {\r\n var text = String(this);\r\n\r\n text = text.gsub(/\\r\\n?/, \"\\n\");\r\n\r\n text = text.gsub(/<([A-Z]+)([^>]*)>/, function(match) {\r\n return '<' + match[1].toLowerCase() + match[2] + '>';\r\n });\r\n\r\n text = text.gsub(/<\\/([A-Z]+)>/, function(match) {\r\n return '</' + match[1].toLowerCase() + '>';\r\n });\r\n\r\n text = text.replace(/<br>/g, \"<br />\");\r\n\r\n return text;\r\n }", "function clean(text) {\n return ('' + text).replace(/[<>]/g, '');\n }", "function getContent(html) {\n return html.replace(/<[^>]*>/g, '');\n}", "function stripHtml(input) {\n\t\tif (typeof input === 'undefined') {\n\t\t\treturn '';\n\t\t}\n\t\t// note this is not a good way to do this with normal HTML, but works for GW2's item db\n\t\tvar stripped = input.replace(/<br>/ig, '\\n');\n\t\tstripped = stripped.replace(/(<([^>]+)>)/ig, '');\n\t\tstripped = stripped.replace(/\\n|\\\\n/g, '<br>');\n\t\treturn stripped;\n\t}", "function strip(html){\n var doc = new DOMParser().parseFromString(html, 'text/html');\n return doc.body.textContent || \"\";\n }", "function strip_tags (input, allowed) {\n // making sure the allowed arg is a string containing only tags in lowercase\n // (<a><b><c>)\n allowed = (((allowed || '') + '').toLowerCase()\n .match(/<[a-z][a-z0-9]*>/g) || []).join('');\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n}", "function fixEmptyTags(xmlString) {\n return xmlString.replace(/<(([\\w:.-]+)(?:\\s[^>]*|))\\/>/g, \"<$1></$2>\");\n }", "function strip_html(content) {\r\n // We will first replace <br /> with \\n\r\n content = content.replace('<br>', '\\n');\r\n content = content.replace('<br />', '\\n');\r\n return strip_tags(content);\r\n}", "function stripHtml(html)\n {\n html = html.replace(/<br>/g,\" \");\n var tmp = document.createElement(\"DIV\");\n tmp.innerHTML = html;\n return tmp.textContent || tmp.innerText || \"\";\n }", "function strip_tags(input, allowed) {\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n\n // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n allowed = (((allowed || \"\") + \"\").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');\n\n return input.replace(commentsAndPhpTags, '').replace(tags, function($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n }", "function convertHTML(str) {\n // &colon;&rpar;\n var emptyString = \"\";\n \n for (var i = 0; i < str.length; i++) { \n if (str[i] === \"&\") {\n emptyString += \"&amp;\";\n } else if (str[i] === \"<\") { \n emptyString += \"&lt;\";\n } else if (str[i] === \">\") { \n emptyString += \"&gt;\";\n } else if (str[i] === '\"') { \n emptyString += \"&quot;\";\n } else if (str[i] === \"'\") { \n emptyString += \"&apos;\";\n } else { \n emptyString += str[i];\n }\n }\n \n return emptyString;\n}", "function htmlUnescape(str) {\n return str\n .replace(/&quot;/g, '\"')\n .replace(/&#39;/g, \"'\")\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&amp;/g, '&');\n }", "function stripHtmlToText(e){var t=document.createElement(\"DIV\");t.innerHTML=e;var n=t.textContent||t.innerText||\"\";return n.replace(\"​\",\"\"),n=n.trim()}", "function unEntity(str){\n return str.replace(/&lt;/g, '<').replace(/&gt;/g, '>');\n}", "function noHtml(elem) {\n\t\telem.innerHTML.replace(/<.+?>/gim, '')\n\t}", "function html(str) {\n return (str || '')\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n }", "function unescapeHtml(str){\n\t str = toString(str)\n\t .replace(/&amp;/g , '&')\n\t .replace(/&lt;/g , '<')\n\t .replace(/&gt;/g , '>')\n\t .replace(/&#0*39;/g , \"'\")\n\t .replace(/&quot;/g, '\"');\n\t return str;\n\t }", "function convertHTML(str) {\n //turn the string into an array to iterate through it later\n let strArr = str.split(\"\");\n \n //iterate through it with a loop\n for(let i = 0, l = strArr.length; i < l; i++){\n //use switch to convert items when found\n switch(strArr[i]){\n case \"&\":\n strArr[i] = \"&amp;\";\n break;\n case \"<\":\n strArr[i] = \"&lt;\";\n break;\n case \">\":\n strArr[i] = \"&gt;\";\n break;\n case '\"':\n strArr[i] = \"&quot;\";\n break;\n case \"'\":\n strArr[i] = \"&apos;\";\n break;\n //use default to process all other letters and spaces\n default:\n break;\n }\n }\n //merge everything back together \n return strArr.join(\"\");\n}", "function deHTML(message) { return message.replace(/&/g, \"&amp;\").replace(/>/g, \"&gt;\").replace(/</g, \"&lt;\"); }", "function convertHTML(str) {\n var temp = str.split(\"\");\n for(var i =0; i < temp.length; i++){\n switch(temp[i]){\n case \"<\":\n temp[i] = \"&lt;\";\n break;\n case \"&\":\n temp[i] = '&amp;'; \n break;\n case \">\":\n temp[i] = \"&gt;\";\n break;\n case '\"':\n temp[i] = \"&quot;\";\n break;\n case \"'\":\n temp[i] = \"&apos;\";\n break;\n }\n }\n temp = temp.join('');\n return temp;\n }", "function htmlUnescape(str) {\r\n\treturn str.replace(/&quot;/g, '\"')\r\n\t\t.replace(/&#39;/g, \"'\")\r\n\t\t.replace(/&lt;/g, '<')\r\n\t\t.replace(/&gt;/g, '>')\r\n\t\t.replace(/&amp;/g, '&');\r\n}", "function clean_content(string) {\n\tstring = basic_clean(string)\n \n\t// replace doubled-up quotes unless preceded with '='\n\tstring = string.replace(/(?<!=)([\\'\\\"])+/gi, '$1')\n \n\t// remove redundant div tags\n\tstring = string.replace(/\\<div\\>([^]*?)\\<\\/div\\>/gi,'$1')\n\tstring = string.replace(/\\<div\\s+(?:id|lang|class)=\".*?\"\\s*\\>(.*?)\\<\\/div\\>/gi,'$1')\n\t// remove redundant span tags\n\tstring = string.replace(/\\<span\\>([^]*?)\\<\\/span\\>/gi,'$1')\n\tstring = string.replace(/\\<span\\s+(?:id|lang|class|style)=\".*?\"\\s*\\>(.*?)\\<\\/span\\>/gi,'$1')\n\t// remove redundant p tags\n\tstring = string.replace(/\\<p\\>([^]*?)\\<\\/p\\>/gi,'$1')\n\tstring = string.replace(/\\<p\\s+(?:id|lang|class)=\".*?\"\\s*\\>(.*?)\\<\\/p\\>/gi,'$1')\n\t// remove redundant <br id> tags\n\tstring = string.replace(/\\<br\\s+id=\".*?\"\\s*\\/\\>\\s+/gi,'\\n')\n \n\t// make ellipses standard\n\tstring = string.replace(/(\\w+)\\.{2,}\\s*(\\w+)/gi,'$1... $2')\n\t//string = string.replace(/(\\.+\\s+)?\\.{2,}(\\s*\\.+)?/gi,'... ')\n \n\t// remove duplicated punctuation\n\tstring = string.replace(/(&amp;){2,}/gi, '$1')\n\tstring = string.replace(/([\\(\\)]){2,}/gi, '$1')\n\tstring = string.replace(/([!?,:;$]){2,}/gi, '$1')\n\tstring = string.replace(/[!?,:;]\\./gi, '.',)\n\tstring = string.replace(/'\\.([!?,:;])/gi, '$1')\n \n \t// make sure \"xxx ,\" doesnt happen\n\tstring = string.replace(/\\b(\\w+)\\s+,\\s?/gi, '$1, ')\n\n\t// standardise double lines and remove spaces before newlines\n\tstring = string.replace(/\\s*\\n+/gi, '\\n\\n')\n\n\t// headify links header\n\tstring = string.replace(/\\n+(\\<hr\\s*\\/\\>\\n+)*(\\<h\\d\\>\\s*)?Links(\\<\\/h\\d\\>\\s*)?\\n+/i, '<hr />\\n<h5>Links</h5>\\n')\n\t//string = string.replace(/\\<hr\\s?\\/?\\s?\\>\\n+Links\\s?\\n+/i, '<hr />\\n<h5>Links</h5>\\n')\n\n\t// remove initial blank line (this can remove *all* blank lines)\n\tstring = string.replace(/^(?:\\s|\\n)*([^]*)/i, '$1')\n\t\n\t// correctly form initial byline (if any)\n\tstring = string.replace(/^(?:\\<em\\>)?\\s*(By\\\\b.*?)[\\.\\s]*(?:\\<\\/em>)?\\n/gi, '<em>$1.</em>\\n')\t\n\t\n\t// remove terminal blank lines\n\tstring = string.replace(/(.*)(?:\\s|\\n)*$/i, '$1')\n\n\t// PICS\n\n\t// make pic full size\n\t// buggers up [caption ... width...]\n\t//string = string.replace(\n\t//\t/\\<img\\s+(.*)?width=\"\\d+?\"\\s+height=\"\\d+?\"\\s+\\>/gi,\n\t//\t'<img $1 width=\"100%\" height=\"100%\" />')\n\n\t// ensure all pics open correct page \n\t// fix pics with no link\n\tstring = string.replace(\n\t\t/\\<img class=\"(.*?(\\d+).*?)\"[\\b\\s]*src=\"(.*?)\"(.*?)[\\b\\s]*\\/\\>/gi,\n\t\t'<a href=\"https://whitleypump.net/?attachment_id=$2\" target=\"_blank\" rel=\"noopener noreferrer\"><img class=\"$1\" src=\"$3\" $4 /></a>')\n \n \t// fixed duplicated hrefs (where post has mix of linked and unlinked pics)\n\tstring = string.replace(\n\t\t/(\\<a\\s+.*?\\>)(\\<a\\s+.*?\\>)(\\<img\\s+.*?\\/\\>)(\\<\\/a\\>)+/gi,\n\t\t'$2$3</a>')\n\t\t\n \t// fix pics with 'custom link'\n\tstring = string.replace(\n\t\t/\\<a href=\"(whitleypump\\.net(?:(?!attachment_id).)*)\"\\>[\\b\\s]*\\<img class=\"(.*?(\\d+).*?)\"[\\b\\s]*src=\"(.*?)\"(.*?)[\\b\\s]*\\/>[\\b\\s]*\\<\\/a\\>/gi,\n\t\t'<a href=\"https://whitleypump.net/?attachment_id=$3\" target=\"_blank\" rel=\"noopener\"><img class=\"$2\" src=\"$4\" $5 /></a>')\n\n\t// LINKS \n\n\t// ensure all links open in new page\n\tstring = string.replace(/\\<a\\s+(.*?)\\>/gi, '<a $1 target=\"_blank\" rel=\"noopener noreferrer\">')\n\tstring = string.replace(/(\\btarget=\"_blank\"\\s+rel=\"(noopener|\\s|noreferrer)+\"\\s*)+/gi, '$1')\n \n \t// ensure all internal links (aka bookmarks with href=\"#abc\") *dont* open in new page\n\t\n\n\t// MORE LINE\n\t\n\t// add more line after first para, if one not already included\n\tif (string.search(/\\<!--more--\\>/i) < 0 )\n\t{\n\t //string = string.replace(/^(\\<a[^\\n]+\\<\\/a\\>\\n+[^\\n]+)\\n*/i, '$1\\n\\n<!--more-->\\n')\n\t string = string.replace(\n\t /^((?:[\\[\\<].*?[\\]\\>]\\n+)?[^\\n]*?)\\n+/i,\n\t '$1\\n\\n<!--more-->'\n\t )\n\t}\n\t// make sure more line is correctly spaced\n\t//string = string.replace(/(?:(\\<br\\s?\\/?\\s?\\>|\\n))*<(?:!-*)?more(?:-*)?\\>(?:(\\<br\\s?\\/?\\s?\\>|\\n))*/i, '\\n\\n<!--more-->')\n\tstring = string.replace(/[\\n\\s]*\\<!-*more-*\\>[\\n\\s]*/i, '\\n\\n<!--more-->')\n\t\n \treturn string;\n}", "function safeTagsRegex(str) {\n return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n}", "function __filter($str) {\r\n $str = $str.replace(/</g,\"&lt;\");\r\n $str = $str.replace(/>/g,\"&gt;\");\r\n $str = $str.replace(/\\\"/g,\"&quot;\");\r\n return $str;\r\n}", "clean(html) {\n\t\treturn html\n\t\t\t.replace(/(&#xA0;)+/g, ' ')\n\t\t\t.replace(' ', ' ')\n\t\t\t.replace(/\\s*([<>])\\s*/g, '$1');\n\t}", "function _sanitizeHtml(html) {\n return html.replace(/\\<\\s*script/gi, '');\n }", "function stripHtmlToText(html)\n{\n\tvar tmp = document.createElement(\"DIV\");\n\ttmp.innerHTML = html;\n\tvar res = tmp.textContent || tmp.innerText || '';\n\tres.replace('\\u200B', ''); // zero width space\n\tres = res.trim();\n\treturn res;\n}", "function strip(html){\n let tmp = document.createElement(\"div\");\n tmp.innerHTML = html;\n return tmp.textContent || tmp.innerText || \"\";\n }", "function unhtmlify(original) {\n original = original.trim();\n // Also remove any newlines, adding a space if there was none otherwise.\n original = original.replace(/( (\\r\\n|\\n|\\r)+|(\\r\\n|\\n|\\r)+ |(\\r\\n|\\n|\\r)+)/gm,\" \");\n var testversion = original.replace(/^ *<p>/i, '').replace(/<\\/p> *$/i, '');\n if(!html_only_regex.test(testversion)) {\n testversion = dounescape(testversion);\n if(!html_regex.test(testversion)) return testversion;\n }\n return original;\n}", "function _escTag(s){ return s.replace(\"<\",\"&lt;\").replace(\">\",\"&gt;\");}", "function _escTag(s){ return s.replace(\"<\",\"&lt;\").replace(\">\",\"&gt;\");}", "function unescapeHtml(string){\n\treturn string.replace(/&amp;/g, '&')\n .replace(/&gt;/g, '>')\n .replace(/&lt;/g, '<')\n .replace(/&quot;/g, '\"')\n .replace(/&apos;/g, \"'\")\n\t\t\t\t.replace(/&#x2F;/g, \"/\");\n}", "function xmlCleaner(xmlString) {\n var fixedHtml = xmlString.replace('EN\">','EN\" \"\">').replace(\"</HEAD>\",\"</head>\").replace(/<br>/g,\"<br />\").replace(\"</HTML>\",\"</html>\");\n Logger.log(\"xmlCleaner: \" + fixedHtml);\n return fixedHtml;\n}", "function unEntity (str) {\n return str.replace(/&lt;/g, '<').replace(/&gt;/g, '>')\n}", "function balanceTags(html)\n {\n\n if (html == \"\")\n return \"\";\n\n var re = /<\\/?\\w+[^>]*(\\s|$|>)/g;\n // convert everything to lower case; this makes\n // our case insensitive comparisons easier\n var tags = html.toLowerCase().match(re);\n\n // no HTML tags present? nothing to do; exit now\n var tagcount = (tags || []).length;\n if (tagcount == 0)\n return html;\n\n var tagname, tag;\n var ignoredtags = \"<p><img><br><li><hr>\";\n var match;\n var tagpaired = [];\n var tagremove = [];\n var needsRemoval = false;\n\n // loop through matched tags in forward order\n for (var ctag = 0; ctag < tagcount; ctag++)\n {\n tagname = tags[ctag].replace(/<\\/?(\\w+).*/, \"$1\");\n // skip any already paired tags\n // and skip tags in our ignore list; assume they're self-closed\n if (tagpaired[ctag] || ignoredtags.search(\"<\" + tagname + \">\") > -1)\n continue;\n\n tag = tags[ctag];\n match = -1;\n\n if (!/^<\\//.test(tag))\n {\n // this is an opening tag\n // search forwards (next tags), look for closing tags\n for (var ntag = ctag + 1; ntag < tagcount; ntag++)\n {\n if (!tagpaired[ntag] && tags[ntag] == \"</\" + tagname + \">\")\n {\n match = ntag;\n break;\n }\n }\n }\n\n if (match == -1)\n needsRemoval = tagremove[ctag] = true; // mark for removal\n else\n tagpaired[match] = true; // mark paired\n }\n\n if (!needsRemoval)\n return html;\n\n // delete all orphaned tags from the string\n\n var ctag = 0;\n html = html.replace(re, function (match)\n {\n var res = tagremove[ctag] ? \"\" : match;\n ctag++;\n return res;\n });\n return html;\n }", "function balanceTags(html) {\n\n if (html == \"\")\n return \"\";\n\n var re = /<\\/?\\w+[^>]*(\\s|$|>)/g;\n // convert everything to lower case; this makes\n // our case insensitive comparisons easier\n var tags = html.toLowerCase().match(re);\n\n // no HTML tags present? nothing to do; exit now\n var tagcount = (tags || []).length;\n if (tagcount == 0)\n return html;\n\n var tagname, tag;\n var ignoredtags = \"<p><img><br><li><hr>\";\n var match;\n var tagpaired = [];\n var tagremove = [];\n var needsRemoval = false;\n\n // loop through matched tags in forward order\n for (var ctag = 0; ctag < tagcount; ctag++) {\n tagname = tags[ctag].replace(/<\\/?(\\w+).*/, \"$1\");\n // skip any already paired tags\n // and skip tags in our ignore list; assume they're self-closed\n if (tagpaired[ctag] || ignoredtags.search(\"<\" + tagname + \">\") > -1)\n continue;\n\n tag = tags[ctag];\n match = -1;\n\n if (!/^<\\//.test(tag)) {\n // this is an opening tag\n // search forwards (next tags), look for closing tags\n for (var ntag = ctag + 1; ntag < tagcount; ntag++) {\n if (!tagpaired[ntag] && tags[ntag] == \"</\" + tagname + \">\") {\n match = ntag;\n break;\n }\n }\n }\n\n if (match == -1)\n needsRemoval = tagremove[ctag] = true; // mark for removal\n else\n tagpaired[match] = true; // mark paired\n }\n\n if (!needsRemoval)\n return html;\n\n // delete all orphaned tags from the string\n\n var ctag = 0;\n html = html.replace(re, function (match) {\n var res = tagremove[ctag] ? \"\" : match;\n ctag++;\n return res;\n });\n return html;\n }", "function unescapeHtml(text){\n if( !text ) return;\n var tL, cleanRet='', temp = createEl('div',{},text);\n tL = temp.childNodes.length;\n for(var i=0; i<tL; i++){\n if( typeof(temp.childNodes[i])!='object' ) continue;\n cleanRet += (function (t){\n return t.replace( /\\&\\#(\\d+);/g, function( ent, cG ){return String.fromCharCode( parseInt( cG ) )})\n })(temp.childNodes[i].nodeValue);\n }\n try{ temp.removeChild(temp.firstChild) }catch(e){}\n return cleanRet;\n}", "function convertHTML(str) {\n let regEx = /[&<>\"']/g\n let match = str.match(regEx)\n\n return str.replace(regEx, function(match){\n if(match === \"&\"){\n return \"&amp;\"\n }else if(match === \"<\"){\n return \"&lt;\"\n }else if(match === \">\"){\n return \"&gt;\"\n }else if(match === \"'\"){\n return \"&apos;\"\n }else if(match === '\"'){\n return \"&quot;\"\n }\n })\n}", "function stripHTML(el) {\n el.innerHTML = el.textContent;\n }", "function htmlToText(html) {\n return _HtmlEntities.reduce(function (pv, cv, i, a) {\n return pv.replace(cv[0], cv[1]);\n }, html.replace(/(<.+?>)/g, ''));\n}", "function convertHTML(str) {\n //turn the string into an array to iterate through it with map()\n let strArr = str.split(\"\").map(i => {\n //use switch to convert items when found\n switch(i){\n case \"&\":\n i = \"&amp;\";\n break;\n case \"<\":\n i = \"&lt;\";\n break;\n case \">\":\n i = \"&gt;\";\n break;\n case '\"':\n i = \"&quot;\";\n break;\n case \"'\":\n i = \"&apos;\";\n break;\n //use default to process all other letters and spaces\n default:\n break;\n }\n return i;\n //merge everything back together \n }).join(\"\");\n \n return strArr;\n}", "function removeLinks(str) \n{\n return stripStringRegEx(str, \"<\", \">\");\n}", "function sanitiseHtml(node) {\n for (var child of node.childNodes)\n {\n if (child.tagName && child.tagName.match(/script|style/i))\n {\n node.removeChild(child);\n }\n }\n}", "function SBRecordsetPHP_stripPHPTags(inStr)\r\n\r\n{\r\n\r\n var theStr = String(inStr);\r\n\r\n theStr = theStr.replace(/(<\\?\\s*php\\s*echo)*/gi,\"\"); //remove open tags \r\n\r\n theStr = theStr.replace(/(\\?>)*/gi,\"\"); //remove close tags\r\n\r\n return theStr;\r\n\r\n}", "function strip(html)\n{\n var tmp = document.createElement(\"DIV\");\n tmp.innerHTML = html;\n return tmp.textContent || tmp.innerText || \"\";\n}", "function strip(s, tags) {\n s = s.replace(RegExp('^' + tags.start), '');\n return s.replace(RegExp(tags.stop + '$'), '');\n }", "function sanitizeText(html) {\n\t\tif (typeof html !== 'string') {\n\t\t\treturn html;\n\t\t}\n\t\tvar value = \"<div>\" + html.replace(/(\\s)(on(?:\\w+))(\\s*=)/, '$1xss-$2$3') + \"</div>\";\n\t\tvar elems = $($.parseHTML(value, null, false));\n\n\t\telems.find('*').each(function() {\n\t\t\tsanitizeElement(this);\n });\n\n\t\treturn elems.html();\n\t}", "function convertHTML(str) {\n const entities = {\n \"&\": \"&amp;\",\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n \"''\": \"&quot;\",\n '\"': \"&quot;\",\n \"'\": \"&apos;\"\n }\n return str.split('').map(item => item.replace(item, entities[item] || item)).join('')\n}", "function sanitize (text) {\n return text.split('').map(function (char) {\n return char === '<' ? '&lt;' : char === '>' ? '&gt;' : char\n ;}).join('');\n }", "function removeScriptTag(str) {\n var scriptTagReg = /<\\/?script[^>]*>/gi;\n return str.replace(scriptTagReg, '');\n}", "function isHTMLString(str) {\n return (/<[^>]+?>/.test(str)\n );\n }", "function sanitize(string) {\n return string.replace(/[&<>]/g, '');\n }", "function convertHTML(str) {\n\treturn (str = str\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&apos;'));\n}", "function htmlToText(e){return e.replace(/<\\/div>\\n/gi,\"\").replace(/<\\/p>/gi,\"\").replace(/<\\/span>/gi,\"\").replace(/<\\/div>/gi,\"\").replace(/<\\/ul>/gi,\"\").replace(/<\\/li>/gi,\"\").replace(/<\\/strong>/gi,\"\").replace(/<\\/center>/gi,\"\").replace(/<\\/pre>/gi,\"\").replace(/<\\s*p[^>]*>/gi,\"\").replace(/<\\s*span[^>]*>/gi,\"\").replace(/<\\s*div[^>]*>/gi,\"\").replace(/<\\s*ul[^>]*>/gi,\"\").replace(/<\\s*li[^>]*>/gi,\"\").replace(/<\\s*strong[^>]*>/gi,\"\").replace(/<\\s*center[^>]*>/gi,\"\").replace(/<\\s*pre[^>]*>/gi,\"\").replace(/<hr>/gi,\"\").replace(/<div><br>/gi,\"\\n\").replace(/<div>/gi,\"\").replace(/<\\s*br[^>]*>/gi,\"\\n\").replace(/<\\s*\\/li[^>]*>/gi,\"\").replace(/<\\s*script[^>]*>[\\s\\S]*?<\\/script>/gim,\"\").replace(/<\\s*style[^>]*>[\\s\\S]*?<\\/style>/gim,\"\").replace(/<!--.*?-->/gim,\"\").replace(/<\\s*a[^>]*href=['\"](.*?)['\"][^>]*>([\\s\\S]*?)<\\/\\s*a\\s*>/gi,\"$2 ($1)\").replace(/&([^;]+);/g,decodeHtmlEntity)}", "function convertHTML(str) {\n const htmlValues = {\n \"&\": \"&amp;\",\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n '\\\"': \"&quot;\",\n \"\\'\": \"&apos;\",\n }\n return str.split(\"\").map(el => /[&<>\"']/.test(el) ? htmlValues[el] : el).join(\"\");\n}", "strip_tags(...args) {\n return strip_tags(...args)\n }", "function removeTags(x, y){\n if (!y) y = [];\n y = y.map(function(d){ return \"<\" + d + \">\"; }).join(\",\");\n y = (((y || \"\") + \"\").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(\"\"); // making sure the y arg is a string containing only tags in lowercase (<a><b><c>)\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n return x.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return y.indexOf(\"<\" + $1.toLowerCase() + \">\") > -1 ? $0 : \"\";\n });\n }", "stripHtml( text, removeUrls ) {\n let div = document.createElement( 'div' );\n div.innerHTML = String( text || '' );\n let output = String( div.textContent || div.innerText || '' );\n if ( removeUrls ) output = output.replace( /(https?\\:\\/\\/[\\w\\-\\.\\?\\=\\&\\%\\/\\#]+)/gi, '' );\n return output;\n }", "function cleanUpRTEHtmlMarkup(msg) {\n msg = msg.replace(/(<p><\\/p>)/ig,\"\"); //replace <p></p> - globally\n msg = msg.replace(/<p/ig,\"<span\"); //replace all open paragraphs with span\n msg = msg.replace(/<\\/p>/ig,\"</span></br>\"); //replace all closing paragraphs with closing span and break. Please note that <br/> keeps the indentation in-tact - where as <p/> invalidates it.\n return msg;\n }", "function SBRecordsetPHP_stripPHPTags(inStr)\r\n{\r\n var theStr = String(inStr);\r\n theStr = theStr.replace(/(<?\\s*php\\s*echo)*/gi,\"\"); //remove open tags \r\n theStr = theStr.replace(/(?>)*/gi,\"\"); //remove close tags\r\n return theStr;\r\n}", "function convertHTML(str) {\n\tlet pairs = {\n\t\t'&': '&amp;',\n\t\t'<': '&lt;',\n\t\t'>': '&gt;',\n\t\t'\"': '&quot;',\n\t\t\"'\": '&apos;'\n\t};\n\t// return [...str].map(value => value.replace(value, pairs[value] || value)).join('');\n\n\treturn [...str].map(value => pairs[value] ? pairs[value] : value).join('');\n\n\tlet out = str;\n\t// for (let value of [...str]) {\n\t// \tif (pairs[value]) {\n\t// \t\tout = out.replace(value, pairs[value]);\n\t// \t}\n\t// }\n\treturn out;\n}", "function specil2htm(str){\n\tif(typeof(str)!=\"string\")return str;\n\tstr=str.replace(/&gt;/g,'>');\n\tstr=str.replace(/&lt;/g,'<');\n\treturn str;\n}", "sanitize(htmlStr) {\r\n return DOMPurify.sanitize(htmlStr, {\r\n FORBID_TAGS: ['figure','figcaption']\r\n });\r\n }", "function convertHTML(str) {\n return str.replace(/&/g, '&amp;').replace(/>/g, '&gt;').replace(/</g, '&lt;').replace(/'/g, '&apos;').replace(/\"/g, '&quot;');\n\n}", "function isHTMLString(str) {\n return (/<[^>]+?>/.test(str)\n );\n }", "function convertHTML (str) {\n return str.replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&apos;');\n}", "function cleanHtml(html) {\n \tvar body = html.match(/<body[^>]*>([\\S\\s]*)<\\/body>/i);\n \tif (!body || !body[1])\n \t\treturn html;\n\n \treturn body[1];\n }", "function markupHTML(str){ \n\treturn closeHTMLtags(escapeHTML(str)).replace(\n\t\t/(&lt;[~!-_`#])|([~!-_`#]&gt;)|/g,\n\t\ttag => ({\n\t\t\t'&lt;~': '<i>', '~&gt;': '</i>',\n\t\t\t'&lt;!': '<b>', '!&gt;': '</b>',\n\t\t\t'&lt;-': '<del>', '-&gt;': '</del>',\n\t\t\t'&lt;_': '<sub>', '_&gt;': '</sub>',\n\t\t\t'&lt;`': '<sup>', '`&gt;': '</sup>',\n\t\t\t'&lt;#': '<mark>', '#&gt;': '</mark>'\n\t\t}[tag] || tag)\n\t);\n}", "function sanitizeHtml(html) {\n return defaultHtmlSanitizer.sanitize(html);\n}", "function isHtml(str) {\n const tagStart = str.indexOf('<');\n if (tagStart < 0 || tagStart > str.length - 3)\n return false;\n const tagChar = str.charCodeAt(tagStart + 1);\n return (((tagChar >= CharacterCodes.LowerA && tagChar <= CharacterCodes.LowerZ) ||\n (tagChar >= CharacterCodes.UpperA && tagChar <= CharacterCodes.UpperZ) ||\n tagChar === CharacterCodes.Exclamation) &&\n str.includes('>', tagStart + 2));\n}" ]
[ "0.8302168", "0.8137263", "0.79710877", "0.79237795", "0.77911013", "0.77765584", "0.77449584", "0.77090126", "0.7688056", "0.7641428", "0.75990945", "0.756668", "0.75078505", "0.7467474", "0.73918295", "0.73069614", "0.7176929", "0.70276827", "0.6965834", "0.688803", "0.6876985", "0.6779279", "0.67746013", "0.670858", "0.6668334", "0.6655986", "0.66218066", "0.6618148", "0.6611123", "0.65782857", "0.655497", "0.65467906", "0.6509314", "0.6499426", "0.64640206", "0.6454982", "0.64195347", "0.6402431", "0.6389807", "0.6388946", "0.63792026", "0.63727885", "0.6351578", "0.6343446", "0.63349074", "0.63285595", "0.63277644", "0.63260204", "0.63201", "0.63130385", "0.63037443", "0.6283362", "0.6254228", "0.62471384", "0.6230538", "0.6224005", "0.6223201", "0.62143975", "0.6210063", "0.61870015", "0.61870015", "0.6177739", "0.6171054", "0.61658925", "0.61450106", "0.61441725", "0.6128586", "0.61245817", "0.61226827", "0.6117012", "0.61126095", "0.6104508", "0.60970265", "0.60738647", "0.6072382", "0.60443497", "0.6029391", "0.601324", "0.6007537", "0.60011894", "0.5999584", "0.59958553", "0.5989664", "0.5977184", "0.597713", "0.59611875", "0.59610105", "0.59516686", "0.59459215", "0.594222", "0.593825", "0.5931263", "0.5927179", "0.59162915", "0.5912287", "0.59022295", "0.58985984", "0.58799523", "0.586319", "0.5855329" ]
0.81383085
1
============================================== TOPBAR FIXED ===============================================
function navFixed() { var heightNav = $('.topbar-fixed').outerHeight(); var heightTopBar = $('.topbar-absolute').outerHeight(true); $('.topbar-absolute').parent().css('height', heightNav); var topHambu = parseInt($('.side-nav__boton-sideNav').css('top'), 10); var scrollPx = $(this).scrollTop(); var pxinit = 16; var heightSetted = false; function setHeight() { $('.topbar-helper').css('height', heightTopBar); heightSetted = true; } function resetHeight() { $('.topbar-helper').css('height', 0); heightSetted = false; } function px() { return pxinit - scrollPx; } $(window).scroll(function () { scrollPx = $(this).scrollTop(); if (scrollPx <= 16) { $('.topbar-absolute').removeClass("stick"); resetHeight(); } else { $('.topbar-absolute').addClass("stick"); if (!heightSetted) setHeight(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initTopBar(){\n\tvar header = jQuery('#header')\n\tvar animSpeed = 400;\n\tvar win = jQuery(window);\n\tjQuery('.top-bar').each(function(){\n\t\tvar bar = jQuery(this);\n\t\tbar.css({\n\t\t\ttop: -bar.outerHeight()\n\t\t}).hide();\n\t\twin.bind('scroll resize orientationchange load', function(){\n\t\t\tif(win.scrollTop() < header.height()) {\n\t\t\t\tbar.stop().animate({\n\t\t\t\t\ttop: -bar.outerHeight()\n\t\t\t\t}, {duration:animSpeed, complete: function(){\n\t\t\t\t\tbar.hide();\n\t\t\t\t}})\n\t\t\t}\n\t\t\telse bar.show().stop().animate({top: 0}, {duration:animSpeed});\n\t\t})\n\t})\n}", "function fixedTopBar() {\n\n 'use strict';\n\n var offset,\n $navbar = $( '.navbar' );\n\n $( window ).on( 'scroll.happytodesign', function() {\n offset = $navbar.offset().top;\n if ( offset > 10 ) {\n if ( $navbar.attr( 'data-scrolling' ) !== 'true' ) {\n $navbar.attr( 'data-scrolling', 'true' );\n }\n }\n else {\n $navbar.attr( 'data-scrolling', 'false' );\n }\n } ).trigger( 'scroll.happytodesign' );\n}", "function fixed_topbar(){\n d_top = $(document).scrollTop();\n if(d_top*2 > w_height){\n $(\".home__nav\").addClass(\"fixed\");\n }else{\n $(\".home__nav\").removeClass(\"fixed\");\n }\n}", "function followingBar() {\n // $(window).unbind('scroll');\n // console.log($._data( $(window)[0], \"events\" ));\n $(window).scroll(function() {\n var isFullscreen = $editor.hasClass('fullscreen');\n\n if (isFullscreen) {\n // console.log(\"fullscreen\");\n return false;\n }\n\n var toolbar = $editor.children('.note-toolbar');\n var toolbarHeight = toolbar.outerHeight();\n var editable = $editor.children('.note-editable');\n var editableHeight = editable.outerHeight();\n var editorWidth = $editor.width;\n var toolbarOffset, editorOffsetTop, editorOffsetBottom;\n var activateOffset, deactivateOffsetTop, deactivateOffsetBottom;\n var currentOffset;\n var relativeOffset;\n var otherBarHeight;\n\n // check if the web app is currently using another static bar\n otherBarHeight = $(\".\" + options.otherStaticBarClass).outerHeight();\n if (!otherBarHeight) otherBarHeight = 0;\n //console.log(otherBarHeight);\n\n currentOffset = $(document).scrollTop()+$('nav.nav-extended').height();\n toolbarOffset = toolbar.offset().top+$('nav.nav-extended').height();\n editorOffsetTop = $editor.offset().top;\n editorOffsetBottom = editorOffsetTop + editableHeight;\n activateOffset = toolbarOffset - otherBarHeight;\n deactivateOffsetBottom = editorOffsetBottom - otherBarHeight;\n deactivateOffsetTop = editorOffsetTop - otherBarHeight;\n\n if ((currentOffset > activateOffset) && (currentOffset < deactivateOffsetBottom)) {\n relativeOffset = currentOffset - $editor.offset().top + otherBarHeight;\n toolbar.css({'top': relativeOffset + 'px', 'z-index': 990});\n } else {\n if ((currentOffset < toolbarOffset) && (currentOffset < deactivateOffsetBottom)) {\n toolbar.css({'top': 0, 'z-index': 990});\n\n if (currentOffset > deactivateOffsetTop) {\n relativeOffset = currentOffset - $editor.offset().top + otherBarHeight;\n toolbar.css({'top': relativeOffset + 'px', 'z-index': 990});\n }\n }\n }\n });\n }", "function initToolbar() {\n\t\taddEvent(window, \"scroll\", function() {\n\t\t\tvar toolbar = document.getElementById(\"toolbar\");\n\t\t\tvar tcontainer = document.getElementById(\"toolbar-container\");\n\t\t\tif (tcontainer.getBoundingClientRect().top<=0) {\n\t\t\t\ttoolbar.style.position = \"fixed\"; toolbar.style.top = 0;\n\t\t\t} else \n\t\t\t\ttoolbar.style.position = \"relative\";\n\t\t})\n\t}", "createTopBar() {\n\t\t//make the back of the message box\n\t\tvar rec = this.add.rectangle(200, 0, this.game.config.width - 200, 150, 0x001a24).setScrollFactor(0).setDepth(1);\n\t\trec.setOrigin(0, 0);\n\t\tthis.dayCounterText = this.add.text(rec.x + 20, rec.y + 20, 'Day ' + this.game.gameData.turn + ' of outbreak',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '25px', fontWeight: 'bold' }).setScrollFactor(0).setDepth(1);\n\t\tthis.populationText = this.add.text(rec.x + 20, rec.y + 50, 'Population: ' + this.game.city.getPopulation() +\n\t\t\t'\\nConfirmed Infected: ' + this.game.city.getInfected() +\n\t\t\t'\\nDeaths: ' + this.game.city.getDead(),\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\t\tvar logo = this.add.image(this.game.config.width / 2 + 25, 70, 'logo');\n\t\tlogo.setScale(0.1);\n\t\tlogo.setScrollFactor(0).setDepth(1);\n\t\tlogo.setInteractive({ useHandCursor: true }).on('pointerdown', () => this.virusCheatClicked++);\n\n\t\tvar threatText = this.add.text(this.game.config.width - 380, 25, 'Threat:',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\t\tthis.threatPercent = this.add.text(this.game.config.width - 80, 25, Math.floor(this.game.gameData.threatLevel * 100) + '%',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\n\t\tvar progressBoxRed = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBoxRed.lineStyle(4, 0xeeeeee, 1.0);\n\t\tprogressBoxRed.fillStyle(0x8c0000, 1);\n\t\tprogressBoxRed.strokeRect(this.game.config.width - 300, 20, 200, 30);\n\t\tprogressBoxRed.fillRect(this.game.config.width - 300, 20, 200, 30);\n\n\t\tvar progressBarRed = this.game.gameData.progressBarRed = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBarRed.fillStyle(0xff0000, 1);\n\t\tprogressBarRed.fillRect(this.game.config.width - 300, 20, Math.floor(this.game.gameData.threatLevel * 200), 30);\n\n\n\t\tvar moraleText = this.add.text(this.game.config.width - 380, 65, 'Morale:',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\t\tthis.moralePercent = this.add.text(this.game.config.width - 80, 65, Math.floor(this.game.city.getMorale() * 100) + '%',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\n\t\tvar progressBoxGreen = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBoxGreen.lineStyle(4, 0xeeeeee, 1);\n\t\tprogressBoxGreen.fillStyle(0x245f24, 1);\n\t\tprogressBoxGreen.strokeRect(this.game.config.width - 300, 60, 200, 30);\n\t\tprogressBoxGreen.fillRect(this.game.config.width - 300, 60, 200, 30);\n\n\t\tvar progressBarGreen = this.game.gameData.progressBarGreen = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBarGreen.fillStyle(0x00ff00, 1);\n\t\tprogressBarGreen.fillRect(this.game.config.width - 300, 60, Math.floor(this.game.city.getMorale() * 200), 30);\n\n\t\tvar cureText = this.add.text(this.game.config.width - 380, 105, 'Cure:',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\t\tthis.curePercent = this.add.text(this.game.config.width - 80, 105, Math.floor(this.game.gameData.cure * 100) + '%',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\n\t\tvar progressBoxBlue = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBoxBlue.lineStyle(4, 0xeeeeee, 1);\n\t\tprogressBoxBlue.fillStyle(0x034157, 1);\n\t\tprogressBoxBlue.strokeRect(this.game.config.width - 300, 100, 200, 30);\n\t\tprogressBoxBlue.fillRect(this.game.config.width - 300, 100, 200, 30);\n\n\t\tvar progressBarBlue = this.game.gameData.progressBarBlue = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBarBlue.fillStyle(0x31d5fd, 1);\n\t\tprogressBarBlue.fillRect(this.game.config.width - 300, 100, Math.floor(this.game.gameData.cure * 200), 30, 10);\n\t}", "function handleTopbar() {\n\n\tif ($('#topbar').length && $(window).width() > 768 && !wrapper.hasClass('header-no-sticky')) {\n\t\tif ($('#header').hasClass('header-2')) {\n\t\t\tvar header2Height = $('.header-2 .main-nav-wrapper').height();\n\t\t\tvar windowScrollTop = $(window).scrollTop();\n\t\t\tif (windowScrollTop >= topbarHeight + header2Height) {\n\t\t\t\t$('.header-2 .main-nav-wrapper').css('position', 'fixed').css('width', '100%').css('top', 0);\n\t\t\t} else {\n\t\t\t\t$('.header-2 .main-nav-wrapper').attr('style', '');\n\t\t\t}\n\t\t} else {\n\t\t\tif (scrollPos > 0 && scrollPos <= topbarHeight) {\n\t\t\t\t$('#topbar').css('margin-top', - scrollPos);\n\t\t\t\t$('#topbar').removeClass( 'topbar-out' );\n\t\t\t\t//$('#main-navigation').css('top', 0);\n\t\t\t} else if (scrollPos > topbarHeight ) {\n\t\t\t\t\n\t\t\t\tif ( !$('#topbar').hasClass( 'topbar-out' ) ) {\n\t\t\t\t\t$('#topbar').addClass( 'topbar-out' );\n\t\t\t\t\t$('#topbar').css('margin-top', - topbarHeight);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$('#topbar').removeClass( 'topbar-out' );\n\t\t\t\t$('#topbar').css('margin-top', 0);\n\t\t\t\t//$('#main-navigation').css('top', topbarHeight);\n\t\t\t}\n\t\t}\n\t}\n}", "function moveIt() {\n const appDiv = document.querySelector(\".App\");\n let top = appDiv.getBoundingClientRect().top;\n // Setting up the classNames of bars depending on the scroll position\n\n setBar1Container(\n top <= 0 && top >= (infoBarHeight * 0.5 + navBarHeight) * -1\n ? \"showInfoContainer\"\n : \"hideInfoContainer\"\n );\n\n setBar2Container(\n top <= (infoBarHeight * 0.5 + navBarHeight) * -1 &&\n top >= (infoBarHeight * 1.5 + navBarHeight) * -1\n ? \"showInfoContainer\"\n : \"hideInfoContainer\"\n );\n\n setBar3Container(\n top <= (infoBarHeight * 1.5 + navBarHeight) * -1 &&\n top >= (infoBarHeight * 2.5 + navBarHeight) * -1\n ? \"showInfoContainer\"\n : \"hideInfoContainer\"\n );\n }", "function manageTopPosition()\n {\n var scrollHeight = $(window).scrollTop();\n\n if(scrollHeight > 50 && !tucked)\n {\n tucked = true;\n $(\"#top\").css({\"top\": determineTopHeight() + \"px\", \"position\": \"fixed\"});\n $(\"#nav-bar\").toggleClass(\"tucked\");\n $(\"#nav-bar > .link > div:first\").removeClass(\"hovered\");\n }\n else if (scrollHeight <= 50 && tucked)\n {\n tucked = false;\n $(\"#top\").css({\"top\": \"0\", \"position\": \"absolute\"});\n $(\"#name\").css(\"display\", \"flex\");\n $(\"#nav-bar\").toggleClass(\"tucked\");\n resetNavbar();\n $(\"#nav-bar > .link:first > div:first\").addClass(\"hovered\");\n }\n }", "buildTopBar_() {\n dev().assert(this.container_);\n this.topBar_ = this.win.document.createElement('div');\n this.topBar_.classList.add('i-amphtml-lbv-top-bar');\n\n this.topFill_ = this.win.document.createElement('div');\n this.topFill_.classList.add('i-amphtml-lbv-top-bar-top-fill');\n this.topBar_.appendChild(this.topFill_);\n\n this.topGradient_ = this.win.document.createElement('div');\n this.topGradient_.classList.add('i-amphtml-lbv-top-gradient');\n this.topBar_.appendChild(this.topGradient_);\n\n const close = this.close_.bind(this);\n const openGallery = this.openGallery_.bind(this);\n const closeGallery = this.closeGallery_.bind(this);\n\n // TODO(aghassemi): i18n and customization. See https://git.io/v6JWu\n this.buildButton_('Close', 'amp-lbv-button-close', close);\n this.buildButton_('Gallery', 'amp-lbv-button-gallery', openGallery);\n this.buildButton_('Content', 'amp-lbv-button-slide', closeGallery);\n\n this.container_.appendChild(this.topBar_);\n }", "function undockActionBar(posTop){\n\t\t\t\n\t\t\t \n\t\t\t if($.browser.msie && $.browser.version() < 7){\n\t\t\t\t$('#' + options.actionBarId).css({position:\"absolute\",top:posTop + \"px\"});\n\t\t\t}else{\n\t\t\t\t$('#' + options.actionBarId).css({position:\"fixed\",top:\"0px\"});\t\n\t\t\t}\n\t\t }", "moveTopAppBar_() {\n if (this.checkForUpdate_()) {\n // Once the top app bar is fully hidden we use the max potential top app bar height as our offset\n // so the top app bar doesn't show if the window resizes and the new height > the old height.\n let offset = this.currentAppBarOffsetTop_;\n if (Math.abs(offset) >= this.topAppBarHeight_) {\n offset = -numbers$6.MAX_TOP_APP_BAR_HEIGHT;\n }\n\n this.adapter_.setStyle('top', offset + 'px');\n }\n }", "function stick() {\n if (window.pageYOffset >= sticky) {\n toTopBtn.style.opacity = 1;\n // navbar.classList.add(\"fixed-top\");\n } else {\n toTopBtn.style.opacity = 0;\n // navbar.classList.remove(\"fixed-top\");\n }\n }", "function floatingTopButtonToolbarToggle()\n{\n toolbarToggle.updateForScroll();\n}", "setFixedBarsSizeAndPosition() {\n\t\tconst fixedBars = this.bars.filter(b=> b.bar.isFixed === true && window.getComputedStyle(b.bar.element).visibility !== 'hidden');\n\t\tconst win = {\n\t\t\ttitleBarEl: {offsetHeight: 0},\n\t\t\tdefaultBorderSize: 0,\n\t\t\t_currentTop: 0,\n\t\t\t_currentBottom: 0,\n\t\t\t_currentLeft: 0,\n\t\t\t_currentWidth: window.innerWidth,\n\t\t\t_currentHeight: window.innerHeight,\n\t\t};\n\t\tthis.setWindowBarsSizeAndPosition(fixedBars, win, this, false);\n\t}", "function fixedTopNav() {\n if ($(window).scrollTop() > 1) {\n $('#main-header').addClass('fixed-block');\n } else {\n $('#main-header').removeClass('fixed-block');\n }\n if ($(window).outerWidth() > 992) {\n $('#main-header').removeClass('fixed-block');\n }\n }", "function StickyTop() {\n recalculateTabs();\n\n if($('ul.ux-tabs__dropdown-items li').length < 1){\n $('.ux-tabs__headers').parent().removeClass('col-10').css({'width':'100%'});\n $('.ux-tabs__headers').css({'display':'flex'});\n $('.ux-tabs__headers > li').css({'flex':'auto'});\n }else{\n $(\".ux-tabs__headers >li:first-of-type\").removeAttr('style');\n }\n topnavigation.classList.add(\"sticky\");\n\n }", "function centeredNavBottomBarReposition() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $headerOuter = $headerOuterEl,\r\n\t\t\t\t\t$headerSpan9 = $('#header-outer[data-format=\"centered-menu-bottom-bar\"] header#top .span_9'),\r\n\t\t\t\t\t$headerSpan3 = $('#header-outer[data-format=\"centered-menu-bottom-bar\"] header#top .span_3'),\r\n\t\t\t\t\t$secondaryHeader = $headerSecondaryEl,\r\n\t\t\t\t\t$headerBtns = $headerSpan3.find('nav >ul.buttons'),\r\n\t\t\t\t\t$navLogoMargin = parseInt($('body.material #header-outer').attr('data-padding')),\r\n\t\t\t\t\t$navLogoHeight = parseInt($('body.material #header-outer').attr('data-logo-height')),\r\n\t\t\t\t\t$triggerCondition = ($navLogoMargin*2) + $navLogoHeight - parseInt(nectarDOMInfo.adminBarHeight) + parseInt(nectarDOMInfo.secondaryHeaderHeight);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($secondaryHeader.length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('#header-outer[data-remove-fixed=\"1\"]').length == 0 && $('#header-outer[data-condense=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\tnectarDOMInfo.secondaryHeaderHeight = $headerSecondaryEl.outerHeight();\r\n\t\t\t\t\t\t\t}, 50);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Helper to determine if custom mobile breakpoint is active.\r\n\t\t\t\t\tfunction condenseCustomBreakPointHelper() {\r\n\t\t\t\t\t\tvar $withinCustomBreakpoint = mobileBreakPointCheck();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Adding class to prevent logo from hiding when opening OCM\r\n\t\t\t\t\t\tif ( $withinCustomBreakpoint ) {\r\n\t\t\t\t\t\t\t$headerOuterEl.addClass('within-custom-breakpoint');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$headerOuterEl.removeClass('within-custom-breakpoint');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Bind events if \"Condense Header On Scroll\" effect is enabled.\r\n\t\t\t\t\tif ($('#header-outer[data-condense=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.on('scroll.centeredNavCondense', centeredNavBottomFixed_Scroll);\r\n\t\t\t\t\t\t$window.trigger('scroll');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.on('resize', function(){\r\n\t\t\t\t\t\t\tif(nectarDOMInfo.winW < 1000 ) {\r\n\t\t\t\t\t\t\t\t$headerOuter.addClass('force-condense-remove');\r\n\t\t\t\t\t\t\t\t$window.off('scroll.centeredNavCondense');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.smartresize(function () {\r\n\t\t\t\t\t\t\tcondenseCustomBreakPointHelper();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(nectarDOMInfo.winW >= 1000 ) {\r\n\r\n\t\t\t\t\t\t\t\t// Coming from mobile.\r\n\t\t\t\t\t\t\t\tif($headerOuter.hasClass('force-condense-remove')) {\r\n\r\n\t\t\t\t\t\t\t\t\t// Remove condense effect.\r\n\t\t\t\t\t\t\t\t\tcenteredNavBottomFixed_Scroll();\r\n\t\t\t\t\t\t\t\t\t$headerOuter.removeClass('force-condense-remove');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// See if the condense effect needs to be reapplied.\r\n\t\t\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif(nectarDOMInfo.scrollTop >= $triggerCondition) {\r\n\t\t\t\t\t\t\t\t\t\t\t$headerOuter.addClass('force-condense');\r\n\t\t\t\t\t\t\t\t\t\t\tcenteredNavBottomFixed_Scroll();\r\n\t\t\t\t\t\t\t\t\t\t\t$headerOuter.removeClass('force-condense');\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t// Bind scroll event.\r\n\t\t\t\t\t\t\t\t\t\t$window.on('scroll.centeredNavCondense', centeredNavBottomFixed_Scroll);\r\n\t\t\t\t\t\t\t\t\t},200);\r\n\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}); \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcondenseCustomBreakPointHelper();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction centeredNavBottomFixed_Scroll() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Bypass calculating.\r\n\t\t\t\t\t\tif (nectarDOMInfo.winW < 1000 || \r\n\t\t\t\t\t\t\t$('body.material-ocm-open').length > 0 || \r\n\t\t\t\t\t\t\t$('#header-outer[data-has-menu=\"true\"][data-format=\"centered-menu-bottom-bar\"] .span_9').css('display') == 'none') {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$bodyBorderTop = ($bodyBorderTop.length > 0 && nectarDOMInfo.secondaryHeaderHeight > 0) ? $bodyBorderTop.height() : 0;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Add condense effect.\r\n\t\t\t\t\t\tif ($headerOuter.hasClass('force-condense') || !$headerOuter.hasClass('fixed-menu') && nectarDOMInfo.scrollTop >= $triggerCondition) {\r\n\t\t\t\r\n\t\t\t\t\t\t\tvar amountToMove = (parseInt($headerSpan9.position().top) - $navLogoMargin - parseInt(nectarDOMInfo.adminBarHeight)) + parseInt(nectarDOMInfo.secondaryHeaderHeight) - $bodyBorderTop;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Megamenu removes transparency option\r\n\t\t\t\t\t\t\tif ($('#header-outer[data-megamenu-rt=\"1\"]').length > 0 && $('#header-outer .megamenu').length > 0 && $('#header-outer[data-transparent-header=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('no-transition');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerOuter.addClass('fixed-menu').removeClass('transparent').css({\r\n\t\t\t\t\t\t\t\t'top': '-' + amountToMove + 'px',\r\n\t\t\t\t\t\t\t\t'position': 'fixed'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $headerNavBarOffset = $('header#top .span_9 nav >ul').offset().top;\r\n\t\t\t\t\t\t\tvar $headerButtonsOffset = $headerBtns.offset().top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $headerButtonsHeight = ($headerSpan9.find('.sf-menu > li > a').length > 0) ? (20 - parseInt($headerSpan9.find('.sf-menu > li > a').height())) / 2 : 2;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerBtns.css('transform', 'translateY(' + (parseInt($headerNavBarOffset) - parseInt($headerButtonsOffset) - $headerButtonsHeight - 1) + 'px)');\r\n\t\t\t\t\t\t\t$headerBtns.find('.nectar-woo-cart').css('height', $headerOuter.height() + parseInt($headerOuter.css('top')) - parseInt(nectarDOMInfo.adminBarHeight));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Remove condense effect.\r\n\t\t\t\t\t\telse if ($headerOuter.hasClass('force-condense-remove') || $headerOuter.hasClass('fixed-menu') && nectarDOMInfo.scrollTop < $triggerCondition ) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerOuter.removeClass('fixed-menu').css({\r\n\t\t\t\t\t\t\t\t'top': '0',\r\n\t\t\t\t\t\t\t\t'position': 'absolute'\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t$headerBtns.css('transform', 'translateY(0px)');\r\n\t\t\t\t\t\t\t$headerBtns.find('.nectar-woo-cart').css('height', '');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($('#header-outer.transparent').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($('#header-outer[data-megamenu-rt=\"1\"]').length > 0 && \r\n\t\t\t\t\t\t\t\t$('#header-outer .megamenu').length > 0) {\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('no-transition');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($('#header-outer[data-megamenu-rt=\"1\"]').length > 0 && \r\n\t\t\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t\t\t$('#header-outer .megamenu').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') == 'true' && \r\n\t\t\t\t\t\t\t\t\t$('.nectar-box-roll').length == 0 && \r\n\t\t\t\t\t\t\t\t\t$('.megamenu.sfHover').length == 0) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('no-transition');\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\telse if ($headerOuterEl.attr('data-transparent-header') == 'true' && \r\n\t\t\t\t\t\t\t\t\t$('.nectar-box-roll').length == 0 && \r\n\t\t\t\t\t\t\t\t\t$('.megamenu.sfHover').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('no-transition');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') == 'true' && $('.nectar-box-roll').length == 0) {\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} // endif transparent header conditional.\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} // End Remove condense effect.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} // End centeredNavBottomFixed_Scroll.\r\n\t\t\t\t\t\r\n\t\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function setTopBar() {\n return __awaiter(this, void 0, void 0, function () {\n var iframe, body;\n return __generator(this, function (_a) {\n // Check if the site supported\n if (!siteIsSupported()) {\n return [2 /*return*/];\n }\n iframe = document.createElement(\"iframe\");\n iframe.src = chrome.runtime.getURL(\"topbar.html\");\n iframe.id = yankeemallIframeId;\n iframe.style.position = \"fixed\";\n iframe.style.top = \"20vh\";\n iframe.style.left = \"86vw\";\n iframe.style.zIndex = \"1000000000000000000\";\n iframe.style.width = \"12vw\";\n // iframe.style.height = \"100%\";\n iframe.style.border = \"none\";\n iframe.style.display = \"block\";\n iframe.style.opacity = \"1\";\n body = document.querySelector(\"body\");\n body.append(iframe);\n return [2 /*return*/];\n });\n });\n}", "function fixMainOffset() {\n if (statusContainer && statusContainer.length > 0) {\n $('body').css('paddingTop', statusContainer.outerHeight());\n }\n }", "function fixedNavStyle() {\n\t\tif($('.fixed-top-bar').length){\n\t\t\tvar windowHeight = $(window).height();\n\t\t\tvar windowpos = $(window).scrollTop();\n\t\t\tvar fixedBar = $('.fixed-top-bar');\n\t\t\tif (windowpos >= windowHeight) {\n\t\t\t\t$('body').addClass('banner-height-reached');\n\t\t\t\tfixedBar.addClass('now-fixed');\n\t\t\t} else {\n\t\t\t\t$('body').removeClass('banner-height-reached');\n\t\t\t\tfixedBar.removeClass('now-fixed');\n\t\t\t}\n\t\t}\n\t}", "function displayStickyMegaBar() {\n $(\".header-mega-menu .mega-menu-lg-container\").addClass('sticky-show');\n $(\".lg-down-header .mega-menu-lg-down-container\").addClass('sticky-show');\n $(\".header .lg-navbar .login-button\").removeClass(\"d-block\").addClass(\"d-none\");\n $(\".header-mega-menu .login-button-sticky\").removeClass(\"d-none\").addClass(\"d-block\");\n $(\".sticky-navbar\").removeClass(\"login-button-sticky-none\").addClass(\"login-button-sticky-block\");\n displayStickyBarWithAnimate();\n addTopAtCompareTable();\n }", "function freeze() {\n if($(\"html\").css(\"position\") != \"fixed\") {\n var top = $(\"html\").scrollTop() ? $(\"html\").scrollTop() : $(\"body\").scrollTop();\n if(window.innerWidth > $(\"html\").width()) {\n $(\"html\").css(\"overflow-y\", \"scroll\");\n }\n //$(\"html\").css({\"width\": \"100%\", \"height\": \"100%\", \"position\": \"fixed\", \"top\": -top});\n $(\"html\").css({\"width\": \"100%\", \"height\": \"100%\", \"position\": \"fixed\", \"top\": -top});\n $('.topbar').css('padding-top',top); \n }\n }", "function thememascot_scrollToFixed() {\n $('.navbar-scrolltofixed').scrollToFixed();\n }", "function stickyBar() {\n if (window.pageYOffset > 0) {\n navbar.classList.add(\"nav-bg-trans\");\n navChild.classList.add(\"nav-child-shrink\"); \n navbar.classList.add(\"shadow-sm\");\n toTop.classList.add(\"show-me\"); \n \n } else {\n navbar.classList.remove(\"nav-bg-trans\");\n navChild.classList.remove(\"nav-child-shrink\"); \n navbar.classList.remove(\"shadow-sm\");\n toTop.classList.remove(\"show-me\"); \n }\n }", "function maybeHideGlobalBackToTopButton() {\n var hideGlobalBackToTopButton = false,\n activeTab;\n\n if (consoleTab.is(':visible')) {\n hideGlobalBackToTopButton = true;\n activeTab = consoleTab;\n }\n\n globalBackToTopButton.toggleClass('back_to_top', !hideGlobalBackToTopButton);\n if (hideGlobalBackToTopButton){\n globalBackToTopButton.hide();\n } else {\n globalBackToTopButton.show();\n }\n\n if (!activeTab) {\n return;\n }\n\n if (!activeTab.data('enable-scroll-to-fixed')) {\n activeTab.data('enable-scroll-to-fixed', true);\n var topActionBar = activeTab.find('.console-action-bar'),\n bottomActionBar = activeTab.find('.console-footer-action-bar');\n\n topActionBar.pinOnScroll({\n 'z-index': 9,\n top: 90,\n requiredScroll: 233\n });\n\n bottomActionBar.pinOnScroll({\n 'z-index': 100,\n requiredScroll: 0,\n bottomLimit: function () {\n return Math.min($window.height(), bottomActionBar.parent().get(0).getBoundingClientRect().bottom) - bottomActionBar.outerHeight(true);\n }\n });\n } else {\n return;\n }\n }", "function stikyNav() {\n\n top = allWindow.scrollTop();\n\n if ( top >= 100 ) {\n navBar.addClass(\"nav-sticky\");\n\n } else {\n navBar.removeClass(\"nav-sticky\");\n }\n\n // SHow Also Scroll up Button\n if ( top >= 1000 ) {\n $('.scroll-up').addClass(\"show-up-btn\");\n } else {\n $('.scroll-up').removeClass(\"show-up-btn\");\n }\n }", "renderTopBar() {\n\t\treturn <TopBar\n\t\t\tcolor={colorsProvider.routinesMainColor}\n\t\t\tfromCreate={true}\n\t\t\thasParent={false}\n\t\t\tnameOfItem={this.state.name}\n\t\t\thasDueDate={false}\n\t\t\timportance={this.state.importance}\n\t\t\tallChildren={this.state.allPossibleChildren}\n\t\t\tcloseModal={this.props.closeModal}\n\t\t\teditName={item => {\n\t\t\t\tthis.setState({ name: item });\n\t\t\t\tthis.props.name(item);\n\t\t\t}}\n\t\t\thasImportance={true}\n\n\t\t\tsetImportanceNN={() => {\n\t\t\t\tKeyboard.dismiss()\n\t\t\t\tthis.props.setImportanceNN(1)\n\t\t\t}}\n\t\t\tsetImportanceNU={() => {\n\t\t\t\tKeyboard.dismiss()\n\t\t\t\tthis.props.setImportanceNU(2)\n\t\t\t}}\n\t\t\tsetImportanceIN={() => {\n\t\t\t\tKeyboard.dismiss()\n\t\t\t\tthis.props.setImportanceIN(3)\n\t\t\t}}\n\t\t\tsetImportanceIU={() => {\n\t\t\t\tKeyboard.dismiss()\n\t\t\t\tthis.props.setImportanceIU(4)\n\t\t\t}}\n\t\t\tselectParent={() => {\n\t\t\t\tKeyboard.dismiss();\n\t\t\t}}\n\t\t/>\n\t}", "function initFixConfiguratorSidebar()\n\t{\n\t\tvar topOffset = $(\".header-sticky\").outerHeight();\n\n\t\t$(window).on('scroll', function(){\n\t\t\tfixConfiguratorSidebar(topOffset);\n\t\t});\n\n\t\twindow.addEventListener('resize', function(){\n\t\t\ttopOffset = $(\".header-sticky\").outerHeight();\n\t\t});\n\t}", "function topBarToggle () {\n var model = modelConnect();\n var topBarToggleAPI = \"toggleTopBar()\";\n model.postMessage(topBarToggleAPI,\"*\");\n}", "get fixedTopGap() { return this._fixedTopGap; }", "function scrollToTopInit() {\r\n\r\n\t\t\t\t\t// Show/hide based on scroll pos\r\n\t\t\t\t\tif ($('.nectar-social.fixed').length == 0) {\r\n\t\t\t\t\t\ttoTopBind();\r\n\t\t\t\t\t} \r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Rounded style\r\n\t\t\t\t\tif ($('body[data-button-style*=\"rounded\"]').length > 0) {\r\n\t\t\t\t\t\tvar $clone = $('#to-top .fa-angle-up').clone();\r\n\t\t\t\t\t\t$clone.addClass('top-icon');\r\n\t\t\t\t\t\t$('#to-top').prepend($clone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Scroll up click event\r\n\t\t\t\t\t$body.on('click', '#to-top, a[href=\"#top\"]', function () {\r\n\t\t\t\t\t\t$('body,html').stop().animate({\r\n\t\t\t\t\t\t\tscrollTop: 0\r\n\t\t\t\t\t\t}, 800, 'easeOutQuad', function () {\r\n\t\t\t\t\t\t\tif ($('.nectar-box-roll').length > 0) {\r\n\t\t\t\t\t\t\t\t$body.trigger('mousewheel', [1, 0, 0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function initFixPreviewSidebar()\n\t{\n\t\tvar $userMenuHeight = Body.hasClass('body-tablet') ? $(\".header-main\").outerHeight() : $(\".header-sticky\").outerHeight();\n\t\tvar topOffset = $userMenuHeight + $('.step-tabs-nav__list').height();\n\n\t\t$(window).on('scroll', function(){\n\t\t\ttopOffset = $userMenuHeight + $('.step-tabs-nav__list').height();\n\n\t\t\tfixPreviewSidebar(topOffset);\n\t\t});\n\n\t\twindow.addEventListener('resize', function(){\n\t\t\ttopOffset = $userMenuHeight + $('.step-tabs-nav__list').height();\n\t\t});\n\t}", "function hideStickyMegaBar() {\n $(\".header-mega-menu .mega-menu-lg-container\").removeClass('sticky-show');\n $(\".lg-down-header .mega-menu-lg-down-container\").removeClass('sticky-show');\n $(\".header .lg-navbar .login-button\").removeClass(\"d-none\").addClass(\"d-block\");\n $(\".header-mega-menu .login-button-sticky\").removeClass(\"d-block\").addClass(\"d-none\");\n $(\".sticky-navbar\").removeClass(\"login-button-sticky-block\").addClass(\"login-button-sticky-none\");\n addTop0AtCompareTable();\n }", "static fixCanvasUIBar(container, canvas, navbar) {\n var canvasHeight = window.getComputedStyle(canvas).height;\n var containerHeight = window.getComputedStyle(container).height;\n\n canvasHeight = parseFloat(canvasHeight.substr(0, canvasHeight.length - 2));\n containerHeight = parseFloat(containerHeight.substr(0, containerHeight.length - 2));\n\n var shadowPaddingHeight = canvasHeight - containerHeight;\n if (shadowPaddingHeight < 0) {\n navbar.style.marginTop = `${shadowPaddingHeight}px`;\n }\n }", "function handleScroll() {\n var yPos = window.pageYOffset\n if (yPos>700) {\n setShowTopButton(true)\n } else {\n setShowTopButton(false)\n }\n }", "function top_calcul(){\r\n \r\n pose_menu();\r\n \r\n if(xsmall){\r\n top2=$('.g-head').innerHeight() + 524;\r\n }else{\r\n var cons=0;\r\n if(small){\r\n cons=170;\r\n }else if(md){\r\n cons=170;\r\n }else if(lg){\r\n cons=105;\r\n }\r\n //alert(cons);\r\n top2=$('.g-head').innerHeight() + $('.slide').innerHeight()-($('.sous-bloc').innerHeight()+cons);\r\n }\r\n }", "function mainBarScrollHandler(element){\n\t if ($(element).scrollTop() > 135) {\n \t $('#main-nav-bar').addClass('fixed').addClass('slideDown');\n \t if($(this).scrollTop()>157){\n\t \t if($('body').hasClass('p-157')){\n\t \t \t$('body').removeClass('p-157');\n\t \t }\n\t \t $('body').addClass('p-210');\n \t\t }else {\n \t \tif($('body').hasClass('p-210')){\n \t \t\t$('body').removeClass('p-210');\n \t \t}\n \t \t$('body').addClass('p-157');\n \t }\n \t $('#csi-logo').css({'visibility': 'hidden'});\n \t $('#brand_logo').css('width', '200px').fadeIn();\n } else {\n\t $('#brand_logo').css('width', 0).fadeOut(50);\n \t if($('body').hasClass('p-157')){\n \t \t$('body').removeClass('p-157');\n \t }\n \t if($('body').hasClass('p-210')){\n \t \t$('body').removeClass('p-210');\n \t }\n \t $('#csi-logo').css({'visibility': 'visible'});\n $('#main-nav-bar').removeClass('fixed').removeClass('slideDown');\n }\n}", "function updateTitileBar () {\n const nbg = getComputedStyle(document.documentElement).getPropertyValue('--main-background-light').trim()\n console.log(nbg)\n ctb.updateBackground(customTitlebar.Color.fromHex(nbg))\n}", "function head () {\n\t\t\n\t\tif (clientWidth < 800) {\n\n\t\t\tif ($(this).scrollTop() > 100) \n\t\t\t\t$logoBar.css('display', 'none');\n\t\t\telse\n\t\t\t\t$logoBar.css('display', 'block');\n\n\t\t} else {\n\n\t\t\t$logoBar.css('display', 'block');\n\t\t}\n\t}", "topAppBarScrollHandler_() {\n const currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);\n const diff = currentScrollPosition - this.lastScrollPosition_;\n this.lastScrollPosition_ = currentScrollPosition;\n\n // If the window is being resized the lastScrollPosition_ needs to be updated but the\n // current scroll of the top app bar should stay in the same position.\n if (!this.isCurrentlyBeingResized_) {\n this.currentAppBarOffsetTop_ -= diff;\n\n if (this.currentAppBarOffsetTop_ > 0) {\n this.currentAppBarOffsetTop_ = 0;\n } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {\n this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;\n }\n\n this.moveTopAppBar_();\n }\n }", "function WINDOW_HEADER$static_(){ToolbarSkin.WINDOW_HEADER=( new ToolbarSkin(\"window-header\"));}", "function initWindowScrollEvent() {\n // Listen for scroll events\n window.onscroll = function() { stick() };\n\n var navbar = document.querySelector('.header-wrapper');\n var sticky = navbar.offsetTop + 70; // 70 is the height of the footer\n\n function stick() {\n if (window.pageYOffset >= sticky) {\n toTopBtn.style.opacity = 1;\n // navbar.classList.add(\"fixed-top\");\n } else {\n toTopBtn.style.opacity = 0;\n // navbar.classList.remove(\"fixed-top\");\n }\n }\n }", "function fixMenuBar(){\n\t\tvar scrolTop = $(window).scrollTop();\n\t\tvar width = $(window).width();\n\t\t\tif (width<1215){\n\t\t\t\tif(scrolTop>=123){\n\t\t\t\t\t$('body').addClass(\"scroll_padding-top\")\n\t\t\t\t\t$(\".main-menu\").addClass(\"fixed\");\n\t\t\t\t} else {\n\t\t\t\t\t\t$(\".main-menu\").removeClass(\"fixed\");\n\t\t\t\t\t\t$('body').removeClass(\"scroll_padding-top\")\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tif(window.location.pathname== host_pathname || window.location.pathname== '/index.html'){\n\t\t\t\t\t//show-hide menu\n\t\t\t\t\tif(scrolTop>=645 && scrolTop<=860){\n\t\t\t\t\t\t$('.main-menu .catalog-list').removeClass('open')\n\t\t\t\t\t}\n\t\t\t\t\telse if(scrolTop<645) {\n\t\t\t\t\t\t$('.main-menu .catalog-list').addClass('open')\n\t\t\t\t\t}\n\n\t\t\t\t\t//fix menu\n\t\t\t\t\tif(scrolTop>=645){\n\t\t\t\t\t\t$('body').addClass(\"scroll_padding-top\");\n\t\t\t\t\t\t$(\".main-menu\").addClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$('body').removeClass(\"scroll_padding-top\")\n\t\t\t\t\t\t$(\".main-menu\").removeClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t//if we are not on index.html\n\t\t\t\t}else{\n\t\t\t\t\tif(scrolTop>=136){\n\t\t\t\t\t\t$('body').addClass(\"scroll_padding-top\");\n\t\t\t\t\t\t$(\".main-menu\").addClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$('body').removeClass(\"scroll_padding-top\")\n\t\t\t\t\t\t$(\".main-menu\").removeClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\n\t}", "function buttonFixed() {\n\t\tvar\twin\t\t = $(window),\n\t\t\tbutton\t = $('.js-bookbtn'),\n\t\t\tbuttonHeight = button.outerHeight(),\n\t\t\tscrollPos\t = win.scrollTop(),\n\t\t\tbottomPos\t = $('.js-bottom').offset().top,\n\t\t\tabsolutePos = $('.js-bottom').offset().top + $('.js-bottom').outerHeight() - buttonHeight;\n\n\t\tif ( scrollPos > 0 && scrollPos < bottomPos && win.width() > 900) {\n\t\t\tbutton.addClass('is-fixed').css('top', 'initial');\n\t\t} else if (scrollPos == 0 || win.width() < 900) {\n\t\t\tbutton.removeClass('is-fixed').css('top', 'initial');\n\t\t} else {\n\t\t\tbutton.removeClass('is-fixed').css('top', absolutePos);\n\t\t}\n\t}", "get topBar() {\n return $(\"//*[@id='header']/div[2]\");\n }", "function showToTop() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (nectarDOMInfo.scrollTop > 350 && !$offCanvasEl.is('.fullscreen.open') ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#to-top').stop().transition({\r\n\t\t\t\t\t\t\t'bottom': '17px'\r\n\t\t\t\t\t\t}, 350, 'easeInOutCubic');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.off('scroll', showToTop);\r\n\t\t\t\t\t\t$window.on('scroll', hideToTop);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function applyTopBarStyling() {\n\t\t\t$('.ef-top-bar #lang-dropdown-select-language option').each(function() {\n\t\t\t\t$(this).text($(this).val());\n\t\t\t});\n\t\t\t$( \".ef-top-bar .block-menu-menu-ef-user-login-links-menu\" ).prepend( \"<a class='user-top-bar' href='#'>User</a>\" );\n\t\t\t$( \".ef-top-bar .block-search\").prepend( \"<a class='search-top-bar' href='#'>Search</a>\" );\n\t\t\t$(\"a.user-top-bar\").click(function(){\n\t\t\t $(\".ef-top-bar .block-menu-menu-ef-user-login-links-menu .menu \").toggleClass(\"active\");\n\t\t\t}); \n\t\t\t\n\t\t\t$(\"a.search-top-bar\").click(function(){\n\t\t\t $(\".ef-top-bar #search-block-form\").toggleClass(\"active\");\n\t\t\t}); \n\t\t\t\n\t\t\t$(\".ef-top-bar #main-menu li a\").each(function() {\n\t\t\t var $link = $(this);\n\t\t\t $link.addClass('icon-ef_' + $link.html().toLowerCase().trim().replace(/[^a-z0-9]+/gi, '_').replace(/^_+/, '').replace(/_+$/, ''));\n\t\t\t});\n\t\t}", "function topButtonPosition() {\n var console, consoleHeight, bottom, winHeight;\n var el = $('#top');\n console = $('#console-content');\n if (el.length) {\n consoleHeight = console.outerHeight();\n winHeight = $(window).height();\n bottom = console.offset().top + consoleHeight - ( $(window).scrollTop() + winHeight);\n\n if (bottom > 0) {\n el.css({bottom: bottom});\n } else {\n el.css({bottom: 0});\n }\n }\n}", "function centeredNavBottomBarInit() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('#header-outer[data-format=\"centered-menu-bottom-bar\"]').length > 0) {\r\n\t\t\t\t\t\tcenteredNavBottomBarReposition();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "setStickyTop() {\n // Ensures sticky ad fades in below other content in sidebar\n // Subtract height of daily deals also b/c it's transformed up\n this.stickyTop = this.trigger.offset().top\n }", "function initProfileTopBarHeaderBugFixEnter() {\n\t\t \tangular.forEach(document.querySelectorAll('ion-header-bar'), function(v) {\n\t\t\t var element = angular.element(v);\n\t\t\t element.addClass('theme-'+$rootScope.profileTheme);\n\t\t\t });\n\t\t\t}", "function headerFixed() {\n scrollTop = $(window).scrollTop();\n if(scrollTop > 0){\n $header.addClass('minimized')\n }\n else {\n $header.removeClass('minimized')\n }\n }", "function fixTopbar() {\n\n /* Set the Height of the innerOverlay according to the height of the window */\n $('#innerOverlay').css('height', $(window).height() - 72);\n\n /* Add the font-size controll again */\n $('#fontsizeselector').on('blur', function () {\n console.log($(this).val());\n if ($(this).val() < 3 || $(this).val() > 72) {\n $(this).val(12);\n }\n });\n\n fixCollapsedButtons();\n\n /* Applies fontfamily selection again */\n $('#fontfamilyselector').on('change', function () {\n $('#fontfamilyselector').css('font-family', `${this.value}, sans-serif`);\n });\n}", "function commonPageHeaderBar(centeredText, pathToBase) {\n theDivWeWant = document.getElementById(\"headerTopBar\");\n theDivWeWant.style.position=\"absolute\";\n theDivWeWant.style.left=\"0px\";\n theDivWeWant.style.top=\"0px\";\n theDivWeWant.style.height =\"160px\";\n theDivWeWant.style.backgroundColor=\"#862507\";\n theDivWeWant.style.border=\"0px none\";\n deviceWidth = window.innerWidth - window.pageXOffset;\n if (deviceWidth < screen.width)\n deviceWidth = screen.width;\n //window.alert(\"width = \" + deviceWidth.toString());\n theDivWeWant.style.width=deviceWidth.toString() + \"px\";\n theDivWeWant.style.minWidth=\"1024px\";\n //theDivWeWant.style.minWidth=\"1200px\";\n theDivWeWant.innerHTML = '<a href=\"' + pathToBase + 'index.html\"> <p style=\"margin:0px 0px 0px 0px;position:absolute;left:20px;width:30%;top:20px;font-family:Georgia, serif;font-size: 40px;color:white\">THEMNMOORES.NET</p> </a><img src=\"' + pathToBase + 'pictures/familysmall2.jpg\" alt=\"Family\" height=\"160\" style=\"position:relative;left:85%;top:0px\"><p style=\"margin:0px 0px 0px 0px;position:relative;right;left:0%;width:100%;top:-60px;text-align: center;font-family:Georgia, serif;font-size: 40px;color:white\">' + centeredText +'</p>';\n theDivWeWant.innerHTML += '<link rel=\"icon\" type=\"image/x-icon\" href=\"data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA/v7+AP///wCXl5cAZmZmAJ2dnQB9fX0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgIAAgACAgICAgICAgIAIgICAgICAgACAAIEBAQCAgICAgAEAAIAAiIiRERCIiIiIiJEREIiIiIiIkREQiIiIiIiRERCIiIiIiJEREQSIiIiIkREREQiIiAjBAQAAiIiICUGAgIiIiIgIgACACIiIiAiAgICIiIiAAICAgACIiIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" >'\n}", "function renderTopBar() {\n let canvas = document.querySelector(\"#topBarCanvas\")\n canvas.setAttribute(\"width\", document.body.clientWidth)\n canvas.setAttribute(\"height\", 50)\n let ctx = canvas.getContext(\"2d\")\n drawLine(ctx, 0, 0, canvas.width, 0, 8)\n for(let i = 0; i < 20; i++) {\n horizontalPos = i * canvas.width / 19\n horizontalPosInUnits = horizontalPos / canvas.width * (pageEnd - pageStart) + pageStart\n drawLine(ctx, horizontalPos, 3, horizontalPos, 12)\n drawText(ctx, Math.round(horizontalPosInUnits * 10) / 10, {x: horizontalPos - 12, y: 28})\n }\n}", "function UpdateTopBarNavigation(data) {\n\t\t$(\"#PlatformAdminToolbarContainer .HomeLink img:first\").attr('src',\n\t\t\t\tdata.logoUrl);\n\t\t$(\"#PlatformAdminToolbarContainer #UIToolbarContainer:first\")\n\t\t\t\t.removeAttr(\"class\");\n\t\t$(\"#PlatformAdminToolbarContainer #UIToolbarContainer:first\").addClass(\n\t\t\t\t\"UIContainer UIToolbarContainer UIToolbarContainer\"\n\t\t\t\t\t\t+ data.style);\n\t}", "function topScroll() {\r\n if (window.pageYOffset >= sticky) {\r\n navbar.classList.add(\"sticky\")\r\n } else {\r\n navbar.classList.remove(\"sticky\");\r\n }\r\n }", "function setWindowScrollFunction() {\n var offset = $( window ).height() / 2;\n if ( $( this ).scrollTop() > offset ) {\n\n // go to top button show\n $toTopBtn\n .css( 'opacity', '1' )\n .css( 'cursor', 'pointer' );\n\n $( '#contact-section' ).css( 'top', '76px' );\n\n } else {\n\n // go to top button hide\n $toTopBtn\n .css( 'opacity', '0' )\n .css( 'cursor', 'default' );\n\n $( '#contact-section' ).css( 'top', '244px' );\n }\n }", "function showBackToTopButton(){\n if( $(window).scrollTop() >= backToTopFadeinPosition){\n backtoTop.css({'display':'inline-block'});\n }else{\n backtoTop.css({'display':'none'});\n }\n //console.log('Window Position = ' + $(window).scrollTop()); \n }", "function navPostion(windowScroll)\n {\n let servicesTop = $(\"#services\").offset().top;\n if (windowScroll > servicesTop-200 ) \n {\n $(\".navbar\").css(\"backgroundColor\", \"rgba(0,0,0,0.8)\");\n $(\".navbar\").css(\"position\", \"fixed\");\n }\n else \n {\n $(\".navbar\").css(\"backgroundColor\", \"transparent\");\n $(\".navbar\").css(\"position\", \"absolute\");\n }\n }", "function window_scroll() {\n\n var scroll_top = $(window).scrollTop() - $('#canvas').offset().top;\n\n // Show/Hide Header\n\n var header_sidebar_toggle = $('.canvas-sidebar-toggle');\n\n if (scroll_top > 0) {\n\n header_sidebar_toggle.addClass('fade');\n\n } else {\n\n header_sidebar_toggle.removeClass('fade');\n\n }\n\n }", "function headerSticky(){\n\t\tvar windowPos=$(window).scrollTop();\n\t\tif( windowPos>20){\n\t\t\t// SCROLL\n\t\t\t$('.fixed-top').addClass(\"on-scroll\");\n\t\t\t$('#svg-normal').removeClass(\"svg-hidden\");\n\t\t\t$('#svg-branca').addClass(\"svg-hidden\");\n\t\t\t$('.nav-link ').addClass(\"my-menu-scroll\");\n\t\t} else {\n\t\t\t// FIXADO (É O INICIAL)\n\t\t\t$('.fixed-top').removeClass(\"on-scroll\");\n\t\t\t$('#svg-normal').addClass(\"svg-hidden\");\n\t\t\t$('#svg-branca').removeClass(\"svg-hidden\");\n\t\t\t$('.nav-link ').removeClass(\"my-menu-scroll\");\n\t\t}\n\t}", "static get properties(){return{/**\n * Sticky is not available on the mini toolbar\n */sticky:{name:\"sticky\",type:Boolean,value:!1,readOnly:!0}}}", "function scrollFunction_topBtn() {\r\n if (\r\n document.body.scrollTop > 20 ||\r\n document.documentElement.scrollTop > 20\r\n ) {\r\n toTopBtn.style.display = \"block\";\r\n } else {\r\n toTopBtn.style.display = \"none\";\r\n }\r\n }", "function SIDE$static_(){ToolbarSkin.SIDE=( new ToolbarSkin(\"side\"));}", "function upload_floatingbar(floatingbar,top_button,bottom_button, h)\n{\n\tif($(floatingbar))\n\t{\t\n\t\t$(document).scroll(function() {\t\t\n\t\t\tif($(top_button).position())\n\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif(parseFloat($(top_button).position().top) < parseFloat($(window).scrollTop()))\n\t\t\t\t{\t\n\t\t\t\t\t$(floatingbar).css({height: 0}).animate({ height: h}, 40);\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$(floatingbar).animate({ height: 0}, 40);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function sticktothetop() {\n var window_top = $(window).scrollTop();\n var top = $('#stick-here').offset().top;\n if (window_top >= top) {\n $('#stickThis').slideDown('fast');\n $('.bars').fadeIn('slow');\n // on load\n if ($(window).width() +20 <= 900) {\n $('.menu-container').fadeIn(500);\n } else {\n $('.menu-container').css('display', 'none');\n }\n // on window resize\n $(window).resize( () => {\n if ($(window).width() + 20 <= 900) {\n $('.menu-container').fadeIn(500);\n } else {\n $('.menu-container').css('display', 'none');\n }\n });\n } else {\n $('#stickThis').css('display', 'none');\n $('.menu-container').css('display', 'none');\n }\n }", "function dockActionBar(posTop){\n\t\t\t$('#' + options.actionBarId).css({position:\"\"});\n\t\t\tif($.browser.safari){\n\t\t\t\t//css position will only update if something is physically updated for safari\n\t\t\t\t$('#safariErrFix').html(\"\");\n\t\t\t}\n\t\t\t\n\t\t }", "function getOriginalTop() {\r\n appxOffsetTop = getVisible(\"appx_main_container_wrapper\");\r\n}", "function cms_stiky_menu() {\r\n\t\tif (header_top < scroll_top && window_width > 992) {\r\n\t\t\tswitch (true) {\r\n\t\t\t\tcase (window_width > 0):\r\n\t\t\t\t\theader.addClass('header-fixed');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\theader.removeClass('header-fixed');\r\n\t\t}\r\n\t}", "function MAIN_NAVIGATION$static_(){ToolbarSkin.MAIN_NAVIGATION=( new ToolbarSkin(\"main-navigation\"));}", "function headerStyle() {\n if ($window.width() >= 992) {\n if ($header.length) {\n var windowpos = $window.scrollTop();\n if (windowpos >= 200) {\n $header.addClass('fixed-top');\n } else {\n $header.removeClass('fixed-top');\n $page_wrapper.removeClass('overlay');\n $sidenav.removeClass('visible');\n }\n }\n }\n }", "function addButtonToTop(e) {\n if (window.pageYOffset > 15) {\n buttonToTop.classList.remove('no-show');\n } else {\n buttonToTop.classList.add('no-show');\n }\n}", "function ScrollSiderBar(){\n if(WindowWidth >=1200){\n var scroll=$(window).scrollTop(),\n top=$(\"#header\").outerHeight();\n\n $('.detail-cn').each(function(index, value){\n\n var $this=$(this),\n\n offset=$this.offset().top,\n\n height=$this.outerHeight(),\n\n $taget=$this.find('.scroll-heading'),\n\n eheight=$taget.outerHeight(),\n\n scroll_top=scroll-offset +top;\n\n if(scroll_top>0){\n if(height-scroll_top>=0 && (height- eheight) >scroll_top){\n $taget.css({\n 'position': 'fixed',\n 'top': +top+'px'\n });\n }else{\n $taget.css({'position':'static'});\n }\n }else{\n $taget.css({'position':'static'});\n }\n });\n\n $('.scroll-heading a').on('click',function(){\n var id=$(this).attr('href');\n $('html, body').stop().animate({\n scrollTop: $(id).offset().top-70\n }, 1000);\n\n return false;\n });\n }\n }", "function unfreeze() {\n if($(\"html\").css(\"position\") == \"fixed\") {\n var top = $(\"html\").scrollTop() ? $(\"html\").scrollTop() : $(\"body\").scrollTop();\n $(\"html\").css(\"position\", \"static\");\n $(\"html, body\").scrollTop(-parseInt($(\"html\").css(\"top\")));\n $(\"html\").removeAttr('style');\n //$(\"html\").css({\"position\": \"\", \"width\": \"\", \"height\": \"\", \"top\": \"\", \"overflow-y\": \"\"});\n\n // Prevent top banner going down for IE\n if (checkIE()) {\n $('.topbar').css('padding-top', top);\n }else{\n $('.topbar').css('padding-top', -top);\n }\n }\n }", "function sticky_navigation() {\n var scroll_top = document.body.scrollTop; // our current vertical position from the top\n // if we've scrolled more than the navigation, change its position to fixed to stick to top,\n if ($(window).scrollTop() > 250 && $(window).width() >= 960) {\n topBar.addClass('scroll-top-bar');\n navCell.addClass('scroll-nav-tile');\n } else {\n topBar.removeClass('scroll-top-bar');\n navCell.removeClass('scroll-nav-tile');\n }\n }", "function calcdockstick() {\n var annualDockTop = $(\".bfs-income-tax-calulator\").parent().offset();\n var topHeader = $(\".bfs-header-wrap\").outerHeight();\n\n if(annualDockTop != undefined && topHeader != undefined){\n \tif ($(window).scrollTop() >= annualDockTop.top) {\n $(\".summary-main-wrapper\").css({ \"top\": topHeader + \"px\" });\n $(\".summary-main-wrapper\").addClass(\"incomedockfixed\");\n }\n else {\n $(\".summary-main-wrapper\").removeClass(\"incomedockfixed\");\n }\n } \n}", "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n }", "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n }", "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n }", "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n }", "async _refreshBarTitle() {\n this._top.attr(\"width\", this._dimView.width).attr(\"height\", this._barTitleHeight);\n }", "function MDCShortTopAppBarFoundation(adapter) {\n var _this = _super.call(this, adapter) || this;\n\n _this.isCollapsed_ = false;\n _this.isAlwaysCollapsed_ = false;\n return _this;\n }", "function fixedMenuPos() {\n if (window.scrollY >= heroBottom) {\n fixedMenu.style.position = 'fixed';\n fixedMenu.style.top = headerHeight + 'px';\n } else {\n fixedMenu.style.position = 'absolute';\n fixedMenu.style.top = topHeroHeight + 'px';\n }\n }", "function scrollFunction() {\n if (window.innerHeight < 144 || document.documentElement.scrollTop < 144) {\n document.getElementById(\"navbar\").style.top = \"144px\";\n console.log(window.scrollY)\n empo.style.display=\"none\"\n } else {\n document.getElementById(\"navbar\").style.top = \"0px\";\n console.log(window.scrollY)\n empo.style.display=\"initial\"\n\n }\n }", "function fixed() {\n\tif (!document.all) return;\n\tif (side) side.style.pixelTop=document.body.scrollTop+100; \n if (!footer)\n\tfooter.style.display='none'; \n\tfooter.style.bottom='0px'; \n\tfooter.style.display=''; \n}", "function handleTopNav() {\n\tconst topPixels = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;\n\tif (topFixed) {\n\t\tif (topPixels < topNavPixels) {\n\t\t\ttopNav.classList.toggle(\"fixed-top\");\n\t\t\ttopNavPadding.classList.toggle(\"top-nav-padding\");\n\t\t\ttopNavPadding.classList.toggle(\"hidden\");\n\t\t\ttopFixed = false;\n\t\t}\n\t} else {\n\t\tlet topNavPixels = topNav.offsetTop;\n\t\tif (topPixels >= topNavPixels) {\n\t\t\ttopNav.classList.toggle(\"fixed-top\");\n\t\t\ttopNavPadding.classList.toggle(\"top-nav-padding\");\n\t\t\ttopNavPadding.classList.toggle(\"hidden\");\n\t\t\ttopFixed = true;\n\t\t}\n\t}\n}", "function createTopButtonToolbarToggle()\n{\n toolbarToggle.createToolbar();\n}", "get topNavigationBar() {\r\n return new NavigationNodes(this, \"topnavigationbar\");\r\n }", "function MDCShortTopAppBarFoundation(adapter) {\n var _this = _super.call(this, adapter) || this;\n _this.isCollapsed_ = false;\n _this.isAlwaysCollapsed_ = false;\n return _this;\n }", "function MDCShortTopAppBarFoundation(adapter) {\n var _this = _super.call(this, adapter) || this;\n _this.isCollapsed_ = false;\n _this.isAlwaysCollapsed_ = false;\n return _this;\n }", "function minimizApp()\n{\n\tdocument.getElementById(\"openAppHolder\").style = \"position:fixed;top: 150%;\";\n}", "function checkStickySubforumSidebar(){var e,t=$(\".jsMainContent\").offset().top,s=$(\".jsMainContent\").outerHeight(),a=$(\".jsSubforumFixedSidebar\").outerHeight();$(window).scrollTop()>t-50?(\n//$('.jsSubforumFixedSidebar').css(\"transform\", 'translateY(60px)');\n$(\".jsSubforumFixedSidebar\").css(\"top\",\"50px\"),$(window).scrollTop()>t+s-a-50&&(e=t+s-$(window).scrollTop()-a,$(\".jsSubforumFixedSidebar\").css(\"top\",e+\"px\"))):(e=$(\".jsMainContent\").offset().top-$(window).scrollTop(),$(\".jsSubforumFixedSidebar\").css(\"top\",e+\"px\"))}", "function WIDGET_HEADER$static_(){ToolbarSkin.WIDGET_HEADER=( new ToolbarSkin(\"widget-header\"));}", "function HEADER_GRID_100$static_(){ToolbarSkin.HEADER_GRID_100=( new ToolbarSkin(\"header-grid-100\"));}", "function backtoTop() {\r\n var Hwith = window.innerWidth || document.documentElement && document.documentElement.clientWidth || 0;\r\n $(\".backtoTop\").removeClass(\"autohide\");\r\n if (Hwith >= 1339) {\r\n $(\".backtoTop\").removeClass(\"backfix-s\").addClass(\"backfix\");\r\n } else if (Hwith < 1339) {\r\n $(\".backtoTop\").removeClass(\"backfix\").addClass(\"backfix-s\");\r\n }\r\n }", "function fixClear(){\n\t\tif((verify_device.detect() == 'desktop')){\n\n\t\t\tvar _win = $(window).width();\n\t\t\tif(_win < 1024){\n\t\t\t\t$('.header_w').css('position','absolute');\n\t\t\t}else{\n\t\t\t\t$('.header_w').css('position','fixed');\n\t\t\t}\n\t\t}\n\t}", "function getScrollToTopBtn() {\n\n if ($(window).scrollTop() > $('.head-section').height() ) {\n\n $('.scroll-to-top').fadeIn();\n\n } else {\n\n $('.scroll-to-top').fadeOut();\n\n }\n\n }", "function topFct(){\r\n window.scrollTo(0, 0);\r\n }" ]
[ "0.68381476", "0.67199844", "0.67151994", "0.667919", "0.66254693", "0.66119736", "0.65985435", "0.6590434", "0.65260655", "0.6468315", "0.6466307", "0.64447695", "0.6372559", "0.63554686", "0.63512075", "0.63362247", "0.630434", "0.6285866", "0.6237688", "0.62353593", "0.6220291", "0.6208427", "0.6191355", "0.61802566", "0.6155143", "0.61469686", "0.6137335", "0.6121828", "0.61029136", "0.6087723", "0.60606754", "0.6054825", "0.6052907", "0.6048894", "0.6041184", "0.6012264", "0.60122055", "0.5991107", "0.59814894", "0.5967496", "0.59650916", "0.5931347", "0.5926582", "0.5922692", "0.5922422", "0.59183764", "0.590379", "0.5903736", "0.5902725", "0.589966", "0.5888836", "0.5877934", "0.58744305", "0.58742595", "0.58738524", "0.5873175", "0.5872172", "0.5869912", "0.5855046", "0.58470917", "0.58455145", "0.58418596", "0.58354056", "0.58309484", "0.5826904", "0.5826044", "0.5821403", "0.5809367", "0.5806282", "0.58023506", "0.5801368", "0.5787351", "0.57862216", "0.5783591", "0.5783281", "0.5781339", "0.577804", "0.5775569", "0.57735026", "0.57735026", "0.57735026", "0.57735026", "0.5772267", "0.5765658", "0.57652974", "0.57639766", "0.57636255", "0.5762783", "0.57553047", "0.5755129", "0.5753553", "0.5753553", "0.5749863", "0.5748333", "0.5747016", "0.5745625", "0.57420355", "0.57393664", "0.5734181", "0.57320195" ]
0.67395705
1
Callback function for the Google Maps script.
function initMap() { // Attempt to get the user's location. if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { state.map.lat = position.coords.latitude; state.map.lng = position.coords.longitude; }); } map = new google.maps.Map(document.getElementById('map'), { center: {lat: state.map.lat, lng: state.map.lng}, zoom: state.map.zoomLevel, }); placesService = new google.maps.places.PlacesService(map); google.maps.event.addListener(map, 'bounds_changed', function () { getLocations(map.getBounds()) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beginMap() {\r\n appMod.is_error(false);\r\n win = new google.maps.InfoWindow();\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: coordinates,\r\n zoom: 18\r\n });\r\n fetch_resorts();\r\n}", "function initialize() {\n var center = new google.maps.LatLng(53.35055131839989, -6.317138671875);\n\n geocoder = new google.maps.Geocoder();\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 7,\n center: center,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n });\n\n addMarkers();\n} //Display Broker data in info ", "function handleGeoCodes(results, status)\n{\n\tmap = new google.maps.Map(document.getElementById('map_canvas'), {\n\t\tzoom: document.getElementById(\"gm_zoomlevel\").value*1,\n\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t});\n\n\t// add listener for zoom changes\n\tgoogle.maps.event.addListener(map, 'dragend', updateCenter);\n\tgoogle.maps.event.addListener(map, 'zoom_changed', updateZoomlevel);\n\n\t// Retrieve the object\n\tpoint = results[0].geometry.location;\n\t\n\t// Retrieve the Latitude and Longitude (Geo Codes)\n\tThisLat = point.lat();\n\tThisLong = point.lng();\n\t//point = new google.maps.LatLng(ThisLat, ThisLong);\n\tdocument.getElementById(\"latitude\").value = ThisLat;\n\tdocument.getElementById(\"longitude\").value = ThisLong;\n\tdocument.getElementById(\"center_latitude\").value = ThisLat;\n\tdocument.getElementById(\"center_longitude\").value = ThisLong;\n\t// put a marker on the map that the user can drag to adjust\n\tmarker = new google.maps.Marker({position: point, map: map, draggable: true});\n\t// Center the map on the point\n\tmap.setCenter(point, 13);\n\t\n\t//Add the marker to the map\n\t//map.addOverlay(marker);\n\t\n\t// Add listener to listen to dragged marker\n\tgoogle.maps.event.addListener(marker, 'dragend', updateDraggedGeoCodes);\n\n}", "function inicia_google_maps(){\n\tcria_mapa_colorido(PHP.localizacao_geografica[0], PHP.localizacao_geografica[1]);\n}", "function handleMapError() {\n alert(\"Google Maps JS API error occured!\");\n}", "function _onAsyncScriptLoad() {\n\n\n var mapOps = {\n center: get_last_position(),\n scrollwheel: false,\n zoom: get_last_position() != null ? 18 : 8,\n fullscreenControl: false,\n mapTypeControl: false,\n zoomControl: false,\n streetViewControl: false,\n scaleControl: false,\n heading: 90,\n rotateControl: true,\n //gestureHandling: 'cooperative'\n };\n\n if (get_last_position() == null) {\n var linkedFunc = App.Modules.GPS.onUpdate(function(GPS) {\n\n if (GPS.state == GPS.STATES.ON) {\n var pos = {\n lat: GPS.position.latitude,\n lng: GPS.position.longitude\n };\n\n _map.setCenter(pos);\n _map.setZoom(18);\n // TO KILL THIS LISTENER\n linkedFunc();\n }\n });\n }\n\n\n _map = new google.maps.Map(document.getElementById('map'), mapOps);\n \n \n\n // NEXT TELL TO HEAR THE UPDATE ON THE \n App.Modules.GPS.onUpdate(function _onUpdate(GPS) {\n var position;\n \n if (GPS != null && GPS.position != null) {\n position = {\n lat: GPS.position.latitude,\n lng: GPS.position.longitude\n };\n\n // TO SAVE LAST POSITION\n save_last_position(position);\n }\n\n _showMyMarkerPosition();\n\n });\n\n\n // VALIDATE GPS POSITION AND MARK USER POSITION \n if (get_last_position() != null) {\n _showMyMarkerPosition();\n centerUser();\n }\n\n // IF USER DRAG THE MAP\n google.maps.event.addListener(_map, 'center_changed', function() {\n if (_this.centerMe.visible == false) {\n _this.centerMe.show();\n }\n });\n\n // START THE AUTOCOMPLTE PLACES\n initializeInputAutocompletePlaces();\n\n // AND ROUTE\n _this.Google.geocoder = new google.maps.Geocoder();\n _this.Google.directionsService = new google.maps.DirectionsService();\n _this.Google.directionsDisplay = new google.maps.DirectionsRenderer({\n suppressMarkers: true\n });\n\n _this.Google.directionsDisplay.setMap(_map);\n }", "function initialize() {\n $(\"input.booking-places\").geocomplete();\n\n if (document.getElementById('map') == null) {\n console.log(\"false\");\n return false;\n }\n geocoder = new google.maps.Geocoder();\n var mapOptions = {\n center: new google.maps.LatLng(37.7749295, -122.4194155),\n zoom: 3,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n if (document.getElementById('map')) {\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n codeAddresss();\n\n }\n\n\n\n\n }", "function initmap() {\n\n if (($(\".ct-googleMap\").length > 0) && (typeof google === 'object' && typeof google.maps === 'object')) {\n $('.ct-googleMap').each(function () {\n var atcenter = \"\";\n var $this = $(this);\n var location = $this.data(\"location\");\n var zoom = $this.data(\"zoom\");\n\n var offset = -30;\n\n if (validatedata($this.data(\"offset\"))) {\n offset = $this.data(\"offset\");\n }\n\n if (validatedata(location)) {\n $this.gmap3({\n marker: {\n //latLng: [40.616439, -74.035540],\n address: location, options: {\n //visible: false\n icon: new google.maps.MarkerImage(\"/assets/images/marker.png\")\n }, callback: function (marker) {\n atcenter = marker.getPosition();\n }\n }, map: {\n options: {\n //maxZoom:11,\n zoom: zoom,\n mapTypeId: google.maps.MapTypeId.ROADMAP, // ('ROADMAP', 'SATELLITE', 'HYBRID','TERRAIN');\n scrollwheel: false,\n disableDoubleClickZoom: false,\n draggable: false, //disableDefaultUI: true,\n mapTypeControlOptions: {\n //mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID],\n //style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n //position: google.maps.ControlPosition.RIGHT_CENTER\n mapTypeIds: []\n }\n }, events: {\n idle: function () {\n if (!$this.data('idle')) {\n $this.gmap3('get').panBy(0, offset);\n $this.data('idle', true);\n }\n }\n }\n }, overlay: {\n address: location, options: {\n offset: {\n y: -100, x: -25\n }\n }\n }\n //},\"autofit\"\n });\n\n // center on resize\n google.maps.event.addDomListener(window, \"resize\", function () {\n //var userLocation = new google.maps.LatLng(53.8018,-1.553);\n setTimeout(function () {\n $this.gmap3('get').setCenter(atcenter);\n $this.gmap3('get').panBy(0, offset);\n }, 400);\n\n });\n\n // set height\n $this.css(\"min-height\", $this.data(\"height\") + \"px\");\n }\n\n if ($this.parent().parent().hasClass('hidemap')) {\n $this.parent().animate({height: '0px'}, 500);\n }\n\n })\n }\n\n }", "function initialize() {\nvar frm = {lat:25.020192, lng:121.529104, title: 'Get off at here!', msg:'<h2>Taipower MRT Ext2</h2><p>300m away from my apartment, it is just a 5m walk from here.</p>' };\n// xinhai rd\nvar to = {lat:25.021402, lng:121.531651, title: 'My apartment', msg: '<p>2F, No. 90, Sec. 1, Xin-hai Rd.</p><h2>There is a coin laundry store next to it.</h1>'};\nvar xinhai = new google.maps.LatLng(to.lat, to.lng);\nvar opt =\n{ \ncenter:xinhai,\nzoom:17,\n//mapTypeId: google.maps.MapTypeId.TERRAIN,\nmapTypeId: google.maps.MapTypeId.ROADMAP,\n};\nmap = new google.maps.Map(document.getElementById(\"googlemap\"),opt);\n// google.maps.event.addDomListener(window, 'load', initialize);\n}", "function GoogleMapContact() {\n\n if ($('#contact-maps').length) {\n var $map=$('#contact-maps'),\n mapZoom = $map.data('map-zoom'),\n lat = $map.data('map-latlng').split(',')[0],\n lng = $map.data('map-latlng').split(',')[1],\n mapContent = $map.data('map-content'),\n myCenter=new google.maps.LatLng(lat,lng);\n var mapProp = {\n center:myCenter,\n zoom:mapZoom,\n scrollwheel:false,\n mapTypeId:google.maps.MapTypeId.ROADMAP\n };\n\n var map=new google.maps.Map(document.getElementById(\"contact-maps\"),mapProp);\n\n var marker=new google.maps.Marker({\n position:myCenter\n });\n\n marker.setMap(map);\n\n var infowindow = new google.maps.InfoWindow({\n content:mapContent,\n maxWidth: 200\n });\n\n google.maps.event.addListener(marker, 'click', function() {\n infowindow.open(map,marker);\n });\n\n\n }\n }", "function update_google_map(data) {\n // reset the map\n for (var i = 0; i < marker_array.length; i++ ) {\n marker_array[i].setMap(null);\n }\n marker_array = [];\n if (zip_marker != null) {\n zip_marker.setMap(null);\n }\n gmap.setZoom(2); \n var origin = new google.maps.LatLng(40, -80); \n gmap.setCenter(origin);\n\n if ( cfpb_hud_hca.check_hud_data(data) === true ) {\n var lat = data.zip.lat; \n var lng = data.zip.lng; \n var ziplatlng = new google.maps.LatLng(lat, lng); \n var zoom = 10; \n\n gmap.setZoom(zoom); \n gmap.setCenter(ziplatlng);\n\n var bounds = new google.maps.LatLngBounds();\n\n zip_marker = new google.maps.Marker({\n position: ziplatlng,\n icon: {\n path: google.maps.SymbolPath.CIRCLE,\n fillColor: \"#FFFFFF\",\n fillOpacity: 1,\n scale: 3, \n strokeColor: \"#CC0000\",\n strokeWeight: 3\n },\n zIndex: -99,\n draggable: false,\n map: gmap\n });\n\n $.each( data.counseling_agencies, function(i, val) {\n var position = new google.maps.LatLng(val.agc_ADDR_LATITUDE, val.agc_ADDR_LONGITUDE);\n var z = 11 - i;\n var number = i + 1;\n if ( number < 10 ) {\n number = \"0\" + number;\n }\n marker_array[i] = new google.maps.Marker({\n position: position,\n icon: \"img/hud_gmap/agc_\" + number + \".png\",\n map: gmap,\n title: val.nme,\n zIndex: z\n });\n bounds.extend(position);\n\n google.maps.event.addListener(marker_array[i], 'click', function() {\n $(document.body).animate({'scrollTop': $(\"#hud-result-\" + number).offset().top }, 1000);\n }); \n });\n\n gmap.fitBounds(bounds);\n }\n }", "function asyncGoogleMaps() { }", "function initMap() {\n\n\t//initialize map\n var map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 32.75, lng: -97.13},\n scrollwheel: false,\n zoom: 17\n });\n\n\nvar marker = new google.maps.Marker({\n position: {lat: 32.75, lng: -97.13},\n map: map\n });\n\nvar geocoder = new google.maps.Geocoder;\nvar infowindow = new google.maps.InfoWindow;\n\n \n\t//Initializing a mouse click event on map which then calls reversegeocode function\n google.maps.event.addListener(map, \"click\", function (e) {\n\n var latLng = e.latLng;\n\n marker.setMap(null);\n marker = new google.maps.Marker({\n position: latLng,\n map: map\n });\n \n \n reversegeocode(latLng.lat(),latLng.lng(),map, geocoder, infowindow,marker);\n \n sendRequest(latLng.lat(),latLng.lng());\n\n \n\n}); \n\n}", "function success(position) {\n var coords;\n var zoom;\n if (position != false && position.code == undefined) {\n if (lat.value === '' && lng.value === '') {\n coords = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n }\n else {\n coords = new google.maps.LatLng($('#'+latInput).val(), $('#'+lngInput).val());\n }\n zoom = zoomMax;\n }\n else {\n if (lat.value === '' && lng.value === '') {\n coords = new google.maps.LatLng(55.8580, -4.2590);\n zoom = zoomMin;\n }\n else {\n coords = new google.maps.LatLng($('#'+latInput).val(), $('#'+lngInput).val());\n zoom = zoomMax;\n }\n\n }\n lat.value = coords.lat();\n lng.value = coords.lng();\n\n geocoder = new google.maps.Geocoder();\n var options = {\n zoom: zoom,\n center: coords,\n mapTypeControl: false,\n navigationControlOptions: {\n style: google.maps.NavigationControlStyle.SMALL\n },\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n map = new google.maps.Map(document.getElementById(mapDiv), options);\n\n marker = new google.maps.Marker({\n position: coords,\n map: map,\n draggable: true,\n title: \"Drag me!\",\n icon: 'http://s12.postimg.org/4dq9xmsix/AB5bb.png' // null = default icon\n });\n // infowindow, that appears after an event\n infowindow = new google.maps.InfoWindow();\n\n getNearbyVenues();\n\n google.maps.event.addListener(marker, 'dragend', function (evt) {\n map.setCenter(evt.latLng);\n lat.value = evt.latLng.lat();\n lng.value = evt.latLng.lng();\n getNearbyVenues();\n });\n\n google.maps.event.addListener(marker, 'click', function() {\n /**\n * validate date\n */\n if (getDate() == undefined) {\n alert(\"Please input a date first in order to get a timeline of this venue\")\n }\n else {\n // TODO: think of alternative\n lat.value = this.position.lat();\n lng.value = this.position.lng();\n //\n getTwitterAccountFromContent(infowindow.getContent());\n $('#venueSearchModal').modal('show');\n }\n });\n\n map.addListener('click', function(evt) {\n marker.setPosition(evt.latLng);\n map.setCenter(evt.latLng);\n\t\tlat.value = evt.latLng.lat();\n lng.value = evt.latLng.lng();\n getNearbyVenues();\n });\n\n var input = document.getElementById('pac-input');\n var searchBox = new google.maps.places.SearchBox(input);\n map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);\n\n searchBox.addListener('places_changed', function () {\n codeAddress(input.value);\n });\n}", "function googleMaps()\n{\n\n $( '.googleMap' ).each( function()\n\t\t{\n\n\t\t\t\tvar lat = -34.6037;\n\t\t\t\tvar lng = -58.3816;\n\t\t\t\tvar zoom = 11;\n\n\t\t\t\tvar map = new google.maps.Map( document.getElementById( 'googleMap' ),\n\t\t\t\t{\n\n\t\t\t\t\t\tcenter: { lat: lat, lng: lng },\n\n\t\t\t\t\t\tzoom: zoom,\n\n\t\t\t\t\t\tdisableDefaultUI: true\n\n\t\t\t\t});\n\n });\n}", "function mapsError() {\n alert(\"Google Maps Error!\");\n}", "function googleError() {\n alert('Sorry, google map api not working...');\n}", "function init_map() {\r\n var center = new google.maps.LatLng(48.5859718, 7.743764800000008);\r\n var myOptions = {\r\n zoom: 15,\r\n center: center,\r\n mapTypeId: google.maps.MapTypeId.ROADMAP\r\n };\r\n map = new google.maps.Map($('#map .gmap-map')[0], myOptions);\r\n marker = new google.maps.Marker({\r\n map: map,\r\n position: new google.maps.LatLng(48.5859718, 7.743764800000008)\r\n });\r\n infowindow = new google.maps.InfoWindow({content: '<strong>Villa Kleber</strong><br> 6 Quai Kleber, 67000 Strasbourg<br>'});\r\n google.maps.event.addListener(marker, 'click', function () {\r\n infowindow.open(map, marker);\r\n });\r\n infowindow.open(map, marker);\r\n google.maps.event.addDomListener(window, 'resize', function() {\r\n map.setCenter(center);\r\n });\r\n }", "function googleError(){\n alert(\"Sorry, Google Maps doesn't seem to be working :(\");\n}", "function maperror() {\n\n alert(\"There is a problem with Google Maps. Please reload page\");\n\n}", "function DoGeo(sender) {\n\n var startlat = $('.advMap').attr('data-lat');\n // Read start long from page parameter.\n\n var startlong = $('.advMap').attr('data-lon');\n // Read start zoom from page parameter.\n\n var startzoom = $('.advMap').attr('data-zoom');\n if ((startlat) && (startlong) && (startzoom)) {\n initCenterLat = startlat;\n initCenterLon = startlong;\n initZoom = parseInt(startzoom);\n\n var newCentre = new google.maps.LatLng(initCenterLat, initCenterLon);\n map.setCenter(newCentre);\n map.setZoom(initZoom);\n }\n\n var boxlat1 = $('#sw-lat').val();\n var boxlong1 = $('#sw-lon').val();\n var boxlat2 = $('#ne-lat').val();\n var boxlong2 = $('#ne-lon').val();\n\n // Populate box coord textboxes with values if present for POI.\n if (newRect) {\n\n // Create rectangle's coordinate bounds.\n var autoRectBounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(boxlat1, boxlong1),\n new google.maps.LatLng(boxlat2, boxlong2));\n // Create new rectangle.\n var autoRect = new google.maps.Rectangle({\n strokeWeight: 1,\n strokeColor: '#ae4040',\n fillColor: '#bf5050',\n strokeOpacity: 0.5,\n fillOpacity: 0.3,\n editable: true,\n draggable: true,\n bounds: autoRectBounds,\n map: map\n });\n // Store new auto rectanhle in newRect variable so it can be referenced/removed.\n newRect = autoRect;\n // Set up events for rectangle.\n ManageDrawnShape(newRect, \"rectangle\");\n // Set bounding box coord textbox values.\n DoAutoBounds(autoRect);\n // Check the checkbox.\n\n if (!$('#cbManualBounds').is(\":checked\")) {\n\n // reset screen\n //clearScreen();\n\n } else if (newRect != undefined) {\n $('#cbManualBounds').prop('checked', true);\n }\n }\n else {\n $('#cbManualBounds').prop('checked', false);\n DoManualBounds();\n };\n\n\n // Fade in the page dimmer and then the map modal.\n $('#panelOverlay').fadeIn(150, function () {\n $('#gMapModal').fadeIn(150, function () {\n // Display the map search text box and automatically insert the name of the selected POI.\n $('#pac-input').fadeIn(150, function () {\n //$('#pac-input').val(poi);\n // Set focus to the textbox so that the search box appears with any matching results.\n //$('#pac-input').focus();\n $('.pac-container').css({ 'position': 'fixed' });\n\n setTimeout(function () {\n $('#btnRefreshMap').click();\n }, 500);\n });\n });\n });\n}", "function initMap() {\n // this function is required by the google maps api call. Be careful about moving it in the js code.\n // it's very finicky.\n // setTimeout(littleDelay(),5000);\n map = new google.maps.Map(document.getElementById('gmap'), {\n center: {\n // these variables hold the unedited lat and long positions\n lat: rawYourLat,\n lng: rawYourLong,\n }, // end of 'center'\n zoom: 6\n }); // end of google maps map document line\n //setTimeout(console.log(rawYourLat, rawYourLong), 0);\n geocoder = new google.maps.Geocoder;\n // if the map has not been displayed, (google map) button\n // not clicked, then the map should display the location\n // the user entered in the input field. The location\n // info, in this case, comes from the WU api.\n\n // if the google map button has been clicked, then the map should be displayed and the user's location (determined by geolocation) populates the\n // input field directly from the map function.\n //debugger;\n //if(!blnGMClicked) {\n geocode(geocoder, map); // google function that, in this case, reverse geolocates a set of coordinates to user readable location (like city, state).\n // }\n\n //setTimeout(console.log(rawYourLat, rawYourLong), 0);\n setTimeout(function() {Alert(\"Please Wait...\")},1000);\n setTimeout( function () {\n map = new google.maps.Map(document.getElementById('gmap'), {\n center: {\n // these variables hold the unedited lat and long positions\n lat: rawYourLat,\n lng: rawYourLong,\n }, // end of 'center'\n zoom: 6\n });\n geocode(geocoder, map);\n },2000);\n }", "function renderMap(LAT,LNG){\n \n // declaring the google map obl and geting the division where it should be loaded\n map = plugin.google.maps.Map.getMap(mapDiv);\n\n // creating a map obj that will be passed to map \n mapObj = {\n target: {lat: LAT, lng: LNG},\n zoom: 17,\n tilt: 60,\n bearing: 140,\n duration: 5000\n }\n \n // addint a marker to the map\n var marker = map.addMarker({\n position: {lat: LAT, lng: LNG},\n title: \"Your Task Location\",\n animation: plugin.google.maps.Animation.BOUNCE\n });\n\n //passig the map obg to initialize the map\n map.animateCamera(mapObj);\n marker.showInfoWindow();\n\n}", "function runMapPreview() {\n initializeGoogleMaps();\n codeGoogleMapAddress($('#event_original_address').val());\n $('.map_container').fadeIn();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 8,\n center: centerCords\n \n \n });\n addMarkerInfo();\n}", "function initMap() \n{\n\t// load the google map\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: mapcenter,\n\t\tzoom: 13,\n\t\tdisableDefaultUI: true\n\t});\n\t\n\t// load the custom marker libraries to put the custom markers on the screen\n\tInitCustomMarker();\n\tInitCustomLocationMarker();\n \n\t// load the checkboxes\n\tLoadData();\n\t\n\t// load the user location marker\n\tLoadUserMarker();\n\t\n\t// set the event for closing the marker\n\t$(\".contentDetails\").hide();\n\t$(\".exitContainer\").click(HideMarkerInfo);\n}", "function initialize() {\n // alert(\"init\");\n geocoder = new google.maps.Geocoder();\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 6,\n //Coordinates changed to centre map on Birmingham/Midlands region//\n center: new google.maps.LatLng(52.486243, -1.890401),\n mapTypeId: google.maps.MapTypeId.ROADMAP\n });\n var infowindow = new google.maps.InfoWindow();\n var marker, i;\n var bounds = new google.maps.LatLngBounds();\n\n//Establishes parameters of map//\n//Section was originally experimented with when testing marker placement, but restored to default after testing//\n for (i = 0; i < locations.length; i++) {\n var coordStr = locations[i][4];\n var coords = coordStr.split(\",\");\n var pt = new google.maps.LatLng(parseFloat(coords[0]), parseFloat(coords[1]));\n bounds.extend(pt);\n marker = new google.maps.Marker({\n position: pt,\n map: map,\n icon: locations[i][5],\n address: locations[i][2],\n title: locations[i][0],\n html: locations[i][0] + \"<br>\" + locations[i][2]\n });\n gmarkers.push(marker);\n google.maps.event.addListener(marker, 'click', (function(marker, i) {\n return function() {\n infowindow.setContent(marker.html);\n infowindow.open(map, marker);\n }\n })\n (marker, i));\n }\n map.fitBounds(bounds);\n}", "function googleError() {\n alert('Error found while calling Google maps api!');\n\n}", "function onGeoSuccess(position) {\n //create a new Google LatLng object to represent\n //our current latitude and longitude\n var ll = new google.maps.LatLng(position.coords.latitude,\n position.coords.longitude);\n\n //create a simple object for the map options\n var mapOptions = {\n center: ll, //center the map on our current lat/long\n zoom: 16, //zoom level (0 = whole earth)\n mapTypeId: google.maps.MapTypeId.ROADMAP //roadmap type\n }\n\n //create a new Google Map object\n //passing a reference to the map container div\n //and our map options\n var map = new google.maps.Map($('.map-container')[0], mapOptions);\n\n //now add a marker on the map showing our lat/long\n var markerOptions = {\n map: map,\n position: ll,\n title: 'You are Here'\n }\n\n var marker = new google.maps.Marker(markerOptions);\n\n updateMessage(\"Here is where you are (accuracy within \" \n + position.coords.accuracy + \" meters)\");\n\n}", "function initialize() {\n var myLatLng = {lat: 32.75, lng: -97.13};\n geocoder = new google.maps.Geocoder();\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 17,\n center: myLatLng\n });\n\n /* The initial position of the marker is here */\n marker = new google.maps.Marker({\n position: myLatLng,\n map: map\n });\n\n map.addListener('click', function(event) {\n addMarker(event.latLng);\n });\n\n function addMarker(location) {\n /*Everytime the map is clicked, this function is called\n * If the listing is available in Zillow API, the position is updated in the map\n */\n geocoder.geocode({'location': location}, function(results, status) {\n var address = results[0].formatted_address;\n addr = address.split(',', 4);\n sendRequestbyReverseGeoCoding(addr[0], addr[1], addr[2])\n });\n }\n}", "function load(){\r\n if(GBrowserIsCompatible()){\r\n map = new GMap2(document.getElementById(\"map\"));\r\n map.addControl(new GLargeMapControl());\r\n map.addControl(new GMapTypeControl());\r\n LatLng=new GLatLng(47.643742,6.8565076);\r\n map.setCenter(LatLng, 13);\r\n //map.setCenter(new GLatLng(48.125768, 7.481689), 8);\r\n }else {\r\n alert(\"Sorry, the Google Maps API is not compatible with this browser\");\r\n }\r\n getPosition.delay(2000);\r\n //getGeofences.delay(4000);\r\n}", "function getMap() {\n showJourneyMap();\n}", "function contactsMapInit(mapWrap){\n\n if($('#'+mapWrap).length!=0){\n\n function initialize() {\n var myLatlng = new google.maps.LatLng(cordX,cordY);\n\n var myOptions = {\n zoom: 15,\n center: myLatlng,\n draggable: true,\n zoomControl: true,\n disableDefaultUI: true, //без управляющих елементов\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_BOTTOM\n }\n }\n var map = new google.maps.Map(document.getElementById(mapWrap), myOptions);\n\n var contentString = '<div class=\"marker-test\">'+googleText+'</div>';\n\n var infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n\n var marker = new google.maps.Marker({\n position: myLatlng,\n map: map,\n optimized: false,\n visible: true,\n flat: true,\n\n });\n\n google.maps.event.addListener(marker, 'click', function() {\n infowindow.open(map,marker);\n });\n\n /*map.set('styles', [\n {\n stylers: [\n { hue: \"#ff0000\" },\n { saturation: -100 }\n ]\n },{\n featureType: \"road\",\n elementType: \"geometry\",\n stylers: [\n { saturation: 0 },\n { invert_lightness: false }\n ]\n },{\n featureType: \"road\",\n elementType: \"labels\",\n stylers: [\n { visibility: \"off\" }\n ]\n }\n ]);*/\n\n }\n initialize();\n\n }\n\n }", "function gpsCallback(_coords){\n\tTi.API.info('win2.js gpsCallback(_coords) function affecting mapView.setLocation({}); Latitude: ' + _coords.latitude + ' Longitude: ' + _coords.longitude);\n\tmapView.setLocation({\n\tlatitude: _coords.latitude,\n\tlongitude: _coords.longitude,\n\tanimate: true\n\t});\n\n}", "function mapError() {\n alert(\"Hey man. Map can not be loaded from Google.\");\n}", "function my_initial()\n\t{\n\t\tgeo=new google.maps.Geocoder();\n\t\tvar mymap={\n\t\tcenter:new google.maps.LatLng(28.613939,77.209021),\n\t\tzoom:3,\n\tmapTypeId:google.maps.MapTypeId.ROADMAP\n\t}\n\tmap=new google.maps.Map(document.getElementById(\"googlemaps\"),mymap);\n\t}", "function initMap() {\n\n // marker: Malcolm 48 Albert St\n var myLatlng = {lat: -37.803182, lng: 144.897727 };\n\n // BG horse (-37.798514, 144.889510)\n var myLatlng2 = {lat: -37.798514, lng: 144.889510 };\n\n // BG VU (-37.792655, 144.899132)\n var myLatlng3 = {lat: -37.792655, lng: 144.899132 };\n\n // Pirate cat (-37.798474, 144.889435)\n var myLatlng4 = {lat: -37.798474, lng: 144.889435 };\n\n // Elmz street (approx)\n var myLatlng5 = {lat: -37.801947, lng: 144.899882 };\n\n // stay strong women's day\n var myLatlng6 = {lat: -37.799132, lng: 144.897426 };\n\n // Heesco dragon cnr Paisley St\n var myLatlng7 = {lat: -37.800073, lng: 144.892855 };\n\n // franco cozzo hopkins st\n var myLatlng8 = {lat: -37.800105, lng: 144.904036 };\n \n // center long/lat is Footscray\n var map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -37.799132, lng: 144.897426},\n zoom: 15\n } );\n\n\n // marker 1 Malcolm Fraser\n var infowindow = new google.maps.InfoWindow({\n content: 'Heesco' \n });\n\n var marker = new google.maps.Marker({\n position: myLatlng,\n map: map,\n title: 'Malcolm Fraser'\n })\n\n marker.addListener('click', function(){\n infowindow.open(map, marker);\n });\n\n\n // BG horse marker 2\n var infowindow2 = new google.maps.InfoWindow({\n content: 'Baby Guerrilla' \n });\n\n var marker2 = new google.maps.Marker({\n position: myLatlng2,\n map: map,\n title: 'In memoriam'\n })\n\n marker2.addListener('click', function(){\n infowindow2.open(map, marker2);\n });\n\n\n // BG VU marker 3\n var infowindow3 = new google.maps.InfoWindow({\n content: 'Baby Guerrilla' \n });\n\n var marker3 = new google.maps.Marker({\n position: myLatlng3,\n map: map,\n title: 'Big floating woman'\n })\n\n marker3.addListener('click', function(){\n infowindow3.open(map, marker3);\n });\n\n\n // Pirate cat marker 4\n var infowindow4 = new google.maps.InfoWindow({\n content: 'Unknown artist' \n });\n\n var marker4 = new google.maps.Marker({\n position: myLatlng4,\n map: map,\n title: 'Pirate Cat'\n })\n\n marker4.addListener('click', function(){\n infowindow4.open(map, marker4);\n });\n\n\n // Elmz street marker 5 \n var infowindow5 = new google.maps.InfoWindow({\n content: 'Elmz Street' \n });\n\n var marker5 = new google.maps.Marker({\n position: myLatlng5,\n map: map,\n title: 'Face mural'\n })\n\n marker5.addListener('click', function(){\n infowindow5.open(map, marker5);\n });\n\n\n // stay strong 6\n var infowindow6 = new google.maps.InfoWindow({\n content: 'Trashort Art' \n });\n\n var marker6 = new google.maps.Marker({\n position: myLatlng6,\n map: map,\n title: 'Stay Strong mural'\n })\n\n marker6.addListener('click', function(){\n infowindow6.open(map, marker6);\n });\n\n\n // dragon 7 \n var infowindow7 = new google.maps.InfoWindow({\n content: 'Heesco' \n });\n\n var marker7 = new google.maps.Marker({\n position: myLatlng7,\n map: map,\n title: 'Chinese Dragon'\n })\n\n marker7.addListener('click', function(){\n infowindow7.open(map, marker7);\n });\n\n\n // franco cozzo 8 \n var infowindow8 = new google.maps.InfoWindow({\n content: 'Heesco' \n });\n\n var marker8 = new google.maps.Marker({\n position: myLatlng8,\n map: map,\n title: 'Franco Cozzo mural'\n })\n\n marker8.addListener('click', function(){\n infowindow8.open(map, marker8);\n });\n\n\n// to change marker colour of selected artsite at click on artist name\n// and scroll to map\n\nvar changeRed = function() {\n marker.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n marker2.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n marker5.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n marker4.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n marker3.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n marker7.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n marker6.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n marker8.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n};\n\n\n $(\".art-7\").click(function() {\n changeRed();\n marker.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png');\n $('html, body').animate({\n scrollTop: $(\"#map\").offset().top\n }, 1000);\n });\n\n $(\".art-6\").click(function() {\n changeRed();\n marker2.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png');\n $('html, body').animate({\n scrollTop: $(\"#map\").offset().top\n }, 1000);\n });\n\n $(\".art-8\").click(function() {\n changeRed();\n marker5.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png');\n $('html, body').animate({\n scrollTop: $(\"#map\").offset().top\n }, 1000);\n });\n\n $(\".art-9\").click(function() {\n changeRed();\n marker4.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png');\n $('html, body').animate({\n scrollTop: $(\"#map\").offset().top\n }, 1000);\n });\n\n $(\".art-5\").click(function() {\n changeRed();\n marker3.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png');\n $('html, body').animate({\n scrollTop: $(\"#map\").offset().top\n }, 1000);\n });\n\n $(\".art-10\").click(function() {\n changeRed();\n marker7.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png');\n $('html, body').animate({\n scrollTop: $(\"#map\").offset().top\n }, 1000);\n });\n\n $(\".art-11\").click(function() {\n changeRed();\n marker6.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png');\n $('html, body').animate({\n scrollTop: $(\"#map\").offset().top\n }, 1000);\n });\n\n $(\".art-12\").click(function() {\n changeRed();\n marker8.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png');\n $('html, body').animate({\n scrollTop: $(\"#map\").offset().top\n }, 1000);\n });\n\n}", "function mapError() {\n alert('Google Maps could not load!');\n}", "function initialize() {\n // create a google map and center it on the city of portland\n\n var myOptions = {\n center: new google.maps.LatLng(45.5200, -122.6819),\n zoom: 10,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n\n };\n var map = new google.maps.Map(document.getElementById(\"map\"),\n myOptions);\n\n //setMarkers(map);\n\n }", "function initialize()\r\n{\r\n\r\nvar mapOpt = {\r\n center: myCenter,\r\n zoom:15,\r\n mapTypeId:google.maps.MapTypeId.ROADMAP\r\n };\r\nvar map=new google.maps.Map(document.getElementById(\"maps\"),mapOpt);\r\n\r\nvar marker=new google.maps.Marker({\r\n position:myCenter,\r\n });\r\n\r\nmarker.setMap(map);\r\n\r\nvar infowindow = new google.maps.InfoWindow({\r\n content:\"Prypiat\"\r\n });\r\n\r\ngoogle.maps.event.addListener(marker, 'click', function() {\r\n infowindow.open(map,marker);\r\n });\r\n\r\n\r\n}", "function googleError() {\n alert( \"Opps google maps isn't cooperating right now. Please check back later.\");\n}", "function googleError() {\n alert(\"The Google Maps application has encountered an error. Please try again later.\");\n}", "function initMap() {\n\n var place1 = {\n info: '<strong>UPMC Centers for Rehab Services</strong><br>\\\n 3471 Fifth Ave., Kaufmann Medical Bldg., Suite 1002, Pittsburgh, PA 15213<br>\\\n <a href=\"https://goo.gl/maps/Piruqvxvrqu\">Get Directions</a>',\n lat: 40.440550,\n long: -79.960626\n };\n\n var place2 = {\n info: '<strong>NovaCare Rehabilitation</strong><br>\\\n 201 N Craig St, Pittsburgh, PA 15213<br>\\\n <a href=\"https://goo.gl/maps/7PfAtzcSKbA2\">Get Directions</a>',\n lat: 40.449913,\n long: -79.951201\n };\n\n var place3 = {\n info: '<strong>UPMC Centers for Rehab Services South Side </strong><br>\\r\\\n 2000 Mary St., South Side Outpatient Center - First Floor, Pittsburgh, PA 15203<br>\\\n <a href=\"https://goo.gl/maps/vYFsY4p2VsA2\">Get Directions</a>',\n lat: 40.425592,\n long: -79.977756\n };\n\n var locations = [\n [place1.info, place1.lat, place1.long, 0],\n [place2.info, place2.lat, place2.long, 1],\n [place3.info, place3.lat, place3.long, 2],\n ];\n\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 13,\n center: new google.maps.LatLng(40.445013, -79.956392),\n mapTypeId: google.maps.MapTypeId.ROADMAP\n });\n\n var infowindow = new google.maps.InfoWindow({});\n\n var marker, i;\n\n for (i = 0; i < locations.length; i++) {\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locations[i][1], locations[i][2]),\n map: map\n });\n\n google.maps.event.addListener(marker, 'click', (function (marker, i) {\n return function () {\n infowindow.setContent(locations[i][0]);\n infowindow.open(map, marker);\n }\n })(marker, i));\n }\n}", "function handleError() {\n alert('There is an error with Google Maps!');\n}", "function callback(results, status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n createMapMarker(results[0]);//calls function createMapMarker\n }\n }", "function mapError() {\n alert(\"Google Maps failed. Check the internet connection and try again\");\n}", "function initialize() {\n\n\tvar myLatlng = new google.maps.LatLng(53.350140, -6.266155);\n\tvar myOptions = {\n\t\tzoom: 12,\n\t\tcenter: myLatlng,\n\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\tdisableDefaultUI: true,\n\t\tclickableIcons: false\n\t\t}\n\t// Selected by 'onclick' by user\n\tvar source;\n\tvar destination;\n\n\t// For the loading icon when a user picks a source and destination\n infoWindow = new google.maps.InfoWindow({\n content: \"<h1>Loading...</h1><img src='static/ajax-loader.gif' style='display: block; margin: 0 auto;'>\"\n });\n\t\n\tvar map = new google.maps.Map(document.getElementById(\"googleMap\"), myOptions);\n\n // Listener for placing markers\n\tgoogle.maps.event.addListener(map, 'click', function(event) {\n\n\t\tif (markersArray.length == 0) {\n\t\t\tsource = event.latLng;\n\t\t\tplaceMarker(source, map);\n\t\t}\n\t\telse if (markersArray.length == 1) {\n\t\t\tdestination = event.latLng;\n\t\t\tplaceMarker(destination, map);\n\t\t\t\n\t\t\tinfoWindow.setPosition(markersArray[1].center);\n\t\t\tinfoWindow.open(map);\n\t\t\n\t\t\tsetTimeout(function(){\n\t\t\tgetJpidBestRoute(map, source.lat(), source.lng(), destination.lat(), destination.lng());}, 1000);\n\t\t} else {\n\t\t\tresetGlobals();\n\t\t}\n\t})\n}", "function initMap() {\n\n \t\t\n \t\tvar mapLatitude = 31.423308 ; // Google map latitude \n \t\tvar mapLongitude = -8.075145 ; // Google map Longitude \n\n\t var myLatlng = new google.maps.LatLng( mapLatitude, mapLongitude );\n\n\t var mapOptions = {\n\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t zoom: 10,\n\t scrollwheel: false\n\t }; \n\n\t var map = new google.maps.Map(document.getElementById(\"contact-map\"), mapOptions);\n\n\t var marker = new google.maps.Marker({\n\t \t\n\t position: myLatlng,\n\t map : map,\n\t \n\t });\n\n\t // To add the marker to the map, call setMap();\n\t marker.setMap(map);\n\n\t // Map Custom style\n\t var styles = [\n\t\t {\n\t\t stylers: [\n\t\t { hue: \"#1f76bd\" },\n\t\t { saturation: 80 }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"geometry\",\n\t\t stylers: [\n\t\t { lightness: 80 },\n\t\t { visibility: \"simplified\" }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"labels\",\n\t\t stylers: [\n\t\t { visibility: \"off\" }\n\t\t ]\n\t\t }\n\t\t];\n\n\t\tmap.setOptions({styles: styles});\n\n\t}", "function initMap() {\n\n \t\t\n \t\tvar mapLatitude = 31.423308 ; // Google map latitude \n \t\tvar mapLongitude = -8.075145 ; // Google map Longitude \n\n\t var myLatlng = new google.maps.LatLng( mapLatitude, mapLongitude );\n\n\t var mapOptions = {\n\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t zoom: 10,\n\t scrollwheel: false\n\t }; \n\n\t var map = new google.maps.Map(document.getElementById(\"contact-map\"), mapOptions);\n\n\t var marker = new google.maps.Marker({\n\t \t\n\t position: myLatlng,\n\t map : map,\n\t \n\t });\n\n\t // To add the marker to the map, call setMap();\n\t marker.setMap(map);\n\n\t // Map Custom style\n\t var styles = [\n\t\t {\n\t\t stylers: [\n\t\t { hue: \"#1f76bd\" },\n\t\t { saturation: 80 }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"geometry\",\n\t\t stylers: [\n\t\t { lightness: 80 },\n\t\t { visibility: \"simplified\" }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"labels\",\n\t\t stylers: [\n\t\t { visibility: \"off\" }\n\t\t ]\n\t\t }\n\t\t];\n\n\t\tmap.setOptions({styles: styles});\n\n\t}", "function googleError() {\n alert('There went something wrong when loading Google Maps - please try again!');\n}", "function initMap() {\ngeocoder = new google.maps.Geocoder();\nmap = new google.maps.Map(document.getElementById('map'), {\nzoom: 13,\ncenter: new google.maps.LatLng(37.4419, -122.1419),\nscrollwheel: false,\n//custom colors\nstyles: [{\"featureType\":\"landscape\",\"stylers\":[{\"hue\":\"#FFA800\"},{\"saturation\":0},{\"lightness\":0},{\"gamma\":1}]},{\"featureType\":\"road.highway\",\"stylers\":[{\"hue\":\"#53FF00\"},{\"saturation\":-73},{\"lightness\":40},{\"gamma\":1}]},{\"featureType\":\"road.arterial\",\"stylers\":[{\"hue\":\"#FBFF00\"},{\"saturation\":0},{\"lightness\":0},{\"gamma\":1}]},{\"featureType\":\"road.local\",\"stylers\":[{\"hue\":\"#00FFFD\"},{\"saturation\":0},{\"lightness\":30},{\"gamma\":1}]},{\"featureType\":\"water\",\"stylers\":[{\"hue\":\"#00BFFF\"},{\"saturation\":6},{\"lightness\":8},{\"gamma\":1}]},{\"featureType\":\"poi\",\"stylers\":[{\"hue\":\"#679714\"},{\"saturation\":33.4},{\"lightness\":-25.4},{\"gamma\":1}]}]\n});\n\n//var infoWindow = new google.maps.InfoWindow({map: map});\n\n // Geolocation services, start user at current geolocation\n /*if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n infoWindow.setPosition(pos);\n infoWindow.setContent('Your Location');\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }*/\n\n}", "function googleError() {\n alert('Google Maps Load Error');\n}", "function initMap() {\n\n//Grab UI element to place map and then set the map center to Charlotte, NC coordinates.\n var mapCenter = {lat: 35.227085, lng: -80.843124};\n map = new google.maps.Map(document.getElementById('google-maps-display'), {\n center: mapCenter,\n zoom: 11,\n }); \n\n//Loop through park locations and add a custom marker on the map for each location.\n for (i = 0; i < parkLocations.length; i++){\n mapmarkerFinal = parkLocations[i];\n\n var marker = new google.maps.Marker({ \n position: mapmarkerFinal,\n map: map,\n icon: \"assets/images/urbanpark.png\",\n title: mapmarkerFinal.name,\n optimized: false,\n draggable: false,\n animation: google.maps.Animation.DROP,\n }); \n };\n\n//Bounce animation for when event button is clicked.\n// function toggleBounce () {\n// if (marker.getAnimation() != null) {\n// marker.setAnimation(null);\n// } else {\n// marker.setAnimation(google.maps.Animation.BOUNCE);\n// }\n// }\n\n\n// Create the location search box and link it to the UI element.\n var input = document.getElementById('location-SearchBox');\n var searchBox = new google.maps.places.SearchBox(input);\n\n// Bias the SearchBox results towards current map's viewport.\n map.addListener('bounds_changed', function() {\n searchBox.setBounds(map.getBounds());\n });\n\n\n// Listen for the event fired when the user selects a prediction and retrieve more details for that place.\n var markers = [];\n\n searchBox.addListener('places_changed', function() {\n var places = searchBox.getPlaces();\n\n if (places.length == 0) {\n return;\n };\n\n// Clear out the old markers.\n markers.forEach(function(marker) {\n marker.setMap(null);\n });\n markers = [];\n\n// For each place, get the icon, name and location.\n var bounds = new google.maps.LatLngBounds();\n places.forEach(function(place) {\n if (!place.geometry) {\n console.log(\"Returned place contains no geometry\");\n return;\n };\n var icon = {\n url: place.icon,\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(25, 25),\n };\n\n// Create a marker for each place.\n markers.push(new google.maps.Marker({\n map: map,\n zoom: 20,\n icon: \"assets/images/searchlocation.png\",\n title: \"Your search location\",\n position: place.geometry.location,\n }));\n\n if (place.geometry.viewport) {\n// Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n });\n map.fitBounds(bounds);\n});\n\ninfoWindow = new google.maps.InfoWindow;\n\n//HTML5 geolocation.\nfunction geolocation (){\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude,\n };\n\n//Set User Location marker.\nvar usermarker = new google.maps.Marker({ \n position: pos,\n map: map,\n optimized: false,\n icon: \"assets/images/locationmarker.png\",\n title: \"Your approx. location\",\n draggable: false,\n animation: google.maps.Animation.DROP,\n});\n\n infoWindow.setPosition(pos);\n infoWindow.setContent('Approx. location found.');\n infoWindow.open(map);\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n//If Browser doesn't support Geolocation.\n handleLocationError(false, infoWindow, map.getCenter());\n };\n \nfunction handleLocationError(browserHasGeolocation, infoWindow, pos) {\n infoWindow.setPosition(pos);\n infoWindow.setContent(browserHasGeolocation ?\n 'Error: Geolocation request denied. \\n Please enter your location below!' :\n 'Error: Your browser doesn\\'t support geolocation.');\n infoWindow.open(map);\n};\n};\n\n//Run Geolocation function.\ngeolocation()\n}", "function googleError() {\n alert(\"There was an error loading Google Maps. Please try again later.\");\n}", "function DrawGoogleMap() {\n $(\"#google-map\").empty();\n var script_tag = document.createElement('script');\n script_tag.type = 'text/javascript';\n script_tag.src = \"https://maps.googleapis.com/maps/api/js?key=AIzaSyCHNMMsn8uWjLdbAQUWpT0Vsnc11DzNHcg&libraries=places&callback=initMap\"\n script_tag.setAttribute('defer','');\n script_tag.setAttribute('async','');\n $(\"#googleMap\").append(script_tag);\n}", "function map(){\n\t// Setting the center of the map in the center of Romania\n var latlng = new google.maps.LatLng(46, 25);\n \n var myOptions = {\n zoom: 6,\n center: latlng,\n streetViewControl: false,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n zoomControl: true\n };\n \n map = new google.maps.Map(document.getElementById(\"map\"), myOptions);\n \n \n // Starting the map watch ( watches your position )\n google.maps.event.addListenerOnce(map, 'tilesloaded', function(){\n watchID = navigator.geolocation.watchPosition(geo_success, geo_error, { maximumAge: 5000, timeout: 5000, enableHighAccuracy: true }); \n }); \n}", "function setupMap(e){\n \n var coords = {lat: 48.8957235, lng: 2.2494012};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 14,\n center: coords,\n mapTypeId\t: google.maps.MapTypeId.ROADMAP\n });\n\n var marker = new google.maps.Marker({\n position: coords,\n map: map,\n title: \"Opticien Krys\",\n pixelOffset: new google.maps.Size(100,140)\n });\n}", "function myMap(address=null) {\n\n // Se comprueba si existe la dirección del request, ya que si existe debemos ubicarnos en la posición adecuada\n if ( address != '' && address != null ){\n console.log(address);\n var geoCoder = new google.maps.Geocoder(address);\n var request = {address:address};\n geoCoder.geocode(request, function(result, status){\n geometry_request = new google.maps.LatLng(result[0].geometry.location.lat(), result[0].geometry.location.lng());\n\n map = new google.maps.Map(document.getElementById(\"googleMap\"), {\n center: {lat: result[0].geometry.location.lat(),lng: result[0].geometry.location.lng() },\n scrollwheel: false,\n zoom: 15\n });\n\n marker = new google.maps.Marker({\n position:{lat: result[0].geometry.location.lat(),lng: result[0].geometry.location.lng() },\n map:map,\n cursor: 'default',\n draggable: true\n });\n $('#longitude').val(result[0].geometry.location.lng());\n $('#latitude').val(result[0].geometry.location.lat());\n\n // Evento de captura para arrastre de marca\n google.maps.event.addListener(marker, 'dragend', function(evt){\n console.log(evt.latLng.lat());\n console.log(evt.latLng.lng());\n $('#longitude').val(evt.latLng.lng());\n $('#latitude').val(evt.latLng.lat());\n });\n\n });\n\n //setInterval(requestBusiness,1000);\n }\n // De no existir, se ubica en sitio por defecto\n else{\n\n\n if ($('#longitude').val() != '' && $('#longitude').val() != undefined && $('#latitude').val() != '' && $('#latitude').val() != undefined) {\n var lat = parseFloat($('#latitude').val());\n var lon = parseFloat($('#longitude').val());\n console.log(lat + \", \" + lon );\n var mapProp = {\n center: new google.maps.LatLng(lat, lon),\n zoom: 15,\n };\n var map = new google.maps.Map(document.getElementById(\"googleMap\"), mapProp);\n marker = new google.maps.Marker({\n position:{lat: lat, lng: lon },\n map: map,\n cursor: 'default',\n draggable: true\n });\n google.maps.event.addListener(marker, 'dragend', function(evt){\n console.log(evt.latLng.lat());\n console.log(evt.latLng.lng());\n $('#longitude').val(evt.latLng.lng());\n $('#latitude').val(evt.latLng.lat());\n });\n\n /*\n listengForMark();*/\n } else {\n var mapProp = {\n center: new google.maps.LatLng(51.508742, -0.120850),\n zoom: 5,\n };\n var map = new google.maps.Map(document.getElementById(\"googleMap\"), mapProp);\n }\n }\n }", "function initialize(mapdata, elementid) {\n var map;\n var bounds = new google.maps.LatLngBounds();\n var mapOptions = {\n mapTypeId: 'roadmap'\n };\n\n // Display a map on the page 1 bedroom\n map = new google.maps.Map(document.getElementById(elementid), mapOptions);\n map.setTilt(45);\n\n var mapdata = mapdata;\n\n // Display multiple markers on a map\n var infoWindow = new google.maps.InfoWindow(), marker, i;\n var image = 'images/icons/map-marker.png';\n var markers = [];\n for (var maploop = 0; maploop<mapdata.length; maploop++) {\n var position = new google.maps.LatLng(mapdata[maploop].lat, mapdata[maploop].lng);\n bounds.extend(position);\n marker = new google.maps.Marker({\n position: position,\n map: map,\n icon: image,\n title: mapdata[maploop].label\n });\n markers.push(marker);\n\n // Allow each marker to have an info window\n google.maps.event.addListener(marker, 'click', (function(marker, maploop) {\n return function() {\n infoWindow.setContent(tplInfoWindow(mapdata[maploop]));\n infoWindow.open(map, marker);\n\n };\n })(marker, maploop));\n\n // Automatically center the map fitting all markers on the screen\n map.fitBounds(bounds);\n google.maps.event.addListener(infoWindow, 'domready', function() {\n // Reference to the DIV that wraps the bottom of infowindow\n var iwOuter = $('.gm-style-iw');\n if ($('.gm-style-iw .map_info_window').length){\n iwOuter.parent().addClass('gm-style-iw2');\n $('.gm-style-iw').prev().hide();\n }else {\n iwOuter.parent().removeClass('gm-style-iw2');\n $('.gm-style-iw').prev().hide();\n }\n\n });\n }\n\n\n // Override our map zoom level once our fitBounds function runs (Make sure it only runs once)\n var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) {\n this.setZoom(14);\n google.maps.event.removeListener(boundsListener);\n });\n var markerCluster = new MarkerClusterer(map, markers);\n}", "function initialize_map() {\r\n get_current_location(function(latitude, longitude) {\r\n // Update the user's profile with the new information.\r\n $.get('/home/update_user_location', {\r\n 'latitude': latitude,\r\n 'longitude': longitude,\r\n auto: true\r\n }, function (data) {\r\n data = $.parseJSON(data);\r\n if (data.status == 'adjusted') {\r\n // Location automatically adjusted\r\n alert(data.text);\r\n \r\n // Assign the latitude and longitude vars\r\n myLatitude = latitude;\r\n myLongitude = longitude;\r\n \r\n // Upload the city name\r\n get_current_city_name(function() {\r\n $.get('/home/update_user_location', {\r\n 'city': myCity\r\n });\r\n \r\n $('#using_location').html('Using location: ' + myCity);\r\n });\r\n \r\n // Map the user's position and show the map\r\n map_user_position();\r\n show_data_container('#map_content');\r\n } else if (data.status == 'from_profile') {\r\n // Assign the longitude, latitude, and city coordinates from the server to the js variables\r\n myLatitude = parseFloat(data.loc[0]);\r\n myLongitude = parseFloat(data.loc[1]);\r\n myCity = data.city_state;\r\n \r\n $('#using_location').html('Using location: ' + myCity);\r\n map_user_position();\r\n } else if (data.status == 'silent') {\r\n // Just get the city from the server\r\n myCity = data.city_state;\r\n $('#using_location').html('Using location: ' + myCity);\r\n \r\n map_user_position();\r\n }\r\n });\r\n \r\n // Create the map\r\n var map_options = {\r\n zoom: 14,\r\n center: new google.maps.LatLng(latitude,longitude),\r\n mapTypeId: google.maps.MapTypeId.ROADMAP\r\n };\r\n \r\n console.log('map_created');\r\n map = new google.maps.Map(document.getElementById(\"map\"), map_options);\r\n \r\n // Attach and assign the back to info button\r\n $('#map').append($('<div class=\"back_to_info\">Back to info</div>'));\r\n $('.back_to_info').click(function() {\r\n show_data_container('#info_content');\r\n });\r\n });\r\n}", "function codeLatLng() {\n\t\t\tconsole.log('in codeLatLng'); \n var latlng = new google.maps.LatLng(thisLat, thisLng);\n geocoder.geocode({'latLng': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n if (results[1]) {\n map.setZoom(17);\n marker = new google.maps.Marker({\n position: latlng,\n map: map\n });\n\t\t\t\t infowindow.setContent('<p class=\"infoItem\">Title: '+thisTitle+'</p><p class=\"infoItem\">Borough: '+thisBorough+'</p><p class=\"infoItem\">Year: '+thisYear+'</p><button class=\"getDir mapInfoBtn\">Get Directions</button><button class=\"imdbInfo mapInfoBtn\">More Info</button>');\n infowindow.open(map, marker);\n }\n } else {\n alert(\"Geocoder failed due to: \" + status);\n }\n });\n }", "function map_initialize()\n\t{\n\t\t\tvar googleMapOptions = \n\t\t\t{ \n\t\t\t\tcenter: myLatLng, // map center\n\t\t\t\tzoom: 17, //zoom level, 0 = earth view to higher value\n\t\t\t\tmaxZoom: 20,\n\t\t\t\tminZoom: 10,\n\t\t\t\tfullscreenControl: true,\n\t\t\t\tzoomControlOptions: {\n\t\t\t\t\t\t\t\t\tstyle: google.maps.ZoomControlStyle.LARGE //zoom control size\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\tscaleControl: true, // enable scale control\n\t\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP // google map type\n\t\t\t};\n\t\t\n\t\t \tmap = new google.maps.Map(document.getElementById(\"google_map\"), googleMapOptions);\t\t\n\t\t\t\n\t\t\t//Load Markers from the XML File, Check (map_process.php)\n\t\t\t$.get(\"map_process.php\", function (data) {\n\t\t\t\t$(data).find(\"marker\").each(function () {\n\t\t\t\t\t var name \t\t= $(this).attr('name');\n\t\t\t\t\t var address \t= '<p>'+ $(this).attr('address') +'</p>';\n\t\t\t\t\t var type \t\t= $(this).attr('type');\n\t\t\t\t\t var point \t= new google.maps.LatLng(parseFloat($(this).attr('lat')),parseFloat($(this).attr('lng')));\n\t\t\t\t\t create_marker(point, name, address, false, false, false, \"icons/pin_blue.png\");\n\t\t\t\t});\n\t\t\t});\t\n\n\t\t\t//Right Click to Drop a New Marker\n\t\t\tgoogle.maps.event.addListener(map, 'rightclick', function(event) {\n\t\t\t\t//Edit form to be displayed with new marker\n\t\t\t\tvar EditForm = '<p><div class=\"marker-edit\">'+\n\t\t\t\t'<form action=\"ajax-save.php\" method=\"POST\" name=\"SaveMarker\" id=\"SaveMarker\">'+\n\t\t\t\t'<label for=\"pName\"><span>Place Name :</span><input type=\"text\" name=\"pName\" class=\"save-name\" placeholder=\"Enter Title\" maxlength=\"40\" /></label>'+\n\t\t\t\t'<label for=\"pDesc\"><span>Description :</span><textarea name=\"pDesc\" class=\"save-desc\" placeholder=\"Enter Address\" maxlength=\"150\"></textarea></label>'+\n\t\t\t\t'<label for=\"pType\"><span>Type :</span> <select name=\"pType\" class=\"save-type\"><option value=\"restaurant\">Rastaurant</option><option value=\"bar\">Bar</option>'+\n\t\t\t\t'<option value=\"house\">House</option></select></label>'+\n\t\t\t\t'</form>'+\n\t\t\t\t'</div></p><button name=\"save-marker\" class=\"save-marker\">Save Marker Details</button>';\n\n\t\t\t\t//Drop a new Marker with our Edit Form\n\t\t\t\tcreate_marker(event.latLng, 'New Marker', EditForm, true, true, true, \"icons/pin_green.png\");\n\t\t\t});\t\t\t\n\t}", "function handleLoadMapFailure() {\n alert(\"failed to load google map, check your network connection and try again\");\n}", "function gmInitialize() {\n $('#contents').html('<div id=\"map\"></div>');\n var myLatLng = new google.maps.LatLng(29.516596899999996, -95.71289100000001);\n GEO = new google.maps.Geocoder();\n MAP = new google.maps.Map(document.getElementById('contents'), {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: myLatLng,\n zoom: 4\n });\n}", "function initMap() {\n\t\n\tvar userLat = parseFloat(document.getElementById(\"userLat\").innerHTML);\n\tvar userLong = parseFloat(document.getElementById(\"userLong\").innerHTML);\n\t\n\tif (isNaN(userLat) || isNaN(userLong)) {\n\t\t// The Boyd Orr: centre of the known universe\n\t\tvar myLatlng = {lat: 55.87371280304047, lng: -4.2924705147743225};\n\t} else {\n\t\tvar myLatlng = {lat: userLat, lng: userLong};\n\t}\t\n\t\n\t\n\tvar map = new google.maps.Map(document.getElementById('map'), {\n\t\tzoom: 8,\n\t\tcenter: myLatlng\n\t});\n\t\n\tvar originalMarker = new google.maps.Marker({\n\t\tposition: myLatlng,\n\t\tmap: map,\n\t\ttitle: 'Home sweet home!'\n\t});\n\t\n\tvar markers = [];\n\n\tgoogle.maps.event.addListener(map, \"click\", function (e) {\n\t\t\n\t\t\t\t\n\t});\t\n}", "function initialize () {\n var id = document.getElementById('map');\n map = new google.maps.Map(id, {\n center: {lat: 32.75, lng: -97.13},\n zoom: 17\n });\n marker = new google.maps.Marker({\n position: {lat: 32.75, lng: -97.13},\n map: map,\n title: 'my_marker',\n draggable:true\n });\n\n //Adding information about the address and zestimate to the map\n address_label = new google.maps.InfoWindow({\n content: \"Address : Central Arlington, Arlington, TX, USA\"\n });\n address_label.open(map,marker);\n\n //Adding the functionality to find zestimate when clicked on map\n map.addListener('click', function(click_pos) {\n \n var geocoder = new google.maps.Geocoder(); \n geocoder.geocode({\n latLng: click_pos.latLng\n }, function(responses) { \n if (responses != null)\n {\n document.getElementById('address').value = responses[0].formatted_address;\n sendRequest(); \n }\n \n }); \n \n });\n \n}", "function init() {\n\tmap = new google.maps.Map(document.getElementById('map-canvas'),\n myOptions);\n\tgetMyLocation();\n}", "function googleError() {\n alert('Google Maps has failed to load. Please check your internet connection or try again later.');\n}", "function initialize() {\n var mapProp = {\n center: new google.maps.LatLng(51.508742, -0.120850),\n zoom: 5,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n mapaNuevoViaje = new google.maps.Map(document.getElementById(\"googleMapViaje\"), mapProp);\n mapaVuelo = new google.maps.Map(document.getElementById(\"googleMapVuelo\"), mapProp);\n mapaReview = new google.maps.Map(document.getElementById(\"googleMapViajeReview\"), mapProp);\n mapaReviewRecom = new google.maps.Map(document.getElementById(\"googleMapViajeReviewRecom\"), mapProp);\n var markerBounds = new google.maps.LatLngBounds();\n}", "function initialize() {\n var mapOptions = {\n center: new google.maps.LatLng(35.090349,-35.367574),\n zoom: 4,\n mapTypeId: google.maps.MapTypeId.HYBRID\n };\n \n/*\nroadmap displays the default road map view. This is the default map type.\nsatellite displays Google Earth satellite images\nhybrid displays a mixture of normal and satellite views\nterrain displays a physical map based on terrain information.\n*/ \n \n map = new google.maps.Map(document.getElementById(\"map_canvas\"),\n mapOptions);\n // creating a marker\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(35.090349,-35.367574),\n map: map,\n title:\"LA NOSTRA BARCA!\",\n icon: createMarker(25, 25, 4)\n });\n // creating a SECOND marker\n var marker2 = new google.maps.Marker({\n position: new google.maps.LatLng(34.090349,-34.367574),\n map: map,\n title:\"PALLONCINO!\",\n icon: createBaloon(25, 25, 4)\n });\n}", "function initialize(){\n geocoder = new google.maps.Geocoder();\n var latlng = new google.maps.LatLng(0,0);\n var myOptions = {\n zoom: 1,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n }\n map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n}", "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 8,\n center: {lat: -34.397, lng: 150.644}\n });\n var geocoder = new google.maps.Geocoder();\n\n $(document).ready(function(){\n\t $('#submit').click(function(){\n\t \t$('.instagram .colonne-1 li').remove();\n\t geocodeAddress(geocoder, map, function(callback){\n\t \tvar lat = callback.lat;\n\t \tvar lng = callback.lng;\n\t \tgetLocation(lat, lng);\n\t });\n\t });\n });\n}", "function initMap() {\n\n //create the actual map\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 0, lng: 0 },\n zoom: 1\n });\n\n //init geocoder to transform names into coordinates\n geocoder = new google.maps.Geocoder();\n\n //Init DB\n openDB();\n\n //Create Table If not exists\n db.transaction(createTable);\n\n //Get all locations from the database and create Map Markers\n db.transaction(getAllEntries);\n\n //Event Handler\n document.getElementById('get_coordinates').addEventListener('click', function() {\n geocodeAddress(geocoder, map);\n });\n}", "function initialize() {\n\n progressMessage = new myWonderApp.ProgressMessageForUser('warnings_panel');\n progressMessage.setProgressMessage(\"initialize the directions service\");\n\n// console.log(\"initialize: \")\n // Instantiate a directions service.\n directionsService = new google.maps.DirectionsService();\n\n // Create a map and center it on Manhattan.\n var manhattan = new google.maps.LatLng(40.7711329, -73.9741874);\n var mapOptions = {\n zoom: 13,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: manhattan,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.DROPDOWN_MENU\n }\n };\n map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);\n\n addDropDown(map);\n// addProgressMessage(map);\n\n progressMessage.setProgressMessage(\"get the map div\");\n// console.log(\"directions: \" + map);\n // Create a renderer for directions and bind it to the map.\n var rendererOptions = {\n map: map\n }\n progressMessage.setProgressMessage(\"initialize the directions renderer\");\n directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions)\n\n // Instantiate an info window to hold step text.\n progressMessage.setProgressMessage(\"initialize the info window\");\n stepDisplay = new google.maps.InfoWindow();\n\n progressMessage.setProgressMessage(\"initialize the routeboxer\");\n routeBoxer = new RouteBoxer();\n //initDatabase();\n initGoogle()\n placeWrapper = new myWonderApp.PlaceWrapper(map, database);\n emptyFields = new myWonderApp.EmptyFields();\n}", "function cityMap() {\n var mapProp = {\n center: new google.maps.LatLng(43.720448, 10.392116),\n zoom: 14,\n disableDefaultUI: true\n };\n map = new google.maps.Map(document.getElementById(\"city_map\"),\n mapProp);\n route_planned = false;\n last_content = Array(svm.length)\n addVmMarkers();\n}", "function mapOnClick(e) {\n var coords = e.latLng;\n \n geocoder.geocode({'location': coords}, function(results, status) {\n if (status === 'OK') {\n if (program.addAllInfo(results[0])) { setMarkerPosition(coords); }\n } else {\n program.showMessage(\"\", \"Óþekkt villa. Ekki tókst að sækja staðsetninguna\");\n }\n });\n }", "function mapInit() {\n var mapOptions = {\n disableDoubleClickZoom: true,\n zoom: 15,\n center: neighborhood,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n panControl: true,\n scrollwheel: false,\n draggable: true,\n zoomControl: false,\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_BOTTOM\n },\n mapTypeControl: false,\n scaleControl: false,\n streetViewControl: false,\n overviewMapControl: false\n };\n map = new google.maps.Map($('#mapCanvas')[0], mapOptions);\n\n // set map to full size and places list to full height\n $('#mapCanvas').css('height', $(window).height());\n $('.scrollable-menu').css('max-height', $(window).height()-70);\n $('.scrollable-menu').css('max-width', $(window).width());\n\n // ensure the map is full size and places list to full height after a window resize event\n $(window).resize(function() {\n $('#mapCanvas').css('height', $(window).height());\n $('.scrollable-menu').css('max-height', $(window).height()-70);\n $('.scrollable-menu').css('max-width', $(window).width());\n });\n\n // Google API infoWindow\n var infoWindowElement = $('#infoWindow')[0];\n var infoOptions = {\n content: infoWindowElement\n };\n infoWindow = new google.maps.InfoWindow (infoOptions);\n // get places in the vicinity\n getPlacesNearby();\n }", "function initialize(){\r\n mapOptions = {\r\n center: new google.maps.LatLng(39.8106, -97.0569),\r\n zoom: 4,\r\n mapTypeId: google.maps.MapTypeId.ROADMAP,\r\n panControl: true\r\n };\r\n}", "function getItemMap(latitude, longitude) {\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: { lat: latitude, lng: longitude },\r\n zoom: 8\r\n });\r\n var geocoder = new google.maps.Geocoder;\r\n //var infowindow = new google.maps.InfoWindow;\r\n var latlng = { lat: latitude, lng: longitude };\r\n geocoder.geocode({ 'location': latlng }, function (results, status) {\r\n if (status === google.maps.GeocoderStatus.OK) {\r\n if (results[1]) {\r\n map.setZoom(17);\r\n var marker = new google.maps.Marker({\r\n position: latlng,\r\n\r\n map: map\r\n });\r\n //infowindow.setContent(results[1].formatted_address);\r\n //infowindow.open(map, marker);\r\n document.getElementById('addressText').innerText = results[1].formatted_address;\r\n } else {\r\n window.alert('No results found');\r\n }\r\n } else {\r\n window.alert('Geocoder failed due to: ' + status);\r\n }\r\n });\r\n}", "function initialize() {\n\n // definição do mapa\n var pos1 = origin.split(\",\");\n var x = parseFloat(pos1[0]);\n var y = parseFloat(pos1[1]);\n\n var mapProp = {\n center:new google.maps.LatLng(x, y),\n zoom:13,\n mapTypeId:google.maps.MapTypeId.ROADMAP\n };\n var map=new google.maps.Map(document.getElementById(\"googleMap\"), mapProp);\n\n // marcador de origem\n var myLatLng = {lat: x, lng: y};\n var OriginMarker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n title: 'Origem!'\n });\n\n // descobrindo parada mais próxima\n var parada = nearestParada(x, y);\n\n var splitCoord = coordinates[parada].split(\",\");\n var paradaEntradaX = parseFloat(splitCoord[0]);\n var paradaEntradaY = parseFloat(splitCoord[1]);\n\n //marcador de destino\n var myDestLatLng = {lat: paradaEntradaX, lng: paradaEntradaY};\n var destMarker = new google.maps.Marker({\n position: myDestLatLng,\n map: map,\n title: 'Destino!'\n });\n /**/\n var latlngbounds = new LatLngBounds();\n latlngbounds.extend(myDestLatLng);\n latlngbounds.extend(myLatLng);\n\n map.setCenter(latlngbounds.getCenter(), map.getBoundsZoomLevel(latlngbounds));\n}", "function initMap() {\n\n//need to call the geolocation and initMap function at the same time for them to load together.\n GeoLoco();\n\n//This is to hide the bottom panel that contains more detailed information about the location\n $(\"#panel\").hide();\n\n\n writtendetails= document.getElementById(\"mapwrittendetails\");\n infoPane = document.getElementById('panel');\n mapdetails=document.getElementById(\"placedetails\");\n getdirections=document.getElementById(\"getdirections\");\n var latmap = new google.maps.LatLng(53.41291, -8.24389);\n\n\n map = new google.maps.Map(document.getElementById(\"map-canvas\"), {\n zoom: 15,\n center: latmap\n });}", "function initMap() {\r\n var myOptions = {\r\n zoom: 14,\r\n center: new google.maps.LatLng(44.9727, -93.23540000000003),\r\n }\r\n map = new google.maps.Map(document.getElementById(\"map\"), myOptions);\r\n\r\n var geocoder = new google.maps.Geocoder(); // Create a geocoder object\r\n geocodeAddress(geocoder, map); // Puts markers on map\r\n var loc = new google.maps.LatLng(44.9727, -93.23540000000003);\r\n \r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n loc = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n\r\n document.getElementById(\"search\").onclick = function() {\r\n map.setCenter(loc);\r\n directionsRenderer.setMap(null);\r\n deleteMarkers();\r\n findPlace(map,loc);\r\n \r\n };\r\n \r\n var directionsService = new google.maps.DirectionsService();\r\n var directionsRenderer = new google.maps.DirectionsRenderer();\r\n directionsRenderer.setMap(map);\r\n directionsRenderer.setPanel(document.getElementById('directionsPanel'));\r\n \r\n document.getElementById(\"go\").onclick = function() {\r\n map.setCenter(loc);\r\n directionsRenderer.setMap(map);\r\n deleteMarkers();\r\n calculateAndDisplayRoute(directionsService, directionsRenderer,loc);\r\n changeStyle();\r\n };\r\n\r\n });\r\n } else {\r\n window.alert(\"Error: the Geolocation service has failed\");\r\n }\r\n\r\n}", "function mapLoadErr() {\n\n\talert(\"Google Maps API is not responding. Application cannot complete execution.\");\n}", "function mapHandler() {\n var map = new BMap.Map(\"map\");\n map.centerAndZoom(\"成都\", 15); // 初始化地图,设置中心点坐标和地图级别\n map.addControl(new BMap.MapTypeControl()); //添加地图类型控件\n map.setCurrentCity(\"成都\"); // 设置地图显示的城市 此项是必须设置的\n map.enableScrollWheelZoom(true);\n var geolocation = new BMap.Geolocation();\n geolocation.getCurrentPosition(function (r) {\n if (this.getStatus() == BMAP_STATUS_SUCCESS) {\n var mk = new BMap.Marker(r.point);\n map.addOverlay(mk);\n map.panTo(r.point);\n }\n else {\n alert('failed' + this.getStatus());\n }\n }, {enableHighAccuracy: true});\n}", "function initializeMap(Lat, Lon) {\n\n //define the center location \n var myLatlng = new google.maps.LatLng(Lat, Lon);\n //define the map options\n var mapOptions = {\n center: myLatlng,\n zoom: mapZoom,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n //instantiate the map wih the options and put it in the div holder, \"map-canvas\"\n map = new google.maps.Map(document.getElementById(\"map_canvas\"),\n mapOptions);\n\n// $.each(markersArray, function(i, marker) {\n// marker.setMap(null);\n// });\n\n if (infoBubble)\n overrideBubbleCloseClick();\n\n /* var oms will hold all the markers so as to resolve\n * the issue of overlapping ones\n */\n // oms = new OverlappingMarkerSpiderfier(map);\n // var iw = new google.maps.InfoWindow();\n // oms.addListener('click', function(marker) {\n // iw.setContent(marker.desc);\n // iw.open(map, marker);\n // });\n\n /* We initialize the infobubble styling */\n infoBubble = new InfoBubble({\n shadowStyle: 1,\n padding: 0,\n backgroundColor: '#F8804F',\n borderRadius: 10,\n arrowSize: 10,\n borderWidth: 2,\n maxWidth: 300,\n borderColor: '#f8b24f',\n disableAutoPan: false,\n arrowPosition: 30,\n arrowStyle: 2,\n hideCloseButton: true\n });\n \n getLiveFeeds();\n}", "function success(pos) {\n var crd = pos.coords;\n var currentLoc = new location(crd.latitude, crd.longitude);\n var img = new Image();\n //img.src = \"https://maps.googleapis.com/maps/api/staticmap?center=\" + crd.latitude + \",\" + crd.longitude + \"&zoom=17&size=300x300&sensor=false&key=\" + API_KEY;\n\n var locationOutput = '<p>Latitude is ' + currentLoc.latitude + '° <br>Longitude is ' + currentLoc.longitude + '°</p>';\n\n notifyUser(\"Located!\", locationOutput, img);\n\n //Google Maps information added\n\n var myLatLng = {lat:pos.coords.latitude, lng: pos.coords.longitude};\n //Zooms in the map\n\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 20,\n center: myLatLng\n });\n\n\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n title: 'This is you!'\n });\n\n //Check current location against the statues array\n for (var i = 0; i < statues.length; i++) {\n var target = new location(statues[i].latitude, statues[i].longitude);\n if (checkDistance(currentLoc, target) < 10) {\n notyMessage(statues[i]);\n console.log('Congratulations, you are within 10m from the target');\n audio.play();\n displayInfo(statues[i]);\n //add found locations name to array\n foundLocationNames.push(statues[i].name)\n //add found locations to foundStatues, and remove from statues\n removeFound(foundLocationNames, statues, foundStatues);\n //saves cookie each time a location is found\n saveCookie(foundLocationNames);\n }\n }\n\n }", "function initMap(){\n geocoder = new google.maps.Geocoder();\n}", "function initMap() {\n //create variable map from google.maps class\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 13, center: {lat:31.771959, lng: 35.217018}}); \n geocoder = new google.maps.Geocoder();\n infoWindow = new google.maps.InfoWindow;\n //center the map onload by correct position in map\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n \n infoWindow.setPosition(pos);\n infoWindow.setContent('<img src =\"images/person.png\" width=\"20px\" height =\"30px\"/>');\n infoWindow.setContent\n infoWindow.open(map);\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n function handleLocationError(browserHasGeolocation, infoWindow, pos) {\n infoWindow.setPosition(pos);\n infoWindow.setContent(browserHasGeolocation ?\n 'Error: The Geolocation service failed.' :\n 'Error: Your browser doesn\\'t support geolocation.');\n infoWindow.open(map);\n }\n //pass variable to function that contain all rows without lat & lng and set new values\n codeAddress(fromDb)\n //pass all data to function and set the lat lng on map\n showAllAddress(allData);\n\n function showAllAddress(allData){\n var infowind = new google.maps.InfoWindow;\n //foreach on array and set on map\n allData.forEach(data=>{\n var div = document.createElement('div');\n var strong = document.createElement('strong');\n strong.textContent = data.name;\n div.appendChild(strong);\n \n var marker = new google.maps.Marker({\n map: map,\n icon: 'images/summer.png',\n position: new google.maps.LatLng(data.lat ,data.lng),\n });\n marker.addListener('click',function(){\n console.log(infowind);\n infowind.setContent(div);\n infowind.open(map,marker)\n })\n \n \n })\n }\n //set lat and lng to address\n function codeAddress(fromDb) {\n fromDb.forEach(data => {\n let address = data.address;\n address.trim()\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == 'OK') {\n map.setCenter(results[0].geometry.location);\n map.getCenter().lat()\n let points = {}\n points.id = data.id\n points.lat = map.getCenter().lat();\n points.lng = map.getCenter().lng();\n //send the new data to function\n updateAddressWithLatLng(points)\n \n } else {\n alert('Geocode was not successful for the following reason: ' + status);\n }\n });\n })\n }\n //update the table with new data\n function updateAddressWithLatLng(points){\n\n $.ajax({\n url:'php/action.php',\n method:'post',\n data:points,\n success:function(res){\n console.log(res);\n }\n })\n \n }\n\n\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 10,\n center: {\n lat: 37.29723,\n lng: -122.0982877\n }\n });\n geocoder = new google.maps.Geocoder();\n\n\n return;\n}", "function initMap() {\n // The location of University Center, The New School\n var aus = {lat: -18.2871, lng: 147.6992};\n var ita = {lat: 45.444958, lng: 12.3155};\n var mt = {lat: 48.7596, lng: -113.7870};\n var ds = {lat: 31.5590, lng: 35.4732};\n var amz = {lat: -2.163106, lng: -55.126648};\n var yaml = {lat: 70.0000, lng: 70.0000};\n var mal = {lat: 3.2028, lng: 73.2207};\n var fld = {lat: 24.555059, lng: -81.779984};\n var rv = {lat: 48.864716, lng: 2.349014};\n var mub = {lat: 19.0760, lng: 72.8777};\n var alp = {lat: 46.8876, lng: 9.6570};\n var napa = {lat: 38.5025, lng: -122.2654};\n var rdj = {lat: -22.752754, lng: -42.864876};\n var cntr = {lat: 40.735973, lng: -73.994818};\n\n // The map, centered to show all the pins\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 2.5, center: cntr});\n\n // The marker, positioned at different buildings of The New School\n var markerAUS = new google.maps.Marker({position: aus, map: map, animation: google.maps.Animation.DROP, title: 'The Great Barrier Reef, Australia'});\n var markerITA = new google.maps.Marker({position: ita, map: map, animation: google.maps.Animation.DROP, title: 'Venice, Italy'});\n var markerMT = new google.maps.Marker({position: mt, map: map, animation: google.maps.Animation.DROP, title: 'Glacier National Park, Montana'});\n var markerDS = new google.maps.Marker({position: ds, map: map, animation: google.maps.Animation.DROP, title: 'The Dead Sea'});\n var markerAMZ = new google.maps.Marker({position: amz, map: map, animation: google.maps.Animation.DROP, title: 'The Amazon, Brazil'});\n var markerYML = new google.maps.Marker({position: yaml, map: map, animation: google.maps.Animation.DROP, title: 'The Yamal Peninsula, Russia'});\n var markerMAL = new google.maps.Marker({position: mal, map: map, animation: google.maps.Animation.DROP, title: 'The Maldives, Indian Ocean'});\n var markerFLD = new google.maps.Marker({position: fld, map: map, animation: google.maps.Animation.DROP, title: 'Key West, Florida'});\n var markerRV = new google.maps.Marker({position: rv, map: map, animation: google.maps.Animation.DROP, title: 'The Rhône Valley, France'});\n var markerMUB = new google.maps.Marker({position: mub, map: map, animation: google.maps.Animation.DROP, title: 'Mumbai, India'});\n var markerALP = new google.maps.Marker({position: alp, map: map, animation: google.maps.Animation.DROP, title: 'The Alps'});\n var markerNAPA = new google.maps.Marker({position: napa, map: map, animation: google.maps.Animation.DROP, title: 'Napa Valley, California'});\n var markerRDJ = new google.maps.Marker({position: rdj, map: map, animation: google.maps.Animation.DROP, title: 'Rio de Janeiro, Brazil'});}", "function initialize_map () {\n directionsDisplay = new google.maps.DirectionsRenderer();\n MAP = new google.maps.Map(document.getElementById(\"map\"), mapOptions);\n directionsDisplay.setMap(MAP);\n OMS = new OverlappingMarkerSpiderfier(MAP, oms_options);\n // set_location();\n }", "onScriptLoad() {\n\t\tlet map;\n\t\tmap = new window.google.maps.Map(\n\t\t\tdocument.getElementById(this.props.id), this.props.options);\n\t\t//add the markers\n\t\tthis.props.onMapLoad(map);\n\n\t}", "function initMap() {\n // The map, centered on the venue\n geocoder = new google.maps.Geocoder();\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n });\n}", "initIndex() {\n $(window).on('gMapsLoaded', this.customMap.init);\n this.customMap.loadGoogleMaps();\n }", "function initialize() {\n infoWindow = new google.maps.InfoWindow();\n\n /*\n * infoWindow customization, referenced from:\n * http://en.marnoto.com/2014/09/5-formas-de-personalizar-infowindow.html\n */\n google.maps.event.addListener(infoWindow, 'domready', function() {\n\n // Reference to the DIV which receives the contents of the infowindow using jQuery\n var iwOuter = $('.gm-style-iw');\n\n var iwBackground = iwOuter.prev();\n\n // Remove the background shadow DIV\n iwBackground.children(':nth-child(2)').css({'display' : 'none'});\n\n // Remove the white background DIV\n iwBackground.children(':nth-child(4)').css({'display' : 'none'});\n\n// Moves the arrow 70px to the left margin\n iwBackground.children(':nth-child(3)').attr('style', function(i,s){ return s + 'left: 70px !important; bottom: 5px !important;'});\n\n iwBackground.children(':nth-child(3)').find('div').children().css({'z-index' : '1',\n 'border': '5px solid ' + rating.colour});\n iwOuter.css({'max-width': '160px', 'width':'160px', 'border': '5px solid ' + rating.colour});\n\n var iwCloseBtn = iwOuter.next();\n\n// Reposition the button\n iwCloseBtn.css({\n opacity: '1', // by default the close button has an opacity of 0.7\n right: '20px', top: '20px', // button repositioning\n });\n });\n // initialize map\n var mapOptions = {\n zoom: 10,\n center: new google.maps.LatLng(-37.8141,144.9633),\n streetViewControl: false,\n mapTypeControl: false,\n fullscreenControl: false\n };\n map = new google.maps.Map(document.getElementById('mapDemo'),\n mapOptions);\n\n\n //configure search bar\n input = document.getElementById('search');\n\n //restrict the search and autocomplete to VIC\n searchBound = new google.maps.LatLngBounds(\n new google.maps.LatLng(-38.54816, 144.42077),\n new google.maps.LatLng(-37.35269, 145.49743)\n );\n var option = {\n bounds: searchBound,\n strictBounds: true\n }\n autoCom = new google.maps.places.Autocomplete(input, option);\n\n geoCodingService = new google.maps.Geocoder; //initialise geocoding\n\n //perform auto search function, results automatically show if choose suggested location, or hit enter to do the search\n autoCom.addListener('place_changed', function() {\n placeSearched = autoCom.getPlace();\n if (!placeSearched || !placeSearched.geometry) {\n manualLookUp(); //if it's not a valid place object, perform a geocoding search to find location\n } else { //get risk info and display to website\n $('#search').addClass('searchBarLoading');\n locationInfoByCoords(placeSearched.geometry.location.lat(), placeSearched.geometry.location.lng());\n }\n });\n\n//request pm10 data and store it\n $.ajax({\n url: 'scripts/pm10Request.php',\n type: 'GET'\n }).done(function(res) {\n pm10Measures = res;\n }).fail(function() {\n alert('Oops, Something wrong at the back');\n pm10Measures = '[]';\n }).always(function() {\n displayDefault(); //function to display the default locations when loading the page\n initLocate(); //function to location user current location when loading the page\n });\n\n\n //add listener for user to click to view default location info from pop up and info box\n map.data.addListener('click', function(event) {\n displayInfoInBox(event.feature.getProperty(\"city\"), event.feature.getProperty(\"riskScore\"));\n infoWindow.setContent(\n setInfoWindowContent(event.feature.getProperty(\"city\"),\n event.feature.getProperty(\"temp\"),\n event.feature.getProperty(\"weather\"),\n event.feature.getProperty(\"riskScore\"))\n );\n infoWindow.setOptions({\n position:{\n lat: event.latLng.lat(),\n lng: event.latLng.lng()\n },\n pixelOffset: {\n width: -13,\n height: -20\n }\n });\n infoWindow.open(map);\n });\n}", "function initializeVer(){\n\tvar mapProp = {center:myCenterVer, zoom:14, mapTypeId:google.maps.MapTypeId.ROADMAP};\n\n\tmapVer = new google.maps.Map(document.getElementById(\"googleMapVer\"),mapProp);\n\n\tgoogle.maps.event.addListener(mapVer, 'click', function(event){ placeMarkerVer(event.latLng); });\n\n\tvar marcador;\n\tvar infowindows = [];\n\tvar markerActu = [];\n\tfor(var i = 0; i < (PuntosLimpios.length); i++){\n\t\tconsole.log(PuntosLimpios[i]+\" \"+PuntosLimpios[i+1]);\n\t\tmarcador = new google.maps.Marker({position: {lat: parseFloat(PuntosLimpios[i]), lng: parseFloat(PuntosLimpios[i+1])}, map: mapVer,});\n\t\tinfowindow = new google.maps.InfoWindow({content:PuntosLimpios[i+2]});\n\t\tmarkerActu.push(marcador);\n\t\tinfowindows.push(infowindow);\n\t\tgoogle.maps.event.addListener(markerActu[parseInt(i/6)], 'click', function(k){\n\t\t\treturn function(){\n\t\t\t\tfor (var j = 0; j < infowindows.length; j++) {\n\t\t\t\t\tinfowindows[j].close();\n\t\t\t\t\tmarkerActu[j].setAnimation(null);\n\t\t\t\t}\n\t\t\t\tmarkerActu[k].setAnimation(google.maps.Animation.BOUNCE);\n\t\t\t\tinfowindows[k].open(mapVer, markerActu[k]);\n\n\t\t\t\tvar latitud = markerActu[k].getPosition().lat();\n\t\t\t\tvar longitud = markerActu[k].getPosition().lng();\n\t\t\t\tdocument.getElementById('coorX').value = latitud;\n\t\t\t\tdocument.getElementById(\"coordX\").innerHTML = latitud;\n\t\t\t\tdocument.getElementById('coorY').value = longitud;\n\t\t\t\tdocument.getElementById(\"coordY\").innerHTML = longitud;\n\n\t\t\t\tvar direccion = \"http://maps.googleapis.com/maps/api/geocode/json?latlng=\"+latitud+\",\"+longitud+\"&sensor=true\";\n\t\t\t\tconsole.log(direccion);\n\t\t\t\t$.getJSON(direccion, function(result){\n\t\t\t\t\tvar address = result.results[0].formatted_address;\n\t\t\t\t\tdocument.getElementById(\"dir\").innerHTML = address;\n\t\t\t\t\tdocument.getElementById(\"direccion\").value = address;\n\t\t\t\t});\n\t\t\t\tvar infoI = k*7 + 2;\n\t\t\t\tdocument.getElementById(\"nombreJunta\").innerHTML = PuntosLimpios[infoI];\n\t\t\t\tdocument.getElementById(\"nombre\").innerHTML = PuntosLimpios[infoI+2];\n\t\t\t\tdocument.getElementById(\"telefono\").innerHTML = PuntosLimpios[infoI+3];\n\t\t\t\tdocument.getElementById(\"email\").innerHTML = PuntosLimpios[infoI+4];\n\t\t\t\tdocument.getElementById(\"fecha\").innerHTML = PuntosLimpios[infoI+1];\n\t\t\t\t$('#collapseVerInfo').collapse(\"show\");\n\t\t\t}\n\t\t}(parseInt(i/7)));\n\t\ti += 6;\n\t}\n\n\tvar marcadorExistente;\n\tinfowindowsExistente = [];\n\tmarkerActuExistente = [];\n\tfor(var i = 0; i < (PuntosLimpiosExistente.length); i++){\n\t\tconsole.log(PuntosLimpiosExistente[i]+\" \"+PuntosLimpiosExistente[i+1]);\n\t\tmarcadorExistente = new google.maps.Marker({position: {lat: parseFloat(PuntosLimpiosExistente[i]), lng: parseFloat(PuntosLimpiosExistente[i+1])}, map: mapVer,icon:\"resources/pinkball.png\",});\t\t\n\t\tinfowindowExistente = new google.maps.InfoWindow({content:PuntosLimpiosExistente[i+2]});\n\t\tmarcadorExistente.setVisible(false);\n\t\tmarkerActuExistente.push(marcadorExistente);\n\t\tinfowindowsExistente.push(infowindowExistente);\n\t\tgoogle.maps.event.addListener(markerActuExistente[parseInt(i/3)], 'click', function(k){\n\t\t\treturn function(){\n\t\t\t\tfor (var j = 0; j < infowindowsExistente.length; j++) {\n\t\t\t\t\tinfowindowsExistente[j].close();\n\t\t\t\t}\n\t\t\t\tinfowindowsExistente[k].open(mapVer, markerActuExistente[k]);\n\t\t\t}\n\t\t}(parseInt(i/3)));\n\t\ti += 2;\n\t}\n}", "function mapError() {\n alert('unable to load Google Map');\n}", "function GeoCallback ( in_geocode_response\t///< The JSON object.\n\t\t\t\t\t\t\t)\n\t{\n\t\tif ( in_geocode_response && in_geocode_response[0] && in_geocode_response[0].geometry && in_geocode_response[0].geometry.location )\n\t\t\t{\n\t\t\tWhereAmI_CallBack ( {'coords':{'latitude':in_geocode_response[0].geometry.location.lat(),'longitude':in_geocode_response[0].geometry.location.lng()}} );\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\talert ( c_g_address_lookup_fail );\n\t\t\twindow.history.back();\n\t\t\t};\n\t}", "function CurrentLocation() {\n Marker1=new google.maps.LatLng(clat, clng); addMarker(Marker1, \"Current Location\");\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -14.834991, lng: -64.903790},\n zoom: 15\n }); \n\n var location = [\n {title: 'Plaza Principal José Ballivián', location:{lat: -14.834991, lng: -64.903790} },\n {title: 'Saltenas Chingolas', location:{lat: -14.835045, lng: -64.906800} },\n {title: 'El Tabano', location:{lat: -14.838037, lng: -64.908804} },\n {title: 'La Estancia', location:{lat: -14.839857, lng: -64.903700} },\n {title: 'Pacumuto', location:{lat: -14.829196, lng: -64.906162} },\n {title: 'Aeropuerto de trinidad', location:{lat: -14.821583, lng: -64.917416} },\n ]; \n inizileArray(location);\n addInMenu(locationTitle, locationCoord);\n flagV=true;\n}", "function onSuccess(position) {\r\n \r\n lat = position.coords.latitude;\r\n lng = position.coords.longitude;\r\n updatedLat = lat;\r\n updatedLng = lng;\r\n \r\n //Google Maps\r\n myLatlng = new google.maps.LatLng(lat,lng);\r\n \r\n mapOptions = {zoom: 16,center: myLatlng, zoomControl: false, mapTypeControl: false, streetViewControl: false}\r\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\r\n \r\n // variables for direction services\r\n var directionsService = new google.maps.DirectionsService;\r\n var directionsDisplay = new google.maps.DirectionsRenderer({suppressMarkers: true});\r\n directionsDisplay.setMap(map);\r\n\r\n marker = new google.maps.Marker({\r\n position: myLatlng,\r\n icon: 'https://image.ibb.co/j8F82F/user_icon.png',\r\n title: 'Current Position',\r\n map: map\r\n });\r\n \r\n $.getJSON('https://script.google.com/macros/s/AKfycbygukdW3tt8sCPcFDlkMnMuNu9bH5fpt7bKV50p2bM/exec?id=10x8hgJEz1cy5vfrr_4-Q1FkKYopa825TCQR6IcgKP30&sheet=Sheet',\r\n function (data) {\r\n var results = data.Sheet;\r\n for (var i = 0; i < results.length; i++) {\r\n var lat1 = results[i].latitude;\r\n var lon1 = results[i].longitude;\r\n var latLng = new google.maps.LatLng(lat1,lon1);\r\n var name = results[i].name;\r\n var info = results[i].info;\r\n var img = results[i].img;\r\n var directions = 'https://www.google.com/maps/dir/?api=1&origin='+myLatlng+'&destination='+latLng+'&travelmode=walking';\r\n markers[i] = new google.maps.Marker({\r\n position: latLng,\r\n icon: 'https://image.ibb.co/iR3Vzv/toilet_map.png',\r\n map: map\r\n });\r\n \r\n (function(marker,i){\r\n // infowindow content\r\n var contentString = '<div id=\"iw-container\">' + '<div class=\"iw-title\">'+ name + '</div>' + '<div class=\"iw-content\">' + \r\n '<div class=\"iw-subTitle\">'+ info + '<img src='+ img +'>' + '<br><a href=\"'+ directions +'\" target=\"_blank\">Open in Google Maps</a>' + '</div>' + '</div>' + '</div>';\r\n\r\n google.maps.event.addListener(marker, 'click', function(){ \r\n calculateAndDisplayRoute(directionsService, directionsDisplay, myLatlng, marker.position);\r\n infowindow.close();\r\n // Updates the content of the infowindow before opening it\r\n infowindow.setContent(contentString);\r\n infowindow.open(map, marker);\r\n destLat = this.position.lat();\r\n destLng = this.position.lng();\r\n\r\n // Highlights selected toilet icon from black to yellow\r\n if (selectedMarker !== null){\r\n selectedMarker.setIcon(\"https://image.ibb.co/iR3Vzv/toilet_map.png\")\r\n }\r\n marker.setIcon(\"https://image.ibb.co/kjpwPQ/toilet2_map.png\");\r\n selectedMarker = marker;\r\n\r\n }); \r\n }(markers[i],i));\r\n }\r\n });\r\n}" ]
[ "0.7110744", "0.70606136", "0.7004338", "0.68623734", "0.68493164", "0.6823201", "0.6801846", "0.6797154", "0.6778971", "0.6754326", "0.6746589", "0.6745704", "0.6716422", "0.6716061", "0.6709883", "0.6694243", "0.66937786", "0.6686383", "0.668621", "0.6679218", "0.6656666", "0.6638488", "0.662249", "0.66155285", "0.6614107", "0.6604738", "0.66015136", "0.65985304", "0.65920573", "0.65909314", "0.6586587", "0.6583444", "0.6582614", "0.6576981", "0.6574371", "0.6559415", "0.6552727", "0.6551584", "0.65502375", "0.6545839", "0.65396935", "0.65357023", "0.65346354", "0.6526943", "0.6522984", "0.65216553", "0.65131867", "0.6511742", "0.6511742", "0.65114087", "0.65110266", "0.65102017", "0.6508895", "0.65085757", "0.6504043", "0.64993316", "0.6499262", "0.64947265", "0.64839506", "0.6483669", "0.6483004", "0.64806014", "0.6478636", "0.64739263", "0.6473045", "0.6470064", "0.6469093", "0.64615697", "0.64605206", "0.6459274", "0.6457756", "0.64516836", "0.64511114", "0.64485395", "0.644755", "0.644613", "0.6441046", "0.6439805", "0.6439412", "0.64387864", "0.64360493", "0.64359045", "0.64356977", "0.6429754", "0.642952", "0.64281595", "0.6428025", "0.6427522", "0.64236647", "0.64234173", "0.6421535", "0.64210933", "0.6420496", "0.6420237", "0.642008", "0.64147776", "0.64104116", "0.6406136", "0.6405518", "0.64053285", "0.64028454" ]
0.0
-1
Calls the backend for location objects.
function getLocations(bounds) { const url = "/api/v1/stores?lat1=" + bounds.getNorthEast().lat() + "&lat2=" + bounds.getSouthWest().lat() + "&lng1=" + bounds.getNorthEast().lng() + "&lng2=" + bounds.getSouthWest().lng(); // Query the backend to refresh results. $.getJSON(url, updateView); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static list() {\n return api_base_1.default.request('locations/').then((locations) => {\n return locations.data.map(each => new Location_1.default(each));\n });\n }", "updateLocation() {\n this.api.exec('getLocation');\n }", "function locationizer(work_obj) {\n\n}", "componentDidMount() {\n this.fetchLocations();\n }", "function loadLocations() {\n fetch(\"http://localhost:3000/location/load\", {\n method: \"GET\",\n })\n .then((res) => {\n return res.json();\n })\n .then((data) => {\n locations = data.locations;\n })\n .catch((err) => {\n console.log(`Error looking up the location, ${err}`);\n });\n }", "function getAllLocations(callback) {\n\t\tcallback(vm.model.locationArr);\n\t}", "function getAllLocations(callback) {\n\t\tcallback(vm.model.locationArr);\n\t}", "function getAllLocations(callback) {\n\t\t\tcallback(vm.locationArr);\n\t\t}", "function loopStores(){\n for (var i = 0; i < storeObjects.length; i++){\n allLocations(storeObjects[i]);\n }\n}", "componentDidMount () {\n this.getLocations()\n }", "componentDidMount() {\n this.getLocations();\n }", "fetchLocations() {\n let url = \"https://5f4529863fb92f0016754661.mockapi.io/locations\"\n fetch(url)\n .then(response => response.json())\n .then(data => {\n this.setState({ locations: data })\n })\n }", "function getAllLocations(){\n\t$.ajax({\n\t\turl: \"http://pokeapi.co/api/v2/location?limit=10\",\n\t\tsuccess: getAllLocationsCallback\n\t})\n}", "getLocations() {\n this.locationsService = locations_service_1.LocationsService.getLocationsSlowly()\n .then(locations => this.unmodifiedLocations = locations);\n }", "function getLocation() {\n coord = null;\n // coord = Alloy.Globals.getCurrentLocation();\n if (Ti.Geolocation.locationServicesEnabled) {\n Ti.Geolocation.purpose = \"Receive User Location\";\n Titanium.Geolocation.getCurrentPosition(function(e) {\n coord = e.coords;\n // coord = {\n // latitude : 19.0760,\n // longitude : 72.8777\n // };\n //Ti.API.info('current locations ' + JSON.stringify(coord));\n if (coord != null) {\n\n if (args.inStore) {\n //Ti.API.info('do nthing');\n getDirectionforInStore();\n } else {\n ///\n\n showLoader($.findStore);\n //now calling store locator web service\n var param = {\n latitude : coord.latitude,\n longitude : coord.longitude,\n filter : \"All\",\n storetype : \"All\"\n };\n\n var requestMethod = Alloy.Globals.commonUrl.storeList;\n var requestParams = JSON.stringify(param);\n //Ti.API.info('request Param--->' + requestParams);\n Alloy.Globals.webServiceCall(requestMethod, requestParams, _getStoreListSuccessCallback, _getStoreListErrorCallback, \"POST\", $.findStore);\n ////\n }\n } else {\n coord = null;\n //display message that location is not enabled\n setTimeout(function() {\n geolocation();\n }, 1500);\n showAlert($.findStore, \"Allow location access for D'Decor app by going to Settings\");\n\n }\n\n });\n } else {\n coord = null;\n setTimeout(function() {\n geolocation();\n }, 1500);\n //display message that location is not enabled\n showAlert($.findStore, \"Allow location access for D'Decor app by going to Settings\");\n\n }\n\n}", "async function locations(zone, type, coord){\r\n \r\n let query, headers, queryURL\r\n \r\n let locationTypes = ['PARKING_ZONE','TRAFFIC_LANE','WALKWAY']\r\n \r\n // (typeof(coord) === undefined) ? tenant.bbox : coord\r\n if (coord === undefined) {coord = '-90:-180,90:180'}\r\n \r\n if (type === 'bbox') {\r\n console.debug('querying locations by bbox')\r\n query = '/locations/search?bbox='+coord\r\n } else if (locationTypes.indexOf(type) >= 0) {\r\n console.debug('querying locations by locationType')\r\n query = '/locations/search?bbox='+coord+'&q=locationType:'+type \r\n } else {\r\n console.debug('querying locations by locationUid')\r\n query = '/locations/'+type\r\n }\r\n\r\n headers = {authorization: 'Bearer '+client_token, 'predix-zone-id': zone} \r\n queryURL = tenant.metadataservice+query\r\n console.log('Query URL: '+queryURL)\r\n \r\n let response = (await request(queryURL,headers))\r\n return (response.content === undefined) ? response : response.content \r\n }", "getLocations (value) {\n if (!value) return\n if (this.state.request) this.state.request.abort() // Abort last active request\n\n let url = `https://secure.geonames.org/searchJSON?username=${Settings.geonamesUser}&maxRows=1000&country=${Settings.country}&`\n let self = this\n\n // Decide which query parameter to use depending on if value is a zip code or not\n if (isNaN(value)) {\n url += `name_startsWith=${value}`\n } else {\n url += `postalcode_startsWith=${value}`\n }\n\n if (consoleLog) console.log(`Fetching locations that match \"${value}\"...`)\n\n let req = request(url, function (error, response, body) {\n if (consoleLog) console.log('geonames.org response:', response.toJSON())\n\n if (error) return self.promiseSetState({ locations:[] }) // Just ignore errors\n\n let data = JSON.parse(body)\n if (consoleLog) console.log('geonames.org parsed body:', data)\n\n let locations = data.geonames\n .filter(l => l.fcl === 'P') // Only return cities\n .map(l => Object({\n id: l.geonameId,\n label: `${l.name}, ${l.adminName1}`,\n lat: l.lat,\n lng: l.lng\n }))\n\n return self.promiseSetState({ locations })\n })\n\n return self.promiseSetState({ request:req }).then(() => req)\n }", "loadLocationData() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/location/\", {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(obj => this.processLocationData(obj));\n }", "function getLocations(callBack) {\n $$.ajax({\n url: \"https://cloud.dean.technology/location\",\n type: \"GET\",\n contentType: \"application/json\",\n \"crossDomain\": true,\n success: function(data, textStatus, jqXHR) {\n data = JSON.parse(data);\n myApp.template7Data.locations = data;\n callBack();\n },\n error: function(data, textStatus, jqXHR) {\n console.log(\"getLocations ERROR\", data);\n }\n });\n}", "function loadLocations() {\n// var locations = new Location(0, 0, null);\n var area = new Area(\"University\");\n send(new Arrival(\"area_read\", session, area, true), writeLocations);\n}", "getAllLocations() {\n\n infoWindow = new window.google.maps.InfoWindow();\n if (navigator && navigator.geolocation) {\n\n navigator.geolocation.getCurrentPosition(function (position) {\n pos = [position.coords.latitude, position.coords.longitude]\n let centerpos = { \"lat\": position.coords.latitude, \"lng\": position.coords.longitude }\n map.setCenter(centerpos);\n\n }, function (error) {\n console.log(\"error\", error)\n this.handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n this.handleLocationError(false, infoWindow, map.getCenter());\n }\n }", "componentWillMount(){\n this.fetchGeographicLocation();\n }", "function locationizer(work_obj) {\n var locations = [];\n for(job in work_obj.jobs) {\n \tvar newLocation = work_obj.jobs[job].location;\n locations.push(newLocation);\n\n }\n return locations;\n}", "function GeoLocQuery(){}", "componentDidMount() {\n\t\tthis.getLocations();\n\t}", "getLocations(success) {\n connection.query('select * from Locations', (error, results) => {\n if (error) return console.error(error);\n\n success(results);\n });\n }", "componentDidMount() { // determine user location and make API request\n this.getLocation();\n}", "_customLocation() {\n if (this.state.somewhereElse) {\n this.getCoordsByAddress();\n } else {\n this._onForward();\n }\n }", "function getLocations(res, mysql, context, complete){\n mysql.pool.query(\"SELECT loc_id as id, loc_name AS name FROM GoT_Locations ORDER BY loc_name\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.locations = results;\n complete();\n });\n }", "function allLocations(store){\n pushHoursOpen(store);\n perHour(store);\n pushToSales(store);\n}", "async getLocations() {\n const locations = await this.client().location.list()\n .then(location => location)\n .catch((err) => console.log(err));\n\n return locations\n }", "function Location(obj) { this.obj = obj; }", "function locationizer(work_obj) {\n\tvar locationArray = [];\n\twork_obj.jobs.forEach(function(job) {\n\t\tvar newLocation = job.location;\n\t\tlocationArray.push(newLocation);\n\t});\n\treturn locationArray;\n}", "componentDidMount(){\n this.loadLocations();\n }", "async getLocation() {\n const currentLocation = await getCurrentLocation();\n if (!this._isMounted) return;\n this.setState({\n position: currentLocation,\n markers: await this.getMarkers(currentLocation),\n });\n }", "getLocations() {\n return super.get(['locations'], function (data) {\n return data['locations'];\n });\n }", "function loadSampleLocations() {\n $.ajax({\n url: \"/api/sample-locations\",\n data: {},\n success: function(data, status) {\n if (status === \"success\") {\n var sampleLocations = data.sampleLocations;\n\n createMarkersForMultiplePlaces(sampleLocations);\n }\n },\n error: function(error, status) {\n if (status === \"error\") {\n displayErrorMessage(\n \"Error: There was an error in retrieving sample locations!\"\n );\n }\n }\n });\n}", "function loadLocations(){\n var result = LocationsService.get({param:AuthService.getId()}, function() {\n $scope.locations = result.directions;\n }, function(){\n Loading.showText('No se pudo cargar los taxistas.');\n Loading.hideTimeout();\n });\n }", "function loadLocations(){\n var result = LocationsService.get({param:AuthService.getId()}, function() {\n $scope.locations = result.directions;\n }, function(){\n Loading.showText('No se pudo cargar los taxistas.');\n Loading.hideTimeout();\n });\n }", "function getLocations() {\n return $http.get('location.json')\n .then(successFn, errorFn);\n }", "GetDisplayLocationList() {\n // return [displayLocations] to Frontend\n }", "function locationFinder() {\n\t\tvar locations = [];\n\t\tlocations.push(bio.contacts.location);\n\t\tfor (var school in education.schools) {\n\t\t\tlocations.push(education.schools[school].location);\n\t\t}\n\t\tfor (var job in work.jobs) {\n\t\t\tlocations.push(work.jobs[job].location);\n\t\t}\n\t\treturn locations;\n\t}", "function onLocationFound(location){\n\n\t// Update the model with the coordinate pair for use later.\n\tapp.position = location;\n\n\t// If successful, find all nearby brunch locations at those coordinates.\n findNearbyBrunchLocations(location.coords);\n\n}", "function search(locURL) {\n $.ajax({\n url: locURL,\n method: \"GET\",\n dataType: 'json',\n success : function (data) {\n var obj = data;\n var o = obj.results[0][\"geometry\"][\"location\"];\n makeURL(o.lat, o.lng);\n initialize(o.lat, o.lng);\n }\n })\n}", "function locationizer(work_obj) {\n var locArray = [];\n for (job in work_obj.jobs) {\n var newLocation = work_obj.jobs[job].location;\n locArray.push(newLocation);\n }\n return locArray;\n}", "function getLocations(callback) {\n return fetch('/locations', {\n accept: \"application/json\"\n }).then(checkStatus)\n .then(response => response.json())\n .then(convertToMapObject)\n .then(callback);\n}", "function locationFinder() {\n\n // initializes an empty array\n var locations = [];\n var inArray; //to check if location was included\n\n // adds the location and its information from bio to the arrays\n var contacts = octopus.getContacts();\n locationsInfo[contacts.location.split(',')[0].trim()] = {\n text: contacts.locationText,\n url: contacts.locationURL,\n image: contacts.locationImage\n };\n locations.push(contacts.location);\n\n // iterates through school locations and appends each location and\n // its information to the arrays\n var schools = octopus.getSchools();\n var len = schools.length;\n for (var school = 0; school < len; school++) {\n inArray = $.inArray(schools[school].location, locations);\n if (inArray == -1) {\n locationsInfo[schools[school].location.split(',')[0].trim()] = {\n text: schools[school].locationText,\n url: schools[school].locationURL,\n image: schools[school].locationImage\n };\n locations.push(schools[school].location);\n }\n }\n\n // iterates through work locations and appends each location and\n // its information to the arrays\n var jobs = octopus.getJobs();\n len = jobs.length;\n for (var job = 0; job < len; job++) {\n inArray = $.inArray(jobs[job].location, locations);\n if (inArray == -1) {\n locationsInfo[jobs[job].location.split(',')[0].trim()] = {\n text: jobs[job].locationText,\n url: jobs[job].locationURL,\n image: jobs[job].locationImage\n };\n locations.push(jobs[job].location);\n }\n }\n return locations;\n }", "function locationizer(workObj) {\n\tlocsFromWork = [];\n\tfor (job in workObj.jobs) {\n\t\t\tlocsFromWork.push(workObj.jobs[job].location);\n\t}\n\treturn locsFromWork;\n}", "function locationizer(work_obj) {\n\tvar locationArray = [];\n\n\tfor (job in work_obj.jobs) {\n\t\tvar newLocation = work_obj.jobs[job].location;\n\t\tlocationArray.push(newLocation);\n\t}\n\treturn locationArray;\n}", "function locationFinder() {\n\n // initializes an empty array\n var locations = [];\n\n // adds the single location property from bio to the locations array\n locations.push(bio.contacts.location);\n\n // iterates through school locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n education.schools.forEach(function (school) {\n locations.push(school.location);\n });\n\n // iterates through work locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n work.jobs.forEach(function (job) {\n locations.push(job.location);\n });\n\n return locations;\n }", "function locationFinder() {\n\n // initializes an empty array\n var locations = [];\n\n // adds the single location property from bio to the locations array\n locations.push(bio.contacts.location);\n\n // iterates through school locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n education.schools.forEach(function(school){\n locations.push(school.location);\n });\n\n // iterates through work locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n work.jobs.forEach(function(job){\n locations.push(job.location);\n });\n\n return locations;\n }", "componentDidMount() {\n this.props.getAllLocations();\n }", "function createLocations(){\n\n\t//Uptown Areas\n\tlibrary = new Location('Library', 'This is the Library of ' + user.townName + '. It is filled with thousand of books, Magazines, and newspaper articles. Any information you are looking for you will find here. There is a librarian here all the time and you will usually find at least one student studying.', [ancientBook, hiddenTreasureMap, bookOnDecipheringCode, scienceBook, mathBook], [librarian, student], [], 'library');\n\n\thotel = new Location ('Hotel', 'The hotel of ' + user.townName + ' is a hundred year old building with 42 beautiful rooms for travelers, tourists, and businessmen to stay in. There is always front desk help for any needs you have and a bell boy to take care of your luggage.', [roomKeySet, luggage, luggageCart, pillow, elevatorKey], [bellboy, frontDeskHelp], [], 'hotel');\n\n\t//Shopping District Areas\n\tgroceryStore = new Location ('Grocery Store', 'You will find a lot of ' + user.townName + ' shoppers here on the weekend getting their groceries. Any clerk or cashier will be happy to help you get your freshest food and other essential groceries here all at once!', [shoppingBasket, boxOfCereal, rawSteak, priceGun, cashRegister], [cashier, clerk, shopper], [], 'grocery');\n\n\tcoffeeShop = new Location ('Coffee Shop', 'A nice little place to get any type of coffee you would like along with a little something to eat. There is only need for one employee but she is very good and will take care of you. Beware of the hipster that comes in everyday. Regardless anyday of the year is a good time to stop in!', [hotCoffee, icedCoffee, doughnut, muffin, thermos], [employee, hipster], [], 'coffee');\n\n\thardwareStore = new Location ('Hardware Store', 'With aisles and aisles of home and yard improvement items this is the perfect place to get the tool for the job. The owner is a great guy and will always help you plus you will find a contractor or two that will probably be able to help you as well.', [hammer, screwdriver, wrench, shovel, saw], [owner, contractor], [], 'hardware');\n\n\t//Downtown Areas\n\tpoliceStation = new Location ('Police Station', 'You do not want to end up here in the ' + user.townName + ' Police Station. The town is not highly crime plagued but this Station has eight holding cells and twelve officers prepared for anything. Do not be like the crook in here now because the officer will not take it easy on you.', [handcuffs, nightstick, handcuffKey, taser, policeReport], [officer, crook], [], 'police');\n\n\tautoShop = new Location ('Auto Shop', 'This Auto Shop features a six bay garage with four lifts. They have everything possible to fix any vehicle. Mike the mechanic is the best just ask any customer of his! Do not go anywhere else to get your car, truck, or any other motorized vehicle fixed!', [tire, engine, torqueWrench, carJack, alternator], [mechanic, customer], [], 'auto');\n\n\t//Districts\n\tdowntown = new Location ('Downtown', 'This is Downtown ' + user.townName + ' where you will find our lovely Police Station and Auto Shop. If you get into trouble with the law or car problems you will find yourself here. If you travel north from here, you will find yourself in the Shopping District.', [], [], [], 'downtown');\n\n\tshoppingDistrict = new Location ('Shopping District', 'You find yourself in the busy Shopping District of ' + user.townName +'. You see a large grocery store on your right. Across the street from the grocery store you see a road that leads west to Uptown. On one side of this road you see a small coffee shop. Across the street from the coffee shop you see a hardware store. If you take the main road south, you will arrive in Downtown.', [], [], [], 'shopping');\n\n\tuptown = new Location ('Uptown', 'While in Uptown ' + user.townName + ' you will experience a nice laid back area. This part of town includes a library, for the book connoisseurs, and a Hotel for individuals visiting on business or some tourists.If you travel South-East you will find the Shopping District and continue South to get to Downtown', [], [], [], 'uptown');\n}", "componentDidMount() {\n this.getLocation();\n }", "function locationFinder() {\n\n // initializes an empty array\n var locations = [];\n\n // adds the single location property from bio to the locations array\n locations.push(bio.contacts.location);\n\n // iterates through school locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n education.schools.forEach(function(school) {\n locations.push(school.location);\n });\n\n // iterates through work locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n work.jobs.forEach(function(job) {\n locations.push(job.location);\n });\n return locations;\n }", "async componentDidMount() {\n console.log(this.state.obj_id);\n //localStorage.removeItem(\"obj_id\");\n // const url = \"http://localhost:5543/api/getData/\" + this.state.obj_id;\n // \"https://web-backend-server.herokuapp.com/api/getData/100/\" +\n // (this.state.trip_id === null ? 1 : this.state.trip_id);\n const url = \"https://web-project-maps.herokuapp.com/api/getData/\"+ this.state.obj_id;\n const response = await fetch(url);\n const data = await response.json();\n console.log(data);\n this.setState({ location: data.data[0], loading: false });\n\n // geo-encoder function call, to change address to lat and lng.\n this.getGeocode(this.state.location.source, \"p\");\n this.getGeocode(this.state.location.destination, \"d\");\n }", "componentDidMount(){\n this.getLocation();\n }", "getLocations(){\n return axios.get(\"/api/locations\")\n }", "function locationFinder() {\n\n var locations = [];\n locations.push(bio.contacts.location);\n \n // iterates through school locations and appends each location to the locations array.\n education.schools.forEach(function(school){\n locations.push(school.location);\n });\n\n // iterates through work locations and appends each location to the locations array.\n work.jobs.forEach(function(job){\n locations.push(job.location);\n });\n return locations;\n }", "function locationizer(work_obj) {\r\n var locationArray = [];\r\n\r\n for(job in work_obj.jobs) {\r\n \tvar newlocation = work_obj.jobs[job].location;\r\n \tlocationArray.push(newlocation);\r\n }\r\n\r\n return locationArray;\r\n \r\n}", "function locationizer(work_obj) {\n var locationArray = [];\n\n for (job in work_obj.jobs) {\n var newLocation = work_obj.jobs[job].location;\n locationArray.push(newLocation);\n }\n return locationArray;\n}", "function locationizer(work_obj) {\n var locationArray = [];\n\n for (job in work_obj.jobs) {\n var newLocation = work_obj.jobs[job].location;\n locationArray.push(newLocation);\n }\n\n return locationArray;\n}", "function locationizer(work_obj) {\n var locationArray = [];\n for (var i = 0; i < work.jobs.length; i++) {\n var newLocation = work_obj.jobs[i].location;\n locationArray.push(newLocation);\n }\n return locationArray;\n}", "function getLocationListCallback(locationList) {\n // Get result list:\n tmpLocationList = locationList;\n // Get target ID:\n var locationID = getLocationIDFromLocationList(locationList, locationName);\n if (locationID == null) {\n callback(null);\n return null;\n }\n // Get gist list by location ID:\n indexVue.getPointsByLocationIDFromWebservice(locationID, getPointsCallback);\n }", "function getGeoLocation() {\n showPage('results');\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(returnedPosition) {\n let position = {};\n position.longitude = returnedPosition.coords.longitude;\n position.latitude = returnedPosition.coords.latitude;\n getCityByLocation(position);\n });\n }\n}", "function parseLocation(locObj){\n //Use the first result from Google\n if(locObj.status == \"OK\"){\n callback(locObj.results[0]);\n } else {\n console.warn(\"Problem contacting the geolocation API: \" + locObj.status);\n }\n }", "componentDidMount() {\n api.discoverLocations().then(locations => {\n this.setState(\n {\n locations: locations\n },\n this.loadMap()\n );\n });\n }", "function getPlacesAndDetail(baseLoc) {\n var locs;\n //check if locations are available in the localStorage\n //if available in LocalStorage, call 'generateLocations' to load data as an array of Objects\n //if not available in LocalStorage, call 'getLocations' to fetch from data provider\n (locs = JSON.parse(localStorage.getItem(baseLoc))) ? generateLocations(locs) : getLocations(baseLoc, processInfo);\n\n //loads the location info to mapViewModel.locations\n function generateLocations(locs) {\n var noOfLocs = locs.length;\n for (i = 0; i < noOfLocs; i++) {\n var loc = new Location(locs[i]);\n mapViewModel.locations.push(loc);\n }\n }\n\n //this is the callback for getLocations\n function processInfo(error, result) {\n //if getLocations returns error, try to display the map alone centered at baseLoc\n if (error) {\n getGeocode(baseLoc, centerMap);\n return;\n }\n\n //no error from getLocations. Process data\n var resultLength = result.response.groups[0].items.length;\n for (var i = 0; i < resultLength; i++) {\n var item = result.response.groups[0].items[i];\n var loc = new Location();\n loc.name = item.venue.name;\n loc.address = item.venue.location.address ? item.venue.location.address : 'Address not available';\n loc.lat = item.venue.location.lat;\n loc.lon = item.venue.location.lng;\n loc.phone = item.venue.contact.formattedPhone ? item.venue.contact.formattedPhone : 'Not Available';\n loc.category = item.venue.categories[0].name ? item.venue.categories[0].name : 'Category not available';\n loc.marker = makeMapMarker(loc);\n mapViewModel.locations.push(loc);\n }\n\n //store the locations in localStorage\n localStorage.setItem(baseLoc, JSON.stringify(mapViewModel.locations(), replacer));\n \n //this is for JSON.stringify.\n //to ensure location.marker to have null value.\n //otherwise stringify will throw error.\n function replacer(i, obj) {\n if (i == 'marker') {\n return null;\n }\n return obj;\n }\n\n //callback for getGeocode\n //centers the map using the data returned from getGeocode\n function centerMap(error, data) {\n var centre = {lat: -34.397, lng: 150.644}; //default map center\n \n //if getGeocode returns a valid location, center the map using that location\n if (!error && data.status === 'OK' ) { \n centre = data.results[0].geometry.location;\n }\n map.setCenter(centre);\n }\n }\n}", "function getLocations() {\n return $.ajax({\n type: \"get\",\n async: false,\n url: '/mapapi/getAllLocation'\n });\n}", "function callSearchLocation(){\n\tif(\"undefined\" != address && null != address && 0 < address.length && currentlyEmittedAddressIndex < address.length-1){\n\t\taddressString = address.slice(currentlyEmittedAddressIndex + 1,address.length).join(\" \");\n\t\tcurrentlyEmittedAddressIndex ++;\n\t\tsearchLocationOnMapAddressArray(addressString);\n\t}\n}", "componentDidMount() {\n this.state.alllocations.map(location => {\n return fetchJsonp(\n `https://en.wikipedia.org/w/api.php?action=opensearch&search=${\n location.title\n }&format=json&callback=wikiCallback`\n )\n .then(response => response.json())\n .then(responseData => {\n let fetchedInfo = [\n ...this.state.locationsInfo,\n [responseData, responseData[2][0], responseData[3][0]]\n ];\n this.updateData(fetchedInfo);\n })\n .catch(function() {\n alert('Failed to fetch information');\n });\n });\n }", "function getLocation() {\n return findLocation(getStatus());\n}", "function retrieveWeather(locations) {\n for (let loc of locations) {\n getTemp(currentURL, loc.id, appID, (temp) => {\n try {\n let obj = JSON.parse(temp);\n loc.weather = obj;\n updateMarker(loc.weather.main.temp, loc.weather.weather[0].main, loc.id);\n } catch(error) {\n console.log(error);\n }\n });\n }\n}", "componentWillMount() {\r\n this.getLocation();\r\n }", "function LocationList() {\n const [state, dispatch] = useStoreContext();\n\n//Will display locations based on what is currently in the search location state in the global state manager.\n const getLocations = () => {\n // dispatch({ type: LOADING });\n API.getLocationByState(state.searchLocation.region, state.searchLocation.city, state.searchLocation.difficulty)\n .then(results => {\n dispatch({\n type: GET_LOCATIONS,\n locations: results.data\n });\n })\n .catch(err => console.log(err));\n };\n //Will update the locations displayed when the search location is updated in the global state. Would also like to have this display the users current location on load in future development.\n useEffect(() => {\n getLocations();\n }, [state.searchLocation]);\n\n// Going to display locations if search locations currently exists. Lazy load was throwing up too many warnings as is, will use it in future development.\n return (\n <div>\n {state.locations.length ? (\n <div>\n <h4 className=\"mb-2 mt-0 text-center\">Explore New Trails in {state.searchLocation.city}</h4>\n <List>\n {state.locations.map(location => (\n // <LazyLoad offsetVertical={300}>\n <ListItem key={location._id}>\n <Link to={\"/locations/\" + location._id}>\n {location.area}: <strong>{location.name}</strong>\n </Link>\n </ListItem>\n // </LazyLoad>\n ))}\n </List>\n </div>\n ) : (\n <h3>There are no locations to display!</h3>\n )}\n </div>\n );\n}", "function locationFinder() {\n\n\t// initializes an empty array\n\tvar locations = [];\n\n\t// adding places I've lived\n\tlocations = bio.places;\n\n\t// adds the single location property from bio to the locations array\n\tlocations.push(bio.contacts.location);\n\n\t// iterates through school locations and appends each location to\n\t// the locations array\n\tfor (var school in education.schools) {\n\t\tlocations.push(education.schools[school].location);\n\t}\n\n\t// iterates through work locations and appends each location to\n\t// the locations array\n\tfor (var job in work.jobs) {\n\t\tlocations.push(work.jobs[job].location);\n\t\t//console.log(locations);\n\t}\n\n\t//console.log(locations);\n\treturn locations;\n}", "function getAllLocationsCallback(response){\n\tconsole.log(response.results.forEach(function(locations){\n\t\tconsole.log(locations.name);\n\t}))\n}", "function getObjects(req, res, next) {\n var location = req.param(\"location\");\n var type = req.param(\"type\");\n objectService.getObjects(location, type, (error, response) => {\n if (response == null) {\n ResponseHandler(404, response, res);\n return;\n }\n ResponseHandler(error, response, res);\n });\n}", "function getLocations() {\n console.log('client sent request to server for all locations');\n $http.get('/schedule/locations').then(function(response) {\n locations.array = response.data;\n console.log('locations: ', locations.array);\n });\n }", "findStoresAction(queryText, searchConfig, longitudeLatitude, countryIsoCode, useMyLocation, radius) {\r\n if (useMyLocation && this.winRef.nativeWindow) {\r\n this.clearWatchGeolocation(new FindStoresOnHold());\r\n this.geolocationWatchId = this.winRef.nativeWindow.navigator.geolocation.watchPosition((pos) => {\r\n const position = {\r\n longitude: pos.coords.longitude,\r\n latitude: pos.coords.latitude,\r\n };\r\n this.clearWatchGeolocation(new FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: position,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }, () => {\r\n this.globalMessageService.add({ key: 'storeFinder.geolocationNotEnabled' }, _spartacus_core__WEBPACK_IMPORTED_MODULE_1__[\"GlobalMessageType\"].MSG_TYPE_ERROR);\r\n this.routingService.go(['/store-finder']);\r\n });\r\n }\r\n else {\r\n this.clearWatchGeolocation(new FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: longitudeLatitude,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }\r\n }", "function getLocation(locale) {\n const URL = \"https://api.weather.gov/points/\" + locale; \n // NWS User-Agent header (built above) will be the second parameter \n fetch(URL, idHeader) \n .then(function(response){\n if(response.ok){ \n return response.json(); \n } \n throw new ERROR('Response not OK.');\n })\n .then(function (data) { \n // Let's see what we got back\n console.log('Json object from getLocation function:'); \n console.log(data);\n // Store data to localstorage \n storage.setItem(\"locName\", data.properties.relativeLocation.properties.city); \n storage.setItem(\"locState\", data.properties.relativeLocation.properties.state); \n \n // Next, get the weather station ID before requesting current conditions \n // URL for station list is in the data object \n let stationsURL = data.properties.observationStations;\n let forecastHourly= data.properties.forecastHourly; \n // Call the function to get the list of weather stations\n getStationId(stationsURL); \n getHourly(forecastHourly);\n }) \n .catch(error => console.log('There was a getLocation error: ', error)) \n} // end getLocation function", "componentDidMount() {\n // A FUNCTION THAT SENDS LONGITUDE AND LATITUDE TO BACKEND THAT RECEIVES LIST OF RESTAURANTS THAT MAPS IT INTO MARKER JSX FORMAT INTO AN ARRAY\n navigator.geolocation.getCurrentPosition((position) => {\n console.log('current position: ', position);\n console.log('latitude: ', position['coords']['latitude']);\n let newPosition = {\n latitude: position['coords']['latitude'],\n longitude: position['coords']['longitude'],\n latitudeDelta: 0.05,\n longitudeDelta: 0.05,\n };\n this.setState({ position: newPosition });\n this.getYelp();\n });\n }", "function getLocation(location) {\n\t lat = location.coords.latitude;\n\t lng = location.coords.longitude;\n\t\tgetVenues();\n\t}", "function get_location(town, state, obj) {\n\t\tvar location = {};\n\t\tvar addString = town+\", \"+state;\n\n\n\t\tvar geocoder = new google.maps.Geocoder();\n\t\tgeocoder.geocode({address: addString }, function(result, status){\n\t\t\tif(status == 'OK'){\n\t\t\t\t// Problem here is that function is returning before locations are complete\n\t\t\t\tlocation.lat = result[0].geometry.location.lat() \n\t\t\t\tlocation.lng = result[0].geometry.location.lng()\n\t\t\t\tobj.location = location;\n\t\t\t\t// console.log(location)\t\n\t\t\t}\n\t\t});\n\t}", "_setLocation(location){\n this.location = location;\n this.notify(UpdateMessage.Relocated);\n }", "function fetchLocationData(locationNames) {\n console.log(`fetching ${locationNames.length} locations`);\n return Promise.all(locationNames.map(_findPlaceIdFor))\n .then(placeIds => Promise.all(placeIds.map(_fetchPlaceByPlaceId)))\n .then(places => _formatResult(places, locationNames))\n}", "function fetch_location(){\n console.log(\"Pta ni kya yaar!\");\n}", "function locationHandler(request,response) {\n const city = request.query.data;\n location.getLocation(city)\n .then(data => render(data, response))\n .catch( (error) => errorHandler(error, request, response) );\n}", "function processInfo(error, result) {\n //if getLocations returns error, try to display the map alone centered at baseLoc\n if (error) {\n getGeocode(baseLoc, centerMap);\n return;\n }\n\n //no error from getLocations. Process data\n var resultLength = result.response.groups[0].items.length;\n for (var i = 0; i < resultLength; i++) {\n var item = result.response.groups[0].items[i];\n var loc = new Location();\n loc.name = item.venue.name;\n loc.address = item.venue.location.address ? item.venue.location.address : 'Address not available';\n loc.lat = item.venue.location.lat;\n loc.lon = item.venue.location.lng;\n loc.phone = item.venue.contact.formattedPhone ? item.venue.contact.formattedPhone : 'Not Available';\n loc.category = item.venue.categories[0].name ? item.venue.categories[0].name : 'Category not available';\n loc.marker = makeMapMarker(loc);\n mapViewModel.locations.push(loc);\n }\n\n //store the locations in localStorage\n localStorage.setItem(baseLoc, JSON.stringify(mapViewModel.locations(), replacer));\n \n //this is for JSON.stringify.\n //to ensure location.marker to have null value.\n //otherwise stringify will throw error.\n function replacer(i, obj) {\n if (i == 'marker') {\n return null;\n }\n return obj;\n }\n\n //callback for getGeocode\n //centers the map using the data returned from getGeocode\n function centerMap(error, data) {\n var centre = {lat: -34.397, lng: 150.644}; //default map center\n \n //if getGeocode returns a valid location, center the map using that location\n if (!error && data.status === 'OK' ) { \n centre = data.results[0].geometry.location;\n }\n map.setCenter(centre);\n }\n }", "function loadLocations() {\n\t$.ajax({\n\t\turl: '/location',\n\t\ttype: 'GET',\n\t\tdataType: 'json',\n\t\tsuccess: function(response) { \n\t\t\tlet locations = response.locations;\t\t\t\n\t\t\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\t\t zoom: 11,\n\t\t\t center: startPosition\n\t\t\t});\n\t\t\n\t\t\tfor(var i=0; i<locations.length; i++) {\n\t\t\t\tvar newMarker = new google.maps.Marker({\n\t\t\t\t\tposition: {lat: parseFloat(locations[i].lat), lng: parseFloat(locations[i].lng)},\n\t\t\t\t\tmap: map,\n\t\t\t\t\ttitle: locations[i].title,\n\t\t\t\t\tid: locations[i].id\n\t\t\t\t});\t\t\n\t\t\t\tmarkers.push(newMarker);\n\t\t\t}\n\t\t\tupdateMarkers();\n\t\t},\n\t\tcomplete: function(xhr, status) { \n\n\t\t},\n\t\terror: function(xhr, status) { \n\n\t\t}\n\t}); \n}", "updateLocation() {\n this.apiList.map.clearMarkers();\n $('.eventsContainer').empty();\n $('.businessContainer').empty();\n $('.weatherContainer').empty();\n $('.destinationsAdded').empty();\n $('.directionsPanel').empty();\n $('.calculateRoute').removeClass('hidden');\n var userMarker = new Marker(this.apiList.map.mapObj, { name: \"You\" }, undefined, this.apiList.map.updateLocation, this.apiList.map.closeWindows, this.apiList.map.expandClickHandler);\n userMarker.renderUser({\n lat: this.userPositionLat,\n lng: this.userPositionLong\n });\n this.apiList.map.markers.user = userMarker;\n this.initAJAX();\n }", "getLocation() {\n navigator.geolocation.getCurrentPosition((position) => {\n this.setState({lat: position.coords.latitude, lon: position.coords.longitude});\n // if successful, proceed to make API request\n this.getLocationName();\n }, (error) => this.setState({errorMessage: error}))\n }", "componentDidMount() {\n if (\"geolocation\" in navigator) {\n navigator.geolocation.getCurrentPosition(\n position => {\n const [lat, lng] = [\n position.coords.latitude,\n position.coords.longitude\n ];\n this.setState({\n location: {\n lat: lat,\n lng: lng\n },\n queryMarkerLocation: {\n lat: lat,\n lng: lng\n },\n hasUsersLocation: true,\n zoom: 18\n });\n },\n err => {\n fetch(\"https://ipapi.co/json\")\n .then(res => res.json())\n .then(location => {\n const [lat, lng] = [location.latitude, location.longitude];\n this.setState({\n location: {\n lat: lat,\n lng: lng\n },\n queryMarkerLocation: {\n lat: lat,\n lng: lng\n },\n hasUsersLocation: true,\n zoom: 8\n });\n });\n }\n );\n }\n }", "getCoordinatesByAddress() {\n if ( this.props.locationData.address.length > 0 ) {\n LocationActions.getCoordinatesByAddress(this.props.dispatch, this.props.locationData.address);\n }\n }", "function Api(location) {\n this.location = location;\n\n // When the function is explicity named, easier to follow stack traces are given.\n this.run = function run(callback) {\n const data = {\n '/location1': ['location1', 'data'],\n '/location2': ['/ocation2', 'data']\n };\n\n setTimeout(() => {\n this.onDataRecieved(data[this.location], callback)\n }, 500);\n };\n\n this.onDataRecieved = function onDataRecieved(data, callback) {\n callback(data);\n };\n}", "async _getLocation() {\n let me = this;\n let { status } = await Permissions.askAsync(Permissions.LOCATION);\n if (status !== 'granted') {\n Alert.alert('Location permission was denied');\n return;\n }\n this.setState({isLoading: true});\n this.watchID = this.geoLoc.watchPosition(position => {\n const location = JSON.stringify(position);\n me.setState({ isLoading:false, region: {latitude: position.coords.latitude, longitude: position.coords.longitude,\n latitudeDelta: 0.0122,\n longitudeDelta: 0.0021}});\n },\n error => {\n me.setState({isLoading:false});\n Alert.alert('Error while getting location', error.message)\n },\n { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 });\n }", "fetchGeographicLocation() {\n\t\t//First check if the browser supports geo locations\n\t\tif (navigator.geolocation){\n\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\t/*anonymous method passed as the first argument used by the getCurrentPosition\n\t\t\t\t method when it was successful, else it calls the error function */\n\t\t\t\t(position) => {\n\t\t\t\t\t//creating a variable to store the coordinates\n\t\t\t\t\tlet crds = position.coords;\n\t\t\t\t\tthis.fetchWeatherData(crds.latitude, crds.longitude);\n\t\t\t\t},\n\t\t\t\t//the method that gets called when an error occurs\n\t\t\t\t() => {\n\t\t\t\t\twindow.alert(\"Error has occurred\");\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}", "function initLocations() {\n\tvar spots = [0];\n\tvar bar = new Location(\"bar\", spots);\n\t\n\ttavernLocationList = [bar];\n}", "function useCurrentLocation(pos) {\n console.log(\"Using actual loaction\")\n console.log(pos.coords)\n // requestPhotos(pos.coords)\n \n //* FALLBACK LOCATION *//\n \n function useFallbackLocation() {\n console.log(\"Using fallback location\")\n requestPhotos(fallBackLocation)\n }\n \n \n \n}", "async function getLocationList(){\n let requestOptions = {\n method : \"GET\",\n headers : {\n \"Content-Type\" : \"application/json\"\n }\n }\n const response = await fetch('/locations', requestOptions);\n const body = await response.json();\n\n if (response.status != 200){\n throw Error(body.message);\n }\n return body\n}" ]
[ "0.6452191", "0.6297527", "0.6216586", "0.6147725", "0.6145211", "0.61318725", "0.61318725", "0.610508", "0.6100868", "0.6073528", "0.6071257", "0.6067039", "0.60230684", "0.59927094", "0.5961285", "0.5941312", "0.59357184", "0.59279853", "0.59099203", "0.5884117", "0.5871099", "0.58431774", "0.58233964", "0.5816432", "0.58138853", "0.57944965", "0.5786627", "0.57638395", "0.5752058", "0.5744315", "0.5735563", "0.57316756", "0.5729375", "0.5710847", "0.57053304", "0.56880116", "0.56831473", "0.56815857", "0.56815857", "0.56731695", "0.5667004", "0.5666718", "0.566351", "0.5652929", "0.56472373", "0.56329477", "0.5621469", "0.56186944", "0.56169766", "0.56103057", "0.5597708", "0.5594728", "0.5594185", "0.55920595", "0.5579041", "0.5578861", "0.55718136", "0.5568322", "0.5557919", "0.5552417", "0.55436414", "0.5528322", "0.5517471", "0.55073357", "0.55060834", "0.5491699", "0.54887307", "0.54713845", "0.5468377", "0.5433666", "0.5432052", "0.5429919", "0.54277736", "0.54258305", "0.5423412", "0.5408303", "0.53989965", "0.5394267", "0.53866655", "0.5369724", "0.5367021", "0.53668046", "0.5365372", "0.53555274", "0.53538185", "0.53507286", "0.53438634", "0.5341246", "0.53345287", "0.53294575", "0.5323961", "0.5321228", "0.5314308", "0.5308225", "0.53053796", "0.53049934", "0.5303241", "0.5300744", "0.52994955", "0.5299358" ]
0.64608437
0
Updates the Vue data
function updateView(results) { // Find which location is selected let selectedName; if (resultsList.selected !== -1 && resultsList.items.length > resultsList.selected) { selectedName = resultsList.items[resultsList.selected].name } else { selectedName = null; resultsList.selected = -1; } // If the location still exists, keep it selected for (let i = 0; i < results.length; i++) { if (selectedName === results[i].name) { resultsList.selected = i; break; } } const names = []; const newNames = []; for (let i = 0; i < resultsList.items.length; i++) { names[i] = resultsList.items[i].name; } // Update markers for (let i = 0; i < results.length; i++) { newNames.push(results[i].name); if (names.includes(results[i].name)) { continue; } // Add a marker const marker = new google.maps.Marker({ position: { lat: results[i].latitude, lng: results[i].longitude }, map: map, icon: markerIcon, }); marker.addListener('click', function () { selectLocation(i); }); resultsList.markers.push(marker); } for (let i = 0; i < resultsList.items.length; i++) { if (!newNames.includes(resultsList.items[i].name)) { resultsList.markers[i].setMap(null); } } for (let i = 0; i < resultsList.markers.length; i++) { let icon; if (i === resultsList.selected) { icon = null; } else { icon = markerIcon; } resultsList.markers[i].setIcon(icon); } resultsList.items = results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(data) {\n this.data = data;\n this.populate(this.dindex);\n console.log(\"Infographic of type \\\"\" + this.typename + \"\\\" updated.\");\n }", "update(data) {\n this.data = data || this.data;\n this._updateID++;\n }", "update() {\n this.dataChanged = true;\n this.persons.all = undefined;\n this.jobTitles.all = undefined;\n this.updateFiltered();\n this.updateTimed();\n }", "updateData(data) {\n this.data(data, true);\n\n return this;\n }", "update (data) {\n for (let key in data) {\n if (this.hasOwnProperty(key)) { // Can only update already defined properties\n this[key] = data[key];\n }\n }\n }", "componentDidUpdate() { //triggered if data changed in the database\n this.setData()\n }", "setData (data) {\n this.processData(data);\n this.trigger('update', data);\n }", "function updateData() {\n $.getJSON(window.location + 'data', {\n measure: _store.measure,\n dag: _store.dag,\n id: _store.id\n }, function (data) {\n var array = [];\n for (var key in data) {\n array.push({ value: data[key].value, date: new Date(data[key].ds) });\n }\n _store.data = array;\n _store.updating = false;\n DetailViewStore.emit(DATA_UPDATE_EVENT);\n });\n}", "update() {\n this.showLoader();\n axios\n .put(`users`, {\n users: this.users\n })\n .then(response => {\n if (response.data.success) {\n this.alert(\"Users updated\", \" \", \"success\", 2000);\n this.getUsers();\n }\n })\n .catch(error => {\n this.alert(\n \"Something went wrong\",\n \"Your changes could not be saved\",\n \"error\",\n false\n );\n })\n .finally(() => {\n this.hideLoader();\n });\n }", "function updateData() {\n\t/*\n\t* TODO: Fetch data\n\t*/\n}", "__doDataUpdate() {\n if (this.$isDestroyed) {\n return;\n }\n\n let queues = this.__setDataQueue;\n this.__setDataQueue = null;\n if (!queues || !queues.length) {\n return;\n }\n\n // call lifecycle beforeUpdate hook\n this.beforeUpdate && this.beforeUpdate();\n this.setData(getSetDataPaths(queues), this.__nextTickCallback);\n }", "update(startingData) {}", "function update(data) {\n console.log('+++ TODO');\n }", "updateSpoofaxData(newData)\r\n {\r\n //console.log(\"\\nUpdating Spoofax data: \" + JSON.stringify(newData));\r\n this.spoofaxData = newData;\r\n this.io.emit('spoofax-data', this.spoofaxData);\r\n }", "#updateData() {\n this.container.querySelector('.data').innerHTML = this.data;\n }", "update(data) {\n return this.ref.update(data);\n }", "updateParsafixData(newData)\r\n {\r\n this.parsafixData = newData;\r\n this.io.emit('parsafix-data', '<pre>' + prettyPrintJson.toHtml(this.parsafixData) + '</pre>');\r\n }", "setData(data){\r\n this.model.setData(data);\r\n }", "update(data = {}) {\r\n console.log(data);\r\n this.state = Object.assign(this.state, data);\r\n this.notify(this.state);\r\n }", "getData () {\n if (data) {\n this.data = data;\n this.emit('change', this.data);\n }\n }", "update( data ) {\n this.state.cursor().update( cursor => {\n return cursor.merge( data )\n })\n }", "update(){}", "update(){}", "update(){}", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "function update() {\n if (ctrl.version != ''){\n var path = 'testapi-ui/components/guidelines/data/' + ctrl.version + '.json';\n $http.get(path).success(function(data){\n ctrl.data = data;\n }).error(function(error){\n });\n }\n }", "updateVendors(data){\n\t\tlet input = JSON.parse(data);\n\t\tthis.vendors[input.vendor].items = input.items;\n\t}", "updateObject(data) {\n super.updateObject(data);\n\n if (data.filterData && !isEqual(this.filterData, data.filterData)) {\n this.setFilterData(data.filterData);\n Signals.elementChanged.dispatch();\n }\n\n if (data.trackingURL && this.trackingURL !== data.trackingURL) {\n this.setTrackingURL(data.trackingURL);\n Signals.elementChanged.dispatch();\n }\n\n if (data.utmData && !isEqual(this.utmData, data.utmData)) {\n this.setUTMData(data.utmData);\n Signals.elementChanged.dispatch();\n }\n\n if (data.texturePath && !isEqual(this.texturePath, data.texturePath)) {\n this.setTexturePath(data.texturePath);\n }\n }", "update(data = {}) {\n this.state = Object.assign(this.state, data);\n this.notify(this.state);\n }", "componentDidUpdate() {\n this.loadData();\n }", "set data(data) {\n if (this._data === data) return;\n this._data = data;\n this._render();\n }", "watchData() {\n this.service = this.$services[this.serviceId];\n this.loading = true;\n this.updating = false;\n this.profileUrl = undefined;\n\n this.canEdit = Boolean(\n this.currentUser.publicId\n && (this.publicId === this.currentUser.publicId)\n );\n\n this.$unwatchData();\n if (this.data && this.data.$destroy) {\n this.data.$destroy();\n }\n\n const ref = this.service.dataRef(this.publicId);\n\n this.data = this.$firebaseObject(ref);\n this.$unwatchData = this.data.$watch(() => this.onDataChanged());\n }", "update(data) {\n this.vendorDataService.updateVendor(this.id, data)\n .$promise\n .then((data) => {\n this.log(data);\n this.editing = '';\n this.addressRevertData = '';\n this.hoursRevertData = '';\n this.ammenitiesRevertData = '';\n this.menu = data.menu;\n this.vendor = data;\n this.hours = this.setUpHours()\n\n })\n .catch((error) => {\n this.error('XHR Failed for getContributors.\\n' + angular.toJson(error.data, true));\n });\n }", "function updateData() {\n ctrl.data = {};\n ctrl.data.vendors = ctrl.rawData.vendors.filter(function(vendor) {\n return ctrl._filterVendor(vendor);\n });\n ctrl.data.vendors.sort(function(a, b) {\n if (a.type > b.type) {\n return 1;\n }\n if (a.type < b.type) {\n return -1;\n }\n return a.name.localeCompare(b.name);\n });\n }", "set data(newData){\n\t\tlet _self = this;\n\t\tif(!newData){\n\t\t\tconsole.log(\"set data with undefined\");\n\t\t\treturn;\n\t\t}\n\n\t\tif(this.dtInstance) {\n\t\t\t// this._data = this.prepareData(newData);\n\t\t\tthis._data = this.sortData(newData);\n\n\t\t\tthis.$timeout(function(){\n\t\t\t\t_self.updateTable();\n\t\t\t});\n\t\t} else {\n\t\t\tthis._data = newData;\n\t\t}\n\t}", "updateMpsData(newData)\r\n {\r\n //console.log(\"\\nUpdating MPS data\");\r\n this.mpsData = newData;\r\n this.classEmitter.emit(\"mps-data\", this.mpsData);\r\n this.io.emit('mps-data', '<pre>' + prettyPrintJson.toHtml(this.mpsData) + '</pre>', this.mpsData);\r\n }", "refreshDatas() {\n this.populateBrandsData(); \n this.forceUpdate();\n }", "function _updateDeviceData(data) {\n vm.deviceData = data;\n vm.isAdmin = (UserService.getUserRole() > 0) ? true : false;\n vm.buttonStyles = _formatButton(data.state, data['active_reservations'][0]);\n _formatDetails(data);\n\n vm.switchView('infoView');\n vm.loadingState = 'contentSuccess';\n }", "refresh() {\n if (this.date && this.price)\n this.update(this.date, this.price);\n }", "function vdDemo_updateData(){\n\tvar d=GLB.vdDemoData[GLB.vdDemoIdx];\t// Use current index row of Demo Data Array\n\t\n\t// Update VDvehicle obj with data: [id,vehicle,speed,accel,heart,X,Y,Z,lat,lng,insurance]\n\tGLB.vehicle.updateData(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10]);\n\tGLB.vehicle.updateDriverImg(d[11]);\n\tGLB.vehicle.updateRoadImg(d[12]);\n\n\t// Update the Text elements on the page\n\tGLB.vehicle.modifyHtmlText();\n\n\t//UPDATE CHARTS HERE\n\n\t// Check if index has reached end of array\n\t// - If no: update by 1\n\t// - If yes: rollover\n\tif(GLB.vdDemoIdx==(GLB.vdDemoData.length-1))\n\t\tGLB.vdDemoIdx=0;\n\telse\n\t\tGLB.vdDemoIdx++;\n}", "set data(value) {\n this.setData(value);\n }", "setData() {\r\n this.fireSlimGridEvent(\"onBeforeDataUpdate\", {});\r\n\r\n this.generateColumns();\r\n this.generateFilters();\r\n this.setOptions();\r\n\r\n this.dataView.beginUpdate();\r\n this.setDataViewData();\r\n this.dataView.endUpdate();\r\n\r\n this.fireSlimGridEvent(\"onDataViewUpdate\", {});\r\n this.fireSlimGridEvent(\"onAfterDataUpdate\", {});\r\n }", "update(updater) {\n if (typeof updater === \"function\") {\n this.data = updater(this.data);\n } else {\n this.data = Object.assign({}, this.data, updater);\n }\n\n this.persist();\n }", "async _update() {\n if (!this._prevent) {\n this._prevent = true;\n let resolveUpdate;\n this.updated = new Promise((resolve) => (resolveUpdate = resolve));\n\n await this.mounted;\n\n this._prevent = false;\n this.update();\n\n resolveUpdate();\n }\n }", "componentDidUpdate(){\n this.loadData();\n }", "updated(){\n console.log('Updated');\n }", "onPaginationData(data) {\n this.$refs.pagination.setPaginationData(data);\n }", "update(data) {\n this.data = data;\n this.destroy();\n drawChart.call(this);\n }", "onUpdate(data) {\n this.setState(data);\n }", "function updateData(data) {\n if (data && !data.error) {\n state.stops[\"id\"+data.id.substring(6)] = data; \n }\n displayData();\n}", "onLatestUpdate(data) {\n data.forEachField((fieldName, fieldPos, latest) => {\n this.get('item').setProperties({\n latest\n });\n });\n }", "function updateData(data) {\n // data.selectedGen++;\n // model.provider.updateField(data.name, { active: data.selected });\n model.provider.toggleFieldSelection(data.name);\n }", "function init() {\n new Vue({\n el: '#app',\n components: {\n //Pagination\n },\n data: {\n todos: [0, 1],\n input: \"\",\n //nextid:11,\n currentPage:0,\n pageSize:'',\n visibleTodos:[],\n nbRestau:0,\n etatAdd:true,\n etatAdd2:true,\n idMod:\"\",\n newRestaurant: {\n nom: null,\n cuisine: null\n },\n filtrage:[\"anoir\",\"simoi\",\"imane\"]\n \n \n },\n mounted() {\n console.log(\"--- MOUNTED, appelée avant le rendu de la vue ---\");\n \n this.getDataFromWebService();\n },\n \n methods: {\n\n getDataFromWebService: function () {\n console.log(\"page size\"+this.pageSize);\n let url = \"http://localhost:8080/api/restaurants?page=\"+this.currentPage+\"&pagesize=\"+this.pageSize;\n\n fetch(url).then((data) => {\n console.log(\"les données sont arrivées !\")\n return data.json();\n }).then((dataEnJavaScript) => {\n // ici on a bien un objet JS\n this.todos = dataEnJavaScript.data;\n this.nbRestau = dataEnJavaScript.count;\n console.log(\"total !\"+this.nbRestau);\n\n });\n },\n \n onchangee:function()\n {\n console.log(\"teeesttt\"+this.pageSize);\n //this.pageSize=numberr;\n this.getDataFromWebService();\n }\n \n ,\n add:function()\n {\n this.etatAdd=false;\n },\n add2:function(index)\n {\n console.log(\"iiiddd\"+index);\n this.idMod=index;\n this.etatAdd2=false;\n },\n Annuler:function()\n {\n this.etatAdd=true;\n },\n Annuler2:function()\n {\n this.etatAdd2=true;\n },\n //modification\n putRequest:function(event) {\n // Pour éviter que la page ne se ré-affiche\n event.preventDefault();\n \n // Récupération du formulaire. Pas besoin de document.querySelector\n // ou document.getElementById puisque c'est le formulaire qui a généré\n // l'événement\n \n // Récupération des valeurs des champs du formulaire\n // en prévision d'un envoi multipart en ajax/fetch\n let donneesFormulaire = new FormData(document.querySelector('formulaireModificationform'));\n \n let id = this.idMod; // on peut aller chercher la valeur\n // d'un champs d'un formulaire\n // comme cela, si on connait le nom\n // du champ (valeur de son attribut name)\n \n let url = \"http://localhost:8080/api/restaurants/\" + id;\n \n fetch(url, {\n method: \"PUT\",\n body: donneesFormulaire\n })\n .then(function(responseJSON) {\n responseJSON.json()\n .then(function(res) {\n // Maintenant res est un vrai objet JavaScript\n // afficheReponsePUT(res);\n console.log(\"resultat\"+res.msg);\n });\n })\n .catch(function (err) {\n console.log(err);\n });\n console.log(\"total2 !\"+this.nbRestau);\n\n this.getDataFromWebService();\n },\n \n afficheReponsePUT:function(reponse) {\n let div = document.querySelector(\"#reponsePUT\");\n div.innerHTML = reponse.msg;\n\n // On affiche le tableau à jour\n getRequest1();\n},\n \n // REQUETES POST\n postRequest: function(event) {\n // Pour éviter que la page ne se ré-affiche\n event.preventDefault();\n console.log(\"poost1\");\n // Récupération du formulaire. Pas besoin de document.querySelector\n // ou document.getElementById puisque c'est le formulaire qui a généré\n // l'événement\n //let form = event.target;\n\n // Récupération des valeurs des champs du formulaire\n // en prévision d'un envoi multipart en ajax/fetch\n //let donneesFormulaire = new FormData(form);\n let formee = new FormData(document.querySelector('formulaireInsertionform'));\n\n let url = \"http://localhost:8080/api/restaurants\";\n console.log(this.newRestaurant.nom);\n console.log(this.newRestaurant.cuisine);\n fetch(url, {\n method: \"POST\",\n body: formee\n })\n .then(function(responseJSON) {\n responseJSON.json()\n .then(function(res) {\n // Maintenant res est un vrai objet JavaScript\n console.log(\"poost2\"+res);\n // afficheReponsePOST(res);\n \n });\n })\n .catch(function (err) {\n console.log(err);\n });\n },\n \n\n// REQUETES DELETE\n deleteRequest:function(index) {\n // Pour éviter que la page ne se ré-affiche\n event.preventDefault();\n\n // Récupération du formulaire. Pas besoin de document.querySelector\n // ou document.getElementById puisque c'est le formulaire qui a généré\n // l'événement\n //let form = event.target;\n console.log(\"iiddddiiiddd\"+ index);\n let id = index; // on peut aller chercher la valeur\n console.log(\"iiddddiiiddd2222\"+ id); // d'un champs d'un formulaire\n // comme cela, si on connait le nom\n // du champ (valeur de son attribut name)\n\n this.envoieRequeteFetchDelete(id);\n}\n,\n envoieRequeteFetchDelete:function(id) {\n console.log(\"iiddddiiiddd333\"+typeof id); \n let url = \"http://localhost:8080/api/restaurants/\" + id;\n\n fetch(url, {\n method: \"DELETE\",\n })\n .then(function(responseJSON) {\n responseJSON.json()\n .then(function(res) {\n // Maintenant res est un vrai objet JavaScript\n // afficheReponseDELETE(res);\n \n });\n })\n .catch(function (err) {\n console.log(err);\n });\n this.getDataFromWebService();\n}\n ,\n \n Suivant: function()\n {\n this.currentPage++;\n if(this.currentPage >= (this.nbRestau/this.pageSize))\n {\n console.log(\"current f page\"+this.currentPage);\n console.log(\"count f\"+this.nbRestau);\n console.log(\"condition f\" +(this.nbRestau/this.pageSize));\n this.currentPage--;\n this.getDataFromWebService();\n }\n else\n {\n \n console.log(\"current page\"+this.currentPage);\n console.log(\"count\"+this.nbRestau);\n console.log(\"condition\"+(this.nbRestau/this.pageSize));\n this.getDataFromWebService();\n }\n \n \n },\n afficheReponsePOST: function(reponse) {\n console.log(\"poost3\");\n let div = document.querySelector(\"#reponsePOST\");\n div.innerHTML = reponse.msg;\n },\n Precedent: function()\n {\n this.currentPage--;\n if(this.currentPage<0)\n {\n this.currentPage++;\n console.log(\"current page\"+this.currentPage);\n this.getDataFromWebService();\n }\n else\n {\n console.log(\"current page\"+this.currentPage);\n this.getDataFromWebService();\n }\n \n \n }\n,\n\n \n \n addTodo: function () {\n this.todos.push({ title: this.input });\n //this.todos.push(this.todos.length)\n this.input = \"\";\n this.updateVisibleTodos();\n\n },\n removeTodo: function (index) {\n //console.log(index)\n this.todos.splice(index, 1);\n this.updateVisibleTodos();\n\n },\n getColor: function (index) {\n return (index % 2) ? 'red' : 'green';\n },\n \n }\n })\n}", "function updateData(data) {\n const updated = createContainer(data);\n main.innerHTML = \"\";\n main.append(updated);\n}", "componentDidUpdate() {\n this.componentData();\n }", "async update() {}", "function updateData() {\n var pedido = new LineaDePedido();\n\n var json = JSON.stringify(p);\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", '../api/pedido' + '/' + this.id, true);\n xhr.setRequestHeader('Content-type', 'application/json; charset=utf-8');\n xhr.onreadystatechange = function () {\n if (xhr.status == \"204\") {\n } else {\n }\n }\n xhr.send(json);\n}", "function _onUpdateSuccess(data) {\n console.log(\"updating success\", data);\n vm.$alertService.success(\"update website\");\n $location.path('/list');\n vm.notify(function () {\n vm.item = data.item;\n });\n }", "function updateData(data) {\n\t\t\t$scope.$parent.mainEntity.get().then(refreshMainEntity, processError);\n\t\t}", "updateUserData() {\n if (this.form.subscribe == true) {\n this.form.subscribe = 1;\n } else {\n this.form.subscribe = 0;\n }\n this.form\n .post(\"/api/user-update\", {\n headers: { Authorization: `Bearer ${localStorage.token}` },\n })\n .then((response) => {\n this.$swal.fire({ icon: \"success\", title: \"Profile updated!!\" });\n })\n .catch((error) => {\n this.handleError(error);\n });\n }", "function updateFormData(data) {\n axios\n .put(\"/member\", data)\n .then(() => {\n location.href = \"/member/list\";\n })\n .catch(e => console.error(e));\n}", "update() {\n this.forceUpdate();\n }", "update() {\n this.forceUpdate();\n }", "set data(val) {\n this._data = val;\n }", "updateGraphData() {\n this.PieGraph.data.labels = this.labelsAndDataset.labels;\n this.PieGraph.data.datasets.forEach((dataset) => {\n dataset.data.push(...this.labelsAndDataset.dataset);\n });\n this.PieGraph.update();\n }", "async update ({ route, data }) {\n return await Axios.put(route, data)\n }", "update(dt) {\n this.instance.update(dt);\n }", "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "put(id,data,onSuccess){\n\n this.db.type = 'PUT';\n this.status = data ;\n\n const url = server.base() + '/' + this.model + '?id='+id;\n\n axios.put(url,data,this.db.config)\n .then((res)=>{\n\n //preLoad('stop');\n //this.listenDataChange(res);\n onSuccess(res.data)\n },(error)=>{\n\n this.onError(error)\n\n })\n\n }", "onNewData(e) {\n const data = JSON.parse(e.body)\n this.currencyCollection.updateData(data)\n }", "async store(data) {\n console.log('filling', data);\n this.fill(data);\n this.property('updatedAt', Date.now());\n await this.save();\n }", "mounted() {\n let tempData = [];\n let tempLabel = [];\n\n rentalService.getMonthlyPrice(newdata => {\n for (let i = 0; i < newdata.length; i++) {\n tempData.push(newdata[i].sumPrice);\n tempLabel.push(this.months[newdata[i].month - 1]);\n }\n\n this.newData = tempData;\n this.newLabel = tempLabel;\n });\n }", "updateUserDocument(data) {\n\t\tlet bookedCars = this.state.bookedCars;\n\t\tbookedCars.push(data);\n\t\taxios({\n\t\t\tmethod: 'put',\n\t\t\turl: `http://localhost:3000/users/${this.props.userId}`,\n\t\t\tdata: {\n\t\t\t\tbookedCars: bookedCars\n\t\t\t}\n\t\t});\n\t}", "update() {\r\n this.sendDetail();\r\n }", "async update(data) {\n\t\t\tif (data.name !== undefined) {\n\t\t\t\tthis.set('name', data.name);\n\t\t\t}\n\t\t\tif (data.alt_names !== undefined) {\n\t\t\t\tthis.set('alt_names', data.alt_names);\n\t\t\t}\n\t\t\tif (data.description !== undefined) {\n\t\t\t\tthis.set('description', data.description);\n\t\t\t}\n\t\t\tif (data.image_url !== undefined) {\n\t\t\t\tthis.set('image_url', data.image_url);\n\t\t\t}\n\t\t\tawait this.save();\n\t\t\treturn this;\n\t\t}", "function updateData() \n{\n\tObject.keys(raidApp.selectedLocations).forEach((key) => \n\t{\n\t\tconst raid = raidApp.selectedLocations[key];\n\t\tconst card = getRaidCard(raid);\n\t\t// CODELAB: Add code to call getForecastFromCache\n\n\t\t// Get the forecast data from the network.\n\t\t//getRaidFromNetwork(location.geo).then((forecast) => {\n\t\t//renderForecast(card, forecast);\n\t\t//});\n\t\trenderRaid(card, raid) \n\t});\n}", "update (data) {\n debug && console.log(Util.timestamp(), 'C3GaugeWrapper.update:', this.containerId, data && data.length);\n let self = this;\n \n if (self.chart) {\n try {\n self.chart.load(self.parseData(data));\n } catch (e) {\n console.error('C3GaugeWrapper.update failed:', e, data);\n }\n } else {\n console.error('C3GaugeWrapper.update failed because no chart was found');\n }\n }", "function update() {\n ctrl.showError = false;\n ctrl.data = null;\n // Construct the API URL based on user-specified filters.\n var contentUrl = refstackApiUrl + '/vendors';\n if (typeof ctrl.rawData === 'undefined'\n || ctrl.rawData === null) {\n ctrl.vendorsRequest =\n $http.get(contentUrl).success(function (data) {\n ctrl.rawData = data;\n ctrl.updateData();\n }).error(function (error) {\n ctrl.rawData = null;\n ctrl.showError = true;\n ctrl.error =\n 'Error retrieving vendors listing from server: ' +\n angular.toJson(error);\n });\n } else {\n ctrl.updateData();\n }\n }", "onDataChanged() {\n this.loading = false;\n\n if (!this.data || this.data.$value === null || !this.data.details) {\n this.updating = false;\n this.profileUrl = undefined;\n\n return;\n }\n\n this.setProfileUrl();\n this.setUpdating();\n }", "updated(_changedProperties){}", "updated(_changedProperties){}", "@action updateSelectedData(data) {\n this.selectedData = data.details;\n this.activeDetailTab = data.label;\n }", "updateData() {\n this.reset();\n\n if (this.cryptoConnect) {\n this.dataLabel(this.crypto, 'crypto', this.crypto.Symbol, this.Currency, 'Percent24H');\n }\n else if (this.serverFiat === 'RU') {\n this.dataLabel(this.fiatRU, 'fiat', this.Currency, 'RUB', 'Percent');\n }\n else {\n this.dataLabel(this.fiatEU, 'fiat', $t.fiatName.EUR, this.Currency, 'Percent');\n }\n }", "update() {\n this.weapons.forEach(weapon => {\n weapon.update();\n });\n }", "saveNewOrgan() {\n this.showLoading();\n\n let newOrgan = {\n id: this.newOrgan.id,\n title: this.newOrgan.title,\n city: this.newOrgan.city\n };\n\n let url = \"\";\n let method = \"\";\n let registerType = \"\";\n\n if (newOrgan.id == null) {\n registerType = \"Registration\";\n url = document.pageData.url.organStore;\n method = \"post\";\n } else {\n registerType = \"Update\";\n url = document.pageData.url.organUpdate.replace(\"_ID_\", newOrgan.id);\n method = \"patch\";\n }\n\n axios[method](url, newOrgan)\n .then(res => {\n const data = res.data;\n\n if (data.success) {\n let index;\n\n if (newOrgan.id == null){\n index = this.organs.length;\n }\n else {\n index = this.organs.findIndex(organ => organ.id == newOrgan.id);\n }\n\n Vue.set(this.organs, index, data.data);\n const sorted = this.organs.sort((a, b) => a.title.localeCompare(b.title));\n Vue.set(this, 'organs', sorted);\n\n Vue.set(this, 'savingSuccess', true);\n setTimeout(() => {\n Vue.set(this, 'savingSuccess', false);\n }, 2000);\n this.changeFormMode(this.FORM_MODES.LIST);\n } else {\n alert(`${registerType} failed!`);\n }\n })\n .catch(err => {\n console.log(err);\n })\n .then(() => {\n this.hideLoading();\n });\n }", "update(oldVnode, vnode) {\r\n addToProviderUpdateDuplicate(this)\r\n this.forceUpdate()\r\n }", "refresh() {\n this.forceUpdate();\n }", "@action changeCategoryData(data) {\n this.editingCategoryData = {\n ...this.editingCategoryData,\n ...data,\n };\n }", "async updateMetafield(data) {\n await axios({\n method: \"put\",\n url: updateMetafield(this.metaId),\n data: data,\n })\n .then((res) => console.log(res.data.metafields))\n .catch((err) => console.log(err));\n }", "setData(dataObj) {\n for (let field in dataObj) {\n this.data[field] = dataObj[field];\n this.changedFields.add(field);\n }\n }", "updated(_changedProperties) { }", "mounted() {\n let vm = this;\n\n vm.interval = null;\n vm.job = null;\n vm.editable = true;\n vm.rowId = null;\n vm.rowType = 'column';\n vm.refresh = false;\n $('#st-processsing-div').hide();\n\n show_loading('sample-template-contents');\n\n // Get the overview information from the server\n vm.updateSampleTemplateOverview();\n }", "setData(data) {\n this.dataAgents.map((d, idx) => d.setData(data[idx]));\n this.sheet.table.render();\n }", "function updateData(eve){\n let currentRow=eve.target.parentNode.parentNode;\n let id=currentRow.id;\n let vpid=currentRow.dataset.vpid;\n currentRowChilds=currentRow.childNodes;\n\n let updateItems={};\n let vpUpdateObj={};\n currentRowChilds.forEach((td,i) => {\n if(i!==8 && i!==0){\n td.innerText=td.firstChild.value;\n let key=td.getAttribute(\"name\");\n if(key==='v_item' || key==='case_price'){\n vpUpdateObj[key]=td.innerText;\n }else{\n\n updateItems[key]=td.innerText;\n }\n }\n })\n eve.target.style.display='none';//hide the update button\n eve.target.previousElementSibling.style.display='inline';//display edit button\n\n //fectch update--product\n fetch(`https://easysource-backend.herokuapp.com/api/v1/products/${id}`,{\n method: 'PATCH',\n headers:{'Content-Type':'application/json'},\n body:JSON.stringify(updateItems)\n })\n\n //complete fetch update--product\n\n\n //fetch update ---vendor_products for price and v_item\n \n fetch(`https://easysource-backend.herokuapp.com/api/v1/vendor_products/${vpid}`,{\n method: 'PATCH',\n headers:{'Content-Type':'application/json'},\n body:JSON.stringify(vpUpdateObj)\n })\n //end of vendor_products update\n\n }", "onUpdateProperty(data) {\n const { firstImageId } = this.state;\n const element = getElementFromFirstImageId(firstImageId);\n segmentInputCallback({...data, element});\n this.refreshSegmentList(firstImageId);\n }", "function update() {\n \n // data\n var key = Object.keys(ids).find( key => ids[key] == this.value) ;\n var newId = data.id[key];\n var newValue = data.value[key];\n var newDemo = data.demographics[key];\n \n // bar chart\n Plotly.restyle('bar', 'x', [newValue.slice(0,10).reverse()]);\n Plotly.restyle('bar', 'y', [newId.slice(0,10).reverse().map( i => 'OTU ' + i.toString() )]);\n\n // bubble chart\n Plotly.restyle('bubble', 'x', [newId]);\n Plotly.restyle('bubble', 'y', [newValue]);\n\n // info panel\n d3.selectAll('#sample-metadata text').remove();\n Object.entries(newDemo).forEach( v => {\n d3.select('#sample-metadata')\n .append('text')\n .text(`${v[0]} : ${v[1]}`)\n .append('br');\n });\n\n // gauge\n Plotly.restyle('gauge', 'value', [newDemo.wfreq]);\n Plotly.restyle('gauge', 'title', [{ text: `Scrubs per Week | Participant: ${newDemo.id}` }]);\n\n }", "function updateData() {\n $http.get('backend.php?method=index').then(function(response) {\n console.log('Result from method index----');\n console.log(response.data);\n $scope.items = response.data;\n });\n }", "update() {\n Spark.put(`/settings/${Spark.teamsPrefix}/${this.team.id}/name`, this.form)\n .then(() => {\n Bus.$emit('updateTeam');\n Bus.$emit('updateTeams');\n });\n }", "updateSensorView() {\n window.controller.allSensorsData = this.allSensorsData;\n this.dataMap.updateSensor(this.allSensorsData)\n }", "update() {\n http.put(`/users/${this.user.id}/contact`, this.form)\n .then(() => {\n Bus.$emit('updateUser');\n });\n }", "updateRow(row) {\n const id = notifyInfo(\"Update läuft\");\n axios.put(row._links.self.href, row ,{headers: {'Content-Type': 'application/json'}})\n .then(results => {\n console.log(results);\n notifyUpdateSuccess(id, \"Update erfolgreich\");\n this.getTableData(false)\n })\n .catch(error => {\n console.log(error);\n notifyUpdateError(id, \"Update fehlgeschlagen\");\n });\n }" ]
[ "0.69307137", "0.6838959", "0.6815097", "0.6736424", "0.6709157", "0.65819496", "0.65227675", "0.64698297", "0.6445746", "0.6439201", "0.6411723", "0.6333722", "0.63000834", "0.6281043", "0.62808335", "0.6275701", "0.6241766", "0.6215161", "0.6186266", "0.61179674", "0.6117057", "0.6084996", "0.6084996", "0.6084996", "0.607186", "0.60520524", "0.6051615", "0.6050879", "0.60315055", "0.6025103", "0.6005074", "0.599835", "0.5971242", "0.5970939", "0.5969519", "0.5919751", "0.5914613", "0.59105927", "0.5905963", "0.5888923", "0.5881548", "0.5859326", "0.5856218", "0.5854643", "0.5853335", "0.5841163", "0.5834688", "0.582652", "0.5824748", "0.5824435", "0.5824411", "0.5824014", "0.57941324", "0.5781837", "0.57780004", "0.57654035", "0.57630163", "0.57566637", "0.5756555", "0.5756091", "0.5751136", "0.573891", "0.573891", "0.5737473", "0.5736415", "0.5732289", "0.5730439", "0.5718423", "0.5704753", "0.5700627", "0.56959146", "0.5695487", "0.5690867", "0.5690489", "0.56715184", "0.5671383", "0.56684536", "0.56627697", "0.56585014", "0.5655032", "0.5655032", "0.56539315", "0.5652829", "0.564939", "0.56492203", "0.5640627", "0.5632804", "0.56273484", "0.56237245", "0.56205684", "0.5620497", "0.561441", "0.56134796", "0.5611479", "0.5606419", "0.5600051", "0.55997705", "0.55897635", "0.5586207", "0.558545", "0.5583764" ]
0.0
-1
creating a function to call when player wins and loses
function generateNumbers(){ // this empties the array so that we only end up with 4 new numbers(not add a bunch of random ones on top of the existing numbers) characterNumber=[]; //for loop to generate random number for each character for(var i=0;i<4;i++){ randomNumber = Math.floor(Math.random() * 12); //pushes random number to the characterNumber; characterNumber.push(randomNumber); console.log(characterNumber); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function winsAndLosses() {\n if (randomNum === playerTotal) {\n wins++;\n $('#number-of-wins').text(wins);\n alert('You Win! (╯°□°)╯︵ ┻━┻');\n reset();\n } else if (randomNum < playerTotal) {\n losses++;\n $('#number-of-losses').text(losses);\n alert('You lost! (╯°□°)╯︵ ┻━┻');\n reset();\n }\n }", "function winOrLose() {\n if (randomNumber === userScore) {\n wins++;\n $(\"#wins\").text(\"Wins: \" + wins);\n // call reset function to reset values and random number\n reset();\n } else if (userScore > randomNumber){\n losses++;\n $(\"#losses\").text(\"Losses: \" + losses);\n // call reset function to reset values and random number\n reset();\n }\n }", "function hasUserLost() {\n //check to see if the user has won\n if (guessesLeft == 0 ) {\n console.log(\"USER LOSES\");\n //user has won, increment wins\n losses++;\n //add image and audio HTML if you have time. \n resetGame();\n }\n\n}", "function playerWins() {\n if (scoreOne === 5) {\n winner = winPlayerOne;\n fill(255, 51, 153);\n textSize(48);\n text(winner, width / 4, height / 2);\n setTimeout(endGame, 1500); // Wait 1.5 secons and calls endGame function\n\n } else if (scoreTwo === 5) {\n winner = winPlayerTwo;\n fill(255, 51, 153);\n textSize(48);\n text(winner, width / 4, height / 2);\n setTimeout(endGame, 1500); // Wait 1.5 secons and calls endGame function\n\n }\n}", "checkWin() {\n // If computer or player 2 wins\n if (this.score1 >= 50) {\n // Clear the interval\n clearInterval(this.timeInterval);\n // Change the page state to the winning state\n this.changeState('win');\n // If multiplyer is not being played then computer wins\n if (!this.multiplayer) {\n // Display computer won\n this.winner.textContent = 'Computer Wins!';\n\n // Else player 2 wins\n } else {\n // Display player 2 won\n this.winner.textContent = 'Player 2 Wins!';\n }\n\n // If computer or player 2 wins\n } else if (this.score2 >= 50) {\n // Clear the interval\n clearInterval(this.timeInterval);\n // Change the page state to the winning state\n this.changeState('win');\n // Display player 1 won\n this.winner.textContent = 'Player 1 Wins!';\n }\n }", "function userWinOrLose() {\n if (result > randomNum) {\n losses++;\n console.log(\"user lost\");\n // alert(\"You lost! Try again.\");\n initializeGame();\n }\n\n if (result === randomNum) {\n wins++;\n console.log(\"user won\");\n // alert(\"You won! Great job. Best out of 5?\");\n initializeGame();\n }\n}", "function playerWins() {\n $(\"#message\").html(\"<p>Player wins!</p>\");\n gameStarted = false;\n resetGame = true;\n }", "function winLose() {\n\tif (totalScore === startScore) {\n\t\twins++;\n\t\t$('#wins').html(wins);\n\t\t$(\"#resultText\").html(\"YOU WIN. Play again?\");\n\t\t$('#playAgain').show();\n\n// User loses\n\t} else if (totalScore > startScore) {\n\t\tlosses++;\n\t\t$('#losses').html(losses);\n\t\t$(\"#resultText\").html(\"LOSER! Play again?\");\n\t\t$('#playAgain').show();\n\t}\n}", "function winOrLose()\n{\n\tif(blood<0)\n\t{\n\t\twinlose = 1;\n\t\tfill(255);\n\t\ttextSize(38);\n\t\ttext(\"You Lose\", width/2-60, height/2);\n\t\ttextSize(20);\n\t\ttext(\"R replay, N next\", width/2-60, height/2+40);\n\t\tnoLoop();\n\t}\n\tif(score>30)\n\t{\n\t\twinlose = 2;\n\t\tfill(255);\n\t\ttextSize(38);\n\t\ttext(\"You Win\", width/2-60, height/2);\n\t\ttextSize(20);\n\t\ttext(\"R replay, N next\", width/2-60, height/2+40);\n\t\tnoLoop();\n\t}\n}", "function win_loss(userChoice, computer_choice) {\n if (userChoice == \"r\") {\n if (computer_choice == \"p\") {\n console.log(\"Comp Wins!\" + computer_choice)\n lost();\n }\n if (computer_choice == \"s\") {\n console.log(\"User Wins!\" + userChoice)\n win();\n }\n if (computer_choice == \"r\") {\n console.log(\"Draw\")\n draw();\n }\n }\n if (userChoice == \"p\") {\n if (computer_choice == \"r\") {\n console.log(\"User Wins!\" + userChoice)\n win();\n }\n if (computer_choice == \"s\") {\n console.log(\"Comp Wins!\" + computer_choice)\n lost();\n }\n if (computer_choice == \"p\") {\n console.log(\"Draw\")\n draw();\n }\n }\n if (userChoice == \"s\") {\n if (computer_choice == \"r\") {\n console.log(\"Comp Wins!\" + computer_choice)\n lost();\n }\n if (computer_choice == \"p\") {\n console.log(\"User Wins!\" + userChoice)\n win();\n }\n if (computer_choice == \"s\") {\n console.log(\"Draw\")\n draw();\n }\n }\n}", "function gameOver(playerWins) {\n isGameOver = true;\n if (playerWins == true) {\n songWin.play();\n renderPlayerWins();\n } else {\n songLose.play();\n renderPlayerLoses();\n }\n}", "function winMsg(player) {\n\twin = true;\n\n\tif (player == \"I\") {\n\t\tfirstPlayerScore = firstPlayerScore + 1;\n\t\t$('#firstPlayerScore').text(`Player 1: ${firstPlayerScore}`);\n\t\t$('.successmsg').text('**Congratulations, Player 1 have won**');\n\n} else {\n\n\t\tsecondPlayerScore = secondPlayerScore + 1;\n\t\t$('#secondPlayerScore').text(`Player 2: ${secondPlayerScore}`);\n\t $('.successmsg').text('**Congratulations, Player 2 have won**');\n\t}\nresetGame();\n}", "function winLose() {\n\n if (luminousScore === collectorScore) {\n winCount++;\n $(\"#status\").text(luminousScore + \" Bling! You Won! Click any crystal to begin!\")\n startGame();\n } else if (luminousScore > collectorScore) {\n lossCount++;\n $(\"#status\").text(luminousScore + \"oops! To many, Click a any crystal to try again!\")\n startGame();\n }\n if (lossCount === 12) {\n alert(\"too many rounds lost. Let's try again, Shine on!\")\n restartGame();\n }\n}", "function checkWinner() {\n if (winnerCalled()) {\n gameOver();\n }\n}", "winGame() {\n gameWon();\n }", "function winfunction() {\n if(currentscore == targetscore) {\n wins++;\n $(\"#windisplay\").html(\"Wins: \" + wins);\n $(\"#announcement\").html(\"You win!\");\n reset();\n }\n}", "function checkWinOrLoss() {\n if (totalScore === randomNumToGuess) { // We have a winner\n wins++;\n initializeGame()\n }\n else if (totalScore > randomNumToGuess) { // We have a loser\n losses++;\n initializeGame();\n }\n else {\n updateUI;\n }\n }", "function winLose(){\n if(guessThisNumber === playerCounter){\n alert('you win');\n crystalReset();\n winCounter++;\n $('#wins').text(winCounter);\n }else if(playerCounter > guessThisNumber){\n alert('You lost');\n crystalReset();\n lossCounter++;\n $('#loss').text(lossCounter);\n }else{ \n false;\n };\n \n}", "function win() {\n winner.play();\n $(\"#outcome\").show().text(\"Winner!\")\n wins++;\n $(\"#wins\").text('Wins: ' + wins);\n gameReset();\n }", "function checkWinsLosses() {\n if (score === random) {\n wins++;\n $(\"#wins\").text(wins);\n reset();\n } else if (score > random) {\n losses++;\n $(\"#losses\").text(losses);\n reset();\n }\n }", "function winsLosses() {\n if (scoreHolder === winningScore) {\n wins++;\n $(\"#win\").text(wins);\n reset();\n \n }\n\n else if (scoreHolder > winningScore){\n losses++;\n $(\"#loss\").text(losses);\n reset();\n }\n\n \n}", "function winLossChecker(){\n if (userScore === targetScore)\n {\n winCount++;\n gameReset();\n }\n else if (userScore > targetScore){\n lossCount++;\n gameReset();\n }\n}", "check_GameOver() {\n if (this.model.winner == 0) {\n if (this.currentPlayerBot == 0) {\n this.scene.undo_play = false;\n this.state = 'WAIT_UNDO';\n }\n else\n this.state = 'CHANGE_PLAYER';\n }\n else{\n this.state = 'GAME_OVER';\n this.scene.showGameMovie = false;\n this.view.incWinsPlayer(this.model.winner);\n }\n }", "function didSomeoneWin() {\n if (playerScore === 5 || computerScore === 5) {\n gameOverMan();\n }\n}", "function checkWinLoss() {\n\n // This runs when the number of matches is equal to the number of letters and the guesses remaining are more than zero\n if (numMatches === numLetters && numGuesses > 0) {\n \n // Wins are incremented, written to the page, and a new game is started\n console.log('WINNER');\n wins++;\n document.querySelector('#wins').innerHTML = 'Wins: ' + wins;\n // Play theme song when wins\n playThemeSong();\n beginGame();\n\n \n\n // This runs when the user has run out of guesses \n } else if (numGuesses === 0) {\n \n // Losses are incremented, written to the page, and a new game is started\n console.log('LOSER');\n losses++;\n document.querySelector('#losses').innerHTML = 'Losses: ' + losses;\n // Play loss audio\n playLossSong();\n beginGame();\n }\n}", "function game_over() {\n if(model.winner == 0) {\n alert(\"Game over, it is a tie!\");\n model.winner = 1;\n } else {\n if(this.turn === \"x\") {\n // alert(\"Player 1 Won!\");\n } else {\n // alert(\"Player 2 Won!\");\n }\n }\n model.tokensInserted = 0;\n // model.restartGame();\n }", "function winCheck() {\n if (userScore === computerPick) {\n wins++;\n $(\"#wins\").html(\"Wins: \" + wins);\n alert(\"Winning isn’t everything, it’s the ONLY thing\");\n newGame();\n }\n\n else if (userScore > computerPick) {\n losses++;\n $(\"#losses\").html(\"Losses: \" + losses);\n alert(\"...if you ain't first, you're last\");\n newGame();\n };\n }", "function checkWin(){\n if(playerScore===randomNumber){\n wins++\n $(\".wins\").text(wins);\n $(\".message\").text(\"You've got the POWER now!\");\n resetGame()\n }\n else{\n if(playerScore>randomNumber){\n losses++\n $(\".losses\").text(losses);\n $(\".message\").text(\"You suck, try again!\");\n resetGame()\n }\n }\n}", "function youWin(){\n\t\t$('#winOrLose').text(youWon);\n\t\tgamesWon++;\n\t\t$('#wins').text(gamesWon);\n\t\tnewGame();\n\t}", "function decideWinner() {\n\tgameOver = true;\n\tcardOpacity();\n\tif (player1.score > 21 && player2.score > 21) {\n\t\ttextTitle.textContent = \"No one won!\";\n\t\tdrawSound.play();\n\t\tplayer1.draws++;\n\t\tplayer2.draws++;\n\t\tdocument.querySelector(\".player1-draws\").textContent = player1.draws;\n\t\tdocument.querySelector(\".player2-draws\").textContent = player2.draws;\n\t} else if (player1.score > 21) {\n\t\ttextTitle.textContent = \"Player 2 won!\";\n\t\tlossSound.play();\n\t\tplayer2.wins++;\n\t\tplayer1.losses++;\n\t\tdocument.querySelector(\".player1-losses\").textContent = player1.losses;\n\t\tdocument.querySelector(\".player2-wins\").textContent = player2.wins;\n\t} else if (player2.score > 21) {\n\t\ttextTitle.textContent = \"Player 1 won!\";\n\t\twinSound.play();\n\t\tplayer1.wins++;\n\t\tplayer2.losses++;\n\t\tdocument.querySelector(\".player1-wins\").textContent = player1.wins;\n\t\tdocument.querySelector(\".player2-losses\").textContent = player2.losses;\n\t} else {\n\t\tconst player1Complement = 21 - player1.score;\n\t\tconst player2Complement = 21 - player2.score;\n\t\tif (player1Complement < player2Complement) {\n\t\t\ttextTitle.textContent = \"Player 1 won!\";\n\t\t\twinSound.play();\n\t\t\tplayer1.wins++;\n\t\t\tplayer2.losses++;\n\t\t\tdocument.querySelector(\".player1-wins\").textContent = player1.wins;\n\t\t\tdocument.querySelector(\".player2-losses\").textContent = player2.losses;\n\t\t} else if (player2Complement < player1Complement) {\n\t\t\ttextTitle.textContent = \"Player 2 won!\";\n\t\t\tlossSound.play();\n\t\t\tplayer2.wins++;\n\t\t\tplayer1.losses++;\n\t\t\tdocument.querySelector(\".player1-losses\").textContent = player1.losses;\n\t\t\tdocument.querySelector(\".player2-wins\").textContent = player2.wins;\n\t\t} else {\n\t\t\ttextTitle.textContent = \"Draw\";\n\t\t\tdrawSound.play();\n\t\t\tplayer1.draws++;\n\t\t\tplayer2.draws++;\n\t\t\tdocument.querySelector(\".player1-draws\").textContent = player1.draws;\n\t\t\tdocument.querySelector(\".player2-draws\").textContent = player2.draws;\n\t\t}\n\t}\n}", "function checkWin() {\n if (userScore === numToMatch) {\n wins++;\n $(\"#wins\").text(\"Success: \" + wins);\n reset();\n } else if (userScore > numToMatch) {\n losses++\n $(\"#losses\").text(\"Fails: \" + losses);\n reset();\n }\n }", "function checkForWin() {\r\n if (game_1.isWinningState(board)) {\r\n var winner = game_1.detectWinner(board);\r\n view_1.displayGameOver(winner);\r\n }\r\n else if (game_1.isDrawState(board)) {\r\n view_1.displayGameOver(null);\r\n }\r\n}", "function checkGameOver(){\n if (game.game_over()) {\n var winner;\n if(game.in_stalemate()){\n info = \"Stalemate\";\n }\n announcedGameOver = true;\n if(game.in_draw()){\n winner = \"Draw\";\n if(game.in_stalemate()){\n winner = \"Stalemate\";\n }\n $('#engineStatus').html(winner);\n }\n if(game.in_checkmate()){\n winner = game.turn() == 'w' ? 'Black won!' : 'White won!';\n $('#engineStatus').html(winner);\n }\n }\n }", "function userWins() {\n userObject.wins++;\n databaseModify.update();\n userScreen.win();\n setTimeout(function() {\n game.newRound();\n }, 2000);\n }", "function newGame(winOrLoss){\n //winOrLoss refers to the win condition of the human, not the computer player\n\n //if win\n if (winOrLoss == 'w'){\n yourGuessesSoFar = [];\n psychicGuess = returnRandomLowercaseLetter();\n refreshDisplay();\n }\n //if loss\n if (winOrLoss == 'l'){\n losses++;\n yourGuessesSoFar = [];\n guessesLeft = 9;\n psychicGuess = returnRandomLowercaseLetter();\n refreshDisplay();\n }\n\n}", "function checkWin () {\n if (p1.score > p2.score) {\n $('#hero-player-1').stop()\n $('#hero-player-1').removeClass('onechop onebreathe')\n setTimeout(function () {\n $('h1').text('Player One Wins!')\n }, 1000)\n } else if (p1.score < p2.score) {\n $('#hero-player-2').stop()\n $('#hero-player-2').removeClass('twochop twobreathe')\n setTimeout(function () {\n $('h1').text('Player Two Wins!')\n }, 1000)\n } else {\n $('h1').text(`It's a draw!`)\n }\n}", "function gameOverChecker() {\n if (playerOne.heldScore >= 100 || playerTwo.heldScore >= 100) {\n gameOver = true;\n if (playerOne.heldScore >= 100) {\n playerOneName[0].classList.add(\"winner\");\n }\n else {\n playerTwoName[0].classList.add(\"winner\");\n }\n }\n else {\n if (turnTracker === 1) {\n turnChange();\n }\n else {\n turnChange();\n }\n }\n}", "function whoWon(playerWins, computerWins) {\n if (playerWins == computerWins) {\n console.log(\"It's a draw!\");\n } else if (playerWins > computerWins) {\n console.log(\"You beat the computer!\");\n } else {\n console.log(\"You got beat by the computer!\");\n }\n}", "function checkWinLoss(){\n\tif(playerCounter==numToGuess){\n\t\twins++; \n\t\t$(\"#wins\").html(wins); \n\t\tresetNumbers(); \n\t\tgenerateNumbers(); \n\t}else if(playerCounter>numToGuess){\n\t\tlosses++; \n\t\t$(\"#losses\").html(losses); \n\t\tresetNumbers(); \n\t\tgenerateNumbers(); \n\t}\n}", "handleGameOverEvent() {\n \n }", "function checkWinner() {\n if(playerPosition <= 0) {\n alert('Player 1 Wins!')\n } else if(compPosition <= 0) {\n alert('Computer Wins!')\n }\n }", "function checkForWinner() {\n\n if (playerChoice === puterChoice) {\n result.innerText = \"tie\"\n } else if (playerChoice === \"scissors\" && puterChoice === \"paper\"\n || playerChoice === \"paper\" && puterChoice === \"rock\"\n || playerChoice === \"rock\" && puterChoice === \"scissors\") {\n playerScoreUpdate()\n result.innerText = \"you win\"\n } else {\n result.innerText = \"you lose\"\n puterScoreUpdate\n }\n}", "function win() {\n wins++;\n startGame();\n}", "function WON()\n{\n moveCounter++;\n pSwitch();\n if(moveCounter>4)\n {\n let winner=winnerCheck();\n if (winner!=null)\n {\n gameOver(winner,line,coordonate);\n } \n }\n}", "function winGame() {\n $('#status').text(\"You win!\");\n wins++;\n displayWins();\n}", "function checkWinner(player, x, y) {\n if (isWinning(player, x, y) ) {\n playSound('pacman_intermission.wav');\n player.winCount++;\n animUpdateScoreboard();\n updateLocalStorage(player);\n $('.battlefield li').off('click', computeAndCheckWinner);\n alert(player.name + ' wins!');\n // animation on Clear button to make it stand out, disappears on click\n\n } else if (usedFields.length === 9){\n playSound('pacman_death.wav');\n return alert('Tie game!');\n $('.battlefield li').off('click', computeAndCheckWinner);\n // animation on Clear button to make it stand out\n }\n}", "function matchOver(currentWorm)\r\n{\r\n\tplaySound(\"win\");\r\n\tcurrentRound = 0;\r\n\tisNewRound = false;\r\n\talert(\"Winner!\\nThe Winner Worm with \"+maxScore+\" points is....\\nThe Glorious \"+colors[winningWorm]+\" Worm!!\");\r\n\tstartGame();\r\n}", "function gameOver() {\n stopClock();\n writeModalStats();\n toggleModal();\n}", "function gameOver(win) {\n if (win) {\n output.innerHTML = messages.win;\n output.classList.add('win');\n } else {\n output.innerHTML = messages.lose;\n output.classList.add('error');\n }\n\n guessInput.style.display = guessButton.style.display = 'none';\n guessInput.value = '';\n }", "function winsAndLosses() {\n document.getElementById(\"winning\").innerHTML = \"You've won \" + win + \" times\";\n document.getElementById(\"losing\").innerHTML = \"You've lost \" + loss + \" times\";\n }", "function hasWon() {\t\n\tif (leftHand.hasClass('rock') && rightHand.hasClass('scissors') ||\n\t\tleftHand.hasClass('paper') && rightHand.hasClass('rock') ||\n\t\tleftHand.hasClass('scissors') && rightHand.hasClass('paper')){\n\t\tplayerOneWin += 1;\n\t\tround += 1;\n\t\tleft.addClass('spinLeft').removeClass('alt leftLose');\n\t\tright.addClass('rightLose').removeClass('alt');\n\t\t$('#oneWinner').addClass('alt');\n\t} else if (rightHand.hasClass('rock') && leftHand.hasClass('scissors') ||\n\t\t\t \trightHand.hasClass('paper') && leftHand.hasClass('rock') ||\n\t\t\t\trightHand.hasClass('scissors') && leftHand.hasClass('paper')) {\n\t\tplayerTwoWin += 1;\n\t\tround += 1;\n\t\tright.addClass('spinRight').removeClass('alt rightLose');\n\t\tleft.addClass('leftLose').removeClass('alt');\n\t\t$('#twoWinner').addClass('alt');\n\t} else {\n\t\tleft.addClass('spinLeft').removeClass('alt leftLose');\n\t\tright.addClass('spinRight').removeClass('alt rightLose');\n\t\t$('#tie').addClass('alt');\n\t}\n\t// Adds score depending on win state\n\t$('#playerOneScore').text(playerOneWin);\n\t$('#playerTwoScore').text(playerTwoWin);\n\n\tsetTimeout(function(){\n\t\twinAll();\n\t}, 2000);\n\n\t//If player gets 5 wins the page reloads\n\tfunction winAll(){\n\t\tif (playerOneWin === 3) {\n\t\t\talert('Player One Wins! Click ok to restart.');\n\t\t\tlocation.reload();\n\t\t} else if (playerTwoWin === 3) {\n\t\t\talert('Player Two Wins! Click ok to restart');\n\t\t\tlocation.reload();\n\t\t}\n\t}\n}", "function lost(){\n pause();\n playing = false;\n lose = true;\n setHighscore();\n html('rows','Game Over')\n }", "function userWins(playerSelection) {\n userCurrentScore++;\n document.querySelector(\"h1\").textContent = `Current Leader: ${\n userCurrentScore >= computerCurrentScore ? \"You\" : \"Computer\"\n }`;\n document.querySelector(\n \"h2\"\n ).textContent = `You win! ${playerSelection} beats ${computerSelection}`;\n document.querySelector(\"h2\").classList.remove(\"loose\");\n document.querySelector(\"h2\").classList.add(\"win\");\n document.querySelector(\"h2\").classList.remove(\"invisible\");\n document.querySelector(\".refresh\").classList.remove(\"invisible\");\n document.querySelector(\".yourScore\").textContent = userCurrentScore;\n if (userCurrentScore == 5) {\n automate(\"nothing\");\n }\n}", "function checkScore() {\n if (score === targetScore) {\n alert(\"You Win!\")\n wins++\n reset()\n }\n if (score > targetScore) {\n alert(\"You lose!\")\n losses++\n reset()\n }\n\n \n}", "function winner() {\n wins++;\n alert(\"You Win!\")\n $(\"span#wins\").text(\"Wins: \" + wins);\n resetW();\n }", "function processWin() {\n gamesWon++;\n updateGamesWon();\n updateGameResult(\n `YOU WON!...The letter was '${gameLetter.toUpperCase()}'.`);\n updateMessage(\"Congratulations! Let's go again.\");\n resetGame();\n}", "function checkWinOrLose() {\n if (squares.length === 0) {\n state = `win`;\n console.log(\"win\");\n } else if (balls.length === 0) {\n state = `lose`;\n }\n}", "function isGameOver (){\n if (whoWon()) return true\n return false\n}", "#determineIfGameOver() {\n const p1victory = this.players[1].gameboard.allShipsSunk();\n const p2victory = this.players[0].gameboard.allShipsSunk();\n \n if (p1victory) {\n this.#page.setDialog(GAME_STATE.p1victory);\n this.#isWinnerP1 = true;\n } else if (p2victory) {\n this.#page.setDialog(GAME_STATE.p2victory);\n this.#isWinnerP1 = false;\n }\n\n if (p1victory || p2victory) {\n this.#gameOver = true;\n this.#endGame();\n }\n }", "function checkGameStatus() {\r\n\tnumTurns++;\r\n\t\r\n\t//check win\r\n\tif (checkWin()) {\r\n\t\tgameStatus = currentPlayer + \" Wins!\";\r\n\t\t\r\n\t}\r\n\t\r\n\t//chec for tie\r\n\tif (numTurns == 9) {\r\n\t\tgameStatus = \"Tie Game\";\r\n\t\t\r\n\t}//numTurns\r\n\t\t\r\n\t//switch current player\r\n\tcurrentPlayer = (currentPlayer == \"X\" ? \"O\" : \"X\");\r\n\t\r\n\t//game is over\t\r\n\tif(gameStatus != \"\") {\r\n\t\tsetTimeout(function() { showLightBox(gameStatus, \"Game Over.\");}, 500);\r\n\t\t\r\n\t}\r\n\t\r\n} //check game status", "function winLoseState() {\r\n if (currentNumber == targetNumber) {\r\n winScore++;\r\n setTimeout(function() { \r\n winState();}, 100);\r\n } else if (currentNumber > targetNumber) {\r\n lossScore++;\r\n setTimeout(function() {\r\n loseState();}, 100);\r\n }\r\n}", "function winner() {\n userWins++; //ups the win score by one\n $('#win').text(userWins); //updates the HTML with the win\n $('#winLossAlert').text(\"You Won!!!\") //update the HTML with a WIN message\n reset();\n }", "function winLose() {\n\tif (totalScore > randomNumber) {\n\t\tlosses++;\n\t\talert('You Lost! Try Again');\n\t\t$('#losses').html('<h2>Losses: ' + losses + '</h2>');\n\t\tconsole.log(\"console losses \" + losses);\n\t\treset();\n\t} else if (totalScore === randomNumber) {\n\t\twins++;\n\t\t$('#wins').html('<h2>Wins: ' + wins + '</h2>');\n\t\talert('You Win!');\n\t\tconsole.log(\"console win \" + wins);\n\t\treset();\n\t}\t\t\n}", "function win() {\n wins = wins + 1;\n $('#wins').text(wins);\n resetTwo();\n reset();\n }", "function checkIfGameEnded() {\r\n if (chances == 10) gameOver();\r\n if (win == true) winner();\r\n}", "function checkWinner(user, computer) {\n gamePlayed++;\n var verdict;\n\n if (user == computer) {\n gameDraw++;\n verdict = 'draw';\n }\n if (\n user == \"paper\" && computer == \"rock\" ||\n user == \"rock\" && computer == \"scissors\" ||\n user == \"scissors\" && computerPlay == \"paper\"\n ) {\n gameWon++;\n verdict = 'win';\n }\n if (\n computer == \"paper\" && user == \"rock\" ||\n computer == \"rock\" && user == \"scissors\" ||\n computer == \"scissors\" && user == \"paper\"\n ) {\n gameLost++;\n verdict = 'lose';\n }\n\n updateScoreDisplay(gameDraw, gameWon, gameLost, gamePlayed);\n $(\"#game-result\").html(\"You \" + verdict + \"!\").hide().fadeIn(3000);\n}", "function checkWin() {\n if ((userGuess === \"r\") && (opponentGuess === \"s\")) {\n wins++;\n } else if ((userGuess === \"r\") && (opponentGuess === \"p\")) {\n losses++;\n } else if ((userGuess === \"s\") && (opponentGuess === \"r\")) {\n losses++;\n } else if ((userGuess === \"s\") && (opponentGuess === \"p\")) {\n wins++;\n } else if ((userGuess === \"p\") && (opponentGuess === \"r\")) {\n wins++;\n } else if ((userGuess === \"p\") && (opponentGuess === \"s\")) {\n losses++;\n } else if (userGuess === opponentGuess) {\n ties++;\n }\n}", "function win() {\n alert(\"You won!!\");\n wins++\n $(\"#wins\").text(\"Wins: \" + wins);\n reset();\n }", "function playerWins() {\n setGameState('playerWins');\n setRunRoundConfetti(true);\n increasePlayerScore();\n // Wait a moment before setting up the next round\n setTimeout(function () {\n setUpRoundN();\n }, 2000);\n }", "displayWinner() {\n var winningPiece = game.isXTurn ? 'x' : 'o'\n if(game.singleplayer || game.vsAi)\n game.winner = winningPiece\n else\n {\n if(game.player === winningPiece)\n game.winner = game.username\n else\n game.winner = game.opponent\n }\n\n\n game.saveBoard()\n\n game.state.start('win')\n }", "function gameOver() {\n\tstopClock();\n\twriteModalStats();\n\ttoggleModal();\n\tmatched=0;\n}", "function isGameOver(board) {\r\n var y= checkWinningCondition(board);\r\n if (y === 0) {\r\n return false\r\n } else if (y === 1) {\r\n var turnInfo = document.getElementById(\"turnInfo\");\r\n tieSound.play()\r\n turnInfo.innerHTML = messages[0];\r\n } else if (y === 2) {\r\n var turnInfo = document.getElementById(\"turnInfo\");\r\n winSound.play();\r\n turnInfo.innerHTML = messages[1];\r\n } else {\r\n var turnInfo = document.getElementById(\"turnInfo\");\r\n loseSound.play();\r\n turnInfo.innerHTML = messages[2];\r\n }\r\n return true;\r\n}", "function winOrLoseScreen(){\n if (!win){\n GameOverGraphic()\n BGM.pause()\n } else {\n youWinGraphic()\n BGM.pause()\n }\n }", "function checkGameStatus() {\r\n\tnumTurns++; //count turns\r\n\t\r\n\t//check for tie\r\n\tif (numTurns == 9) {\r\n\t\tgameStatus = \"Tie Game\";\r\n\t}//numTurns\r\n\t\r\n\t//check window\r\n\tif (checkWin()) {\r\n\t\tgameStatus = currentPlayer + \" wins!\";\r\n\t}//check wins\r\n\r\n\t//switch current player\r\n\tcurrentPlayer = (currentPlayer == \"X\" ? \"O\" : \"X\" );\r\n}//checkGameStatus", "function gameOver(){\n\tif(gameStatus==YOU_LOSE){\n\t\t$(\"#gameOverStatusHeading\").text(\"YOU LOST THE GAME. PRESS RESTART BUTTON TO PLAY AGAIN !!!\")\n\t\t$(\"#gameOverStatus\").addClass(\"attackStatusDisp\");\n\t\t$(\"#gameOverStatus\").removeClass(\"attackStatus\");\n\t\tnew Audio('assets/sounds/loseSound.mp3').play();\n\n\t}else if(gameStatus==YOU_WIN){\n\t\t$(\"#gameOverStatusHeading\").text(\"YOU WON THE GAME. PRESS RESTART BUTTON TO PLAY AGAIN !!!\")\n\t\t$(\"#gameOverStatus\").addClass(\"attackStatusDisp\");\n\t\t$(\"#gameOverStatus\").removeClass(\"attackStatus\");\n\t\tnew Audio('assets/sounds/winSound.mp3').play();\n\t}\n\n\t$(\"#restartButton\").toggleClass(\"resButton\");\n}", "function __playerWon(player) {\n var playerScores = [], winningPlayer, lostPlayers = [];\n\n for (var i = 0; i < __players.length; i++) {\n var p = __players[i],\n playerScore = p.getScore();\n\n if (p === player) {\n playerScore++;\n }\n\n playerScores.push(playerScore);\n\n }\n\n //console.log()\n\n //__setGamePauseStatus(true);\n __resetGame(playerScores);\n\n for (var i = 0; i < __players.length; i++) {\n var p = __players[i];\n\n if (player.getName() === p.getName()) {\n winningPlayer = p;\n }\n else {\n lostPlayers.push(p);\n }\n\n p.setScore(playerScores[i]);\n }\n\n __eventCallbacks['gameWin'].call(__game, winningPlayer, lostPlayers);\n\n //__showTitleScreen();\n\n }", "function win(){\n //logic for if the game is over\n //return who won the game of if its a draw\n var winner2 = win1(sendObj.Board);\n if (winner2 != \"none\"){\n if(winner2 == \"draw\"){\n sendObj.info = \"It's a draw!\";\n return true;\n }else{\n sendObj.info = winner2 + \" wins!\";\n return true;\n }\n }\n}", "function whoWon(){\n\n if ((playerOneChoice === \"Rock\") || (playerOneChoice === \"Paper\") || (playerOneChoice === \"Scissors\")) {\n\n // This logic determines the outcome of the game (win/loss/tie), and increments the appropriate counter.\n if ((playerOneChoice === \"Rock\") && (playerTwoChoice === \"Scissors\")) {\n playerOneWins++;\n playerTwoLosses++;\n $(\"#results\").html(playerOneName + \" wins!\");\n }\n else if ((playerOneChoice === \"Rock\") && (playerTwoChoice === \"Paper\")) {\n playerOneLosses++;\n playerTwoWin++;\n }\n else if ((playerOneChoice === \"Scissors\") && (playerTwoChoice === \"Rock\")) {\n playerOneLosses++;\n playerTwoWin++;\n }\n else if ((playerOneChoice === \"Scissors\") && (playerTwoChoice === \"Paper\")) {\n playerOneWins++;\n playerTwoLosses++;\n }\n else if ((playerOneChoice === \"Paper\") && (playerTwoChoice === \"Rock\")) {\n playerOneWins++;\n playerTwoLosses++;\n }\n else if ((playerOneChoice === \"Paper\") && (playerTwoChoice === \"Scissors\")) {\n playerOneLosses++;\n playerTwoWin++;\n }\n else if (playerOneChoice === playerTwoChoice) {\n ties++;\n }\n }\n\n }", "function dys_ChecGameOver(){\r\n\t\r\n}", "checkForGameOver() {\n\t\tconst gameOver = this.state.gameOver,\n\t\t\t winner = this.state.winner,\n\t\t\t playerId = this.state.playerId;\n\t\tvar alertText;\n\n\t\tif (gameOver) {\n\t\t\tif (winner === playerId) {\n\t\t\t\talertText = 'You win!';\n\t\t\t} else if (winner) {\n\t\t\t\talertText = 'You lose!';\n\t\t\t} else {\n\t\t\t\talertText = 'You tied!';\n\t\t\t}\n\t\t}\n\n\t\tthis.setState({\n\t\t\talertText: alertText\n\t\t});\n\t}", "function checkForWinner(){\n let bestInSecs = toSeconds(bestTime);\n let isWinner = newTotalSeconds <= bestInSecs;\n isWinner ? ifWon() : ifLost(); // Performs win or lose function based on win \n}", "function gameOver() {\n if (document.getElementById(\"player1\").classList.contains(\"active\")) {\n console.log(\"Player 1 Winner\");\n document.querySelector(\".message\").innerHTML = `${playerOne} WINNER`;\n document.querySelector(\"#finish\").classList.add(\"screen-win-one\");\n } else if (document.getElementById(\"player2\").classList.contains(\"active\")) {\n console.log(\"Player 2 Winner\");\n document.querySelector(\"#finish\").classList.add(\"screen-win-two\");\n if (gameType === \"PvP\") {\n document.querySelector(\".message\").innerHTML = `${playerTwo} WINNER`;\n }else {\n document.querySelector(\".message\").innerHTML = `COMPUTER WINNER`;\n }\n \n }\n hideClassById(\"board\");\n showClassById(\"finish\");\n} //function gameOver()", "function winGame() {\n\t alert(\"You win! Play again!\");\n\t winCount = winCount + 1;\n\t $(\".wins\").text(\"Wins: \" + winCount);\n\t resetGame();\n\t}", "function gameLogic() {\n if (totalScore === computerGuess) {\n wins++;\n $(\"#wins-text\").text(wins); \n initGame(); \n }\n else if (totalScore > computerGuess) {\n losses++;\n $(\"#losses-text\").text(losses);\n initGame();\n }\n }", "function gameStatus() {\n if (enemyHealth === totalScore) {\n isGameOver = true;\n $(\"#gameoverbox\").text(\"You defeated the Supreme Leader!!!\");\n wins++;\n totalScore = 0;\n reset();\n } else if (totalScore > enemyHealth) {\n isGameOver = true;\n\n $(\"#gameoverbox\").text(\"You were defeated!!! GAME OVER!!!\");\n losses++;\n totalScore = 0;\n reset();\n }\n }", "gameOver(){\r\n document.querySelector('#overlay').style.display = '';\r\n const gameOverMessage = document.querySelector('#game-over-message');\r\n const overlay = document.querySelector('#overlay');\r\n const buttonReset = document.querySelector('#btn__reset');\r\n if(this.checkForWin()){\r\n gameOverMessage.innerText = 'You Win!';\r\n overlay.className = 'win';\r\n } else{\r\n gameOverMessage.innerText = 'Sorry, try again next time!';\r\n overlay.className = 'lose';\r\n }\r\n buttonReset.innerText = 'Play Again';\r\n }", "function checkWinner() {\n\n // Select any random icon \n const computerChoice = pickRandomChoice();\n \n // Display user and computer choice\n updateSelection(user_select, userChoice);\n updateSelection(computer_select, computerChoice);\n\n //GAME RULES \n // Draw game if user and computer have the same choice\n if(userChoice === computerChoice){ \n winner.innerText = 'draw';\n }\n\n // Check if User Win \n else if(\n (userChoice === 'paper' && computerChoice === 'rock') || (userChoice === 'rock' && computerChoice === 'scissors')\n ||\n (userChoice === 'scissors' && computerChoice === 'paper')\n ) {\n // Display User Win\n updateScore();\n winner.innerText = 'you win';\n }\n \n // Else Computer Win\n else {\n \n // Display User Lost\n updateComscore();\n winner.innerText = 'you loss';\n }\n}", "function gameOver(hasWon) {\r\n isGameEnded = true;\r\n timeRecord = clock.getElapsedTime();\r\n isGameAnimation = true;\r\n backgroundMusic.stop();\r\n if (hasWon) {\r\n displayText(\"You've Won\", 1, 5, -Math.PI /4);\r\n isWon = true;\r\n winFSX.play();\r\n } else {\r\n displayText(\"Game Over\", 1, 5, -Math.PI /4);\r\n isWon = false;\r\n loseFSX.play();\r\n }\r\n}", "function checkForWin(player) {\n if (player === 'Player 1') {\n var board = p1board;\n if (board[0] === 'x' && board[1] === 'x' && board[2] === 'x') {\n alert(`${player} wins!`)\n } else if (board[3] === 'x' && board[4] === 'x' && board[5] === 'x') {\n alert(`${player} wins!`)\n } else if (board[6] === 'x' && board[7] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n } else if (board[0] === 'x' && board[4] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n } else if (board[2] === 'x' && board[4] === 'x' && board[6] === 'x') {\n alert(`${player} wins!`)\n } else if (board[0] === 'x' && board[3] === 'x' && board[6] === 'x') {\n alert(`${player} wins!`)\n } else if (board[1] === 'x' && board[4] === 'x' && board[7] === 'x') {\n alert(`${player} wins!`)\n } else if (board[2] === 'x' && board[5] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n }\n } else {\n var board = p2board;\n if (board[0] === 'x' && board[1] === 'x' && board[2] === 'x') {\n alert(`${player} wins!`)\n } else if (board[3] === 'x' && board[4] === 'x' && board[5] === 'x') {\n alert(`${player} wins!`)\n } else if (board[6] === 'x' && board[7] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n } else if (board[0] === 'x' && board[4] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n } else if (board[2] === 'x' && board[4] === 'x' && board[6] === 'x') {\n alert(`${player} wins!`)\n } else if (board[0] === 'x' && board[3] === 'x' && board[6] === 'x') {\n alert(`${player} wins!`)\n } else if (board[1] === 'x' && board[4] === 'x' && board[7] === 'x') {\n alert(`${player} wins!`)\n } else if (board[2] === 'x' && board[5] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n }\n}}", "function winner() {\n var playerTotal = playerHand.calculatePoints();\n if (playerHand.calculatePoints() < dealerHand.calculatePoints()) {\n var dealerTotal = dealerHand.calculatePoints();\n $('#messages').append('Dealer wins');\n $('#again-button').show();\n $('#hit-button, #stand-button').attr('disabled', true);\n } else if (dealerHand.calculatePoints() < playerHand.calculatePoints()) {\n $('#messages').append('You win!');\n $('#again-button').show();\n $('#hit-button, #stand-button').attr('disabled', true);\n } else {\n $('#messages').append('Push');\n }\n }", "playerLoses() {\n this.roundEnds('LOSER');\n }", "function lose() {\n losses++;\n startGame();\n}", "function winnerCheck(){\r\t\t// check using a console.log() if this function is working \r\t\t// console.log(\"in winnerCheck FN\");\r\r\t\t// create a \"no winner\" outcome and set it to a variable named result\r\t\tvar result = \"no winner\";\r\r\t\t// use a conditional statement to check if both players' health fell below 0\r\t\tif (p1[2] < 1 && p2[2] < 1) {\r\t\t\t// if above is true, both players lose\r\t\t\tresult = \"You both lost\";\r\t\t\t// since they both didn't lost then check if one of the players' health is below 0 to determine the loser and the other the winner\r\t\t} else if (p1[2] < 1) {\r\t\t\tresult = p2[0] + \" Wins!\";\r\t\t} else if (p2[2] < 1) {\r\t\t\tresult = p1[0] + \" Wins!\";\r\t\t}\r\t\t// return the value to the result variable to make this function reuseable\r\t\treturn result;\r\t}", "function win(playerSelection){\n\tdocument.getElementById(\"p\").textContent = '';\n\tdocument.getElementById(\"p\").textContent = 'Win!';\n\tif (playerSelection < computerSelectionGlobal && playerSelection !== 3){\n\t\tdocument.getElementById(\"score-alert\").textContent = 'Good job! You beat the computer! 1 point awarded';\n\t\tdocument.getElementById(\"lose-alert\").textContent = \"\";\n\t\tplayerCurrentScore++;\n\t\tplayerWins();\n\t\tsetHighScore();\n\t}\n\telse if (playerSelection === 3 && computerSelectionGlobal === 1){\n\t\tdocument.getElementById(\"score-alert\").textContent = 'Good job! You beat the computer! 1 point awarded';\n\t\tdocument.getElementById(\"lose-alert\").textContent = \"\";\n\t\tplayerCurrentScore++;\n\t\tplayerWins();\n\t\tsetHighScore();\n\t}\n\telse {\n\t\tdocument.getElementById(\"lose-alert\").textContent = 'You didn\\'t beat the computer. Minus 2 points';\n\t\tdocument.getElementById(\"score-alert\").textContent = \"\";\n\t\tif (playerCurrentScore - 2 < 0){\n\t\t\tplayerCurrentScore = 0;\n\t\t}\n\t\telse {\n\t\t\tplayerCurrentScore -=2;\n\t\t}\n\t\tplayerWins();\n\t}\n}", "gameOver(gameWon){\n \t\tconst divOverlay = document.getElementById('overlay')\n\n \t\t//display the divOverlay\n \t\tdivOverlay.style.display = '';\n\n \t\t//changes the h1 message depending on the outcome of the game\n \t\tif(gameWon === true){\n \t\t\tdivOverlay.className = 'win';\n \t\t\tdivOverlay.querySelector('h1').innerText = \"By the bear of Zeus, you did it!\";\n \t\t}else{\n \t\t\tdivOverlay.className = 'lose';\n \t\t\tdivOverlay.querySelector('h1').innerText = \"Stay classy by trying again.\";\n \t\t}\n\n \t\t//Give the button on div overlay a 'Play Again?' message\n \t\tdocument.getElementById('btn__reset').innerText = 'Play Again?';\n\n\n \t}", "gameOver() {\n if (playerScore === winningScore || computerScore === winningScore) {\n isGameOver = true;\n // Set Winner\n let winner = playerScore === winningScore ? 'Player' : 'Computer';\n this._showGameOverEl(winner);\n }\n }", "function gameOver() {\n\tstopClock();\n\twriteModalStats();\n\ttoggleModal();\n}", "function winLose() {\n if (wins === answer.length) {\n alert(\"YOU WIN!\");\n winscounter++;\n wins = 0;\n wrongLetter = [];\n display ();\n moviebtn();\n }\n else if (livesLeft === 0) {\n alert(\"YOU LOSE!\");\n losses++;\n livesLeft = 10;\n wrongLetter = [];\n display();\n moviebtn();\n }\n}", "function checkWin(){\n\t//ROW WIN CONDITIONS\nif (oneV === twoV && twoV === threeV && oneV === threeV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\tconsole.log(whoPlayerTemp);\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (fourV === fiveV && fourV === sixV && fiveV === sixV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (sevenV === eightV && sevenV === nineV && eightV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t//COLUMN WIN CONDITIONS\n\t} else if (oneV === fourV && oneV === sevenV && fourV === sevenV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (twoV === fiveV && twoV === eightV && fiveV === eightV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (threeV === sixV && threeV === nineV && sixV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t//CROSS WIN CONDITIONS\n\t} else if (oneV === fiveV && oneV === nineV && fiveV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (threeV === fiveV && threeV === sevenV && fiveV === sevenV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t}\n\t$('#p2Score').text(playerTwoWins);\n\t$('#p1Score').text(playerOneWins);\n\t// checkTie();\n\tbestOfFiveWinner();\n}", "gameOver() {\n //Leaves game screen and returns to overlay\n $(\"#overlay\").show();\n //If player has 5 misses\n if (this.missed === 5) {\n //Gives overlay lose class name\n overlay.className = \"lose\"\n //Shows losing message\n $(\".title\").text(\"You’re not Superman you know!\");\n } else {\n //Gives overlay win class name\n overlay.className = \"win\"\n //Shows winning message\n $(\".title\").text(\"This is my gift , my curse. Who am I? I’m Spiderman.!\");\n }\n\n }", "function checkScore(){\n\t//if userNumber equals targetNumber, user wins and game is over.\n\tif (userNumber == targetNumber) {\n\t\tuserWon = true;\n\t\t//Add 1 to wins counter.\n\t\twins++;\n\t\t$(\".win-counter\").html(wins);\n\t\tgameOver();\n\t}\n\n\t//If userNumber is greater than targetNumber, user loses and game is over.\n\telse if (userNumber > targetNumber) {\n\t\tuserWon = false;\n \t\t//Add 1 to losses counter.\n \t\tlosses++;\n \t\t$(\".loss-counter\").html(losses);\n \t\tgameOver();\n\t}\n}" ]
[ "0.76186585", "0.7598758", "0.7577701", "0.757557", "0.7573876", "0.7512938", "0.75018865", "0.7447839", "0.74039197", "0.73699313", "0.73696715", "0.7355213", "0.73414814", "0.7322213", "0.7310023", "0.73005456", "0.7293744", "0.7293348", "0.726427", "0.7262947", "0.7261964", "0.722095", "0.7218597", "0.7208858", "0.7204926", "0.72036636", "0.7190624", "0.7190485", "0.71857804", "0.7177437", "0.7169487", "0.7166475", "0.71533304", "0.71389455", "0.7137123", "0.71189487", "0.71078354", "0.7097715", "0.70971173", "0.7094599", "0.7085008", "0.7084694", "0.7076823", "0.70685256", "0.70662373", "0.7060753", "0.7059223", "0.705574", "0.70547837", "0.70518726", "0.7047166", "0.70353264", "0.703442", "0.70314395", "0.7024723", "0.70240563", "0.7015314", "0.70143473", "0.7013969", "0.70134383", "0.70092463", "0.70051473", "0.7000988", "0.6993755", "0.69919497", "0.6983594", "0.6981368", "0.6979275", "0.6977987", "0.69766146", "0.69730496", "0.69726753", "0.69642997", "0.693933", "0.69390184", "0.6935094", "0.6934785", "0.6934184", "0.69322574", "0.69246536", "0.69186646", "0.6918184", "0.691637", "0.69115037", "0.69091487", "0.68986934", "0.6897208", "0.68971074", "0.68897504", "0.6888792", "0.6887034", "0.6884869", "0.6880107", "0.68794173", "0.68791264", "0.6870102", "0.6869142", "0.6863957", "0.6862648", "0.68599164", "0.68598855" ]
0.0
-1
actions when you hover over, or click the characters
function gamePlay() { document.getElementById("results").innerHTML = "<p>Your Score: " + 0 + "</p>"; $(".characters").hover(function() { $(this).addClass("characterClick"); }, function () { $(this).removeClass("characterClick"); }); //adds to the score depending on which character is clicked $("#jonsnow").click(function() { score = score + characterNumber[0]; }); $("#khaleesi").click(function() { score = score + characterNumber[1]; }); $("#sansa").click(function() { score = score + characterNumber[2]; }); $("#tyrion").click(function() { score = score + characterNumber[3]; }); $(".characters").click(function() { document.getElementById("yourScore").innerHTML = "<p>Your Score: " + score + "</p>"; if(targetNumber === score) { generateNumbers(); wins++; alert("The throne is yours for the taking. Rule the realm like a boss"); score = 0; document.getElementById("results").innerHTML = "<p>Your Score: " + 0 + "</p>"; targetNumber = Math.floor(Math.random() * (120 - 19 + 1)) + 19; document.getElementById("goal").innerHTML = "Target Number: " + targetNumber; }; // alert player they lost and adjust scores accordingly if(score > targetNumber) { generateNumbers() losses++; alert("Winter is coming. Try Again."); score = 0; document.getElementById("results").innerHTML = "<p>Wins: " + wins + "</p>" + "<p>Losses: " + losses + "</p>"; document.getElementById("yourScore").innerHTML = "<p>Your Score: " + 0 + "</p>"; targetNumber = Math.floor(Math.random() * (120 - 19 + 1)) + 19; document.getElementById("goal").innerHTML ="Target Number: " + targetNumber; }; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function event_cat_mouseOver(){\n\tdiv_cat.style.cursor = 'grab';\n}", "hover() {}", "function handleMouseOverText(e) {\n\t\t\t\te.currentTarget.addClassName('active');\n\t\t\t\tvar parent = $(e.currentTarget).parent().get(0);\n\n\t\t\t\ttheInterface.emit('ui:emphElement', {\n\t\t\t\t\tid : e.currentTarget.getAttribute('id'),\n\t\t\t\t\tlayer : parent.getAttribute('data-layer')\n\t\t\t\t});\n\t\t\t}", "function hovering() {\n\n}", "function mousePressed(){\n\t//Check if one of our objects was clicked here\n\tfor(var i=0; i<astros.length; i++){\n\t\tif(astros[i].hovering()){\n\t\t\t$('#spaceNum').html(astros[i].info.name);\n\t\t}\n\t}\n}", "function mouseUp() { }", "mouseDown(pt) {}", "mouseDown(pt) {}", "function mousePressed() \n{\n\tjump()\n}", "function mouseOverWhich(x, pic, picX, set1, set2, set3){\n push();\n rectMode(CENTER);\n rect(x, height/2+height/6, width/10, height);\n noTint();\n image(pic, picX, height/2, width/13, width/13);\n setText(set1, set2, set3);\n pop();\n\n}", "function hover() {\n raycaster.setFromCamera( pointer, camera );\n const intersects = raycaster.intersectObjects( buttons ); // De objecten binnen de array aan buttons die doorkruist worden door de ray van de raycaster.\n\n if ( intersects.length > 0 ) {\n if ( hoveredItem != intersects[ 0 ].object ) {\n hoveredItem = intersects[ 0 ].object;\n hoveredItem.material.transparent = true;\n hoveredItem.material.opacity = 0.3;\n }\n } else {\n if ( hoveredItem ) hoveredItem.material.opacity = 0.8;\n hoveredItem = null;\n }\n}", "onMouseUp(e) {}", "mouseUp(pt) {}", "mouseUp(pt) {}", "function over(event) {\n window[event.key].alpha = 1;\n document.body.style.cursor = \"pointer\";\n }", "function over(event) {\n window[event.key].alpha = 1;\n document.body.style.cursor = \"pointer\";\n }", "function mouseOver() {\n setMouseOver(true);\n }", "function addText(e) {\n // e.target contains the specific element moused over so let's\n // save that into a variable for clarity.\n let pixel = e.target;\n pixel.innerHTML = currentKey;\n}", "e_mouseOver(e)\n\t{\n\n\t}", "_onPointerOver() {\n this.addState(\"hovered\");\n }", "function handleCharacterHover() {\n var avatarsCollection = document.getElementsByClassName('avatar');\n var avatars = Array.prototype.slice.call(avatarsCollection);\n avatars.forEach(function (avatar) {\n avatar.addEventListener('mouseover', function () {\n characterHoverSound.play();\n characterHoverSound.currentTime = 0;\n\n });\n });\n}", "function handleInstructionsMouseOver(event) {\n if (event.type == \"mouseover\") {\n createjs.Tween.get(questionMark, { loop: false }).to({ scaleX: 1.0625, scaleY: 1.0625 }, 50);\n }\n else {\n createjs.Tween.get(questionMark, { loop: false }).to({ scaleX: 1.0, scaleY: 1.0 }, 50);\n }\n }", "function mouse(kind, pt, id) {\n \n}", "mouseover() {\n this.hoverActive = true;\n }", "function pointer_overIN(e){\n e.currentTarget.Sprites.d._filters = [new PIXI.filters.OutlineFilter (4, 0x16b50e, 1)];\n $mouse.onCase = e.currentTarget;\n }", "function showHoverInfo(e, text) {\n\tctx.font = hoverInfoFont();\n\tctx.textAlign = 'center';\n\tctx.textBaseline = 'middle';\n\n\tvar textWidth = ctx.measureText(text).width,\n\t\tx0 = e.offsetX + 10,\n\t\ty1 = e.offsetY - 10,\n\t\tx1 = x0 + 16 + textWidth,\n\t\ty0 = y1 - hoverInfoFontSize - 6;\n\n\t//draw hover box\n\tctx.beginPath();\n\tctx.textAlign = 'center';\n\tctx.textBaseline = 'middle';\n\tctx.fillStyle = colors.hoverPort;\n\n\tctx.moveTo(x0, y0);\n\tctx.lineTo(x0, y1);\n\tctx.lineTo(x1, y1);\n\tctx.lineTo(x1, y0);\n\tctx.fill();\n\n\t//draw module label\n\tctx.beginPath();\n\tctx.fillStyle = '#000000';\n\tctx.font = hoverInfoFont();\n\tctx.fillText(text, lerp(x0, x1, 0.5), lerp(y0, y1, 0.5));\n}", "function handleMouseOverDist(e) {\n\t\t\t\te.currentTarget.addClassName('active');\n\t\t\t\tvar parent = $(e.currentTarget).parent().get(0);\n\n\t\t\t\ttheInterface.emit('ui:emphElement', {\n\t\t\t\t\tid : e.currentTarget.getAttribute('id'),\n\t\t\t\t\tlayer : parent.getAttribute('data-layer')\n\t\t\t\t});\n\n\t\t\t}", "function Agent_MouseOver(elem) {\r\n\r\n if (g_AgentDisabled)\r\n return;\r\n\r\n // If we don't have Agent, we're done\r\n\r\n if (null == g_AgentCharacter)\r\n return;\r\n\r\n if (g_bAgentIgnoreEvents || g_bAgentInternalIgnoreEvents)\r\n return;\r\n\r\n // If the character is hidden, we're done\r\n\r\n if (!g_AgentCharacter.Visible)\r\n return;\r\n\r\n if (g_strAgentCurrentPage == \"\")\r\n return;\r\n\r\n Agent_StopAll();\r\n\r\n Agent_MoveToElement(elem, \"TopCenterWidth\", 0);\r\n\r\n Agent_StartLookingAtElement(elem, \"Look\" + \"Down\");\r\n\r\n}", "function CTAhover(gfc){\n var hov = new Square({id:'ctahover',width:150,height:40,color:'green',x:75,y:239});\n var g = gfc;\n hov.opacity=0;\n this.add = function(){\n adstage.stage.add(hov);\n hov.on('click', function(){\n window.open(clickTag,'_blank');\n });\n hov.on('mouseover', function(){\n g.to(0.35, {scale:1.1, transformOrigin:U.torg(300,516), ease:Back.easeOut});\n });\n hov.on('mouseout', function(){\n g.to(0.35, {scale:1, transformOrigin:U.torg(300,516)});\n });\n };\n}", "function mousePressed() {\n if (state === `title`) {\n startPiranhaArray();\n\n state = `aquarium`;\n }\n }", "function overButton(e) {\n\te.tint = 0xc0c0c0\n}", "mouseClick(p) {\n }", "showDescription() {\n this.hover = true;\n }", "getHovered() {}", "function onMouseOver1(){\n capital_letters.innerHTML = str1.toUpperCase(); \n}", "function mousePressed() {\n\n CheckButtons(Buttons);\n CheckHover(Buttons);\n\n}", "function step2() {\t \t\r\n \tdocument.getElementById(\"gm-bubble-content\").onmouseover=step3;\r\n}", "_buttonPointerOver() {\n\t\tthis.background.setAlpha(1);\n\t\tthis.text.setColor(\"#FFFFFF\");\n\t}", "hover(x, y){\n var self = this;\n self.startX = x || self.startX;\n self.startY = y || self.startY;\n self.draw(self.selected ? self.line.keyboard.keySelectedHoverBorderColor : self.line.keyboard.keyHoverBorderColor, true);\n }", "function updateOnHover(char) {\n\tvar x = (Math.floor(me.input.mouse.pos.x / 32));\n\tvar y = (Math.floor(me.input.mouse.pos.y / 32));\n\n\tif (char.pos.x / 32 === x && char.pos.y / 32 === y) {\n\n\t\tgame.data.hovered_over = char.id;\n\n\t\t$(\"#name\").html(char.unit_name);\n\t\t$(\"#hp\").html(char.cur_hp.toString() + \"/\" + char.stats.hp.toString());\n\n\t\t// Calculating and displaying stats\n\t\t$(\"#str\").html(char.stats.str.toString());\n\t\t$(\"#mag\").html(char.stats.mag.toString());\n\t\t$(\"#skl\").html(char.stats.skl.toString());\n\t\t$(\"#spd\").html(char.stats.spd.toString());\n\t\t$(\"#luk\").html(char.stats.luk.toString());\n\t\t$(\"#res\").html(char.stats.res.toString());\n\t\t$(\"#def\").html(char.stats.def.toString());\n\t\t$(\"#hit\").html(hit(char.stats).toString());\n\t\t$(\"#avo\").html(avo(char.stats).toString());\n\t\t$(\"#crt\").html(crit(char.stats).toString());\n\n\t\t// Displaying and selecting weapons\n\t\tvar weaponString = \"\";\n\n\t\tfor (var i = 0; i < char.weapons.length; i++) {\n\t\t\tif (char.player_one) {\n\t\t\t\t\n\n\t\t\t\t// Check if this weapon is equipped\n\t\t\t\tif (char.equipped != null && char.equipped === char.weapons[i]) {\n\t\t\t\t\tweaponString += \"<input type=\\\"radio\\\" id=\\\"\"+ i + \"\\\" name=\\\"equip\\\" value=\\\"\" + i + \"\\\" checked>\" + char.weapons[i].name + \"<br>\";\t\n\t\t\t\t} else {\n\t\t\t\t\tweaponString += \"<input type=\\\"radio\\\" id=\\\"\"+ i + \"\\\" name=\\\"equip\\\" value=\\\"\" + i + \"\\\">\" + char.weapons[i].name + \"<br>\";\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tweaponString += char.weapons[i].name + \"<br>\";\n\t\t\t}\n\t\t}\n\n\t\t$(\"#weapon\").html(weaponString);\n\n\t\t// Update the pre-battle box if someone is attacking\n\t\tvar isTargeted = (me.game.currentLevel.getLayerByName(\"map_layer\").getTileId(x * 32,y * 32) == 2);\n\t\tif (!char.player_one && game.data.attacking && isTargeted) {\n\t\t\tgame.data.battle.setTarget(char);\n\t\t}\n\t}\n}", "onMouseOver() \r\n {\r\n this.setState({action: true}); \r\n this.setState({title: true}); \r\n this.setState({shadow: 3}); \r\n }", "pointerhover(payload) {\n domEventSequences.pointerhover(node, payload);\n }", "static onHover() {\n for (var i = 0; i < game.getUI.uiObjects.length; i++) {\n\n if (game.getUI.uiObjects[i] instanceof Button) {\n var buttonObj = game.getUI.uiObjects[i];\n\n if (buttonObj.mouseInside() && buttonObj.getTexture !== \"BUTTON2\") {\n\n buttonObj.setTexture(\"BUTTON2\");\n\n } else if (!buttonObj.mouseInside() && buttonObj.getTexture === \"BUTTON2\") {\n\n buttonObj.setTexture(\"BUTTON\");\n }\n\n }\n }\n }", "function mouseOver() {\n\t\tif (canMove(this)) {\n\t\t\tthis.className = \"piece hover\";\n\t\t}\n\t}", "function canvas_on_mouseover(e) {\r\n canvas.focus(); \r\n}", "function addHover(num) {\n\tmagHolder[num].addEventListener('mouseover', function() {\n\t\tmagText[num].setAttribute(\"style\", \"background-color: white; display: block; border: solid 1px #d5d6d7; z-index: 15; position: absolute; width: 160px; text-align: center; padding: 5px 5px 5px 7px\");\n\t}, false);\n\tmagHolder[num].addEventListener('mouseleave', function() {\n\t\tmagText[num].style.display = 'none';\n\t}, false);\n}", "interactHover(obj) {\n if (obj.object.state === 'idle') {\n obj.object.material.color.setHex(obj.object.hoverColor);\n }\n }", "function mousePressed() {\n if (state === `enter`) {\n state = `display1`;\n } else if (state === `display6`) {\n state = `gallery`;\n } else if (state === `gallery`) {\n interaction1();\n }\n}", "function mouseHover() {\n /**\n * If the mouse is hovering, call state specific mouse hover logic\n */\n if (gameState == \"options\") {\n optionsScreenMouseHover();\n }\n}", "function onMouseDown(event) { }", "_handleMouseInteraction() {\n const that = this;\n\n that._handleTextSelection();\n\n that._changeCheckState('pointer');\n that.focus();\n that._updateHidenInputNameAndValue();\n }", "_handleMouseInteraction() {\n const that = this;\n\n that._handleTextSelection();\n\n that._changeCheckState('pointer');\n that.focus();\n that._updateHidenInputNameAndValue();\n }", "function rect_mouseover() {\n\t\t\tpercentText.style(\"opacity\", 1)\n\t\t\tapproveText.style(\"opacity\", 1)\n\t\t\tfocusDate.style(\"opacity\", 1)\n\t\t}", "function mousePressed() {\n // Store mouse position when pressed\n mouse = [mouseX, mouseY];\n\n // Hirajoshi scale in C\n // https://www.pianoscales.org/hirajoshi.html\n const notes = [\"C\", \"Db\", \"F\", \"Gb\", \"Bb\"];\n const octaves = [2, 3, 4];\n const octave = random(octaves);\n const note = random(notes);\n synth.triggerAttackRelease(note + octave, \"8n\");\n}", "function mouseOverGraphic(ev) {\n map.setMapCursor(\"crosshair\");\n}", "onMouseEnter() {}", "function over(e) {\n // Set the cursor to 'move' wihle hovering an element you can reposition\n e.target.style.cursor = 'move';\n\n // Add a green box-shadow to show what container your hovering on\n e.target.style.boxShadow = 'inset lime 0 0 1px, lime 0 0 1px';\n}", "async hover() {\n await this._actions().mouseMove(this.element()).perform();\n await this._stabilize();\n }", "function mouseOver(x) {\r\nvar img = x;\r\n\r\ndocument.body.style.cursor = \"pointer\";\r\npopUpImg.src=\"\";\r\npopUp.style.display = \"hidden\";\r\n\r\n// Pop-up image of board when it is clicked on the image map\r\nimg.onclick = function(){\r\n popUpImg.src = this.alt;\r\n popUp.style.display = \"block\";\r\n}\r\n}", "function click() {\r\n\t// if the piece is highlighted, move the piece\r\n\tif(this.className == \"highlight\") {\r\n\t\tmove(this);\r\n\t}\r\n}", "function mouseover() {\n focusText.style(\"opacity\",1)\n focus.style(\"opacity\", 1)\n focusText2.style(\"opacity\",1)\n focusText3.style(\"opacity\",1)\n focus2.style(\"opacity\", 1)\n}", "clickHandler(event) {\n let p = this.mouse.add(this.cartography._view);\n if (event.shiftKey) {\n this.state.player.data.input.fire = new Vector(p);\n } else {\n this.state.cursor.data.position.set(p);\n this.state.player.data.destination.set(p);\n }\n }", "function markHover() {\n atomicText.addClass('hover-mark');\n ionicText.addClass('hover-mark');\n}", "function o(a){a.click(p).mousedown(ka)}", "function labelActive(event) {\n characters.forEach((arr) => {\n arr.changeActive(event);\n })\n}", "function mouseOver() {\r\n cursor(ARROW);\r\n\r\n if (currentScene != null) {\r\n currentScene.mouseOver();\r\n }\r\n\r\n mapOnHover(mapGlobal);\r\n}", "function onMouseClick()\r\n{\r\n\tfor (var i = 0; i < activeBtns.length; i++)\r\n\t{\r\n\t\tif (activeBtns[i].over == true)\r\n\t\t{\t\r\n\t\t\tactiveBtns[i].click();\r\n\t\t\tbreak;\r\n\t\t}\t\t\r\n\t}\r\n}", "function cust_MouseDown() {\n\n}", "function mouseover() {\n focus.style(\"opacity\", 1);\n focusText.style(\"opacity\", 1);\n }", "function mouseClicked() {\n if (start.start === false) {\n start.mouseClicked();\n } else {\n handler.mouseClicked();\n }\n if (handler.active === handler.warning && trigger.warning === false) {\n trigger.mouseClicked();\n }\n if (\n handler.active === handler.nameplate &&\n doorbell.ok === false &&\n doorbell.name.length >= 1\n ) {\n doorbell.mouseClicked();\n }\n if (\n handler.active === handler.decisionC1 ||\n handler.active === handler.decisionH3 ||\n handler.active === handler.decisionF1 ||\n handler.active === handler.decisionF3\n ) {\n decision1.mouseClicked();\n decision2.mouseClicked();\n }\n // red flags buttons\n if (handler.active === handler.annegretC1) {\n control.mouseClicked();\n }\n if (handler.active === handler.frankE6) {\n lie.mouseClicked();\n }\n if (handler.active === handler.monologueE3) {\n arm.mouseClicked();\n }\n if (handler.active === handler.annegretF8) {\n victim.mouseClicked();\n }\n if (handler.active === handler.monologueG2) {\n noise.mouseClicked();\n }\n if (handler.active === handler.monologueH8) {\n phone.mouseClicked();\n }\n\n if (handler.active === handler.end) {\n end.mouseClicked();\n }\n}", "function geoButtonMouseOverHandler(event) {\r\n\r\n unsafeWindow.ButtonHoverOn(this);\r\n\r\n}", "function showPointer(){\n $(this).css({\n 'cursor' : 'pointer',\n 'transform' : 'scale(1.1)',\n '-moz-transform' : 'scale(1.1)',\n '-webkit-transform' : 'scale(1.1)',\n '-moz-transition' : '.5s',\n '-webkit-transition' : '.5s'\n });\n }", "onIntersectedByMouse(){\n }", "function mouseOver(mouse_over) {\r\n\tmouse_over.innerHTML= \"Thank You\";\r\n}", "function mousePressed() {\n nuova_poesia();\n}", "function mouseReleased(){\r\n constr.fly();\r\n}", "function mouseOver(obj) {\r\n obj.innerHTML = \"Ora spostalo di nuovo altrove!\"\r\n}", "function over(event) {\n console.log(event);\n console.log(window);\n window[event.key].alpha = 1;\n document.body.style.cursor = \"pointer\";\n }", "mouseClicked() {\n this.inputNode.mouseClicked();\n }", "function toggleReplayText(){\n document.querySelectorAll(\".comment\").forEach(e =>{\n e.onmouseenter = function(x){\n e.querySelector(\".replay__btn\").style.opacity = 1;\n }\n \n \n e.onmouseleave = function(x){\n e.querySelector(\".replay__btn\").style.opacity = 0;\n }\n })\n }", "function mouseOver(x, y) {\r\n\t//debugOut(\"mouse over, x=\"+x+\" y=\"+y);\r\n\t\r\n\t//*** Your Code Here\r\n}", "tooltipClicked() {}", "function mouseover() {\r\n\t// if the piece is movable, give a class name \"highlight\"\r\n\tif(movable(this)) {\r\n\t\tthis.className = \"highlight\";\r\n\t\t// if not, remove the class name \"highlight\"\r\n\t\t} else {\r\n\t\tthis.removeClassName(\"highlight\");\r\n\t}\r\n}", "function quoteBtnHover() {\n var btnBg = document.getElementById(\"quoteBtn\");\n var btnTxt = document.getElementById(\"quoteBtnH3\");\n btnBg.style.backgroundColor = \"#004e92\";\n btnBg.style.cursor = \"pointer\";\n btnTxt.style.color = \"white\";\n btnTxt.style.cursor = \"pointer\";\n\n}", "function mouseOverSfx() {\n mainSfxController(menuHoverSfxSource);\n }", "onMouseOver_() {\n if (this.isOpenable_()) {\n this.updateHoverStying_(true);\n }\n }", "function mousePressed()\n{\n\tvar page = story.getCurrentPage();\n\tpage.mouseP();\n}", "function mouseClicked() {\n drawActive(150,180,\"A big cookie (60g) contains 30g added sugar.\",8,aCraker,\"Roasted Craker\");\n drawActive(300,180,\"A slice of chessecake(120g) contains 35g added sugar.\",9,aBread,\"Homemade Bread\");\n drawActive(450,180,\"A small bowl of granola(136g)contains 18g added sugar.\",5,aOldFashionedOat,\"Old Fashioned Oat\");\n drawActive(600,180,\"A can of Coke(330ml) contains 40g added sugar.\",10,aWater,\"Water\");\n drawActive(750,180,\"An energy bar(68g)contains 26g added sugar.\",7,aDarkChocolate,\"Dark Chocolate\");\n drawActive(900,180,\"A cup of medium-sized coffee Frappuccino(475ml) contains 45g added sugar.\",11,aBlackCoffee,\"Black Coffee\");\n\n drawActive(150,320,\"An ice cream bar(79g) contains 19g added sugar.\",4,aGreekYogurt,\"Plain Greek Yogurt\");\n drawActive(300,320,\"A small cup of yogurt(170g) containss 15g added sugar.\",3,aGreekYogurt,\"Plain Greek Yogurt\");\n drawActive(450,320,\"Two slices of French Brioche(90g) contain 12g added sugar.\",3,aBread,\"Homemade Bread\");\n drawActive(600,320,\"A medium-sized boba milktea contains 37g added sugar.\",9,aWater,\"Water\");\n drawActive(750,320,\"A medium-sized sweentened green tea(475ml) contains 34g added sugar.\",6,aGreenTea,\"Unsweetened Green Tea\");\n drawActive(900,320,\"A cup of sliced fruit(123g) contains 19g added sugar.\",4,aFruit,\"Real Fruit\");\n\n}", "function setmouseactions() {\n setTuntematonMouseAction();\n setTunnetutMouseAction();\n setTeemaMouseAction();\n //TODO: \"vihje sana\" class + newly exposed missing\n}", "mouseDown(event) {\n var button = event.which || event.button;\n this.activeCommands[button] = true;\n }", "mouseDown(event) {\n var button = event.which || event.button;\n this.activeCommands[button] = true;\n }", "function onImgClick () {\n $ ('.img-wrap').one ('click', function (e) {\n console.log ('image clicked');\n console.log (characters);\n attackSound.play ();\n $ ('#selected-character-id').css ('border', 'solid 5px greenyellow');\n $ (this).off (e);\n });\n }", "function ClickbleMapItemCursor(){\n //changes cursor style when hovering \"clickable\" layer.\n map.on(\"mousemove\", \"photos\", function(e) {map.getCanvas().style.cursor = 'pointer';});\n map.on('mouseleave', \"photos\", function() {map.getCanvas().style.cursor = '';});\n\n}", "function on_paint() {\r\n menu_dt()\r\n menu_idt()\r\n menu_tgt()\r\n menu_aa()\r\n menu_vis()\r\n menu_msc()\r\n handle_vis()\r\n handle_msc_two()\r\n}", "function mousePressed() {\n if (state === \"menu\") {\n if (isDancingClicked(mouseX, mouseY)) {\n state = \"dancing\";\n }\n if (isHowToClicked(mouseX, mouseY)) {\n state = \"howToPlay\";\n }\n }\n}", "handleMouseOver() {\n this.IsHover = true;\n }", "hoverSelect() {\n const cellSelect = document.querySelectorAll(\".cell-select\");\n cellSelect.forEach((cell) => {\n let piece = document.createElement(\"div\");\n cell.addEventListener(\"mouseover\", () => {\n piece.classList.add(\"piece\", \"align-self-center\");\n this.isPlayer1 ? (piece.style.background = \"#3DE7FB\") : (piece.style.background = \"#FF9900\");\n cell.appendChild(piece);\n });\n cell.addEventListener(\"mouseleave\", () => {\n cell.removeChild(piece);\n });\n cell.addEventListener(\"click\", () => {\n cell.removeChild(piece);\n });\n });\n }", "function mousePressed() {\n session.mousePressed();\n}", "clicked(x, y) {}", "function makeItClickable(){\n\n }", "function onMouseOver(evt) {\n $('#event-diagnostic').text('Mouse over fired.');\n }" ]
[ "0.6669675", "0.662272", "0.6511007", "0.65012217", "0.64592904", "0.6423126", "0.63551104", "0.63551104", "0.6341227", "0.62963045", "0.6281964", "0.6256983", "0.6255091", "0.6255091", "0.62460935", "0.62460935", "0.6215957", "0.6205709", "0.62052155", "0.62043005", "0.6183429", "0.6158856", "0.6152869", "0.61435664", "0.61219376", "0.6099272", "0.60911214", "0.60706764", "0.60693187", "0.6047661", "0.60423595", "0.6034065", "0.60263354", "0.60173625", "0.60067654", "0.6003288", "0.6002764", "0.5989443", "0.5984747", "0.59742314", "0.59718996", "0.596611", "0.59639597", "0.59535736", "0.5949797", "0.5948885", "0.59487474", "0.5944078", "0.59439063", "0.59386075", "0.59257746", "0.59257746", "0.5923382", "0.59087497", "0.5908435", "0.5907642", "0.5903483", "0.5890744", "0.58860356", "0.5875803", "0.5871354", "0.5857313", "0.5854709", "0.5852093", "0.585153", "0.58514655", "0.584974", "0.5848348", "0.58483154", "0.5838571", "0.5833926", "0.5832951", "0.5824686", "0.5815225", "0.5810822", "0.5810264", "0.5808987", "0.5808526", "0.5789064", "0.5787191", "0.578054", "0.57776797", "0.57754326", "0.5774208", "0.57709026", "0.57700336", "0.5767639", "0.5762185", "0.5759792", "0.57592857", "0.57592857", "0.5753532", "0.57476026", "0.57441854", "0.5731325", "0.5726989", "0.572454", "0.5717511", "0.57096237", "0.5707078", "0.5704436" ]
0.0
-1
this function can now be removed
function pressBtnRalstonAnnex() { var u = document.getElementById('location25a').innerHTML; if(u == "Ralston Hall Annex") { map.flyTo({center: [-122.286468,37.517468],speed: 0.3}); var popup = new mapboxgl.Popup({closeOnClick: true}) .setLngLat([-122.286468,37.517468]) .setHTML('<h3>' + geojson.features[39].properties.title + '</h3><iframe class="popup-image" allowfullscreen="allowfullscreen" frameborder="0" scrolling="auto" src="' + geojson.features[39].properties.image + '"></iframe><p>' + geojson.features[39].properties.description + '</p><br>' + '<a href="#" onClick="popUpModal(\'' + geojson.features[39].properties.title + '\',\'' + geojson.features[39].properties.history + '\',\'' + geojson.features[39].properties.video + '\',\'' + geojson.features[39].properties.image + '\',\'' + geojson.features[39].properties.description + '\')" class="btn btn-primary btn-lg active" role="button" aria-pressed="true">History</a>') .addTo(map); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "static final private internal function m106() {}", "static private protected internal function m118() {}", "transient final private protected internal function m167() {}", "static private internal function m121() {}", "transient private protected public internal function m181() {}", "function _____SHARED_functions_____(){}", "static transient final protected internal function m47() {}", "static transient private protected internal function m55() {}", "static transient final private internal function m43() {}", "transient final private internal function m170() {}", "transient private public function m183() {}", "static private protected public internal function m117() {}", "static transient final protected public internal function m46() {}", "static transient final private protected internal function m40() {}", "transient final private protected public internal function m166() {}", "static transient private protected public internal function m54() {}", "static protected internal function m125() {}", "static final private protected internal function m103() {}", "function StupidBug() {}", "static final private protected public internal function m102() {}", "static transient final protected function m44() {}", "function miFuncion (){}", "static final protected internal function m110() {}", "static final private public function m104() {}", "transient final private public function m168() {}", "function DWRUtil() { }", "static transient private public function m56() {}", "static transient private internal function m58() {}", "function fm(){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function Scdr() {\r\n}", "function fn() {\n\t\t }", "static transient final private protected public function m38() {}", "__previnit(){}", "obtain(){}", "static transient final private protected public internal function m39() {}", "static private public function m119() {}", "function comportement (){\n\t }", "static transient final private public function m41() {}", "function ea(){}", "function customHandling() { }", "function wa(){}", "updated() {}", "removed() {}", "removed() {}", "function TMP() {\n return;\n }", "function updateroster() {\n\n}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "function __func(){}", "function kp() {\n $log.debug(\"TODO\");\n }", "static transient protected internal function m62() {}", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function AeUtil() {}", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function fechaserver() {\n}", "method() {\n throw new Error('Not implemented');\n }", "function Utils() {}", "function Utils() {}", "function TMP(){return;}", "function TMP(){return;}", "function datasetDangerously () {}", "function reserved(){}", "function oi(){}", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "onOpenedFile() {\n throw \"[CacheObjectBaseInject::onOpnenedFile] Function Abstract, extended class have implement this method\";\n }", "function _construct()\n\t\t{;\n\t\t}", "function Utils(){}", "frame() {\n throw new Error('Not implemented');\n }", "function Rebelizer() {\n\n}", "function hc(){}", "added() {}", "function StackFunctionSupport() {\r\n}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}" ]
[ "0.73518246", "0.7247393", "0.71687174", "0.69204676", "0.68473953", "0.68310493", "0.6652985", "0.64847845", "0.64604914", "0.6411417", "0.6387217", "0.6252365", "0.62090635", "0.61930454", "0.6154018", "0.6132278", "0.6126609", "0.60454065", "0.6008585", "0.6003555", "0.5991413", "0.59603536", "0.5932782", "0.5852938", "0.5829689", "0.5821231", "0.57541573", "0.5745712", "0.56869185", "0.5654975", "0.56458414", "0.5635672", "0.56263465", "0.5604528", "0.56024367", "0.5590037", "0.55517435", "0.55517435", "0.55517435", "0.55029386", "0.5473829", "0.5445727", "0.5413737", "0.5408852", "0.5405367", "0.5397856", "0.5391968", "0.5354924", "0.5290064", "0.5281013", "0.5270094", "0.52661455", "0.5265045", "0.5265045", "0.5253155", "0.523191", "0.52310497", "0.52310497", "0.523093", "0.5221902", "0.51953894", "0.51856947", "0.51856947", "0.5171672", "0.51706856", "0.51550126", "0.51550126", "0.51550126", "0.51550126", "0.51550126", "0.51550126", "0.51550126", "0.51491386", "0.5134804", "0.5116299", "0.5116299", "0.51064867", "0.51064867", "0.5101124", "0.51003593", "0.5094251", "0.5089743", "0.50717676", "0.50595105", "0.50591326", "0.50490284", "0.50472957", "0.5044672", "0.50413823", "0.50326014", "0.50266445", "0.50266445", "0.50266445", "0.50266445", "0.50266445", "0.50266445", "0.50266445", "0.50266445", "0.50266445", "0.50266445", "0.50266445" ]
0.0
-1
this function now can be removed
function pressBtnRalston() { var u = document.getElementById('location25').innerHTML; if(u == "Ralston Hall Mansion") { map.flyTo({center: [-122.286784, 37.517380],speed: 0.3}); var popup = new mapboxgl.Popup({closeOnClick: true}) .setLngLat([-122.286784, 37.517380]) .setHTML('<h3>' + geojson.features[2].properties.title + '</h3><iframe class="popup-image" allowfullscreen="allowfullscreen" frameborder="0" scrolling="auto" src="' + geojson.features[2].properties.image + '"></iframe><p>' + geojson.features[2].properties.description + '</p><br>' + '<a href="#" onClick="popUpModal(\'' + geojson.features[2].properties.title + '\',\'' + geojson.features[2].properties.history + '\',\'' + geojson.features[2].properties.video + '\',\'' + geojson.features[2].properties.image + '\',\'' + geojson.features[2].properties.description + '\')" class="btn btn-primary btn-lg active" role="button" aria-pressed="true">History</a>') .addTo(map); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "static private protected internal function m118() {}", "static final private internal function m106() {}", "transient final private protected internal function m167() {}", "static private internal function m121() {}", "transient private protected public internal function m181() {}", "static transient final protected internal function m47() {}", "static transient private protected internal function m55() {}", "function _____SHARED_functions_____(){}", "transient final private internal function m170() {}", "static transient final private internal function m43() {}", "transient private public function m183() {}", "static private protected public internal function m117() {}", "static transient final protected public internal function m46() {}", "static transient final private protected internal function m40() {}", "transient final private protected public internal function m166() {}", "static transient private protected public internal function m54() {}", "function StupidBug() {}", "static protected internal function m125() {}", "static final private protected internal function m103() {}", "static transient final protected function m44() {}", "static final private protected public internal function m102() {}", "transient final private public function m168() {}", "function miFuncion (){}", "static final protected internal function m110() {}", "static transient private internal function m58() {}", "static final private public function m104() {}", "static transient private public function m56() {}", "function fm(){}", "function DWRUtil() { }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function fn() {\n\t\t }", "function Scdr() {\r\n}", "static transient final private protected public function m38() {}", "__previnit(){}", "obtain(){}", "static transient final private protected public internal function m39() {}", "function comportement (){\n\t }", "static private public function m119() {}", "function updateroster() {\n\n}", "function wa(){}", "static transient final private public function m41() {}", "function TMP() {\n return;\n }", "function customHandling() { }", "updated() {}", "function ea(){}", "removed() {}", "removed() {}", "function kp() {\n $log.debug(\"TODO\");\n }", "function fechaserver() {\n}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "static transient protected internal function m62() {}", "function __func(){}", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function datasetDangerously () {}", "function TMP(){return;}", "function TMP(){return;}", "function reserved(){}", "function AeUtil() {}", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function oi(){}", "hacky(){\n return\n }", "function Utils() {}", "function Utils() {}", "added() {}", "method() {\n throw new Error('Not implemented');\n }", "function Rebelizer() {\n\n}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "preset () { return false }", "function priv () {\n\t\t\t\n\t\t}", "function fos6_c() {\n ;\n }" ]
[ "0.7355305", "0.7173245", "0.71494406", "0.6875981", "0.6806564", "0.67839277", "0.6619987", "0.64201486", "0.64018667", "0.63808984", "0.636692", "0.62007827", "0.61258286", "0.6110206", "0.6107111", "0.60880846", "0.6076824", "0.5984499", "0.59570956", "0.5924319", "0.59238666", "0.5912943", "0.5888038", "0.5828958", "0.5827855", "0.5751705", "0.56799394", "0.56727105", "0.5596272", "0.55892444", "0.5587636", "0.5569019", "0.5562334", "0.5547257", "0.553907", "0.5511499", "0.54498637", "0.54498637", "0.54498637", "0.54415774", "0.5425862", "0.53949565", "0.5378735", "0.5366951", "0.5356385", "0.535029", "0.5344319", "0.5305191", "0.5288351", "0.5273906", "0.5267094", "0.5260687", "0.5259536", "0.525235", "0.5239637", "0.5239637", "0.517017", "0.5164568", "0.5161073", "0.5161073", "0.5153229", "0.5143776", "0.51207376", "0.51207376", "0.51207376", "0.51207376", "0.51207376", "0.51207376", "0.51207376", "0.5100135", "0.5098501", "0.50981474", "0.50981474", "0.5097986", "0.5079812", "0.5072175", "0.5072175", "0.5036327", "0.50323063", "0.501002", "0.5008573", "0.5008573", "0.5007083", "0.5003066", "0.49890196", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.4982434", "0.49810424", "0.4979813", "0.49741966" ]
0.0
-1
this function can also be removed now
function pressBtnTheApartmentsKane() { var u = document.getElementById('location32a').innerHTML; if(u == "The Apartments Kane") { map.flyTo({center: [-122.285434,37.516556],speed: 0.3}); var popup = new mapboxgl.Popup({closeOnClick: true}) .setLngLat([-122.285434,37.516556]) .setHTML('<h3>' + geojson.features[33].properties.title + '</h3><iframe class="popup-image" allowfullscreen="allowfullscreen" frameborder="0" scrolling="auto" src="' + geojson.features[33].properties.image + '"></iframe><p>' + geojson.features[33].properties.description + '</p><br>' + '<a href="#" onClick="popUpModal(\'' + geojson.features[33].properties.title + '\',\'' + geojson.features[33].properties.history + '\',\'' + geojson.features[33].properties.video + '\',\'' + geojson.features[33].properties.image + '\',\'' + geojson.features[33].properties.description + '\')" class="btn btn-primary btn-lg active" role="button" aria-pressed="true">History</a>') .addTo(map); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "static final private internal function m106() {}", "static private protected internal function m118() {}", "static private internal function m121() {}", "transient final private protected internal function m167() {}", "function _____SHARED_functions_____(){}", "transient private protected public internal function m181() {}", "static transient final protected internal function m47() {}", "static transient private protected internal function m55() {}", "static transient final private internal function m43() {}", "static private protected public internal function m117() {}", "transient final private internal function m170() {}", "transient private public function m183() {}", "function StupidBug() {}", "static transient final protected public internal function m46() {}", "static transient private protected public internal function m54() {}", "static transient final private protected internal function m40() {}", "static protected internal function m125() {}", "transient final private protected public internal function m166() {}", "static final private protected internal function m103() {}", "function miFuncion (){}", "static final private protected public internal function m102() {}", "static transient final protected function m44() {}", "function DWRUtil() { }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function fm(){}", "static final private public function m104() {}", "static transient private public function m56() {}", "function fn() {\n\t\t }", "static final protected internal function m110() {}", "function Scdr() {\r\n}", "static transient private internal function m58() {}", "transient final private public function m168() {}", "static private public function m119() {}", "function comportement (){\n\t }", "function customHandling() { }", "function wa(){}", "obtain(){}", "function ea(){}", "__previnit(){}", "static transient final private protected public function m38() {}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "function TMP() {\n return;\n }", "updated() {}", "removed() {}", "removed() {}", "static transient final private protected public internal function m39() {}", "static transient final private public function m41() {}", "function updateroster() {\n\n}", "function TMP(){return;}", "function TMP(){return;}", "function AeUtil() {}", "function __func(){}", "function Utils() {}", "function Utils() {}", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "hacky(){\n return\n }", "function positionMapTools(){\r\n\t//deprecated...\t\r\n}", "function datasetDangerously () {}", "function Utils(){}", "function kp() {\n $log.debug(\"TODO\");\n }", "function fechaserver() {\n}", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function reserved(){}", "function oi(){}", "preset () { return false }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function StackFunctionSupport() {\r\n}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function FunctionUtils() {}", "added() {}", "static transient protected internal function m62() {}", "function hc(){}", "function jessica() {\n $log.debug(\"TODO\");\n }", "incapacitate(){\n\t\t//\n\t}", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "analyze(){ return null }", "function Rebelizer() {\n\n}", "function fos6_c() {\n ;\n }", "function r(){}", "function r(){}", "function r(){}", "function r(){}" ]
[ "0.72497845", "0.70916903", "0.70081943", "0.6740817", "0.66799307", "0.66319406", "0.6491074", "0.640899", "0.63919187", "0.63778627", "0.6250777", "0.620593", "0.60872495", "0.6059894", "0.6025639", "0.60238975", "0.5954994", "0.5945581", "0.59154016", "0.5878295", "0.5877758", "0.58487225", "0.5827054", "0.577777", "0.577586", "0.5727826", "0.57020515", "0.56346714", "0.5634556", "0.5620737", "0.5614855", "0.5614855", "0.5614855", "0.5585371", "0.5550729", "0.5519319", "0.5507238", "0.5502192", "0.54860234", "0.54740065", "0.5455198", "0.5377948", "0.5375202", "0.53677094", "0.5353478", "0.5329704", "0.53167903", "0.5296742", "0.529093", "0.5287063", "0.5287063", "0.5278759", "0.52713466", "0.52705455", "0.52705455", "0.52632695", "0.5260069", "0.52508193", "0.5232134", "0.5232134", "0.5228759", "0.52181864", "0.51999104", "0.51999104", "0.51842535", "0.51842535", "0.51842535", "0.51842535", "0.51842535", "0.51842535", "0.51842535", "0.516172", "0.5151812", "0.5144835", "0.51391935", "0.5138541", "0.5130594", "0.5120127", "0.51068604", "0.5106238", "0.5082987", "0.5079044", "0.5079044", "0.5073503", "0.50721395", "0.50721395", "0.50721395", "0.50648963", "0.50633514", "0.505861", "0.50439453", "0.50227827", "0.50098693", "0.5002711", "0.4996468", "0.4996223", "0.49916643", "0.49891275", "0.49891275", "0.49891275", "0.49891275" ]
0.0
-1
Create Local Web Server
function openServer() { connect.server({ host: cfg.server.host, root: cfg.server.root, port: cfg.server.port, livereload: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHttpServer() {\n\t\tutil.log('Starting http server...');\n\t\thttp.createServer(function (req, response) {\n\n\t\t\tvar setHeader = function (status, ctype) {\n\t\t\t\tif (typeof ctype === constants.variables.undef) {\n\t\t\t\t\tctype = 'text/plain';\n\t\t\t\t}\n\n\t\t\t\tresponse.writeHead(status, {\n\t\t\t\t\t'Content-Type': ctype\n\t\t\t\t});\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\tvar parsedUrl = url.parse(req.url, true);\n\t\t\t\tvar queryData = parsedUrl.query;\n\t\t\t\tvar _ids = queryData.id;\n\n\t\t\t\t//set default response \n\t\t\t\tsetHeader(200);\n\n\t\t\t\tif (queryData.mode && queryData.mode === 'upload') {\n\t\t\t\t\tfileupload.upload(req, response, _ids, function (cb) {\n\t\t\t\t\t\tcb();\n\t\t\t\t\t});\n\n\t\t\t\t} else if (parsedUrl.path.indexOf('/static/') > -1) {\n\t\t\t\t\tvar img = fs.readFileSync(constants.variables.appPath + parsedUrl.path);\n\t\t\t\t\tsetHeader(200, 'image/jpeg');\n\t\t\t\t\tresponse.end(img, 'binary');\n\t\t\t\t} else {\n\t\t\t\t\tresponse.end(\"furb.static.serv\\n\");\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tsetHeader(500);\n\t\t\t\tresponse.end('maybe overload?');\n\t\t\t\tutil.inspect(e);\n\t\t\t}\n\t\t}).listen(constants.variables.httpPort);\n\t}", "function createWebWatchServer() {\n\tconst server = createServer({\n\t\tmode,\n\t\tcustomLogger: createLogger(\"info\", { prefix: `[web]` }),\n\t\tconfigFile: \"src/renderer/vite.config.js\",\n\t});\n\n\treturn server;\n}", "function createWebServer() {\n // The directory where all .html files are stored\n const htmlPath = (__dirname + '/views/');\n\n // Allows css, img, and js resources within public to be served\n // and/or used by .html files\n webServerApp.use(webServerExpress.static('public'));\n\n // Allows the web-server to use body-parser to parse JSON\n webServerApp.use(bodyParser.json());\n\n // Serves index.html whenever the root of the \n // webserver is requested (i.e. localhost)\n webServerApp.get('/', function(req, res) {\n res.sendFile(htmlPath + 'index.html');\n }); \n\n // Serves about.html whenever root/about.html of the \n // webserver is requested (i.e. localhost/about.html)\n webServerApp.get('/about.html', function(req, res) {\n res.sendFile(htmlPath + 'about.html');\n }); \n\n // Serves the mongo-express UI when path/mongo-express is navigated to\n webServerApp.use('/mongo_express', mongo_express(mongo_express_config));\n\n // Serves 404.html whenever an unknown file is \n // requested from the web-server\n webServerApp.get('*', function(req, res) {\n res.sendFile(htmlPath + '404.html');\n }); \n\n // Listens on the given port for HTTP calls\n webServerApp.listen(webServerPort);\n}", "function serve() {\n var server = gls.static('dist/', PORT);\n //server.start();\n var promise = server.start();\n //optionally handle the server process exiting\n promise.then(function(result) {\n console.log('server started')\n openBrowser()\n });\n}", "function createServer(options) {\r\n var app;\r\n\r\n if (!options) throw new Error('Invalid options');\r\n\r\n if (typeof options === 'string') cfg.path = options;\r\n else if (typeof options === 'object') cfg = mergeObj(cfg, options);\r\n else throw new TypeError('Type of ' + options + ' is not an object or a string');\r\n\r\n // Right after i read the conf launch the Logger (to be aware of verbose mode);\r\n csl = new Logger();\r\n\r\n // OH! We have a cli app, read the confs from launch args\r\n if (cfg.cli) load();\r\n if (!cfg.safe) template = fs.readFileSync(path.join(__dirname, '..', 'public/index.html'), 'utf8');\r\n // Switch protocols depending on options\r\n // SPDY - HTTPS - HTTP\r\n // And yes just require the valid one\r\n if (options.spdy) app = require('spdy').createServer(https.Server, options.spdy, server);\r\n else if (options.https) {\r\n app = https.createServer(options.https, server);\r\n } else app = http.createServer(server);\r\n\r\n // Avoid loggin twice, because of domains\r\n var logged = 0;\r\n\r\n // When the server is already listing on a port log the conf\r\n\r\n function listener() {\r\n if (logged == 1) return;\r\n logged = 1;\r\n cfg.port = app.address().port;\r\n csl.log('Server running on port := ' + cfg.port);\r\n // Log the current configuration\r\n for (var key in cfg) {\r\n if (key != 'spdy' || key != 'https')\r\n csl.log(key + ' : ' + cfg[key]);\r\n }\r\n\r\n // If browser is true, launch it.\r\n if (cfg.browser) {\r\n var browser;\r\n switch (process.platform) {\r\n case \"win32\":\r\n browser = \"start\";\r\n break;\r\n case \"darwin\":\r\n browser = \"open\";\r\n break;\r\n default:\r\n browser = \"xdg-open\";\r\n break;\r\n }\r\n csl.warn('Opening a new browser window...');\r\n require('child_process').spawn(browser, ['http://localhost:' + app.address().port]);\r\n }\r\n }\r\n\r\n // Add the hability to pick the PORT in the env var.\r\n if (!cfg.ignorePort) cfg.ignorePort = true;\r\n if (process.env.PORT && cfg.ignorePort) cfg.port = process.env.PORT;\r\n\r\n var handler = domain.create();\r\n // Yeah just once\r\n handler.once('error', function() {\r\n csl.warn('The port that you provide is in use, trying one more time');\r\n app.listen('', listener);\r\n });\r\n\r\n handler.run(function() {\r\n app.listen(cfg.port, listener);\r\n });\r\n\r\n // Add config (useful for cli apps)\r\n app.config = cfg;\r\n // Important config to share to parent\r\n app.port = cfg.port;\r\n app.path = cfg.path;\r\n // Returns a http server instance\r\n return app;\r\n}", "function startWebserver() {\n\n if ( curProtocol === 'https' ) {\n const credentials = {\n key: fs.readFileSync( configs.protocol[ curProtocol ].privateKey ),\n cert: fs.readFileSync( configs.protocol[ curProtocol ].certificate ),\n ca: fs.readFileSync( configs.protocol[ curProtocol ].ca )\n };\n const https_server = https.createServer( credentials, handleRequest );\n\n // start HTTPS webserver\n https_server.listen( configs.protocol[ curProtocol ].port );\n\n console.log( 'HTTPS server started at: https://' + configs.domain + ':' + configs.protocol[ curProtocol ].port );\n\n } else if ( curProtocol === 'http' ) {\n const http_server = http.createServer( handleRequest );\n\n // start HTTP webserver\n http_server.listen( configs.protocol[ curProtocol ].port );\n\n console.log( 'HTTP server started at: http://' + configs.domain + ':' + configs.protocol[ curProtocol ].port);\n\n } else {\n console.error( \"neither 'http' or 'https' configuration specified\" );\n }\n }", "function createServer(app){\n if(process.env.USE_HTTPS === \"true\"){\n var https = require('https');\n var fs = require('fs');\n\n // as this is intended only for DEV use, you need those (same names) in the root folder of the app\n const options = {\n key: fs.readFileSync('server.key'),\n cert: fs.readFileSync('server.crt')\n } \n\n debug(\"Setting up server over HTTPS...\");\n return https.createServer(options, app);\n } else {\n var http = require('http');\n debug(\"Setting up server over HTTP...\");\n return http.createServer(app); \n }\n \n}", "function StartWebServer(port) {\n if (port == 0 || port == 65535) return;\n obj.args.port = port;\n if (obj.tlsServer != null) {\n if (obj.args.lanonly == true) {\n obj.tcpServer = obj.tlsServer.listen(port, function () { console.log('MeshCentral HTTPS web server running on port ' + port + '.'); });\n } else {\n obj.tcpServer = obj.tlsServer.listen(port, function () { console.log('MeshCentral HTTPS web server running on ' + certificates.CommonName + ':' + port + '.'); });\n }\n } else {\n obj.tcpServer = obj.app.listen(port, function () { console.log('MeshCentral HTTP web server running on port ' + port + '.'); });\n }\n }", "function startServer () {\n require('http').createServer(function (req, res) {\n req.addListener('end', function (e) {\n //\n // Serve files!\n //\n server.serve(req, res, function (resp) {\n if (resp && (resp.status === 404)) { // If the file wasn't found\n\n server.serveFile('/index.html', 302, resp.headers, req, res);\n }\n });\n });\n }).listen(8080);\n\n console.log('server now listening on port: 8080')\n}", "function createServer() {\n var server = http.createServer(function (request, response) {\n var method = request.method;\n var url = request.url;\n var cookies = new Cookies(request, response);\n // Determining if this is a connection from an existing client or a new one\n var sessionId = cookies.get('sessionId');\n if ( typeof sessionId == 'undefined' ) {\n sessionId = uuid.v4();\n cookies.set('sessionId', sessionId, {path:'/'});\n }\n\n if ( this[method] instanceof Function ) {\n this[method](url, request, response);\n }\n\n\n if ( request.url == \"/favicon.ico\" ) return response.end();\n //console.log('requesting ', request.url);\n var filePath = '.' + request.url.split(\"?\")[0];\n if ( filePath == './' )\n filePath = './index.html';\n\n var extname = path.extname( filePath );\n var contentTypes = { '.js': 'text/javascript', '.css': 'text/css' };\n var contentType = contentTypes[extname] || 'text/html';\n\n fs.exists( filePath, function( exists ) {\n if ( exists ) {\n console.log(\"Serving file:\", filePath );\n fs.readFile(filePath, function( error, content ) {\n if ( error ) {\n response.writeHead( 500 );\n response.end();\n }\n else {\n response.writeHead( 200, { 'Content-Type': contentType } );\n response.end(content, 'utf-8');\n }\n });\n }\n else {\n console.log( \"File not found:\", filePath );\n response.writeHead(404);\n response.end();\n }\n });\n });\n server.listen.apply(server, arguments);\n}", "function createHTTPServer(rootFolder) {\n /*return a new server instance*/\n\treturn new ServerInstance(rootFolder);\n}", "function main() {\n const config = createConfig();\n const server = createServer(config);\n\n const {hostname, port} = config.getWebserverHost();\n console.error(`Starting rpi-clock webserver on ${hostname}:${port}`);\n server.listen(port, hostname);\n}", "function startHttpServer() {\n var server = http.createServer(httpRequestHandler);\n var port = program.port || httpRequestHandler.get('port');\n\n server.listen(port, function() {\n console.log('\\nPersonalization server listening on port ' + port);\n });\n}", "function startServer() {\n if (!opts.p) {\n console.log(opts.p)\n }else\n {\n if (opts.f === '') {\n fs.writeFileSync(tileDirectory + 'index.html', preview(geojsonFiles[0],mapCenter.geometry.coordinates,8));\n }else{\n fs.writeFileSync(tileDirectory + 'index.html', preview(tileLayerName,mapCenter.geometry.coordinates,8));\n }\n var StaticServer = require('static-server');\n var server = new StaticServer({\n rootPath: tileDirectory, // required, the root of the server file tree\n name: 'my-http-server', // optional, will set \"X-Powered-by\" HTTP header\n port: 80, // optional, defaults to a random port\n host: '127.0.0.1', // optional, defaults to any interface\n cors: '*', // optional, defaults to undefined\n followSymlink: true, // optional, defaults to a 404 error\n templates: {\n index: 'index.html', // optional, defaults to 'index.html'\n notFound: '404.html' // optional, defaults to undefined\n }\n });\n\n server.start(function () {\n console.log('Server listening to', server.port);\n });\n opener('http://127.0.0.1/')\n }\n}", "function createServer() {\n const script = getScriptPath()\n const cp = require(\"child_process\")\n\n if(!isPackaged())\n server = cp.spawn('python', [script, PORT])\n else\n server = cp.execFile(script, [PORT])\n\n server.stderr.on('error', err => {\n console.log('Server threw an error: ' + err)\n })\n server.on('close', code => {\n console.log('Server exited with code ' + code)\n })\n}", "function startServer() {\n const proxyApp = express();\n const webServer = require('http').createServer(proxyApp);\n const port = process.env.port || 3088;\n\n // set up routes and enable CORS\n proxyApp.use(cors())\n proxyApp.get('/api/cars', getCarOwners); \n const path = __dirname + '/../dist';\n console.log('Hosting server at http://localhost:' + port)\n if (fs.existsSync(path)) {\n const staticContent = express.static(path);\n proxyApp.use(staticContent);\n } else {\n proxyApp.get('/', (req, res, next) => {\n res.send('<h1>Applicaton not built and published</h1>')\n next();\n });\n }\n\n // local server for Dev acting as Proxy for original service\n webServer.listen(port, () => {\n successlog.info('CORS enabled proxy API server launched..');\n });\n}", "function serve() {\n var http = require('http');\n http.createServer(function(req, res){\n fs.readFile(html_source, 'utf8', function(err, data) {\n if (err) {\n res.send(err);\n console.log(err);\n }\n res.end(data.toString());\n });\n }).listen(port);\n console.log(\"\\nRunning \".yellow + \"joy\".blue + \" development server\".yellow);\n console.log(\"http://127.0.0.1:1337\".green);\n console.log(\"Ctrl-C to Stop\\n\".green);\n}", "function startServer (config, controller) {\n // TODO port will be required for multi-team auth\n if (config.port) {\n controller.setupWebserver(config.port)\n }\n}", "CrearServidorHttp() {\n this.server = http.createServer(this.app);\n }", "async function startWebServer () {\n const shutdownOptions = {\n logger: console,\n forceTimeout: 30000\n }\n\n if (sslEnabled) {\n secureCtx = await createSecureContext()\n // create with `secureCtx` so we can renew certs without restarting the server\n const httpsServer = https.createServer(\n {\n SNICallback: (_, cb) => cb(null, secureCtx)\n },\n app\n )\n // update secureCtx to reassign the new cert files\n app.use(\n '/reload-certs',\n async () => (secureCtx = await createSecureContext())\n )\n // graceful shutdown prevents new clients from connecting & waits for to diconnect\n app.use(graceful(httpsServer, shutdownOptions))\n // websocket uses same fd\n attachWebSocket(httpsServer)\n // callback gets public facing ip\n httpsServer.listen(sslPort, checkPublicIpAddress)\n }\n\n const httpServer = http.createServer(app)\n app.use(graceful(httpServer, shutdownOptions))\n\n if (sslEnabled) {\n // set up a route to redirect http to https\n httpServer.get('*', function (req, res) {\n res.redirect('https://' + req.headers.host + req.url)\n })\n } else {\n attachWebSocket(httpServer)\n }\n httpServer.listen(port, checkPublicIpAddress)\n}", "function start(){\n server = http.createServer(app).listen( config.port );\n logger.info((new Date()).toString()+ \":: PROJECT_NAME server listening on port::\", config.port, \", environment:: \", app.settings.env);\n}", "function serve() {\n connect.server(serverConfig);\n}", "function serve() {\n connect().use(serveStatic(__dirname + \"/_site\")).listen(port, function() {\n console.log('Content served on http://localhost:' + port);\n });\n}", "async function serve() {\n createCtrlcHandler('serve');\n logServeMode();\n watch(serverFiles, restartServer);\n await startServer();\n await performPreBuildSteps();\n}", "serve() {\n\t\tconst server = new Server(this);\n\t\tconst serverConfig = this._config.devServer;\n\n\t\tserver.logServer('/log');\n\n\t\tif (serverConfig.enableRawProxy) {\n\t\t\tserver.rawProxy('/proxy');\n\t\t}\n\n\t\tconst proxyMap = serverConfig.proxy;\n\t\tObject.keys(proxyMap)\n\t\t\t.forEach((path) => {\n\t\t\t\tserver.proxy(path, proxyMap[path]);\n\t\t\t});\n\n\t\tlet staticFiles = {};\n\t\tfor (const entity of this._config.include) {\n\t\t\tif (entity.static) {\n\t\t\t\tstaticFiles = Object.assign(staticFiles, entity.static);\n\t\t\t}\n\t\t}\n\n\t\tlogger.silly(`Serving static files: \\n${JSON.stringify(staticFiles, null, '\\t')}`);\n\n\t\tfor (const [customPath, filePath] of Object.entries(staticFiles)) {\n\t\t\tconst alias = `/${customPath.replace(/^\\//, '')}`;\n\t\t\tconst absolutePath = this._pathHelper.resolveAbsolutePath(filePath);\n\n\t\t\tif (fs.existsSync(absolutePath)) {\n\t\t\t\tserver.serveStatic(alias, absolutePath);\n\t\t\t} else {\n\t\t\t\tlogger.warn(`Can't serve static path ${kleur.green(alias)} from ${kleur.underline(absolutePath)}`);\n\t\t\t}\n\t\t}\n\n\t\tthis._codeSource.watch();\n\n\t\tserver.start(serverConfig.port)\n\t\t\t.then((addresss) => {\n\t\t\t\tlogger.output(`Server started at ${kleur.underline(addresss)}`);\n\t\t\t}, (err) => {\n\t\t\t\tlogger.error(`Error starting server: ${err.toString()}`);\n\t\t\t\tlogger.debug(err.stack);\n\t\t\t});\n\t}", "function Server( webServer ) {\n\tthis.webServer = webServer;\n}", "fireUpEngines() {\n const httpServer = http.createServer(this.app);\n httpServer.listen(this.configuration.port);\n console.log(`TreeHouse HTTP NodeJS Server listening on port ${this.configuration.port}`);\n\n // HTTPS - Optional\n if (this.configuration.https) {\n const httpsServer = https.createServer(this.getHttpsCredentials(), this.app);\n httpsServer.listen(this.configuration.https.port);\n console.log(`TreeHouse HTTPS NodeJS Server listening on port ${this.configuration.https.port}`);\n }\n }", "function Server(webServer) {\n this.webServer = webServer;\n}", "function serve(context, path, port) {\n var service = server.create().listen(port, { keepAlive: true }, function (request, response) {\n var fqn = path + request.url;\n var key = port + \":\" + request.url;\n\n if (stubs[key] !== undefined) { r = {body: stubs[key], code: 200}; }\n else if (fs.exists(fqn)) { r = {body: fs.read(fqn), code: 200}; }\n else { r = {body: \"\", code: 404}; }\n\n response.statusCode = r.code;\n response.headers = { 'Cache': 'no-cache', 'Content-Length': r.body.length, 'Content-Type': 'text/html' };\n response.write(r.body);\n response.close();\n });\n\n if (!service) { console.log('Error: Could not create web server listening on port ' + port); phantom.exit(); }\n respond(null, context, [])\n}", "startWebServer() {\n express.listen(this.master.CLA.port, () => console.log(`Running on port ${this.master.CLA.port}`))\n this.loadRoutes()\n }", "_createServer(){\n if ( this._server === null ){\n // Create a new HTTP server.\n this._server = net.createServer(this._options);\n // Bind event handlers.\n this._bindEventHandlers();\n }\n }", "function createServerAndGetTestUrl() {\n const httpServer = createTestHTTPServer();\n\n httpServer.registerContentType(\"html\", \"text/html\");\n httpServer.registerContentType(\"js\", \"application/javascript\");\n\n httpServer.registerPathHandler(\n \"/\" + HTML_FILENAME,\n function (request, response) {\n response.setStatusLine(request.httpVersion, 200, \"OK\");\n response.write(HTML_CONTENT);\n }\n );\n httpServer.registerPathHandler(\n \"/\" + JS_ASCII_FILENAME,\n function (request, response) {\n response.setStatusLine(request.httpVersion, 200, \"OK\");\n response.setHeader(\"Content-Type\", \"application/javascript\", false);\n let content = \"\";\n for (const curSeason of SEASONS) {\n content += `console.log(\"${curSeason.english}\");`;\n }\n response.write(content);\n }\n );\n httpServer.registerPathHandler(\n \"/\" + ENCODED_JS_UNICODE_FILENAME,\n function (request, response) {\n response.setStatusLine(request.httpVersion, 200, \"OK\");\n response.setHeader(\"Content-Type\", \"application/javascript\", false);\n let content = \"\";\n for (const curSeason of SEASONS) {\n content += `console.log(\"${curSeason.escapedChinese}\");`;\n }\n response.write(content);\n }\n );\n const port = httpServer.identity.primaryPort;\n return `http://localhost:${port}/${HTML_FILENAME}`;\n}", "function createServer () {\n\n // Create server\n\n var server = express.createServer();\n\n // Configure Server\n\n server.configure(function () {\n\n // Built-in\n\n server.use(express.methodOverride()); // Allow method override using _method form parameter\n server.use(express.bodyDecoder()); \t // Parse application/x-www-form-urlencoded\n server.use(express.staticProvider(__dirname + '/files')); // Serve client documents in local directory\n\n // Local\n\n server.use(setResponseHeader()); // Set default response headers for CORS\n server.use(logConsole()); // Display incoming requests\n\n // Authentication\n\n server.use(auth([auth.Mac({ realm: \"Example\", // Set realm, typically a domain name or application name\n getTokenAttributes: getToken, // Function used to fetch the access token record, typically from a database\n // hostHeader: 'x-forwarded-host', // Needed when running behind a proxy such as Apache2\n // isHTTPS: true, // Uncomment for HTTPS\n checkNonce: nonceCheck, // Optional nonce checking function\n bodyHashMode: \"require\" })])); // Require body hash validation for all non GET/HEAD/OPTIONS requests\n });\n\n // Setup generic OPTIONS route\n\n server.options(/.+/, function (req, res) {\n\n res.send(' ');\n });\n\n return server;\n}", "function home(request){\n request.serveFile(\"index.html\");\n}", "function serve(cb) {\n return exec('http-server', [], (err, stdout, stderr) => {\n console.log(stdout);\n console.log(stderr);\n cb(err);\n });\n}", "startHTTPServer()\r\n {\r\n var self = this;\r\n if(!this.httpServer)\r\n {\r\n this.httpServer = Http.createServer();\r\n this.httpServer.on(\"request\", function(_request, _response){\r\n self.requestReceived(_request, _response);\r\n });\r\n\r\n // start the server on the port given in the settings\r\n this.httpServer.listen(this.settings.port, function() {\r\n self.logVerbose('Raumserver listening on port ' + self.settings.port.toString());\r\n });\r\n }\r\n }", "function startServer() {\n Http.listen(env.serverPort, () => {\n console.log('Listening at :' + env.serverPort + '...');\n });\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT,\n browser: \"iexplore\",\n reloadOnRestart: true,\n directory: true\n }, done);\n}", "function srv() {\n return src('./dist')\n .pipe(server({\n livereload: true,\n open: true\n }));\n}", "function server(done) {\n browser.init({\n server: PATHS.dist, port: PORT\n }, done);\n}", "async serve(staticDir, baseUrl) {\n let http = require('http');\n\n let serve = require('serve-handler');\n\n return new Promise(resolve => {\n this.server = http.createServer((req, res) => {\n serve(req, res, {\n public: staticDir\n });\n }).listen(() => {\n let {\n port\n } = this.server.address();\n resolve(`http://localhost:${port}`);\n });\n });\n }", "function createSyncServer() {\n\t/**\n\t * Middleware for serving the 'index.html' file.\n\t * Based on https://github.com/BrowserSync/browser-sync/issues/204#issuecomment-51469022\n\t */\n\tfunction serveDefault(req, res, next) {\n\t\tvar file = url.parse(req.url);\n\t\t file = file.href.split(file.search).join('');\n\n\t\tvar exists = fs.existsSync(path.join(__dirname, file));\n\n\t\tif(!exists && file.indexOf('browser-sync-client') < 0) {\n\t\t\treq.url = '/index.html';\n\t\t}\n\t\treturn next();\n\t}\n\treturn sync({ server: { baseDir: '.', middleware: serveDefault } });\n}", "function serve() {\n var liveServer = require(\"live-server\");\n\n var params = {\n port: 8181, // Set the server port. Defaults to 8080.\n host: \"0.0.0.0\", // Set the address to bind to. Defaults to 0.0.0.0 or process.env.IP.\n open: false, // When false, it won't load your browser by default.\n watch: ['src','*.md'], // comma-separated string for paths to watch\n// ignore: '', // comma-separated string for paths to ignore\n file: \"index.html\", // When set, serve this file (server root relative) for every 404 (useful for single-page applications)\n wait: 1000, // Waits for all changes, before reloading. Defaults to 0 sec.\n logLevel: 2 // 0 = errors only, 1 = some, 2 = lots\n };\n liveServer.start(params);\n\n return watch(['./src/*.js','./src/*.css'], function() {\n css();\n js();\n });\n}", "function start_server () {\n var server = new msp.Proxy();\n server.listen(8050);\n log('Proxying from http://:8050');\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT\n });\n done();\n }", "function main() {\n let cfg = loadConfig()\n startHttpServer(cfg)\n}", "function httpserv(options) {\n process.on('message', handleMessage);\n var server = require('http').createServer(httpHandler);\n server.listen(options.port, function() { console.info(\"httpserv is listening on \"+getIPAddresses().join(\";\")+\" port \"+options.port); });\n require('./wsserv').wsserv(server);\n const appmain = require('./appmain.js').init(options);\n getApp = appmain.getApp;\n runApp = appmain.runApp;\n changedApps = appmain.changedApps;\n listAppsApks = appmain.listAppsApks;\n}", "static get dedicatedServer() {}", "function serverController(hostname) {\n const server = http.createServer((request, response) => {\n \n // Creates space around .html requests so that they stand out more in the console\n if (path.extname(request.url) == '.html' || request.url == '/') {\n console.log(`\\nPage Requested: ${request.url}\\n`);\n } else {\n console.log(`Request came: ${request.url}`);\n }\n \n // Sends the requested resources to the response stream\n if (request.url == '/') {\n var file = path.join(__dirname, landing); // delivers index.html by default\n sendFile(file, landing, 'text/html', response);\n } else {\n var file = path.join(__dirname, request.url); // delivers requested resource\n sendFile(file, request.url, getContentType(request.url), response);\n };\n });\n \n // Gives server a port to listen to and gives an IP address to find it\n server.listen(port, hostname, () => {\n console.log(`Server running at ${hostname}:${port}\\n`);\n });\n}", "function server() {\n let config = {\n browser: {\n server: {\n baseDir: './'\n },\n logPrefix: 'Modernización',\n host: 'localhost',\n port: 9000,\n online: true,\n browser: [\n 'chrome'\n ],\n logLevel: 'info',\n ui: false\n }\n };\n\n return browser.init(config.browser);\n}", "function startServer() {\n\tserver = require(__dirname + '/NetworkServer');\n\tserver.startServer();\n}", "function server(options) {\n\toptions = options || {};\n\tconst port = options.port || 0;\n\tconst listen = options.listen || '::1';\n\tconst handlers = options.handlers || [static_handler.file_handler('/', ROOT_DIR)];\n\n\tconst serv = http.createServer((req, res) => {\n\t\treq.socket.setNoDelay(true);\n\n\t\tconst pathname = url.parse(req.url).pathname;\n\n\t\tfor (const h of handlers) {\n\t\t\tif (h(req, res, pathname) !== 'unhandled') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t});\n\tserv.listen(port, listen, () => {\n\t\tconst domain = ((listen === '::') || (listen == '0.0.0.0')) ? 'localhost' : (\n\t\t\tlisten.includes(':') ? `[${listen}]` : listen\n\t\t);\n\t\tif (options.start_callback) {\n\t\t\toptions.start_callback(null, 'http://' + domain + ':' + serv.address().port + '/');\n\t\t}\n\t});\n\tserv.on('error', (err) => {\n\t\tthrow err;\n\t});\n\treturn serv;\n}", "function startServer(){\n server.start((err) => {\n if (err) {\n throw err;\n }\n console.log(`Server running at: ${server.info.uri}`);\n //pino.info('Server running at 8080')\n });\n}", "create () {\n this.server = https.createServer(\n Object.assign({\n IncomingMessage: CherryIncomingMessage,\n ServerResponse: CherryServerResponse\n }, this.options.httpsOptions),\n (req, res) => {\n this.bootstrap(req, res)\n }\n )\n }", "function startHttpServer(app) {\n var httpServer;\n\n try {\n httpServer = http.createServer(app);\n httpServer.on('error', httpError);\n httpServer.listen(config.httpPort);\n\n // if the app is being served through nginx, show the nginx information\n // instead of the HTTP port for the app\n if (process.env.NGINX_PORT) {\n console.log('Server started: https://localhost:' + process.env.NGINX_PORT);\n } else {\n console.log('Server started on HTTP: ' + config.httpPort);\n }\n\n } catch (e) {\n console.error('Error while starting HTTP server on ' + config.httpPort + ':');\n console.error(e);\n throw e;\n }\n}", "function initWebServer(port, pagespath) {\n return http.createServer((req, res) => {\n // Parsing the url\n var uri = url.parse(req.url, true);\n var reqpath = uri.pathname;\n \n // Redirecting to index.html if no specific file is requested\n if (!reqpath.includes('.'))\n reqpath += (reqpath.endsWith('/') ? '' : '/') + 'index.html';\n\n // User recognition\n var operating = null;\n var cookies = httpUtils.parseCookies(req);\n if (cookies.auth) {\n for (var c in carts) {\n if (carts[c].authtoken == cookies.auth)\n operating = carts[c];\n }\n }\n\n // Do token handling\n var cookiesout = '';\n if (reqpath == '/index.html'){\n if (uri.query.token !== undefined){\n cookiesout += `auth=${uri.query.token};`\n\n for (var c in carts) {\n if (carts[c].authtoken == uri.query.token) \n operating = carts[c];\n }\n }\n }\n\n // Redirects to about page\n //if (reqpath == '/index.html') httpUtils.redirect(res, '/about');\n\n // Redirects if a not authenticated user tries to use auth-only pages\n /*else*/ if (!operating && !(reqpath.includes('/noauth') || reqpath.includes('/done') || reqpath.includes('/noauth') || reqpath.includes('/about'))) httpUtils.redirect(res, '/noauth');\n \n // Reading the requested file or - if it doesnot exist - 404.html\n else {\n var path = pagespath + reqpath;\n if (!fs.existsSync(path))\n path = `${pagespath}/404.html`;\n var content = fs.readFileSync(path, 'utf8');\n \n // Send out response\n var type = mime.lookup(path);\n res.writeHead(200, {\n 'Set-Cookie': cookiesout,\n 'Content-Type': type\n });\n res.end(content);\n }\n }).listen(port);\n}", "function run(httpServer) {\n httpServer.listen();\n}", "function server( done ) {\n browser.init({\n server: 'build'\n });\n done();\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT\n });\n done();\n}", "function showHome(request){\n request.serveFile(\"index.html\"); \n}", "async start () {\n assert(!this._server, 'http server is already started');\n this._app = express();\n this._app.use('/healthcheck', healthcheck(this._config));\n this._app.use('/', video(this._counterService, this._config));\n\n this._server = http.createServer(this._app);\n this._statsServer = new StatsServer(this._server, this._communicationMesh);\n await this._statsServer.start();\n this._logger.info({ port: this._config.get('LISTEN_PORT') }, 'Goint to listen http:// and ws:// at port');\n this._server.listen(this._config.get('LISTEN_PORT'));\n }", "startServer() {\n const server = fractal.web.server();\n\n server.on('error', err => logger.error(err.message));\n\n return server.start().then(() => {\n // Code to make a nicer console output.\n const header = 'Fractal Web UI server is running!';\n const footer = fractal.cli.isInteractive() ? 'Use the \\'stop\\' command to stop the server.' : 'Use ^C to stop the server.';\n const serverUrl = server.urls.server;\n const format = str => logger.theme.format(str, 'success', true);\n let body = '';\n\n if (!server.isSynced) {\n body += `Local URL: ${format(serverUrl)}`;\n } else {\n const syncUrls = server.urls.sync;\n body += `Local URL: ${format(syncUrls.local)}`;\n body += `\\nNetwork URL: ${format(syncUrls.external)}`;\n body += `\\nBrowserSync UI: ${format(syncUrls.ui)}`;\n }\n\n return logger.box(header, body, footer).persist();\n });\n }", "function httpify () {\n var port = getPort();\n return function() {\n var vows = this;\n var cwd = process.cwd().split(\"/\");\n if (\n \"test\" != cwd[cwd.length - 1]\n ) cwd.push(\"test\");\n // the config.path is set to the test dir\n // everything outside shouldn't be served\n // (cli.js sets config.path to your cwd)\n server.serve(port, cwd.join(\"/\"), function (err) {\n vows.callback(err, port);\n });\n };\n}", "async function startStaticServer() {\n\tconst app = express();\n\tapp.use(bodyParser.json());\n\tapp.use(cors());\n\tapp.use(`/${config.staticHtmlUrl}`, express.static(config.staticHtmlPath), serveIndex(config.staticHtmlPath, {\n\t\ticons: true,\n\t\thidden: true,\n\t\tstylesheet: path.resolve(__dirname, './directory.css'),\n\t}));\n\tapp.listen(config.staticHtmlPort, () => {\n\t\tconsole.log(`Vela static files server serving files in ${config.staticHtmlPath} at http://localhost:${config.staticHtmlPort}/${config.staticHtmlUrl}`);\n\t});\n}", "function createServer (baseDir) {\n\n if (PROJECT_CONFIG.LANGUAGES.length === 0) {\n\n return alertHandler({\n type: 'error',\n message: `Task can not be complited.\nRemember to set up your LANGUAGES in ${PROJECT_CONFIG.CONFIG_FILE} file.`\n });\n\n }\n\n\n // Init EXPRESS APP ---> https://expressjs.com/en/4x/api.html\n const app = express();\n\n\n // Enables all Cross-Origin Resource Sharing (CORS) requests, more info about CORS ---> https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS\n app.use((req, res, next) => {\n res.header('Access-Control-Allow-Origin', '*');\n\n next();\n });\n\n\n // Serves static files from the directory, which is defined in a variable baseDir\n app.use('/', express.static(`${__dirname}/${baseDir}`));\n // Serves static files: Bower components & Angular material\n app.use('/bower_components', express.static(`${__dirname}/bower_components`));\n app.use('/angular-material', express.static(`${__dirname}/angular-material`));\n\n\n // Handles all possible routes to send the appropriate HTML file\n app.get(['/', '/:lang', '/:lang/*', '*'], (req, res, next) => {\n\n let langValue = PROJECT_CONFIG.LANGUAGES.includes(req.params.lang) ? req.params.lang : PROJECT_CONFIG.LANGUAGES[0];\n\n\n if (/^\\/{3}.*$/.test(req.url)) {\n return res.redirect(301, '/');\n }\n\n return res.status(200).type('html').sendFile(`${__dirname}/${baseDir}/index-${langValue}.html`, (err) => {\n if (err) {\n next(err);\n }\n });\n\n });\n\n\n // Handles HTTP errors\n app.use((err, req, res, next) => {\n\n alertHandler({\n type: 'error',\n message: err\n });\n\n alertHandler({\n type: 'error',\n message: err.stack\n });\n\n\n let statusCode = err.statusCode || 500;\n\n\n return res.status(statusCode).type('json').send( {message: err.message, statusCode: statusCode} );\n\n });\n\n\n // Init BROWSER SYNC ---> https://www.browsersync.io/docs\n browserSync.init({\n proxy: {\n target: PROJECT_CONFIG.BROWSER_SYNC.TARGET\n },\n port: PROJECT_CONFIG.BROWSER_SYNC.PORT,\n middleware: [app],\n logPrefix: PROJECT_CONFIG.BROWSER_SYNC.LOG_PREFIX,\n logConnections: PROJECT_CONFIG.BROWSER_SYNC.LOG_CONNECTIONS\n });\n\n}", "function startServer(port, cb) { \n server = http.createServer(app);\n server.listen(port, function (err) {\n console.log('Listening on ' + port);\n if (cb !== undefined) { cb(err); }\n });\n}", "function startListen() {\r\n if (!_startWebServer)\r\n return;\r\n\r\n try {\r\n if (settingsHelper.settings.port != undefined)\r\n port = settingsHelper.settings.port;\r\n\r\n self.onLog(\"Listening to port: \" + settingsHelper.settings.port);\r\n self.onLog();\r\n\r\n server = http.createServer(app);\r\n\r\n // parse application/x-www-form-urlencoded\r\n app.use(bodyParser.urlencoded({ extended: false }));\r\n\r\n app.use(function (req, res) {\r\n res.header('Content-Type', 'text/html');\r\n var response = '<style>body {font-family: \"Helvetica Neue\",Helvetica,Arial,sans-serif; background: rgb(52, 73, 94); color: white;}</style>';\r\n response += '<h1><img src=\"https://microservicebus.com/Images/Logotypes/Logo6.svg\" style=\"height:75px\"/> Welcome to the ' + settingsHelper.settings.nodeName + ' node</h1><h2 style=\"margin-left: 80px\">API List</h2>';\r\n\r\n app._router.stack.forEach(function (endpoint) {\r\n if (endpoint.route != undefined) {\r\n if (endpoint.route.methods.get != undefined && endpoint.route.methods.get == true)\r\n response += '<div style=\"margin-left: 80px\"><b>GET</b> ' + endpoint.route.path + \"</div>\";\r\n if (endpoint.route.methods.delete != undefined && endpoint.route.methods.delete == true)\r\n response += '<div style=\"margin-left: 80px\"><b>DELETE</b> ' + endpoint.route.path + \"</div>\";\r\n if (endpoint.route.methods.post != undefined && endpoint.route.methods.post == true)\r\n response += '<div style=\"margin-left: 80px\"><b>POST</b> ' + endpoint.route.path + \"</div>\";\r\n if (endpoint.route.methods.put != undefined && endpoint.route.methods.put == true)\r\n response += '<div style=\"margin-left: 80px\"><b>PUT</b> ' + endpoint.route.path + \"</div>\";\r\n }\r\n });\r\n\r\n res.send(response);\r\n });\r\n\r\n app.use('/', express.static(__dirname + '/html'));\r\n\r\n self.onLog(\"REST endpoints:\".green);\r\n app._router.stack.forEach(function (endpoint) {\r\n if (endpoint.route != undefined) {\r\n if (endpoint.route.methods.get != undefined && endpoint.route.methods.get == true)\r\n self.onLog(\"GET: \".yellow + endpoint.route.path);\r\n if (endpoint.route.methods.delete != undefined && endpoint.route.methods.delete == true)\r\n self.onLog(\"DELETE: \".yellow + endpoint.route.path);\r\n if (endpoint.route.methods.post != undefined && endpoint.route.methods.post == true)\r\n self.onLog(\"POST: \".yellow + endpoint.route.path);\r\n if (endpoint.route.methods.put != undefined && endpoint.route.methods.put == true)\r\n self.onLog(\"PUT: \".yellow + endpoint.route.path);\r\n }\r\n });\r\n\r\n server = http.createServer(app).listen(port, function (err) {\r\n self.onLog(\"Server started on port: \".green + port);\r\n self.onLog();\r\n });\r\n }\r\n catch (e) {\r\n self.onLog('Unable to start listening on port ' + port);\r\n }\r\n }", "_webSetup() {\n if ( this.#isConfigured !== true ) {\n this.log.warn('[uibuilder:web.js:_webSetup] Cannot run. Setup has not been called.')\n return\n }\n\n // Reference static vars\n const uib = this.uib\n const RED = this.RED\n const log = this.log\n\n log.trace('[uibuilder:web:_webSetup] Configuring ExpressJS')\n\n /** We need an http server to serve the page and vendor packages. The app is used to serve up the Socket.IO client.\n * NB: uib.nodeRoot is the root URL path for http-in/out and uibuilder nodes\n * Always set to empty string if a dedicated ExpressJS app is required\n * Otherwise it is set to RED.settings.httpNodeRoot\n */\n\n if ( uib.customServer.isCustom === true ) {\n\n // For custom server only, Try to find the external LAN IP address of the server\n require('dns').lookup(/** @type {string} */ (uib.customServer.hostName), 4, function (err, add) {\n if ( err ) {\n log.error('[uibuilder:web.js:_websetup] DNS lookup failed.', err)\n }\n\n uib.customServer.host = add\n\n log.trace(`[uibuilder:web:_webSetup] Using custom ExpressJS server at ${uib.customServer.type}://${add}:${uib.customServer.port}`)\n })\n\n // Port has been specified & is different to NR's port so create a new instance of express & app\n const express = require('express')\n this.app = express()\n\n // Use the Express server options from settings.js uibuilder.serverOptions (if any)\n Object.keys(uib.customServer.serverOptions).forEach( key => {\n this.app.set(key, uib.customServer.serverOptions[key] )\n })\n\n /** Socket.io needs an http(s) server rather than an ExpressJS app\n * As we want Socket.io on the same port, we have to create our own server\n * Use https if NR itself is doing so, use same certs as NR\n * TODO: Switch from https to http/2?\n */\n if ( uib.customServer.type === 'https' ) {\n // Allow https settings separate from RED.settings.https\n if ( RED.settings.uibuilder && RED.settings.uibuilder.https ) {\n try {\n this.server = require('https').createServer(RED.settings.uibuilder.https, this.app)\n } catch (e) {\n // Throw error - we don't want to continue if https is needed but we can't create the server\n throw new Error(`[uibuilder:web:webSetup:CreateServer]\\n\\t Cannot create uibuilder custom ExpressJS server.\\n\\t Check uibuilder.https in settings.js,\\n\\t make sure the key and cert files exist and are accessible.\\n\\t ${e.message}\\n \\n `)\n }\n } else {\n if ( RED.settings.https !== undefined ) { // eslint-disable-line no-lonely-if\n this.server = require('https').createServer(RED.settings.https, this.app)\n } else {\n // Throw error - we don't want to continue if https is needed but we can't create the server\n throw new Error('[uibuilder:web:webSetup:CreateServer]\\n\\t Cannot create uibuilder custom ExpressJS server using NR https settings.\\n\\t Check https property in settings.js,\\n\\t make sure the key and cert files exist and are accessible.\\n \\n ')\n }\n }\n } else {\n this.server = require('http').createServer(this.app)\n }\n\n // Connect the server to the requested port, domain is the same as Node-RED\n this.server.on('error', (err) => {\n if (err.code === 'EADDRINUSE') {\n this.server.close()\n log.error(\n `[uibuilder:web:webSetup:CreateServer] ERROR: Port ${uib.customServer.port} is already in use. Cannot create uibuilder server, use a different port number and restart Node-RED`\n )\n } else {\n log.error(\n `[uibuilder:web:webSetup:CreateServer] ERROR: ExpressJS error. Cannot create uibuilder server. ${err.message}`,\n err\n )\n }\n })\n\n this.server.listen(uib.customServer.port, () => {\n // uib.customServer.host = this.server.address().address // not very useful. Typically returns `::`\n })\n\n } else {\n log.trace(`[uibuilder:web:_webSetup] Using Node-RED ExpressJS server at ${RED.settings.https ? 'https' : 'http'}://${RED.settings.uiHost}:${RED.settings.uiPort}${uib.nodeRoot === '' ? '/' : uib.nodeRoot}`)\n\n // Port not specified (default) so reuse Node-RED's ExpressJS server and app\n // @ts-expect-error\n this.app = /** @type {express.Application} */ (RED.httpNode) // || RED.httpAdmin\n this.server = RED.server\n }\n\n if (uib.rootFolder === null) throw new Error('uib.rootFolder is null')\n // Set views folder to uibRoot (but only if not overridden in settings)\n if ( !uib.customServer.serverOptions.views ) {\n this.app.set('views', path.join(uib.rootFolder, 'views') )\n log.trace(`[uibuilder:web:_webSetup] ExpressJS Views folder set to '${path.join(uib.rootFolder, 'views')}'`)\n } else {\n log.trace(`[uibuilder:web:_webSetup] ExpressJS Views folder is '${uib.customServer.serverOptions.views}'`)\n }\n\n // Note: Keep the router vars separate so that they can be used for reporting\n\n this.app.use(express.json())\n this.app.use(express.urlencoded({ extended: true }))\n\n // Create Express Router to handle routes on `<httpNodeRoot>/uibuilder/`\n this.uibRouter = express.Router({ mergeParams: true }) // eslint-disable-line new-cap\n\n // Add auto-generated index page to uibRouter showing all uibuilder user app endpoints at `../uibuilder/apps`\n this._serveUserUibIndex()\n\n // Add masterStatic to ../uibuilder - serves up front-end/... uib-styles.css, uibuilderfe...\n if ( this.masterStatic !== undefined ) {\n this.uibRouter.use( express.static( this.masterStatic, uib.staticOpts ) )\n log.trace(`[uibuilder:web:_webSetup] Master Static Folder '${this.masterStatic}' added to uib router ('_httpNodeRoot_/uibuilder/')`)\n }\n // Add vendor paths for installed front-end libraries - from `<uibRoot>/package.json`\n this.serveVendorPackages()\n // Add socket.io client (../uibuilder/vendor/socket.io/socket.io.js)\n this.serveVendorSocketIo()\n // Serve the ping endpoint (../uibuilder/ping)\n this.servePing()\n\n // TODO: This needs some tweaking to allow the cache settings to change - currently you'd have to restart node-red.\n if (uib.commonFolder === null) throw new Error('uib.commonFolder is null')\n // Serve up the master common folder (e.g. <httpNodeRoute>/uibuilder/common/)\n this.uibRouter.use( tilib.urlJoin(uib.commonFolderName), express.static( uib.commonFolder, uib.staticOpts ) )\n this.routers.user.push( { name: 'Central Common Resources', path: `${this.uib.httpRoot}/uibuilder/${uib.commonFolderName}/*`, desc: 'Common resource library', type: 'Static', folder: uib.commonFolder } )\n\n // Assign the uibRouter to the ../uibuilder url path\n this.app.use( tilib.urlJoin(uib.moduleName), this.uibRouter )\n\n }", "_createServer () {\n if (this._readyState !== Server.INIT) {\n throw new Error('incorrect ready state')\n } else if (this._server !== null) {\n throw new Error('server not null')\n }\n\n this._server = this._options.secure\n ? https.createServer(this._options)\n : http.createServer()\n\n debug('server created')\n this._attachListeners()\n }", "function server () {\n return http.createServer(function (req, res) {\n var pathname = url.parse(req.url).pathname\n pathname = pathname === '/' ? '/index.html' : pathname\n const ext = path.extname(pathname)\n\n console.log(JSON.stringify({url: pathname, type: 'static'}))\n\n if (ext === '.css') res.setHeader('Content-Type', 'text/css')\n if (ext === '.js') res.setHeader('Content-Type', 'application/javascript')\n\n router.match(pathname, function (err, body) {\n if (err) {\n err = (typeof err === 'object') ? err.toString() : err\n const ndj = JSON.stringify({level: 'error', url: pathname, message: err})\n console.log(ndj)\n }\n if (isStream(body)) return body.pipe(res)\n res.end(body)\n })\n })\n}", "function start() {\n if (path.startsWith(\"http\")) {\n webCat(path);\n } else {\n cat(path);\n }\n}", "function startPlaybackServer() {\n \n console.log(\"Starting web server\");\n\n //start the web server listening on port 3000\n server.listen(3000);\n}", "static set dedicatedServer(value) {}", "startFractalServer () {\n const server = fractal.web.server(this.generateServerSettings('fractal'))\n return server.start().then(() => {\n console.log(`Fractal server is now running at:\\nLocal: ${server.url}\\nExternal: ${server.urls.sync.external}\\nBS UI: ${server.urls.sync.ui}`)\n })\n }", "function prepareRungServer() {\n const server = http.createServer((req, res) => {\n if (req.method !== 'POST') {\n res.writeHead(404);\n return res.end();\n }\n\n const routes = {\n '/login': ~res.writeHead(200),\n '/metaExtensions/drafts': ~res.writeHead(201)\n };\n\n routes[req.url]();\n return res.end();\n });\n\n return new Promise(server.listen(FAKE_SERVER_PORT, _));\n}", "function startExpress() {\n var express = require('express');\n var app = express();\n app.use(express.static(__dirname));\n app.listen(4000);\n}", "function start(port) {\n users_info_data.openUsersInfoDatabase();\n let service = HTTP.createServer(handle);\n try { service.listen(port, 'localhost'); }\n catch (err) { throw err; }\n console.log(\"Visit localhost:\" + port);\n}", "function serve(options) {\n // Set process.env.NODE_ENV to development\n process.env.NODE_ENV = 'development'; // Set process.env.BABEL_ENV to development\n\n process.env.BABEL_ENV = 'development'; // Get project and server config JSONs.\n\n const cwd = (0, _utils.resolveCWD)(options);\n\n const relCwd = _path.default.relative(process.cwd(), cwd); // For spinner\n\n\n const spinner = (0, _ora.default)({\n text: `initiating ${_utils.wpackLogoSmall} development server`,\n spinner: 'dots',\n color: 'yellow'\n });\n console.log(`${_logSymbols.default.success} ${_chalk.default.bold('startup')}: ${_chalk.default.cyan(relCwd === '' ? '.' : relCwd)}`);\n\n try {\n const {\n projectConfig,\n serverConfig,\n projectConfigPath,\n serverConfigPath\n } = (0, _getProjectAndServerConfig.getProjectAndServerConfig)(cwd, options);\n console.log(`${_logSymbols.default.success} ${_chalk.default.bold('project config')}: ${_chalk.default.cyan(_path.default.relative(cwd, projectConfigPath))}`);\n console.log(`${_logSymbols.default.success} ${_chalk.default.bold('server config')}: ${_chalk.default.cyan(_path.default.relative(cwd, serverConfigPath))}`);\n spinner.start();\n let lastWebpackStat = null; // Start the webpack/browserSync server\n\n const server = new _Server.Server(projectConfig, serverConfig, cwd, {\n // tslint:disable:no-empty\n invalid: () => {\n (0, _utils.printCompilingMessage)();\n },\n done: () => {\n (0, _utils.printSuccessfullyCompiledMessage)();\n },\n\n onWatching() {\n (0, _utils.printWatchingMessage)();\n },\n\n onError: msg => {\n (0, _utils.printErrorHeading)('ERROR');\n msg.errors.forEach(e => {\n console.log(e);\n console.log('');\n });\n (0, _utils.printFailedCompileMEssage)();\n },\n onWarn: msg => {\n (0, _utils.printWarningHeading)('WARNING');\n msg.warnings.forEach(e => {\n console.log(e);\n console.log('');\n });\n (0, _utils.printCompiledWithWarnMessage)();\n },\n onEmit: stats => {\n (0, _utils.printCompileTimeMessages)(stats, lastWebpackStat);\n lastWebpackStat = stats.toJson(_utils.webpackStatToJsonOptions);\n },\n firstCompile: stats => {\n spinner.stop();\n const raw = stats.toJson('verbose');\n const messages = (0, _formatWebpackMessages.default)(raw);\n console.log('');\n (0, _utils.serverInfo)(server.getServerUrl(), server.getBsUiUrl());\n console.log('');\n\n if (stats.hasErrors()) {\n (0, _utils.printErrorHeading)('ERROR');\n messages.errors.forEach(e => {\n console.log(e);\n console.log('');\n });\n (0, _utils.printFailedCompileMEssage)();\n } else if (stats.hasWarnings()) {\n (0, _utils.printWarningHeading)('WARNING');\n messages.warnings.forEach(e => {\n console.log(e);\n console.log('');\n });\n (0, _utils.printCompiledWithWarnMessage)();\n } else {\n (0, _utils.printSuccessfullyCompiledMessage)();\n }\n\n (0, _utils.printCompileTimeMessages)(stats, lastWebpackStat);\n lastWebpackStat = stats.toJson(_utils.webpackStatToJsonOptions);\n },\n\n onBsChange(file) {\n (0, _utils.printGeneralInfoMessage)(`changed: ${_chalk.default.bold(file)}`);\n (0, _utils.printGeneralInfoMessage)('reloading browser');\n },\n\n onTcStart() {\n (0, _utils.printGeneralInfoMessage)('waiting for typecheck results...');\n },\n\n onTcEnd(messages) {\n if (messages.errors.length || messages.warnings.length) {\n if (messages.errors.length) {\n (0, _utils.printErrorHeading)('TS ERROR');\n messages.errors.forEach(e => {\n console.log(e);\n console.log('');\n });\n }\n\n if (messages.warnings.length) {\n (0, _utils.printWarningHeading)('TS WARNING');\n messages.warnings.forEach(e => {\n console.log(e);\n console.log('');\n });\n }\n } else {\n (0, _utils.printGeneralInfoMessage)('no typecheck errors', _logSymbols.default.success);\n }\n }\n\n });\n server.serve();\n\n const stopServer = () => {\n console.log((0, _utils.addTimeStampToLog)(`${_logSymbols.default.warning} shutting down development server`));\n server.stop();\n console.log('');\n (0, _utils.endServeInfo)();\n console.log('');\n process.exit(0);\n }; // Listen for `r`\n\n\n if (process.stdin.setRawMode) {\n process.stdin.setRawMode(true);\n const {\n stdin\n } = process;\n stdin.setEncoding('utf8');\n stdin.on('data', key => {\n // ctrl-c ( end of text )\n // or if pressing q, then stop\n // then stop server\n if (key === '\\u0003' || key === 'q') {\n stopServer();\n } // If pressing r, then just refresh\n\n\n if (key.indexOf('r') === 0) {\n (0, _utils.printCompilingMessage)();\n server.refresh();\n }\n });\n } else {\n // Listen for SIGINT and quit properly\n process.on('SIGINT', () => {\n stopServer();\n });\n }\n } catch (e) {\n spinner.stop();\n (0, _utils.prettyPrintError)(e, 'could not start server.');\n process.exit(1);\n }\n}", "function startServer() {\r\n // Start listening on port 3000\r\n httpServer.listen(Constants.PORT, function () {\r\n console.log('listening on *: ', Constants.PORT);\r\n });\r\n\r\n // Start serving the game\r\n let server = new GameServer(io);\r\n server.init();\r\n}", "async registerHttpServer() {\n this.httpServer = new HttpServer(this.app, this.port);\n this.httpServer.on('error', (err) => {\n this.emit('error', err);\n });\n this.httpServer.on('info', (msg) => {\n this.emit('info', msg);\n });\n\n await this.httpServer.init();\n }", "function serve() {\n browsersync.init({\n server: 'src',\n notify: false,\n open: true,\n cors: true,\n online: true\n })\n}", "function start_server(){\n let options = {}\n\n if (config.https.enabled) {\n options = {\n key: fs.readFileSync(config.https.key_file).toString(),\n cert: fs.readFileSync(config.https.cert_file).toString()\n };\n if (config.https.ca_certs) {\n options.ca = [];\n for (const ca in config.https.ca_certs) {\n options.ca.push(fs.readFileSync(config.https.ca_certs[ca]).toString());\n }\n }\n }\n\n const app = require('../app');\n server = http.createServer(app); \n\n /**\n * Get port from environment and store in Express.\n */\n server.listen(normalize_port(config.port));\n server.on('error', on_error);\n server.on('listening', on_listening);\n\n if (config.https.enabled) {\n const serverSecure = https.createServer(options, app);\n\n serverSecure.listen(config.https.port, function() {\n debug('Listening on port ' + serverSecure.address().port);\n });\n }\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT,\n browser: \"google chrome\",\n cors: true,\n notify: false,\n open: false\n });\n done();\n}", "function startServer()\n{\n\tconsole.log(\"Starting web controller...\");\n\n\tvar http = require('http');\n\thttp.createServer(function (req, res) {\n\n\t\t function respond() {\n\t\t\tres.writeHead(200, { \"Content-Type\": \"text/html\" });\n\t\t\tres.write(\"<!DOCTYPE html><html><body>\");\t\t\n\t\t\tres.write(\"<h1>Intel Galileo web controller</h1>\");\n\t\t\tres.write(\"</p><p>LED Status : \");\n\t\t\tres.write(ledstatus);\n\t\t\tres.write(\"</p><p>Actions</p>\");\n\t\t\tres.write(\"<p><input type='button' onclick='location.pathname = \\\"/ledOn\\\"' value='Turn LED on'/></p>\");\n\t\t\tres.write(\"<p><input type='button' onclick='location.pathname = \\\"/ledOff\\\"' value='Turn LED off'/></p>\");\n res.write(\"<p><input type='button' onclick='location.pathname = \\\"/hit\\\"' value='Hit'/></p>\");\n\t\t\tres.write(\"</body></html>\");\n\t \t\tres.end();\n\t\t}\n\n\t\tconsole.log(\"Request: \" + req.url);\n\t\tvar mraa = require('mraa');\n \n\t\tif(req.url === \"/ledOn\")\n\t\t\tturnOnLed();\n\t\telse if(req.url === \"/ledOff\")\n\t\t\tturnOffLed();\n else if(req.url === \"/hit\")\n\t\t\thit(mraa);\n\n\t\trespond();\n \t\t\n\t}).listen(1337);\n\tconsole.log('Server running at http://localhost:1337/');\n}", "function Server() {}", "function createServer(port) {\n let state = 10;\n\n const server = http.createServer(\n (request, response) => {\n switch (request.url) {\n case \"/state\":\n response.write(`{\"state\":${state}}`);\n break;\n case \"/add\":\n state++;\n response.write(`{\"state\":${state}}`);\n break;\n case \"/subtract\":\n state--;\n response.write(`{\"state\":${state}}`);\n break;\n case \"/reset\":\n state = 10;\n response.write(`{\"state\":${state}}`);\n break;\n\n default:\n response.statusCode = 404;\n response.write(\"Not Found Keko\");\n }\n\n response.end();\n }\n // TODO: Write your homework code here\n );\n\n return server;\n}", "function Server(config, http)\n{\n // Handlebars for the templating engine + layout style\n var viewPath = path.resolve(path.join(__dirname, './views'));\n http.engine('hbs.html', exphbs({\n defaultLayout: 'main',\n extname: '.hbs.html',\n layoutsDir: path.resolve(path.join(__dirname, './views/layouts'))\n }));\n http.set('views', viewPath);\n http.set('view engine', 'hbs.html');\n console.log('view path set to %s', viewPath);\n\n // Favvies\n http.use(favicons(path.join(__dirname, '../../public/icons')));\n\n // Server out static files\n http.use(express.static(config('http.webroot')));\n console.log('static server middleware added');\n}", "function startServer (config, onReady) {\n // Form a response\n var instance = {}\n var models = {}\n\n // Register models\n models.serverLog = serverLog\n models.serverDetails = serverDetails\n models.routes = routesModel\n models.plugins = pluginsModel\n models.preflight = preflightModel\n\n // Capture console\n serverLog.capture()\n\n // Create server\n var server = express()\n\n // Load default for conig\n config = defaultConfig.merge(config)\n config.server = server\n config.models = models\n\n // Register a static reference in serverDetails\n serverDetails.instance = instance\n\n // Report server name\n const title = config.productInformation.title\n console.log(NL + `[Starting ${title}]`, NL)\n global.startTime = Date.now()\n\n // Collapse variables onto instance\n instance.server = server\n instance.config = config\n instance.restart = function () {\n restartServer(instance)\n }\n instance.listen = function (onListening) {\n return heyListen(instance, onListening)\n }\n\n // Register Page controller\n const pageController = pageControllerFactory.configure(config)\n\n // Create API controller\n const apiController = apiControllerFactory.configure(config)\n\n // Create Plugin controller\n const pluginController = pluginControllerFactory.configure(config)\n\n instance.addContentPage = function (file) {\n var pathInfo = pathParse(file)\n // Remove the .fragment part:\n var route = '/docs/' + pathParse(pathInfo.name).name\n server.get(route, pageController.createRenderFunctionFor(file))\n return route\n }\n\n instance.registerPluginAPIs = apiController.registerPluginAPIs\n\n // Run first-time install checks, and then start server:\n var firstTimeInstall = require('./monitor/firstTimeInstall')\n firstTimeInstall.configure(config)\n firstTimeInstall.runChecks(function () {\n // Register local content routes\n authSetup(instance)\n .then(() => configureRoutes(instance))\n .then(() => createContentRoutes(server, pageController))\n .then(apiController.registerUserAPIs)\n .then(() => pluginController.loadBuiltInPlugins(instance))\n .then(() => pluginController.loadUserPlugins(instance))\n .then(onConfigured)\n .catch((ex) => console.log('[Product Monitor]', ex, ex.stack))\n })\n\n function onConfigured () {\n // Check for an onReady callback\n if (onReady && typeof onReady === 'function') {\n // Let the user call listen when ready\n console.log(`[${title}]`, 'ready to run! Call instance.listen() on your callback.')\n onReady(instance)\n } else {\n // Call listen ourselves\n instance.listen()\n }\n }\n\n return instance\n}", "start() {\n // listen to coming requests\n const port = Number(this.config.port || process.env.PORT || 0);\n const host = this.config.host || '127.0.0.1';\n this.server.listen(port, host, () => {\n this.app.locals.url = `${this.app.locals.schema}://${host}:${port}`;\n log.info(`Server started on ${this.app.locals.url}`);\n });\n }", "function startServer(port, cb) {\n server = http.createServer(app);\n server.listen(port, function (err) {\n console.log('Listening on ' + port);\n if (cb !== undefined) { cb(err); }\n });\n}", "function startExpress() {\n\n http.createServer(app).listen(app.get('port'), () => {\n console.log('Web server is running on ', app.get('port'));\n });\n}", "startServer() {\n let requestHandler = this.onRequest.bind(this);\n let port = this.port;\n http.createServer(requestHandler).listen(port);\n console.log(\"Server running at http://localhost:%d\", port);\n }", "function startStudioServer() {\n console.log('Starting Rekit Studio...');\n const app = express();\n const server = http.createServer(app);\n const root = path.join(__dirname, '../node_modules/rekit-studio/dist');\n app.use(rekitStudioMiddleWare()(server, app, { readonly: !!args.readonly }));\n app.use(express.static(root));\n app.use(fallback('index.html', { root }));\n\n // Other files should not happen, respond 404\n app.get('*', (req, res) => {\n console.log('Warning: unknown req: ', req.path);\n res.sendStatus(404);\n });\n\n const port = pkgJson.rekit.studioPort;\n server.listen(port, err => {\n if (err) {\n console.error(err);\n }\n\n console.log(`Studio server is listening at http://localhost:${port}/`);\n });\n}", "function startDevServer() {\n const WDS = require('webpack-dev-server');\n\n const wpConf = getWebpackConfig();\n\n // Need to update the app entry for webpack-dev-server. This is necessary for\n // the auto page refresh to happen. See: https://github.com/webpack/webpack-dev-server/blob/master/examples/node-api-simple/webpack.config.js\n const pathToWPDSClient = `${path.resolve(projectPath, 'node_modules/webpack-dev-server/client')}?http://localhost:8080`;\n\n Object.keys(wpConf.entry).forEach((key) => {\n if (Array.isArray(wpConf.entry[key])) {\n wpConf.entry[key] = wpConf.entry[key].map(val => path.resolve(projectPath, val));\n wpConf.entry[key].unshift(pathToWPDSClient);\n } else {\n wpConf.entry[key] = [\n pathToWPDSClient,\n path.resolve(projectPath, wpConf.entry[key]),\n ];\n }\n });\n\n devServer(createCompiler(wpConf), WDS);\n }", "function SuServer ( handle, servPort = 3004, hostName = '127.0.0.1' ) {\n const server = http.createServer ( handle );\n\n server.on ( 'error', ( e ) => {\n if ( e.code === 'EACCES' ) {\n console.log ( `No access to port: ${ servPort }` );\n }\n else {\n console.log ( { e } );\n }\n } );\n server.on ( 'clientError', ( err, socket ) => {\n socket.end ( 'HTTP/1.1 400 Bad Request\\r\\n\\r\\n' );\n } );\n\n server.listen ( servPort, hostName,\n () => console.log ( `Server running at http://${ hostName }:${ servPort }/` ) );\n}", "start(){\n this.applyMiddleWare();\n this.init();\n this.instance.listen(process.env.SERVER_PORT,()=>{\n console.log(`Server started on port ${process.env.SERVER_HOST}.`);\n console.log(`Navigate to http://${process.env.SERVER_HOST}:${process.env.SERVER_PORT}`);\n });\n }", "function createServer(serverName) {\n console.log(\"creating server\", serverName)\n var server = servers[serverName] = net.createServer(handleConnection)\n ports.service(serverName, listen)\n\n function handleConnection(connection) {\n console.log(\"got incoming connection\", connection)\n var stream = proxy.connect(serverName)\n , buffer = PauseStream().pause()\n , intermediate = through(stringer)\n\n connection.pipe(buffer)\n\n process.nextTick(pipe)\n\n function pipe() {\n buffer.pipe(intermediate)\n .pipe(stream).pipe(connection)\n\n buffer.resume()\n }\n }\n\n function listen(port, ready) {\n server.listen(port, ready)\n }\n }", "async function startServer() {\n await startDevServer({\n readCliArgs: false,\n readFileConfig: true\n });\n}", "function onListening() {\n // 忽略80端口\n const _port = (port != 80 ? ':' + port : '');\n const url = \"http://\" + hostname + _port + '/';\n debug(`${staticDir} server running at ${url}`);\n console.log(`${staticDir} server running at`,url);\n\n if(!argv.silent){\n openBrowserURL(url)\n }\n\n}", "function server(done) {\n browser.init({\n server: {\n baseDir: \"./dist/\"\n }\n });\n done();\n}" ]
[ "0.71234614", "0.70387495", "0.69957", "0.69330037", "0.6843447", "0.6836852", "0.6822083", "0.67772067", "0.67768407", "0.6728642", "0.6704851", "0.6613834", "0.65832794", "0.65628415", "0.6543841", "0.6536627", "0.6509445", "0.6456169", "0.64531773", "0.64123297", "0.6378953", "0.63471395", "0.6340984", "0.6288767", "0.62852865", "0.6282208", "0.62802404", "0.6274281", "0.6252091", "0.62340033", "0.6217395", "0.6200383", "0.61956245", "0.6190464", "0.61819845", "0.6168972", "0.61522716", "0.61238045", "0.6117483", "0.6092697", "0.60550475", "0.60347164", "0.60319614", "0.60248876", "0.60185033", "0.60173965", "0.60162246", "0.60094965", "0.5999267", "0.597635", "0.5973563", "0.5971535", "0.59530354", "0.59477746", "0.5942362", "0.5940837", "0.5927724", "0.5924506", "0.5921599", "0.5921085", "0.59191287", "0.5909431", "0.58994496", "0.589585", "0.5894507", "0.58901864", "0.58881027", "0.58855927", "0.58781105", "0.58773285", "0.5877301", "0.5876886", "0.58745486", "0.5871427", "0.5864253", "0.58616453", "0.5861199", "0.5848125", "0.58401465", "0.5837196", "0.58327264", "0.582303", "0.58191967", "0.58175415", "0.5809137", "0.57935953", "0.57893664", "0.5787308", "0.57852846", "0.5784726", "0.577915", "0.5773854", "0.5772962", "0.57705593", "0.57594186", "0.5747017", "0.57393074", "0.5736346", "0.57351303", "0.5731851" ]
0.63674766
21
============================================ draws height lines
function drawlines(){ stroke(0); for(var i = 0; i < 450; i = i + 45){ line(298, 135 + i, 380, 135 + i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawLines(height, id, color) {\n console.log(height, id);\n const canvas = this.refs.canvas;\n const line = canvas.getContext(\"2d\");\n \n\n line.beginPath();\n line.moveTo(20, height);\n line.lineTo(800, height);\n line.strokeStyle = color;\n line.stroke();\n }", "drawVerticalLine(color, height) {\n const width = 2;\n\n let draw = new DrawContext();\n draw.opaque = false;\n draw.respectScreenScale = true;\n draw.size = new Size(width, height);\n\n let barPath = new Path();\n // const barHeight = height;\n barPath.addRoundedRect(\n new Rect(0, 0, height, height),\n width / 2,\n width / 2\n );\n draw.addPath(barPath);\n draw.setFillColor(color);\n draw.fillPath();\n return draw.getImage();\n }", "function lineHeight(){\n\t\thistoryLine.each(function(index, element){\n\t\t\tif(index == $('.line').length - 1){\n\t\t\t\treturn false;\n\t\t\t} else{\n\t\t\t\tvar thisBlock = $(this).closest('.history-item').height()/2;\n\t\t\t\tvar nextBlock = $(this).closest('.history-item').next().height()/2;\n\t\t\t\tvar h = thisBlock+nextBlock;\n\t\t\t\t$(this).height(h);\n\t\t\t}\n\t\t\t\n\t\t})\n\t}", "function appSalesLines(element, height) {}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "function drawLines() {\n}", "function drawLines() {\n}", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t\t }", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t\t }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\r\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "draw(){\n\t\t\n\t\tlet height = this.height; //100\n\t\tlet width = this.width; //100\n\t\t\n\t\tlet ctx = this.ctx;\n\t\t//save last frame\n\t\tlet lastFrame = ctx.getImageData(0, 0, width, height);\n\t\t//clear canvas\n\t\tctx.clearRect(0, 0, width, height);\n\t\t//now, move frame 1 pixel to the left\n\t\tctx.putImageData(lastFrame, -1, 0);\n\t\t\n\t\t//then, draw the lines\n\t\tfor(var line of this.lines){\n\t\t\t\n\t\t\t\n\t\t\tlet range = line.maxValue - line.minValue;\n\t\t\tlet value = line.value;\n\t\t\t\n\t\t\t//Multiply line's value by the ratio between height and range, to get effective range the same but zero at the top\n\t\t\tvalue *= 1 * height / range;\n\t\t\t\n\t\t\t//Now, zero the value by adding the difference between minValue and 0\n\t\t\tvalue -= line.minValue * height / range;\n\t\t\t\n\t\t\t//Now, invert by subtracting from height\n\t\t\tvalue = height - value;\n\t\t\t\n\t\t\tctx.beginPath();\n\t\t\tctx.strokeStyle = line.color;\n\t\t\tctx.moveTo(width - 2, value);\n\t\t\tctx.lineTo(width, value);\n\t\t\tctx.stroke();\n\t\t}\n\t}", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\r\n}", "updateCanvasSize() {\n this.drawLines();\n }", "function ensureLineHeights(cm, lineView, rect) {\n\t\t var wrapping = cm.options.lineWrapping;\n\t\t var curWidth = wrapping && displayWidth(cm);\n\t\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t\t var heights = lineView.measure.heights = [];\n\t\t if (wrapping) {\n\t\t lineView.measure.width = curWidth;\n\t\t var rects = lineView.text.firstChild.getClientRects();\n\t\t for (var i = 0; i < rects.length - 1; i++) {\n\t\t var cur = rects[i], next = rects[i + 1];\n\t\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t\t { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n\t\t }\n\t\t }\n\t\t heights.push(rect.bottom - rect.top);\n\t\t }\n\t\t }", "function ensureLineHeights(cm, lineView, rect) {\n\t\t var wrapping = cm.options.lineWrapping;\n\t\t var curWidth = wrapping && displayWidth(cm);\n\t\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t\t var heights = lineView.measure.heights = [];\n\t\t if (wrapping) {\n\t\t lineView.measure.width = curWidth;\n\t\t var rects = lineView.text.firstChild.getClientRects();\n\t\t for (var i = 0; i < rects.length - 1; i++) {\n\t\t var cur = rects[i], next = rects[i + 1];\n\t\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t\t heights.push((cur.bottom + next.top) / 2 - rect.top);\n\t\t }\n\t\t }\n\t\t heights.push(rect.bottom - rect.top);\n\t\t }\n\t\t }", "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}", "function lines(){\n\tctx.beginPath();\n\tctx.moveTo(0,h/2);\n\tctx.lineTo(w,h/2);\n\tctx.lineWidth=\"3\";\n\tctx.strokeStyle = \"white\"\n\tctx.stroke();\n}", "drawLines() {\n stroke(this.lineColor);\n line(this.startLine, this.top, this.startLine, this.bottom); // start line\n line(this.endLine, this.top, this.endLine, this.bottom); // end line\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && cm.display.scroller.clientWidth;\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && cm.display.scroller.clientWidth;\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && cm.display.scroller.clientWidth;\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && cm.display.scroller.clientWidth;\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function ensureLineHeights(cm, lineView, rect) {\r\n var wrapping = cm.options.lineWrapping;\r\n var curWidth = wrapping && cm.display.scroller.clientWidth;\r\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\r\n var heights = lineView.measure.heights = [];\r\n if (wrapping) {\r\n lineView.measure.width = curWidth;\r\n var rects = lineView.text.firstChild.getClientRects();\r\n for (var i = 0; i < rects.length - 1; i++) {\r\n var cur = rects[i], next = rects[i + 1];\r\n if (Math.abs(cur.bottom - next.bottom) > 2)\r\n heights.push((cur.bottom + next.top) / 2 - rect.top);\r\n }\r\n }\r\n heights.push(rect.bottom - rect.top);\r\n }\r\n }", "function lines() {\n let gapSize = 40;\n let numColumns = displayWidth / gapSize;\n let numRows = displayHeight / gapSize;\n let x = 0;\n let y = 0;\n\n strokeWeight( 1 );\n stroke(\"#eaeaea\");\n\n for( let i = 0; i < numRows; i++ ) {\n y += gapSize;\n line( 0, y, displayWidth, y );\n }\n \n for( let i = 0; i < numColumns; i++){\n x += gapSize;\n line( x, 0, x, displayHeight );\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i],\n next = rects[i + 1];\n\n if (Math.abs(cur.bottom - next.bottom) > 2) {\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n }\n\n heights.push(rect.bottom - rect.top);\n }\n } // Find a line map (mapping character offsets to text nodes) and a", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function height_line(height_object, height_donor){\n height_donor.imagesLoaded(function(){\n height_object.height(height_donor.height());\n height_object.css({\n \"line-height\": height_donor.height() + \"px\"\n });\n });\n }", "function ensureLineHeights(cm, lineView, rect) {\r\n var wrapping = cm.options.lineWrapping;\r\n var curWidth = wrapping && displayWidth(cm);\r\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\r\n var heights = lineView.measure.heights = [];\r\n if (wrapping) {\r\n lineView.measure.width = curWidth;\r\n var rects = lineView.text.firstChild.getClientRects();\r\n for (var i = 0; i < rects.length - 1; i++) {\r\n var cur = rects[i], next = rects[i + 1];\r\n if (Math.abs(cur.bottom - next.bottom) > 2)\r\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\r\n }\r\n }\r\n heights.push(rect.bottom - rect.top);\r\n }\r\n}", "function brickLineBottom() {\n ctx.fillStyle = '#000';\n ctx.save();\n ctx.fillRect(0, canvas.height - 2, canvas.width, 2);\n ctx.fillRect(0, canvas.height - 8, canvas.width, 2);\n ctx.fillRect(0, canvas.height - 14, canvas.width, 2);\n ctx.fillRect(0, canvas.height - 20, canvas.width, 2);\n }", "function ensureLineHeights(cm, lineView, rect) {\n\t var wrapping = cm.options.lineWrapping;\n\t var curWidth = wrapping && displayWidth(cm);\n\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t var heights = lineView.measure.heights = [];\n\t if (wrapping) {\n\t lineView.measure.width = curWidth;\n\t var rects = lineView.text.firstChild.getClientRects();\n\t for (var i = 0; i < rects.length - 1; i++) {\n\t var cur = rects[i], next = rects[i + 1];\n\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t heights.push((cur.bottom + next.top) / 2 - rect.top);\n\t }\n\t }\n\t heights.push(rect.bottom - rect.top);\n\t }\n\t }", "function ensureLineHeights(cm, lineView, rect) {\n\t var wrapping = cm.options.lineWrapping;\n\t var curWidth = wrapping && displayWidth(cm);\n\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t var heights = lineView.measure.heights = [];\n\t if (wrapping) {\n\t lineView.measure.width = curWidth;\n\t var rects = lineView.text.firstChild.getClientRects();\n\t for (var i = 0; i < rects.length - 1; i++) {\n\t var cur = rects[i], next = rects[i + 1];\n\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t heights.push((cur.bottom + next.top) / 2 - rect.top);\n\t }\n\t }\n\t heights.push(rect.bottom - rect.top);\n\t }\n\t }", "function ensureLineHeights(cm, lineView, rect) {\n\t var wrapping = cm.options.lineWrapping;\n\t var curWidth = wrapping && displayWidth(cm);\n\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t var heights = lineView.measure.heights = [];\n\t if (wrapping) {\n\t lineView.measure.width = curWidth;\n\t var rects = lineView.text.firstChild.getClientRects();\n\t for (var i = 0; i < rects.length - 1; i++) {\n\t var cur = rects[i], next = rects[i + 1];\n\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t heights.push((cur.bottom + next.top) / 2 - rect.top);\n\t }\n\t }\n\t heights.push(rect.bottom - rect.top);\n\t }\n\t }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping\n var curWidth = wrapping && displayWidth(cm)\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = []\n if (wrapping) {\n lineView.measure.width = curWidth\n var rects = lineView.text.firstChild.getClientRects()\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1]\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top) }\n }\n }\n heights.push(rect.bottom - rect.top)\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping\n var curWidth = wrapping && displayWidth(cm)\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = []\n if (wrapping) {\n lineView.measure.width = curWidth\n var rects = lineView.text.firstChild.getClientRects()\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1]\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top) }\n }\n }\n heights.push(rect.bottom - rect.top)\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}" ]
[ "0.6964813", "0.6764295", "0.67598224", "0.6623591", "0.65741205", "0.6553168", "0.6553168", "0.6507657", "0.64997023", "0.64898807", "0.64898807", "0.64898807", "0.64898807", "0.64898807", "0.64898807", "0.64898807", "0.64800787", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.646441", "0.643776", "0.643776", "0.643776", "0.64345163", "0.64030546", "0.6379799", "0.63695896", "0.63659537", "0.6340748", "0.6340748", "0.63263226", "0.63238096", "0.6318784", "0.6318784", "0.6318784", "0.6318784", "0.6317973", "0.6317973", "0.6317973", "0.6317973", "0.6317973", "0.6317973", "0.6317973", "0.6317973", "0.6317973", "0.6317973", "0.6317973", "0.63157904", "0.62601376", "0.6258998", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62520635", "0.62380135", "0.62380135", "0.62380135", "0.62380135", "0.6236679", "0.62223", "0.62105143", "0.6209909", "0.6209909", "0.6209909", "0.61985445", "0.61985445", "0.6189121", "0.6189121", "0.6189121", "0.6189121", "0.6189121", "0.6189121", "0.6189121", "0.6189121" ]
0.0
-1
creates and moves the puck
function drawPuck(){ //color the puck stroke(136,137,138); fill(166,167,178) if(mouseX > 280 && mouseX < 280 + 105 && mouseY > 570 && mouseY < 570 + 50){ if(mouseIsPressed){ coverWin(); //recolor the puck stroke(136,137,138); fill(166,167,178) //move puck up until reaches bell if(num < 200) num += PI/5; else if(num < 360)num = num + PI/7; else num += PI/9; if(!(num > 450)){ ellipse(332, 561 - num, 15, 15); } else{ textSize(45); smooth(); fill(255); noStroke(); textFont('Palatino'); text('You win!', 14, 80); } } else{ num = 0; ellipse(332, 561, 15, 15); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_moveTo (ox, oy, px, py, stage, puck) {\n // be random\n var speed = stage.width / (50.0 + Math.floor(Math.random() * 20));\n\n var oldpx = px;\n var oldpy = py;\n\n // calculate deltas\n var dx = px - ox;\n var dy = py - oy;\n\n // calculate distance between puck and paddle position (we use Pythagorean theorem)\n var distance = Math.sqrt(dx * dx + dy * dy);\n\n // if total distance is greater than the distance, of which we can move in one step calculate new x and y coordinates somewhere between current puck and paddle position.\n if (distance > speed) {\n // x = current padle x position + equally part of speed on x axis\n px = ox + speed / distance * dx;\n py = oy + speed / distance * dy;\n }\n\n /*if(Math.pow(oldpx - px, 2) + Math.pow(oldpy - py, 2) < this.radius() + puck.getComponent(\"Ball\").radius()){\n px = ox;\n py = oy;\n }*/\n\n // move paddle to the new position\n this.setPlayerPosition(cc.v2(px, py));\n return true;\n }", "function Puck(position, board) {\n\t/// public variables\t\n\tthis.board = board;\n\t\n\tif (position) {\n\t\tthis.place(position);\n\t}\n}", "function createPuck(Paddle) {\n if (Paddle.x === 5) {\n alivePucks.push(new Puck(12, 3, 2, Paddle.x + Paddle.Pwidth / 2 + 30, Paddle.y + 40))\n } else if (Paddle.x === 563) {\n alivePucks.push(new Puck(12, -3, 2, Paddle.x - Paddle.Pwidth / 2 - 12, Paddle.y + 40))\n }\n}", "function makePoop() { \n poop.push(new Poop(snake.tail[snake.tail.length - 1].x,\n snake.tail[snake.tail.length - 1].y, rInt(50, 400)));\n }", "function evalPuck() {\n if (puck.y > paddle.y) {\n puck.isAlive = false;\n }\n if (puck.y > canvas.height + 200) {\n puck.y = bricks[0].y + bricks[0].height + 40;\n puck.x = canvas.width / 2;\n puck.velX *= -1;\n puck.isAlive = true;\n combo = 0;\n lives--;\n }\n }", "function resetPuck() {\n puckPosX = c.width / 2;\n puckPosY = c.height / 2;\n puckDirX = 0;\n puckDirY = 0;\n }", "move() { }", "move() { }", "move() {\n\n }", "move() {\n }", "newMove(data) {\n\t\tlet found = false;\n\n\t\tlet TLC = thing;\n\n\t\tfunction moveP(element, data) {\n\t\t\tif (data.xy == 'x') {\n\t\t\t\tif (data.PM == 'P') {\n\t\t\t\t\telement.pos.x++;\n\t\t\t\t} else if (data.PM == 'M') {\n\t\t\t\t\telement.pos.x--;\n\t\t\t\t}\n\t\t\t} else if (data.xy == 'y') {\n\t\t\t\tif (data.PM == 'P') {\n\t\t\t\t\telement.pos.y++;\n\t\t\t\t} else if (data.PM == 'M') {\n\t\t\t\t\telement.pos.y--;\n\t\t\t\t}\n\t\t\t} else if (data.xy == undefined) {\n\t\t\t\telement.pos.x = element.pos.x;\n\t\t\t\telement.pos.y = element.pos.y;\n\t\t\t}\n\t\t\t//console.log(element);\n\t\t}\n\n\t\t//checks playerList for the id of incoming player data\n\t\tplayerList.forEach(function(ele) {\n\t\t\tif (ele.id == data.id) {\n\t\t\t\tentities.forEach(function(element) {\n\t\t\t\t\tif (element.id == data.id) {\n\t\t\t\t\t\tmoveP(element, data);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tfound = true;\n\t\t\t\tmoveP(ele, data);\n\t\t\t\tele.direction = data.direction;\n\t\t\t}\n\t\t\tif (ele.id == undefined) {\n\t\t\t\tplayerList = ArrayRemove(playerList, ele);\n\t\t\t}\n\t\t});\n\n\t\t//if no player with the id is found then it creates one\n\t\tif (found == false) {\n\t\t\t//console.log(`socket ${data.id} not found`);\n\t\t\t//console.log(`adding ${data.id} to player list`);\n\t\t\tlet player1 = {\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x,\n\t\t\t\t\ty: TLC.pos.y + data.y,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t\tHP: 300,\n\t\t\t}\n\t\t\tlet player1BR = {\n\t\t\t\tname: 'BR',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x,\n\t\t\t\t\ty: TLC.pos.y + data.y,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player1BL = {\n\t\t\t\tname: 'BL',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x - 1,\n\t\t\t\t\ty: TLC.pos.y + data.y,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player1TR = {\n\t\t\t\tname: 'TR',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x,\n\t\t\t\t\ty: TLC.pos.y + data.y - 1,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player1TL = {\n\t\t\t\tname: 'TL',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x - 1,\n\t\t\t\t\ty: TLC.pos.y + data.y - 1,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tplayerList.push(player1);\n\t\t\tentities.push(player1BR);\n\t\t\tentities.push(player1BL);\n\t\t\tentities.push(player1TR);\n\t\t\tentities.push(player1TL);\n\t\t\t//console.log(playerList);\n\t\t}\n\t}", "move () {\n }", "placePiece() {\r\n this.createPiece();\r\n this.nextPieceF();\r\n // Add score for placing. 36 because why not\r\n this.score += 36;\r\n }", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "function move() {\n\t\tmovePiece(this);\n\t}", "function moveDucks() {\n\tfor (i=0; i < ducks.length; i++) {\n\t\tvar differenceX = ducks[i].targetX - ducks[i].posX;\n\t\tvar differenceY = ducks[i].targetY - ducks[i].posY;\n\n\t\tducks[i].posX = ducks[i].posX + differenceX/20;\n\t\tducks[i].posY = ducks[i].posY + differenceY/20;\n\t}\n}", "function repositionPaddle()\n {\n //paddle 1 movement\n $(\"#paddle\").css(\"top\", paddle.y);\n paddle.y += paddle.speedY;\n }", "createPiece() {\r\n this.tetrominos.push(this.nextPiece); // Use this for gameplay\r\n // this.tetrominos.push(new IPiece); // Use this to test line stuff\r\n this.tetrominos[this.tetrominos.length - 1].isDropping = true;\r\n }", "movePole() {\n this.x -= poleSpeed;\n }", "move(){\r\n if(!clydeActive){\r\n this.ttl--;\r\n if(this.ttl<=0){\r\n this.kill();\r\n }\r\n }if(this.checkPosition()&&this.vel.mag()!=0){//checks if pacman is facing a wall\r\n this.stopTimer = 0;\r\n this.pos.add(this.vel);\r\n //this.pos.add(this.vel);//repeat it for each time it has been upscaled, 2x for 1080p\r\n }else{\r\n this.stopTimer++;\r\n if(this.stopTimer>100){\r\n this.kill();\r\n }\r\n }this.lifespan++;\r\n }", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "movePiceToPosition(_newPosition) {\n // debugger;\n console.log(this.position.getPosX());\n //remove the img from the current Position to the new Pos\n this.removePice();\n\n //assign chess Pice to new Pos\n let s = document.getElementById(`tile${_newPosition.getPosX()},${_newPosition.getPosY()}`);\n let img = document.createElement(`img`);\n img.src = `img/${this._name}.png`;\n s.appendChild(img);\n\n // debugger;\n //assign the current Pos to new Position\n let last_piece = -1;\n for (let i = 0; i < Player.arr.length; ++i) {\n let [x, y, obj] = Player.arr[i];\n if (x == this.position.getPosX() && y == this.position.getPosY()) {\n // debugger;\n last_piece = i;\n break;\n }\n last_piece = -1;\n }\n // debugger;\n if (last_piece !== -1) {\n Player.arr[last_piece] = [_newPosition.getPosX(), _newPosition.getPosY(), Player.arr[last_piece][2]];\n // debugger;\n \n this.setPosition(_newPosition);\n // this.position = _newPosition;\n }else{\n alert(\"error in moving from chesspiece\");\n }\n\n\n }", "function makeRope()\n\t\t\t{\n\t\t\t\tbranchBank -= 5;\n\t\t\t\tleafBank -= 5;\n\t\t\t\tropeBank++;\n\t\t\t\taction(1,1,1);\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "function movePieces() {\n currentTime--\n timeLeft.textContent = currentTime\n autoMoveCars()\n autoMoveLogs()\n moveWithLogLeft()\n moveWithLogRight()\n lose()\n }", "function makeTheMove(ghost) {\n //this find the change of index so that it is not repeated\n ghost.directionMove = ghost.positionMove - ghost.ghostIndex\n //Stores all previous moves\n ghost.directionStore.push(ghost.directionMove)\n //last direction is stored so that it doesn't go back on itself\n ghost.lastDirection = ghost.directionStore[ghost.directionStore.length-1]\n // the class changes depending on if the ghosts is fleeing chasing or dead\n if (ghost.bias === 2) {\n gridSquare[ghost.ghostIndex].classList.remove('ghostFlee')\n ghost.ghostIndex = ghost.ghostIndex + ghost.directionMove\n gridSquare[ghost.ghostIndex].classList.add('ghostFlee')\n } else if (ghost.bias === 3) {\n gridSquare[ghost.ghostIndex].classList.remove('ghostDead')\n ghost.ghostIndex = ghost.ghostIndex + ghost.directionMove\n gridSquare[ghost.ghostIndex].classList.add('ghostDead')\n } else {\n gridSquare[ghost.ghostIndex].classList.remove(ghost.ghostClass)\n ghost.ghostIndex = ghost.ghostIndex + ghost.directionMove\n gridSquare[ghost.ghostIndex].classList.add(ghost.ghostClass)\n }\n }", "spawnPowerTruck(xPos)\n {\n this.powerTrucks.push(new PowerTruck(xPos, this.y));\n }", "movePaddle(ball) {\n if (this.type === 'Human') {\n //\"previous\" values keep track of 4 positions ago, and are the values\n //actually used in spinVector\n this.previousX = this.placeholder2X;\n this.previousY = this.placeholder2Y;\n\n this.placeholder2X = this.placeholderX;\n this.placeholder2Y = this.placeholderY;\n\n this.placeholderX = this.paddle.x;\n this.placeholderY = this.paddle.y;\n\n this.paddle.x = this.stage.mouseX - this.width / 2;\n this.paddle.y = this.stage.mouseY - this.height / 2;\n } else {\n const xGap = ball.farX - (this.paddle.x + (this.width / 2));\n const yGap = ball.farY - (this.paddle.y + (this.height / 2));\n //below divisor determines how quickly aiPaddle reacts\n this.paddle.x += (xGap * (0.025 * (this.difficulty + 1)));\n this.paddle.y += (yGap * (0.025 * (this.difficulty + 1)));\n }\n\n this.defineBounds();\n this.stage.update();\n }", "move() {\n this.x = this.x - 7\n }", "function makeMove(x:int,y:int) {\n\temptySpace -= 1;\n\tcheckVictory(x,y);\t//only need to check for chains made possibly at (x,y)\n\t//Switch the current player.\n\tif (currentPlayer == 1){\n\t\tcurrentPlayer = 2;\n\t} else {\n\t\tcurrentPlayer = 1;\n\t}\n}", "move() {\n const skier = Players.getInstance(\"skier\").getPlayer(\"skier\");\n this.direction = skier.direction;\n if (!this.eating) {\n if (skier.checkIfSkierStopped()) {\n this.y += this.speed;\n this.distance_gained_on_stop += this.speed;\n this.checkIfRhinoHitsSkier(skier);\n } else {\n this.y = skier.y - Constants.RHINO_SKIER_DISTANCE;\n this.y += this.distance_gained_on_stop;\n this.x = skier.x;\n }\n }\n }", "move() \n\t{\n\t\tthis.raindrop.nudge(0,-1,0);\n\n\t\tif (this.raindrop.getY() <= this.belowplane ) \n\t\t{\n\t\t\t//setting the y value to a certain number\n\t\t\tthis.raindrop.setY(random(200,400))\n\t\t}\n\t}", "function tryToMove (direction) {\r\n\t\r\n\t// location before move\r\n\tlet oldLocation = currentLocationOfHorse;\r\n\r\n\t// class of location before move\r\n\tlet oldClassName = gridBoxes[oldLocation].className;\r\n\r\n\tlet nextLocation = 0;\t// location we wish to move to\r\n\t//let nextClass = \"\"; \t// class of location we wish to move to\r\n\r\n\tlet nextLocation2 = 0;\r\n\tlet nextClass2 = \"\";\r\n\r\n\tlet newClass = \"\"; \t// new class to switch to if move successful\r\n\t\r\n\tnextClass = gridBoxes[nextLocation].className;\r\n\t\r\n\tswitch (direction) {\r\n\t\tcase \"left\" : \r\n\t\t\tnextLocation = currentLocationOfHorse - 1; \r\n\t\t\tbreak;\r\n\r\n\t\tcase \"right\" : \r\n\t\t\tnextLocation = currentLocationOfHorse + 1;\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"up\" : \r\n\t\t\tnextLocation = currentLocationOfHorse - widthOfBoard;\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"down\" : \r\n\t\t\tnextLocation = currentLocationOfHorse + widthOfBoard;\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"none\":\r\n\t\t\tnextLocation = currentLocationOfHorse;\r\n\t\t\treturn;\r\n\t} // switch\r\n\r\n\t\tnextClass = gridBoxes[nextLocation].className;\r\n\r\n\tif (gameOn == true && onFence == false) {\t\r\n\t\t// if the obstacle is not passable, don't move\r\n\t\tif (noPassObstacles.includes(nextClass)) { return; };\r\n\r\n\t\t// if it's a fence, and there's no rider, don't move\r\n\t\tif (!riderOn && nextClass.includes(\"fence\")) { return; };\r\n\r\n\t\t// if there's a fence, move 2 spaces with animation\r\n\t\t\tif (nextClass.includes(\"fence\")) {\r\n\r\n\t\t\t\t// rider must be on to jump\r\n\t\t\t\tif (riderOn) {\r\n\r\n\t\t\t\t\tgridBoxes[currentLocationOfHorse].className = \"\";\r\n\t\t\t\t\toldClassName = gridBoxes[nextLocation].className;\r\n\r\n\t\t\t\t\t// set values according to direction\r\n\t\t\t\t\tif (direction == \"left\") {\r\n\t\t\t\t\t\tnextClass = \"jumpleft\";\r\n\t\t\t\t\t\tnextClass2 = \"horserideleft\";\r\n\t\t\t\t\t\tnextLocation2 = nextLocation - 1;\r\n\t\t\t\t\t} else if (direction == \"right\") {\r\n\t\t\t\t\t\tnextClass = \"jumpright\";\r\n\t\t\t\t\t\tnextClass2 = \"horserideright\";\r\n\t\t\t\t\t\tnextLocation2 = nextLocation + 1;\r\n\t\t\t\t\t} else if (direction == \"up\") {\r\n\t\t\t\t\t\tnextClass = \"jumpup\";\r\n\t\t\t\t\t\tnextClass2 = \"horserideup\";\r\n\t\t\t\t\t\tnextLocation2 = nextLocation - widthOfBoard;\r\n\t\t\t\t\t} else if (direction == \"down\") {\r\n\t\t\t\t\t\tnextClass = \"jumpdown\";\r\n\t\t\t\t\t\tnextClass2 = \"horseridedown\";\r\n\t\t\t\t\t\tnextLocation2 = nextLocation + widthOfBoard;\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t// show horse jumping\r\n\t\t\t\t\tgridBoxes[nextLocation].className = nextClass;\r\n\t\t\t\t\tonFence = true;\r\n\r\n\t\t\t\t\tsetTimeout (function() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// set jump back to just a fence\r\n\t\t\t\t\t\tgridBoxes[nextLocation].className = oldClassName;\r\n\r\n\t\t\t\t\t\t// update current location of the horse to be 2 spaces past take off\r\n\t\t\t\t\t\tcurrentLocationOfHorse = nextLocation2;\r\n\r\n\t\t\t\t\t\t// get class of box after jump\r\n\t\t\t\t\t\tnextClass = gridBoxes[currentLocationOfHorse].className;\r\n\r\n\t\t\t\t\t\t// show horse and rider after landing\r\n\t\t\t\t\t\tgridBoxes[currentLocationOfHorse].className = nextClass2;\r\n\r\n\t\t\t\t\t\t// document.addEventListener(\"keydown\", e);\r\n\r\n\t\t\t\t\t\t// if next box is a flag, go up a level\r\n\t\t\t\t\t\tlevelUp(nextClass);\r\n\t\t\t\t\t\tonFence = false;\r\n\r\n\t\t\t\t\t}, 350); //350\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn; \r\n\r\n\t\t\t\t} // if rider on\r\n\r\n\t\t\t} // if class has fence\r\n\r\n\r\n\t\t// if there's a rider, add rider\r\n\t\tif (nextClass == \"rider\") {\r\n\t\t\triderOn = true;\r\n\t\t} // if\r\n\r\n\t\t// if there's a bridge in the old location, keep it\r\n\t\tif (oldClassName.includes(\"bridge\")) {\r\n\t\t\tgridBoxes[oldLocation].className = \"bridge\";\r\n\t\t} else {\r\n\t\t\tgridBoxes[oldLocation].className = \"\";\r\n\t\t} // else\r\n\r\n\t\t// build name of new class\r\n\t\tnewClass = (riderOn) ? \"horseride\" : \"horse\";\r\n\t\tnewClass += direction;\r\n\r\n\t\t// if there is a bridge in the next location, keep it\r\n\t\tif (gridBoxes[nextLocation].classList.contains(\"bridge\")) {\r\n\t\t\tnewClass += \" bridge\";\r\n\t\t}\r\n\r\n\t\t// move 1 space\r\n\t\tcurrentLocationOfHorse = nextLocation;\r\n\t\tgridBoxes[currentLocationOfHorse].className = newClass;\r\n\r\n\t\t// if it is an enemy\r\n\t\tif (nextClass.includes(\"enemy\")) {\r\n\t\t\tstopGame(\"hitEnemy\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// move up a level if needed\r\n\t\tlevelUp(nextClass);\r\n\t} // if GameOn\r\n} // tryToMove", "placePiece(x,y,piece) {\n\n }", "move(){\n this.x=this.x+random(-3,3)\n this.y=this.y+random(-3,3)\n }", "function moveDuck() \n{\n // update the ducks global location\n loc.add(dir);\n\n // find out how much the neck is rotated to decide which way to rotate\n // these constrain how much the neck moves up and down\n if (neckR < -PI/3) \n {\n neckDown = false;\n } \n if (neckR > PI/10) \n {\n neckDown = true;\n }\n // depending on which way we need to rotate, do so\n if (neckDown == true) \n {\n neckR -= PI/100;\n } \n else \n {\n neckR += PI/100;\n }\n\n // find out how much the wing is rotated to decide which way to rotate\n // these constrain how much the wing moves up and down\n if (wingR < -2*PI/5) \n {\n wingDown = true;\n } \n if (wingR > -PI/20) \n {\n wingDown = false;\n }\n if (wingDown == false) \n {\n wingR -= PI/100;\n } \n else \n {\n wingR += PI/100;\n }\n\n if (beakR < -2*PI/15) \n {\n beakDown = true;\n } \n if (beakR > -PI/100) \n {\n beakDown = false;\n }\n if (beakDown == false) \n {\n beakR -= PI/100;\n } \n else \n {\n beakR += PI/100;\n }\n\n if (llegR < -PI/5) \n {\n leftLegDown = true;\n } \n if (llegR > PI/5) \n {\n leftLegDown = false;\n }\n if (leftLegDown) \n {\n \t llegR +=PI/100;\n }\n else \n {\n \t llegR -=PI/100;\n }\n\n\n\n // depending on which way we need to rotate, do so\n if (rlegR < -PI/5) \n {\n rightLegDown = true;\n } \n if (rlegR > PI/5) \n {\n rightLegDown = false;\n }\n if (rightLegDown) \n {\n \t rlegR +=PI/100;\n }\n else \n {\n \t rlegR -=PI/100;\n }\n \n if (footR < -PI/7) \n {\n footDown = true;\n } \n if (footR > PI/6) \n {\n footDown = false;\n }\n if (footDown) \n {\n \t footR +=PI/100;\n }\n else \n {\n \t footR -=PI/100;\n }\n\n\n if (lfootR < -PI/7) \n {\n lfootDown = true;\n } \n if (lfootR > PI/6) \n {\n lfootDown = false;\n }\n \n if (lfootDown) \n {\n \t lfootR +=PI/100;\n }\n else \n {\n \t lfootR -=PI/100;\n }\n \n\n}", "function moveWasp() {\n const down = waspCurrentPosition + width\n const left = waspCurrentPosition - 1\n const right = waspCurrentPosition + 1\n const up = waspCurrentPosition - width\n\n checkGhostMode(waspClass, waspCurrentPosition)\n removeGhost(waspCurrentPosition, waspClass)\n\n // checks movement through tunnel\n if (waspCurrentPosition === 55 && waspXGoal > e && waspPreviousPosition !== 65) {\n waspPreviousPosition = waspCurrentPosition\n waspCurrentPosition = 65\n } else if (waspCurrentPosition === 65 && waspXGoal < e && waspPreviousPosition !== 55) {\n waspPreviousPosition = waspCurrentPosition\n waspCurrentPosition = 55\n } else if (waspYGoal > f) {\n // console.log('ghost higher than player') \n if (isDownClear(waspCurrentPosition) === true && down !== waspPreviousPosition && waspCurrentPosition !== 37 && waspCurrentPosition !== 39) { // check tile below is clear, check previous position\n moveCharacter('down', waspClass, waspPreviousPosition, waspCurrentPosition) // move down\n } else { // if below is blocked, do the following\n if (waspXGoal > e) { // if ghost left of player\n // console.log('ghost left of player')\n if (isRightClear(waspCurrentPosition) === true && right !== waspPreviousPosition) { // check tile to right is clear\n moveCharacter('right', waspClass, waspPreviousPosition, waspCurrentPosition) // move right\n } else { // if down and right is blocked\n // console.log('border to right')\n if (isLeftClear(waspCurrentPosition) === true && left !== waspPreviousPosition) { // check tile to left is clear\n moveCharacter('left', waspClass, waspPreviousPosition, waspCurrentPosition) // move left\n } else { // if down, right and left is blocked\n // console.log('border to left')\n if (isUpClear(waspCurrentPosition) === true) { // check tile above is clear\n moveCharacter('up', waspClass, waspPreviousPosition, waspCurrentPosition) // move up\n } \n }\n }\n } else if (waspXGoal < e) { // if ghost is to right of player\n // console.log('ghost to right of player')\n if (isLeftClear(waspCurrentPosition) === true && left !== waspPreviousPosition) { // check tile to left is clear\n moveCharacter('left', waspClass, waspPreviousPosition, waspCurrentPosition) // move left\n } else { // if down and left is blocked\n // console.log('border to left') \n if (isRightClear(waspCurrentPosition) === true && right !== waspPreviousPosition) { // check tile to right is clear\n moveCharacter('right', waspClass, waspPreviousPosition, waspCurrentPosition) // move right\n } else { // if down, left and right is blocked\n // console.log('border below')\n if (isUpClear(waspCurrentPosition) === true) { // check tile above is clear\n moveCharacter('up', waspClass, waspPreviousPosition, waspCurrentPosition) // move up\n }\n }\n }\n } else if (waspXGoal === e) { // if player and ghost are in line on y-axis\n // console.log('ghost directly above player')\n if (isLeftClear(waspCurrentPosition) === true && left !== waspPreviousPosition) { // check if left tile is clear\n moveCharacter('left', waspClass, waspPreviousPosition, waspCurrentPosition) // move left\n } else if (isRightClear(waspCurrentPosition) === true && right !== waspPreviousPosition) { // if down and left are blocked, check if right tile is clear\n moveCharacter('right', waspClass, waspPreviousPosition, waspCurrentPosition) // move right\n } else if (isUpClear(waspCurrentPosition) === true) { // if down, left and right are blocked, check if tile above is clear\n moveCharacter('up', waspClass, waspPreviousPosition, waspCurrentPosition) // move up\n }\n }\n }\n } else if (waspYGoal < f) { // if ghost is below player\n if (isUpClear(waspCurrentPosition) === true && up !== waspPreviousPosition) { // check tile above is clear\n moveCharacter('up', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost up \n } else { // if above is blocked\n if (waspXGoal > e) { // check if ghost is left of player\n // console.log('ghost left of player')\n if (isRightClear(waspCurrentPosition) === true && right !== waspPreviousPosition) { // check if tile to right is clear\n moveCharacter('right', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost right\n } else if (isLeftClear(waspCurrentPosition) === true && left !== waspPreviousPosition) { // if above and right is blocked, check left is clear\n moveCharacter('left', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost left\n } else if (isDownClear(waspCurrentPosition) === true && waspCurrentPosition !== 37 && waspCurrentPosition !== 39) { // if above, right and left is blocked, check down is clear\n moveCharacter('down', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost down\n } else if (isUpClear(waspCurrentPosition) === true) {\n moveCharacter('up', waspClass, waspPreviousPosition, waspCurrentPosition)\n }\n } else if (waspXGoal < e) { // if ghost is right of player\n if (isLeftClear(waspCurrentPosition) === true && left !== waspPreviousPosition) { // check tile to left is clear\n moveCharacter('left', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost left\n } else if (isDownClear(waspCurrentPosition) === true && down !== waspPreviousPosition && waspCurrentPosition !== 37 && waspCurrentPosition !== 39) { // if above and left is blocked, check if tile below is clear\n moveCharacter('down', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost down\n } else if (isRightClear(waspCurrentPosition) === true) { // if above, left and below is blocked, check right is clear\n moveCharacter('right', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost right\n } else if (isUpClear(waspCurrentPosition) === true) {\n moveCharacter('up', waspClass, waspPreviousPosition, waspCurrentPosition)\n }\n } else if (waspXGoal === e) { // if ghost and player are in line on the y-axis\n if (isLeftClear(waspCurrentPosition) === true && left !== waspPreviousPosition) { // check left tile is clear\n moveCharacter('left', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost left\n } else if (isRightClear(waspCurrentPosition) === true && right !== scorpianPreviousPosition) { // if above and left tile is blocked, check right is clear\n moveCharacter('right', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost right\n } else if (isDownClear(waspCurrentPosition) === true && down !== waspPreviousPosition && waspCurrentPosition !== 37 && waspCurrentPosition !== 39) { // if above, left and right tile is blocked, check below is clear \n moveCharacter('down', waspClass, waspPreviousPosition, waspCurrentPosition) // move ghost down\n } else if (isUpClear(waspCurrentPosition) === true) {\n moveCharacter('up', waspClass, waspPreviousPosition, waspCurrentPosition)\n }\n }\n }\n } else if (waspYGoal === f) { // if ghost and player are in line on x-axis\n // console.log('ghost on same horizontal plane as player')\n if (waspXGoal > e) { // if ghost to left of player\n // console.log('ghost left of player')\n if (isRightClear(waspCurrentPosition) === true && right !== waspPreviousPosition) { // check tile to right is clear\n moveCharacter('right', waspClass, waspPreviousPosition, waspCurrentPosition) // move right\n } else if (isLeftClear(waspCurrentPosition) === true && left !== waspPreviousPosition) { // if right is blocked, check tile to left is clear\n moveCharacter('left', waspClass, waspPreviousPosition, waspCurrentPosition) // move left\n } else if (isDownClear(waspCurrentPosition) === true && down !== waspPreviousPosition && waspCurrentPosition !== 37 && waspCurrentPosition !== 39) { // if right and left blocked, check tile below is clear\n moveCharacter('down', waspClass, waspPreviousPosition, waspCurrentPosition) // move down\n } else if (isUpClear(waspCurrentPosition) === true) { // if right, left and down blocked, check tile above is clear\n moveCharacter('up', waspClass, waspPreviousPosition, waspCurrentPosition) // move up\n }\n } else if (waspXGoal < e) { // if ghost to right of player\n // console.log('ghost right of player')\n if (isLeftClear(waspCurrentPosition) === true && left !== waspPreviousPosition) { // check left is clear\n moveCharacter('left', waspClass, waspPreviousPosition, waspCurrentPosition) // move left\n } else if (isDownClear(waspCurrentPosition) === true && down !== waspPreviousPosition && waspCurrentPosition !== 37 && waspCurrentPosition !== 39) { // if left blocked, check down is clear\n // console.log('left not clear')\n moveCharacter('down', waspClass, waspPreviousPosition, waspCurrentPosition) // move down\n } else if (isRightClear(waspCurrentPosition) === true && right !== waspPreviousPosition) { // if left and down blocked, check right is clear\n // console.log('down not clear')\n moveCharacter('right', waspClass, waspPreviousPosition, waspCurrentPosition) // move right\n } else if (isUpClear(waspCurrentPosition) === true) { // if left, down and right blocked, check up is clear\n // console.log('right not clear, moving up')\n moveCharacter('up', waspClass, waspPreviousPosition, waspCurrentPosition) // move up\n }\n }\n } \n \n addGhost(waspCurrentPosition, waspClass)\n if (cells[waspCurrentPosition].classList.contains(playerClass)) {\n touchGhost(playerCurrentPosition)\n if (ghostMode === 'split class' || ghostMode === 'chase class') {\n playerCurrentPosition = playerStartPosition\n }\n }\n setCharacterCoordinates(waspClass, waspCurrentPosition, e, f)\n }", "moveActor() {\n // used to work as tunnel if left and right are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[0] < -1) {\n this.tileTo[0] = this.gameMap.layoutMap.column;\n }\n if (this.tileTo[0] > this.gameMap.layoutMap.column) {\n this.tileTo[0] = -1;\n }\n\n // used to work as tunnel if top and bottom are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[1] < -1) {\n this.tileTo[1] = this.gameMap.layoutMap.row;\n }\n if (this.tileTo[1] > this.gameMap.layoutMap.row) {\n this.tileTo[1] = -1;\n }\n\n // as our pacman/ghosts needs to move constantly widthout key press,\n // also pacman/ghosts should stop when there is obstacle the code has become longer\n\n // if pacman/ghosts is moving up check of upper box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.UP) {\n if (this.isBlockUpperThanActorEmpty()) {\n this.tileTo[1] -= 1;\n }\n }\n\n // if pacman/ghosts is moving down check of down box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.DOWN) {\n if (this.isBlockLowerThanActorEmpty()) {\n this.tileTo[1] += 1;\n }\n }\n\n // if pacman/ghosts is moving left check of left box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.LEFT) {\n if (this.isBlockLeftThanActorEmpty()) {\n this.tileTo[0] -= 1;\n }\n }\n\n // if pacman/ghosts is moving right check of right box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.RIGHT) {\n if (this.isBlockRightThanActorEmpty()) {\n this.tileTo[0] += 1;\n }\n }\n }", "move() {\n\t\tthis.lastPosition = [ this.x, this.y ];\n\n\t\tthis.x += this.nextMove[0];\n\t\tthis.y += this.nextMove[1];\n\t}", "function moveDuck() \r\n{\r\n // update the ducks global location\r\n loc.add(dir);\r\n\r\n // find out how much the neck is rotated to decide which way to rotate\r\n // these constrain how much the neck moves up and down\r\n if (neckR < -PI/3) \r\n {\r\n neckDown = false;\r\n } \r\n if (neckR > PI/10) \r\n {\r\n neckDown = true;\r\n }\r\n\r\n // depending on which way we need to rotate, do so\r\n if (neckDown == true) \r\n {\r\n neckR -= PI/100;\r\n } \r\n else \r\n {\r\n neckR += PI/100;\r\n }\r\n\r\n // find out how much the wing is rotated to decide which way to rotate\r\n // these constrain how much the wing moves up and down\r\n if (wingR < -2*PI/5) \r\n {\r\n wingDown = true;\r\n } \r\n if (wingR > -PI/20) \r\n {\r\n wingDown = false;\r\n }\r\n\r\n // depending on which way we need to rotate, do so\r\n if (wingDown == false) \r\n {\r\n wingR -= PI/100;\r\n } \r\n else \r\n {\r\n wingR += PI/100;\r\n }\r\n\r\n // find out how much the left leg is rotated to decide which way to rotate\r\n // these constrain how much the leg moves forward and backward\r\n if (leftLegR > PI/6)\r\n {\r\n LeftLegForward = true;\r\n }\r\n if (leftLegR < -PI/6)\r\n {\r\n LeftLegForward = false;\r\n }\r\n \r\n // depending on which way we need to rotate, do so\r\n if (LeftLegForward == false)\r\n {\r\n leftLegR += PI/150;\r\n }\r\n else\r\n {\r\n leftLegR -= PI/150; \r\n }\r\n\r\n\r\n // find out how much the right leg is rotated to decide which way to rotate\r\n // these constrain how much the leg moves forward and backward\r\n if (rightLegR > PI/6)\r\n {\r\n RightLegForward = true;\r\n }\r\n if (rightLegR < -PI/6)\r\n {\r\n RightLegForward = false;\r\n }\r\n \r\n // depending on which way we need to rotate, do so\r\n if (RightLegForward == false)\r\n {\r\n rightLegR += PI/150;\r\n }\r\n else\r\n {\r\n rightLegR -= PI/150; \r\n } \r\n\r\n\r\n // find out how much the left leg is rotated to decide which way to rotate\r\n // these constrain how much the leg moves forward and backward\r\n if (topBeakR > 0)\r\n {\r\n topBeakDown = true;\r\n }\r\n if (topBeakR < -PI/12)\r\n {\r\n topBeakDown = false;\r\n }\r\n \r\n // depending on which way we need to rotate, do so\r\n if (topBeakDown == false)\r\n {\r\n topBeakR += PI/150;\r\n }\r\n else\r\n {\r\n topBeakR -= PI/150; \r\n }\r\n\r\n\r\n // find out how much the right leg is rotated to decide which way to rotate\r\n // these constrain how much the leg moves forward and backward\r\n if (bottomBeakR > PI/12)\r\n {\r\n bottomBeakDown = true;\r\n }\r\n if (bottomBeakR < 0)\r\n {\r\n bottomBeakDown = false;\r\n }\r\n \r\n // depending on which way we need to rotate, do so\r\n if (bottomBeakDown == false)\r\n {\r\n bottomBeakR += PI/150;\r\n }\r\n else\r\n {\r\n bottomBeakR -= PI/150; \r\n } \r\n}", "function tryToMove(direction) {\r\n\r\n \r\n let oldLocation = currentLocationOfHorse; //location before move\r\n let oldClassName = gridBoxes[oldLocation].className; // class of location before move\r\n let nextLocation = 0; //location we wish to move to\r\n let nextClass = \"\"; //class of location we wish to move to\r\n let nextLocation2 = 0;\r\n let nextClass2 = \"\";\r\n let nextClass3 = \"\"; //class for bridge image\r\n let newClass = \"\"; //new class to switch to if move successful\r\n\r\n switch (direction) {\r\n \r\n case \"left\":\r\n nextLocation = currentLocationOfHorse - 1;\r\n break;\r\n\r\n case \"right\":\r\n nextLocation = currentLocationOfHorse + 1;\r\n break;\r\n\r\n case \"up\":\r\n nextLocation = currentLocationOfHorse - widthOfBoard;\r\n break;\r\n\r\n case \"down\":\r\n nextLocation = currentLocationOfHorse + widthOfBoard;\r\n break;\r\n } //switch\r\n nextClass = gridBoxes[nextLocation].className;\r\n\r\n //if the obstacle is not passable, don't move\r\n if (noPassObstacles.includes(nextClass)) {return;}\r\n\r\n //if it's a fence, and there is no rider, not move\r\n if (!riderOn && nextClass.includes(\"seaweed\")) {return;}\r\n\r\n // if there is a fence, move two spaces with animation\r\n if (nextClass.includes(\"seaweed\")) {\r\n \r\n // hat must be on to jump\r\n if (riderOn) {\r\n\t\t\tmove = false;\r\n gridBoxes[currentLocationOfHorse].className = \"\";\r\n oldClassName = gridBoxes[nextLocation].className;\r\n\r\n // set values according to direction\r\n if (direction == \"left\") {\r\n \r\n nextClass = \"fishleftsea\";\r\n nextClass2 = \"fishlefthat\";\r\n nextClass3 = \"fishleftbubbles\";\r\n \r\n nextLocation2 = nextLocation - 1;\r\n \r\n } else if (direction == \"right\") {\r\n\t\t\t\t\r\n nextClass = \"fishrightsea\";\r\n nextClass2 = \"fishrighthat\";\r\n nextClass3 = \"fishrightbubbles\";\r\n\r\n nextLocation2 = nextLocation + 1;\r\n\t\t\t\r\n } else if (direction == \"up\") {\r\n\t\t\t\t\r\n nextClass = \"fishupsea\";\r\n nextClass2 = \"fishuphat\";\r\n nextClass3 = \"fishupbubbles\";\r\n\r\n nextLocation2 = nextLocation - widthOfBoard;\r\n\t\t\t\t\r\n } else if (direction == \"down\") {\r\n\t\t\t\t\r\n nextClass = \"fishdownsea\";\r\n nextClass2 = \"fishdownhat\";\r\n nextClass3 = \"fishdownbubbles\";\r\n\r\n nextLocation2 = nextLocation + widthOfBoard;\r\n } //else if\r\n\r\n //error checking can't land on obstacle\r\n\t\t\tlet errorCheck = gridBoxes[nextLocation2].className;\r\n\t\t\tif(noPassObstacles.includes(errorCheck)){\r\n\t\t\t\treturn;\r\n\t\t\t}//if\r\n\t\t\t\r\n\t\t\tgridBoxes[currentLocationOfHorse].className = \"\";\r\n\t\t\toldClassName = gridBoxes[nextLocation].className;\r\n \r\n // show fish jumping\r\n gridBoxes[nextLocation].className = nextClass;\r\n\r\n setTimeout(function() {\r\n\r\n // set jump back to just a fence\r\n gridBoxes[nextLocation].className = oldClassName;\r\n\r\n // update current location of horse to be 2 spaces past take off\r\n currentLocationOfHorse = nextLocation2;\r\n\r\n //get class of box after jump\r\n nextClass = gridBoxes[currentLocationOfHorse].className;\r\n\r\n\r\n // show horse and rider after landing\r\n gridBoxes[currentLocationOfHorse].className = nextClass2;\r\n gridBoxes[currentLocationOfHorse].className = nextClass3;\r\n\r\n //if next box is a flag go up a level\r\n levelUp(nextClass);\r\n }, 350);\r\n return;\r\n } //rider\r\n } //if class has seaweed\r\n \r\n if(noPassObstacles.includes(gridBoxes[nextLocation2].className)){\r\n\t\t\t\treturn;\r\n }//if\r\n\r\n //if there is a rider, add rider\r\n if (nextClass == \"hat\") {\r\n riderOn = true;\r\n } //if\r\n\r\n //if there is a bridge in the old location keep it\r\n if (oldClassName.includes(\"bridge\")) {\r\n gridBoxes[oldLocation].className = \"bridge\";\r\n } else {\r\n gridBoxes[oldLocation].className = \"\";\r\n } //else\r\n\r\n // build name of new class\r\n newClass = (riderOn) ? \"fishhat\" : \"fish\";\r\n newClass3 = (riderOn) ? \"fishhatbubbles\" : \"fishbubbles\";\r\n newClass += direction;\r\n newClass3 += direction;\r\n\r\n // if there is a bridge in the next location , keep it\r\n if (gridBoxes[nextLocation].classList.contains(\"bridge\")) {\r\n newClass += \"bridge\";\r\n }\r\n\r\n //move 1 space\r\n currentLocationOfHorse = nextLocation;\r\n gridBoxes[currentLocationOfHorse].className = newClass;\r\n\r\n //if it is an enemy, end game\r\n if (nextClass.includes(\"shark\")) {\r\n \r\n document.getElementById(\"lose\").style.display = \"block\"\r\n currentLevel = newGame;\r\n window.clearInterval(currentAnimation);\r\n window.clearInterval(currentAnimation2);\r\n endGame = false;\r\n \r\n return;\r\n }//if\r\n\r\n //move up to next level if needed\r\n levelUp(nextClass);\r\n\r\n} //trytoMove", "move() {\n this.x = this.x + random(-10,10);\n this.y = this.y + random(-10,10);\n }", "castlingMove(from, to) {\n // Remember the from piece (it's a king)\n let fromPiece = this.game.get(from);\n // Remove the king\n this.game.remove(from);\n // Place the king in the destination square\n this.game.put(fromPiece, to);\n // Now we need to position the rook correctly\n let turn = this.game.turn();\n let backRank = turn === this.game.WHITE ? 1 : 8;\n // Handle kingside\n if (this.currentMove.castlingFlag === 'k') {\n // Remove the existing rook\n this.game.remove(`h${backRank}`);\n // Put it in its castled position\n this.game.put({\n type: 'r',\n color: turn\n }, `f${backRank}`);\n }\n // Handle queenside\n else if (this.currentMove.castlingFlag === 'q') {\n // Remove the existing rook\n this.game.remove(`a${backRank}`);\n // Put it in its castled position\n this.game.put({\n type: 'r',\n color: turn\n }, `d${backRank}`);\n }\n this.castling[turn] = undefined;\n\n // Now handle end of turn stuff like disabling input\n this.disableInput();\n\n // Clear all highlights from the board\n this.clearHighlights();\n\n // Update the board based on the new position\n this.board.position(this.game.fen(), true);\n setTimeout(() => {\n // Now we need to check only for captures and offer them\n this.currentMove.from = undefined;\n this.currentMove.to = undefined;\n this.currentMove.captureSquare = undefined;\n this.currentMove.castlingFlag = undefined;\n this.flipTurn();\n this.moveCompleted();\n placeSFX.play();\n }, this.config.moveSpeed * 1.1);\n }", "function setMove(which){\t\t\n\tmover = which;\n\t//get the last position of the thing... (NOW through the transform=translate(x,y))\n\txy=getTransform(which);\n\n\tmyX=xy[0];\n\tmyY=xy[1];\n\t//get the object then re-append it to the document so it is on top!\n\tgetPiece(which).putOnTop(which);\n}", "function movePieces() {\n currentTime--;\n timeLeft.textContent = currentTime;\n autoMoveCars();\n autoMoveLogs();\n moveWithLogLeft();\n moveWithLogRight();\n lose();\n \n }", "moveRock(){\n this.x += this.xVelocity;\n this.y += this.yVelocity;\n // If on mobile the control panel is displayed\n controlPanel();\n // Display bullet bullet\n bulletCount();\n }", "function moveDuck() \n{\n // update the ducks global location\n console.log(loc.x)\n if (loc.x > 380){\n loc.add(dir);\n \n\n // find out how much the neck is rotated to decide which way to rotate\n // these constrain how much the neck moves up and down\n if (neckR < -PI/3) \n {\n neckDown = false;\n } \n if (neckR > PI/10) \n {\n neckDown = true;\n }\n\n // depending on which way we need to rotate, do so\n if (neckDown == true) \n {\n neckR -= PI/100;\n } \n else \n {\n neckR += PI/100;\n }\n\n // find out how much the wing is rotated to decide which way to rotate\n // these constrain how much the wing moves up and down\n if (wingR < -2*PI/5) \n {\n wingDown = true;\n } \n if (wingR > -PI/20) \n {\n wingDown = false;\n }\n\n // depending on which way we need to rotate, do so\n if (wingDown == false) \n {\n wingR -= PI/100;\n } \n else \n {\n wingR += PI/100;\n }\n\n\n//top beak\n if (beakR < radians(-30)) \n {\n topbeakDown = true;\n } \n if (beakR > radians(30)) \n {\n topbeakDown = false;\n }\n\n if (topbeakDown == false) \n {\n beakR -= PI/80;\n } \n else \n {\n beakR += PI/80;\n }\n\n//bottom beak\n if (bottombeakR < radians(-3)) \n {\n bottombeakDown = true;\n } \n if (bottombeakR > radians(3)) \n {\n bottombeakDown = false;\n }\n\n if (bottombeakDown == false) \n {\n bottombeakR -= PI/80;\n } \n else \n {\n bottombeakR += PI/80;\n }\n\n //left leg\n if (leftlegR < -PI/5) \n {\n leftlegOut = true;\n } \n if (leftlegR > PI/5) \n {\n leftlegOut = false;\n }\n\n if (leftlegOut == false) \n {\n leftlegR -= PI/100;\n } \n else \n {\n leftlegR += PI/100;\n }\n\n //right leg\n if (rightlegR < -PI/5) \n {\n rightlegOut = true;\n } \n if (rightlegR > PI/5) \n {\n rightlegOut = false;\n }\n\n if (rightlegOut == false) \n {\n rightlegR -= PI/100;\n } \n else \n {\n rightlegR += PI/100;\n }\n\n}\n}", "spawnNewPuyo() {\n if (this.gameOver) {\n return;\n }\n this.horizontalLock = false;\n this.verticalLock = false;\n this.rotateLock = false;\n if(this.GameOver()) {\n this.gameOver = true;\n return;\n }\n this.pairIsVertical = true;\n //this.puyo1 = Math.floor(Math.random() * this.puyoVariations) + 1;\n //this.puyo2 = Math.floor(Math.random() * this.puyoVariations) + 1;\n this.puyo1 = this.nextBlob1Color;\n this.puyo2 = this.nextBlob2Color;\n this.newNextColor();\n this.puyo1x = 2;\n this.puyo1y = 0;\n this.puyo2x = 2;\n this.puyo2y = 1;\n this.grid[0][2] = this.puyo1;\n this.grid[1][2] = this.puyo2;\n this.blob1 = new Puyo(0,2, this.puyo1, this.game, this.rowHeight, this.colWidth);\n this.blob2 = new Puyo(1,2, this.puyo2, this.game, this.rowHeight, this.colWidth);\n this.blobGrid[0][2] = this.blob1;\n this.blobGrid[1][2] = this.blob2;\n this.blob1.create(this.xOffset + 2*this.colWidth, this.yOffset);\n this.blob2.create(this.xOffset + 2*this.colWidth, this.yOffset + this.rowHeight);\n this.movementTimer = this.game.time.events.loop(this.autoDownwardTimerConstant, \n this.movePuyo, this);\n //this.print();\n }", "function main() {\nmove();\npickBeeper();\nmove();\n}", "function makeDucks() {\n\tfor (i=0; i < 2; i++) {\n\t\tducks.push( {posX: Math.random()*700, posY: Math.random()*550, targetX: Math.random()*700, targetY: Math.random()*550} );\n\t}\n}", "goForward(){\n if(this.isVacant()){\n switch(this.orientation){\n case 0:\n this.positionY--;\n this.graphicalObject.position.z -= (this.room.blockSize + this.room.blockGap); \n break;\n case 1:\n this.positionX++;\n this.graphicalObject.position.x += (this.room.blockSize + this.room.blockGap);\n break;\n case 2:\n this.positionY++;\n this.graphicalObject.position.z += (this.room.blockSize + this.room.blockGap);\n break;\n case 3:\n this.positionX--;\n this.graphicalObject.position.x -= (this.room.blockSize + this.room.blockGap);\n break;\n }\n this.correctHeight();\n }\n }", "function move() {\n orb.roll(60, Math.floor(Math.random() * 360));\n }", "function moveBunch(){\r\n\t\tvar P = clients.positions;\r\n\t\tvar initActive = clients.active;\r\n\t\tif (clients.static) return;\r\n\t\tif (dir && !P[clients.active+1]) dir = false;\r\n\t\tif (!dir && !P[clients.active-1]) dir = true;\r\n\t\tif (dir) {\r\n\t\t\tvar index = P[clients.active].right;\r\n\t\t\tclients.active++;\r\n\t\t} else {\r\n\t\t\t\tindex = P[clients.active].left;\r\n\t\t\tclients.active--;\r\n\t\t}\r\n\t\tif (initActive == clients.active) return moveBunch();\r\n\t\tclients.animateToActive( 1500 );\r\n\t}", "function Setup(p){\r\n\t//var newleft = 0; \r\n\tvar left = 0;\r\n\tvar top = 0;\r\n\r\n\r\n\tfor (var i = 0; i < p.length; i++){ \r\n\t\tif (left ==400) {\r\n\t\t\tleft = 0;\r\n\t\t\ttop += 100;\t\r\n\t\t}\r\n\t\tp[i].style.left = left.toString()+\"px\";\r\n\t\tp[i].style.top = top + \"px\";\r\n\t\tif(!playing){\r\n\t\t\tp[i].style.backgroundPosition = \"-\"+left+\"px -\" +top+ \"px\"; // Adjusts the background position\r\n\t\t}\r\n\t\tleft+=100;\r\n\t\tif(!playing){\r\n\t\t\tp[i].className = \"puzzlepiece\";\r\n\t\t}\t\t\r\n\t\t\r\n\t\t}\r\n\t}", "function moveAIPaddle()\n{\n // destination position is greater than current position\n if((aiPaddle.destination - aiPaddle.top) > 0)\n {\n // if the current position is within one move of the destination position,\n // just move it to the destination position.\n if((aiPaddle.destination - aiPaddle.top) < aiPaddle.speed)\n {\n aiPaddle.top = aiPaddle.destination;\n aiPaddle.moveNow = false;\n }\n else\n {\n aiPaddle.top += aiPaddle.speed;\n }\n }\n\n // destination position is less than current position\n else if((aiPaddle.destination - aiPaddle.top) < 0)\n {\n if((aiPaddle.top - aiPaddle.destination) < aiPaddle.speed)\n {\n aiPaddle.top = aiPaddle.destination;\n aiPaddle.moveNow = false;\n }\n else\n {\n aiPaddle.top -= aiPaddle.speed;\n }\n }\n\n // if the aiPaddle is at the destination, stop moving\n else if(aiPaddle.top === aiPaddle.destination)\n {\n aiPaddle.moveNow = false;\n }\n\n // if the aiPaddle has gone out of bounds, move it back within the boundaries\n if(aiPaddle.top < 0)\n {\n aiPaddle.top = 0;\n }\n else if(aiPaddle.top > 520)\n {\n aiPaddle.top = 520;\n }\n\n // apply changes to aiPaddle element\n document.getElementById('aiPaddle').style.top = (aiPaddle.top) + 'px';\n\n}", "function think() {\n var placables = Array.from(chessboard);\n var id = placables[Math.floor(Math.random() * placables.length)];\n move(id);\n}", "function make_move() {\n\n // get state of board this turn\n var board = get_board(),\n\n // get my position\n myX = get_my_x(),\n myY = get_my_y(),\n\n // get opponents position\n hisX = get_opponent_x(),\n hisY = get_opponent_y();\n\n get_current_counts();\n\n // if we found an item and it isn't dead\n if (board[myX][myY] > 0 && !deadFruits[board[myX][myY]]) {\n return TAKE;\n }\n\n var rand = Math.random() * 10;\n\n if (rand < 1) return NORTH;\n if (rand < 2) return SOUTH;\n if (rand < 3) return EAST;\n if (rand < 4) return WEST;\n\n return move_toward(hisX, hisY);\n}", "function newGame(){\n bricks=[];\n bonuses=[];\n createBricks();\n ball.x = (Width/2)-3;\n ball.y = (Height/2)-3;\n ball.speedX = 0;\n ballOn = false; \n ball = {\n x: (Width/2)-3,\n y: (Height/2)-3,\n radius: 6,\n speedX: 0,\n speedY: 6\n };\n paddle1 = { \n w: 100,\n h: 10,\n x: Width / 2 - (100/2),// 100 is paddle.w\n y: Height-10,\n speed: 6\n };\n }", "movePuyo() {\n if (this.gameOver || this.paused) {\n return;\n }\n if(this.pairIsVertical) {\n if(this.puyo1y < this.puyo2y) {\n if(this.puyo2y == this.rows-1 || this.grid[this.puyo2y+1][this.puyo2x] != 0) {\n //lock movement and spawn\n this.prepareSpawn();\n return;\n }\n }\n else {\n if(this.puyo1y == this.rows-1 || this.grid[this.puyo1y+1][this.puyo1x] != 0) {\n //lock movement and spawn\n this.prepareSpawn();\n return;\n }\n }\n }\n else {\n console.log(\"horizontal\")\n //if on the bottom or one doesn not equal 0\n if(this.puyo1y == this.rows-1) {\n console.log(\"bottom\");\n this.prepareSpawn();\n return;\n }\n else if (this.grid[this.puyo1y+1][this.puyo1x] != 0\n || this.grid[this.puyo2y+1][this.puyo2x] != 0){\n console.log(\"1\");\n if(this.grid[this.puyo1y+1][this.puyo1x] === 0) {\n console.log(\"2\");\n this.dropBlock(this.puyo1x, this.puyo1y);\n this.prepareSpawn();\n return;\n }\n else if(this.grid[this.puyo2y+1][this.puyo2x] === 0) {\n console.log(\"3\");\n this.dropBlock(this.puyo2x, this.puyo2y);\n this.prepareSpawn();\n return;\n }\n //BUG FIX: Originally did not account for if both blobs have something underneath them\n else {\n this.prepareSpawn();\n return;\n }\n }\n }\n this.grid[this.puyo1y][this.puyo1x] = 0;\n this.grid[this.puyo2y][this.puyo2x] = 0;\n this.puyo1y++;\n this.puyo2y++;\n this.blobGrid[this.puyo1y][this.puyo1x] = this.blob1;\n this.blobGrid[this.puyo2y][this.puyo2x] = this.blob2;\n this.blob1.moveDown();\n this.blob2.moveDown();\n this.grid[this.puyo1y][this.puyo1x] = this.puyo1;\n this.grid[this.puyo2y][this.puyo2x] = this.puyo2;\n //this.print();\n }", "function moveRocks() {\n var r = container_rocks.getNumChildren();\n\n for(var j = 0; j < r; j++){\n var rock = container_rocks.getChildAt(j);\n rock.y += rock.velY;\n if(rock.y<0 || rock.y>h){\n\n rock.velY = -rock.velY;\n }\n rock.x += rock.velX;\n if(rock.x<0 || rock.x>w){\n rock.velX = -rock.velX;\n }\n }\n}", "function moveForward(rover) {\n\n switch (rover.direction) {\n\n case \"N\":\n rover.y++;\n break;\n\n case \"E\":\n rover.x++;\n break;\n\n case \"S\":\n rover.y--;\n break;\n\n case \"W\":\n rover.x--;\n break;\n }\n}", "playerTrap() {\n this.trap = new Trap({\n scene: this.scene,\n x: this.x,\n y: this.y\n }, this);\n }", "move() {\n this.x = this.x + random(-2, 2);\n this.y = this.y + random(-2, 2);\n }", "function moveEverything() {\n updateTrack();\n p1.carMove();\n\n if (currentScore >= currentScoreGoal)\n {\n if (stageNow < stageTuning.length - 1){\n levelUp(false);\n }\n else {\n attractLoop = true;\n }\n }\n\n if (trafficCars.length < stageTuning[stageNow].maxCars && Math.random() < stageTuning[stageNow].spawnFreq) {\n spawnTrafficCar();\n }\n\n // Car collisions below\n for (var i = 0; i < trafficCars.length; i ++) {\n for (var ii = i+1; ii < trafficCars.length; ii ++) {\n var laneDiff = Math.abs(trafficCars[i].lanePerc - trafficCars[ii].lanePerc);\n\n if (laneDiff < 0.1) {\n var yDiff = Math.abs(trafficCars[i].y - trafficCars[ii].y);\n\n if (yDiff <= CLOSE_ENOUGH_TO_AVOID) {\n var futureYDiff = Math.abs((trafficCars[i].y - trafficCars[i].speed) - \n (trafficCars[ii].y - trafficCars[ii].speed));\n if (yDiff > futureYDiff) {\n var tempSpeedI = trafficCars[i].speed;\n\n trafficCars[i].speed = trafficCars[ii].speed;\n trafficCars[ii].speed = tempSpeedI;\n //console.log(\"bumped\" + i + \" : \" + ii);\n }\n }\n }\n }\n }\n\n // Updating car positions\n for (var i = 0; i < trafficCars.length; i ++) {\n trafficCars[i].move();\n }\n\n for (var i = trafficCars.length-1; i >= 0; i--) {\n if (trafficCars[i].readyToRemove) {\n trafficCars.splice(i, 1);\n }\n }\n\n // Updating point popper positions\n for (var i = 0; i < pointPoppers.length; i ++) {\n pointPoppers[i].move();\n }\n\n for (var i = pointPoppers.length-1; i >= 0; i--) {\n if (pointPoppers[i].readyToRemove) {\n pointPoppers.splice(i, 1);\n }\n }\n}", "function makeMove(){\n miniMax(boardState, 'computer');\n boardState[computerMove] = 2;\n $('#p' + computerMove).html(computer);\n $('#' + computerMove).css('pointer-events', 'none');\n if(checkWin(boardState) === 2){\n showWin();\n } else if(checkWin(boardState) === 3){\n $('.square').css({'background' : '#BDBDBD', 'border-color' : '#BDBDBD'});\n wait = window.setTimeout(function(){\n $('#message').html('Tie! <br>Play Again?');\n $('.board').css('opacity', 0.2);\n $('.pop-up').css({'opacity' : '1', 'pointer-events' : 'auto'});\n }, 1000);\n }\n }", "move() {\n\n\t\tthis.x += random(-5, 5);\n\t\tthis.y += random(-5, 5);\n\n\t}", "function takeOverAndRefindMoves(){\n //used to pick up manually from any boardstate\n playingComputer = false;\n piecesOnBoard = getPiecesOnBoard(boards[0])\n pickUpFromCurrentPosition()\n}", "move() {\n //Move the kid to the determined location\n this.x = this.nextMoveX;\n this.y = this.nextMoveY;\n //Check in case the kid touches the edges of the map,\n // if so, prevent them from leaving.\n this.handleConstraints();\n }", "resetBoard(){\r\n //location pacman is reset to\r\n this.pos = createVector(13*16+8, 23*16+8); \r\n //resets all of the ghosts\r\n this.blinky = new Blinky();\r\n this.clyde = new Clyde();\r\n this.pinky = new Pinky();\r\n this.inky = new Inky();\r\n //resets pacmans velocity\r\n this.vel = createVector(-1, 0);\r\n this.goTo = createVector(-1,0);\r\n }", "move() {\n this.x += 3;\n this.y += 0;\n if (this.x > 50) {\n this.x += 0;\n this.y += 4;\n }\n if (this.x > 1200) {\n this.y = this.dy;\n this.x = this.dx;\n }\n }", "function MakeMove (move)\n{\n\t//Extracting information from the move number\n\tlet from = FROMSQ(move);\n\tlet to = TOSQ(move);\n\tlet side = GameBoard.side;\n\t\n\tGameBoard.history[GameBoard.hisPly].posKey = GameBoard.posKey;\n\t\n\t//Checking flags\n\t\n\t//en passant case\n\tif ((move & MFLAGEP) != 0)\n\t{\n\t\tif (side == COLORS.WHITE)\n\t\t{\n\t\t\t//Remove the pawn we've 'captured'\t\n\t\t\tClearPiece(to - 10);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t//Remove the pawn we've 'captured'\t\n\t\t\tClearPiece(to + 10);\n\t\t}\n\t}\n\t//castling case\n\telse if ((move & MFLAGCA) != 0)\n\t{\n\t\tswitch (to)\n\t\t{\n\t\t\tcase SQUARES.C1:\n\t\t\t\tMovePiece(SQUARES.A1, SQUARES.D1);\n\t\t\t\tbreak;\n\t\t\tcase SQUARES.C8:\n\t\t\t\tMovePiece(SQUARES.A8, SQUARES.D8);\n\t\t\t\tbreak;\n\t\t\tcase SQUARES.G1:\n\t\t\t\tMovePiece(SQUARES.H1, SQUARES.F1);\n\t\t\t\tbreak;\n\t\t\tcase SQUARES.G8:\n\t\t\t\tMovePiece(SQUARES.H8, SQUARES.F8);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.error(\"Castling to an invalid square\");\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t//If there was an en passant square, we need to reset it (hash it out), because this\n\t//square is reset every turn\n\tif (GameBoard.enPas != SQUARES.NO_SQ)\n\t{\n\t\tHASH_EP();\n\t}\n\t\n\t//I'm not sure why this is here but BFS put it in\n\tHASH_CA();\n\t\n\t//Updating the history table\n\tGameBoard.history[GameBoard.hisPly].move = move;\n\tGameBoard.history[GameBoard.hisPly].fiftyMove = GameBoard.fiftyMove;\n\tGameBoard.history[GameBoard.hisPly].enPas = GameBoard.enPas;\n\tGameBoard.history[GameBoard.hisPly].castlePerm = GameBoard.castlePerm;\n\t\n\t//Handling castling perm, if a square to where a rook or king is, we hash out those values\n\t//Most values are 15, or 1111 in binary (the identity value)\n\tGameBoard.castlePerm &= CastlePerm[from];\n\tGameBoard.castlePerm &= CastlePerm[to];\n\tGameBoard.enPas = SQUARES.NO_SQ;\n\t\n\t//Update castlePerms\n\tHASH_CA();\n\t\n\t//Now we remove the captured piece\n\tlet captured = CAPTURED(move);\n\tGameBoard.fiftyMove++;\t\t\t\t//increasing the move since last capture\n\t\n\tif (captured != PIECES.EMPTY)\n\t{\n\t\tClearPiece(to);\n\t\tGameBoard.fiftyMove = 0;\t\t//if a piece was captured, reset fifty-move timer\n\t}\n\t\n\tGameBoard.hisPly++;\n\tGameBoard.ply++;\n\t\n\tif (PiecePawn[GameBoard.pieces[from]] == BOOL.TRUE)\n\t{\n\t\tGameBoard.fiftyMove = 0;\t\t//if a pawn move, we also reset fifty-move timer\n\t\tif ((move & MFLAGPS) != 0)\n\t\t{\n\t\t\t//If pawn starting move, set en passant square\t\n\t\t\tif (side == COLORS.WHITE)\n\t\t\t{\n\t\t\t\tGameBoard.enPas = from + 10;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tGameBoard.enPas = from - 10;\n\t\t\t}\n\t\t\t//Hash in the en passant to the position key\n\t\t\tHASH_EP();\n\t\t}\n\t}\n\t\n\t//Most special cases have been handled, now we actually move the piece\n\tMovePiece(from, to);\n\t\n\t//Last special case, promotion. Needs to be after the piece is moved from obvious reasons\n\t\n\tif (PROMOTED(move) != PIECES.EMPTY)\n\t{\n\t\t//this is actually where the pawn currently resides, on the last or first rank\n\t\tClearPiece(to);\n\t\t//adding promoted piece\n\t\tAddPiece(to, PROMOTED(move));\n\t}\n\t\n\t//Switch side\n\tGameBoard.side ^= 1;\n\tHASH_SIDE();\n\t\n\t//Ensuring the king is not in check at the end of the move\n\tif (SqAttacked(GameBoard.pList[PCEINDEX(Kings[side], 0)], GameBoard.side))\n\t{\n\t\tTakeMove();\t\t\t//takes back a move if the king is in check\n\t\treturn BOOL.FALSE;\n\t}\n\telse \n\t{\n\t\treturn BOOL.TRUE;\n\t}\n}", "function onSpawn() {\n while(true) {\n pet.moveXY(48, 8);\n pet.moveXY(12, 8);\n }\n}", "move(){\r\n this.x += this.dx;\r\n this.y += this.dy;\r\n\r\n }", "function Pushing() {\n var vel = Speed;\n if (moveamt < PushAbortTime) {\n var [curdx, curdy] = CardinalMoveDirection();\n if ((curdx - dx) | (curdy - dy)) {\n vel = -Speed;\n }\n }\n moveamt += (vel * 4) / (4 + box.W * box.H);\n if (moveamt > 1 || moveamt < 0) {\n if (moveamt > 1) {\n grid.SetRect(boxRect, 0);\n grid.SetRect(playerBounds, 0);\n grid.MoveRect(boxRect, dx, dy);\n grid.MoveRect(playerBounds, dx, dy);\n } else {\n grid.SetRect(playerBounds, 0, dx, dy);\n grid.SetRect(boxRect, 0, dx, dy);\n }\n grid.SetRect(playerBounds, grid.TileTemporary);\n grid.SetRect(boxRect, grid.TileBox);\n box.X = boxRect.X;\n box.Y = boxRect.Y;\n Player.X = box.X + relx;\n Player.Y = box.Y + rely;\n\n if (entityDevice.CheckBox(box)) {\n // Device is now using the box, so don't mark the box as idle.\n Done(false);\n } else {\n Player.Update = Grabbed;\n }\n return;\n }\n box.X = boxRect.X + moveamt * dx;\n box.Y = boxRect.Y + moveamt * dy;\n Player.X = box.X + relx;\n Player.Y = box.Y + rely;\n }", "move(x,y){\n this.position.x += x;\n this.position.y += y;\n }", "moveZombie(zomb) {\n //Gather all appropriate variables.\n var directions = []; //An array of directions that the zombie will take.\n var surTileX = this.Survivor.getCurrentTile().getTileX(); //Tile X location of the Survivor.\n var surTileY = this.Survivor.getCurrentTile().getTileY(); //Tile Y location of the Survivor.\n var zombTileX = zomb.getCurrentTile().getTileX(); //Tile X of this zombie.\n var zombTileY = zomb.getCurrentTile().getTileY(); //Tile Y of this zombie.\n\n var xDelta = surTileX - zombTileX; //Delta between zombie and survivor's X locations.\n var yDelta = surTileY - zombTileY; //Delta between zombie and survivor's Y locations.\n\n var isAbove = (yDelta < 0); //Whether the survivor is above or below the zombie.\n var isLeft = (xDelta < 0); //Whether the survivor is to the left or right of the zombie.\n var isEvenHor = (yDelta == 0); //Whether the survivor is even on the horizontal plane with the zombie.\n var isEvenVert = (xDelta == 0); //Whether the survivor is even on the veritcal plane with the zombie.\n\n //Populate the directions array.\n if (isEvenHor) {\n if (isLeft) {\n directions.push('left');\n } else {\n directions.push('right');\n }\n }\n if (isEvenVert) {\n if (isAbove) {\n directions.push('up');\n } else {\n directions.push('down');\n }\n }\n\n if (isAbove && isLeft) {\n directions.push('left');\n directions.push('up');\n } else if (isAbove && !isLeft) {\n directions.push('up');\n directions.push('right');\n } else if (!isAbove && isLeft) {\n directions.push('down');\n directions.push('left');\n } else if (!isAbove && !isLeft) {\n directions.push('down');\n directions.push('right');\n } else {\n //Do nothing.\n }\n\n\n //console.log(\"Directions: \" + directions[0] + \" \" + directions[1] + \" \" + directions[2] + \" \" + directions[3]);\n\n for (const t of directions) {\n if (this.moveCharacter(zomb, t)) {\n return;\n }\n }\n\n\n }", "function makeMove() {\n grid = makeAMove(grid);\n myMove = false;\n updateMove();\n}", "moveControl() {\n const { view } = this;\n const size = this.sizeShip;\n const bufferY = 3;\n\n this.y += this.speed;\n\n if (this.x < size || this.x >= view.width + size) {\n this.x = view.getRandomPositionX(size);\n }\n if (this.y >= view.height + size) {\n this.y = -view.getRandomPositionY(size) / 2;\n }\n }", "_reset_poke() {\n\t\tthis.level = 1\n\t\tthis.moves = []\n\t}", "function moveGameItem(obj) {\n obj.x += obj.velocityX;\n obj.y += obj.velocityY;\n obj.$element.css('left', obj.x);\n obj.$element.css('top', obj.y);\n\n if (obj.y > BOARD_HEIGHT - obj.height) {\n obj.y = BOARD_HEIGHT - obj.height;\n\n }\n if (obj.y < 0) {\n obj.y = 0;\n }\n }", "function makePoo(){\n pooSize = 20;\n pooX = petX - 20;\n pooY = petY + 20;\n}", "move() {\r\n this.x = this.x + this.v;\r\n }", "function newMove() {\n game.currentGame.push(game.possibilities[Math.floor(Math.random()*4)]);\n showMoves();\n }", "function test14() {\n reset();\n currentPiece = new I();\n let temp;\n while (!rightCollisionCheck()) {\n currentPiece.moveHor(1)\n }\n temp = copyPiece(currentPiece)\n return rotateCollisionCheck();\n}", "function ducksFly() {\n\tvar canvas = document.getElementById(\"game\");\n\n\tfor (i=0; i < ducks.length; i++) {\n\t\tducks[i].targetY = canvas.height/2;\n\t\tducks[i].targetX = -5*duckSize;\n\t}\n}", "function torus_up()\t{let temp = grid.shift(); grid.push(temp);}", "function createRocks()\n{\n\t\tvar direction\n\t\tclock ++;\n\t\tif (clock == 100)\n\t\t{\n\t\t\t\n\t\t\tdirection = random(0,2);\n\t\t\t\n\t\t\tif (direction < 1) direction = 0;\n\t\t\telse direction = height;\n\t\t\t\n\t\t\tboundary = createSprite(Clength,Cheight,1,Cheight*2);\n\t\t\t//boundary.visible = false;\n\t\t\t\n\t\t\trock = createSprite(Clength,direction,75,random(Cheight/2,Cheight));\n\t\t\trock.velocity.x= speed;\n\t\t\trock.immovable = true;\n\t\t\tboundary.velocity.x = speed;\n\t\t\tboundary.visible = false;\n\t\t\trocks.add(rock);\n\t\t\tboundaries.add(boundary);\n\t\t\tclock = 0;\n\t\t}\t\t\t\n}", "newPos() {\n this.x += this.speedX;\n this.y += this.speedY + this.gravity;\n this.hitBottom();\n this.update();\n }", "newPos() {\n this.x += this.speedX;\n this.y += this.speedY + this.gravity;\n this.hitBottom();\n this.update();\n }", "function moveDuck()\n{\n //update the ducks global location\n Dlocx = Dlocx + dirX*time;\n Dlocy = Dlocy + dirY*time;\n\n if (FlegR > radians(45))\n {\n legDown = false;\n }\n if (FlegR < radians(-45))\n {\n legDown = true;\n }\n\n if (legDown)\n {\n FlegR += 0.05;\n }\n else\n {\n FlegR -= 0.05;\n }\n\n\n //find out how much the neck is rotated to decide which way to rotate\n //these constrain how much the neck moves up and down\n if (neckR < -1)\n {\n neckDown = false;\n }\n if (neckR > 0.3)\n {\n neckDown = true;\n }\n\n // depending on which way we need to rotate, do so\n if (neckDown == true)\n {\n neckR -= .03;\n }\n else\n {\n neckR += .03;\n }\n\n //find out how much the wing is rotated to decide which way to rotate\n //these constrain how much the wing moves up and down\n if (wingR < -1.1)\n {\n wingDown = true;\n }\n if (wingR > 0.3)\n {\n wingDown = false;\n }\n\n // depending on which way we need to rotate, do so\n if (wingDown == false)\n {\n wingR -= .03;\n }\n else\n {\n wingR += .03;\n }\n\n if(leg1rot > PI/6 || leg1rot < -PI/10) {\n leg1up = !leg1up;\n }\n\n if(leg2rot > PI/6 || leg2rot < -PI/10) {\n leg2up = !leg2up;\n }\n\n if(leg1up) {\n leg1rot += PI/160;\n } else {\n leg1rot -= PI/160;\n }\n\n if(leg2up) {\n leg2rot += PI/160;\n } else {\n leg2rot -= PI/160;\n }\n\n if(beakRot < 0 || beakRot > PI/8) {\n beakOpen = !beakOpen;\n }\n\n if(beakOpen) {\n beakRot += PI/120;\n } else {\n beakRot -= PI/120;\n }\n}", "function moveScorpian() {\n const down = scorpianCurrentPosition + width\n const left = scorpianCurrentPosition - 1\n const right = scorpianCurrentPosition + 1\n const up = scorpianCurrentPosition - width\n\n checkGhostMode(scorpianClass, scorpianCurrentPosition)\n removeGhost(scorpianCurrentPosition, scorpianClass)\n\n if (!cells[scorpianCurrentPosition].classList.contains(waspClass) || !cells[scorpianCurrentPosition].classList.contains(tarantulaClass)) {\n // checks movement through tunnel\n if (scorpianCurrentPosition === 55 && scorpianXGoal > a && scorpianPreviousPosition !== 65) {\n scorpianPreviousPosition = scorpianCurrentPosition\n scorpianCurrentPosition = 65\n } else if (scorpianCurrentPosition === 65 && scorpianXGoal < a && scorpianPreviousPosition !== 55) {\n scorpianPreviousPosition = scorpianCurrentPosition\n scorpianCurrentPosition = 55\n } else if (scorpianYGoal > b) {\n // console.log('ghost higher than player') \n if (isDownClear(scorpianCurrentPosition) === true && down !== scorpianPreviousPosition && scorpianCurrentPosition !== 37 && scorpianCurrentPosition !== 39) { // check tile below is clear, check previous position\n moveCharacter('down', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move down\n } else { // if below is blocked, do the following\n if (scorpianXGoal > a) { // if ghost left of player\n // console.log('ghost left of player')\n if (isRightClear(scorpianCurrentPosition) === true && right !== scorpianPreviousPosition) { // check tile to right is clear\n moveCharacter('right', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move right\n } else { // if down and right is blocked\n // console.log('border to right')\n if (isLeftClear(scorpianCurrentPosition) === true && left !== scorpianPreviousPosition) { // check tile to left is clear\n moveCharacter('left', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move left\n } else { // if down, right and left is blocked\n // console.log('border to left')\n if (isUpClear(scorpianCurrentPosition) === true) { // check tile above is clear\n moveCharacter('up', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move up\n } \n }\n }\n } else if (scorpianXGoal < a) { // if ghost is to right of player\n // console.log('ghost to right of player')\n if (isLeftClear(scorpianCurrentPosition) === true && left !== scorpianPreviousPosition) { // check tile to left is clear\n moveCharacter('left', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move left\n } else { // if down and left is blocked\n // console.log('border to left') \n if (isRightClear(scorpianCurrentPosition) === true && right !== scorpianPreviousPosition) { // check tile to right is clear\n moveCharacter('right', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move right\n } else { // if down, left and right is blocked\n // console.log('border below')\n if (isUpClear(scorpianCurrentPosition) === true) { // check tile above is clear\n moveCharacter('up', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move up\n }\n }\n }\n } else if (scorpianXGoal === a) { // if player and ghost are in line on y-axis\n // console.log('ghost directly above player')\n if (isLeftClear(scorpianCurrentPosition) === true && left !== scorpianPreviousPosition) { // check if left tile is clear\n moveCharacter('left', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move left\n } else if (isRightClear(scorpianCurrentPosition) === true && right !== scorpianPreviousPosition) { // if down and left are blocked, check if right tile is clear\n moveCharacter('right', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move right\n } else if (isUpClear(scorpianCurrentPosition) === true) { // if down, left and right are blocked, check if tile above is clear\n moveCharacter('up', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move up\n }\n }\n }\n } else if (scorpianYGoal < b) { // if ghost is below player\n // console.log('ghost lower than player')\n if (isUpClear(scorpianCurrentPosition) === true && up !== scorpianPreviousPosition) { // check tile above is clear\n moveCharacter('up', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost up \n } else { // if above is blocked\n if (scorpianXGoal > a) { // check if ghost is left of player\n // console.log('ghost left of player')\n if (isRightClear(scorpianCurrentPosition) === true && right !== scorpianPreviousPosition) { // check if tile to right is clear\n // console.log(right)\n moveCharacter('right', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost right\n } else if (isLeftClear(scorpianCurrentPosition) === true && left !== scorpianPreviousPosition) { // if above and right is blocked, check left is clear\n moveCharacter('left', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost left\n } else if (isDownClear(scorpianCurrentPosition) === true && scorpianCurrentPosition !== 37 && scorpianCurrentPosition !== 39) { // if above, right and left is blocked, check down is clear\n moveCharacter('down', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost down\n } else if (isUpClear(scorpianCurrentPosition) === true) {\n moveCharacter('up', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition)\n }\n } else if (scorpianXGoal < a) { // if ghost is right of player\n // console.log('ghost right of player')\n if (isLeftClear(scorpianCurrentPosition) === true && left !== scorpianPreviousPosition) { // check tile to left is clear\n moveCharacter('left', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost left\n } else if (isDownClear(scorpianCurrentPosition) === true && down !== scorpianPreviousPosition && scorpianCurrentPosition !== 37 && scorpianCurrentPosition !== 39) { // if above and left is blocked, check if tile below is clear\n moveCharacter('down', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost down\n } else if (isRightClear(scorpianCurrentPosition) === true) { // if above, left and below is blocked, check right is clear\n moveCharacter('right', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost right\n } else if (isUpClear(scorpianCurrentPosition) === true) {\n moveCharacter('up', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition)\n }\n } else if (scorpianXGoal === a) { // if ghost and player are in line on the y-axis\n // console.log('ghost on same vertical plane as player')\n if (isLeftClear(scorpianCurrentPosition) === true && left !== scorpianPreviousPosition) { // check left tile is clear\n // console.log('move left')\n moveCharacter('left', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost left\n } else if (isRightClear(scorpianCurrentPosition) === true && right !== scorpianPreviousPosition) { // if above and left tile is blocked, check right is clear\n moveCharacter('right', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost right\n } else if (isDownClear(scorpianCurrentPosition) === true && down !== scorpianPreviousPosition && scorpianCurrentPosition !== 37 && scorpianCurrentPosition !== 39) { // if above, left and right tile is blocked, check below is clear \n moveCharacter('down', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move ghost down\n } else if (isUpClear(scorpianCurrentPosition) === true) {\n moveCharacter('up', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition)\n }\n }\n }\n } else if (scorpianYGoal === b) { // if ghost and player are in line on x-axis\n // console.log('ghost on same horizontal plane as player')\n if (scorpianXGoal > a) { // if ghost to left of player\n // console.log('ghost left of player')\n if (isRightClear(scorpianCurrentPosition) === true && right !== scorpianPreviousPosition) { // check tile to right is clear\n moveCharacter('right', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move right\n } else if (isLeftClear(scorpianCurrentPosition) === true && left !== scorpianPreviousPosition) { // if right is blocked, check tile to left is clear\n moveCharacter('left', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move left\n } else if (isDownClear(scorpianCurrentPosition) === true && down !== scorpianPreviousPosition && scorpianCurrentPosition !== 37 && scorpianCurrentPosition !== 39) { // if right and left blocked, check tile below is clear\n moveCharacter('down', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move down\n } else if (isUpClear(scorpianCurrentPosition) === true) { // if right, left and down blocked, check tile above is clear\n moveCharacter('up', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move up\n }\n } else if (scorpianXGoal < a) { // if ghost to right of player\n // console.log('ghost right of player')\n if (isLeftClear(scorpianCurrentPosition) === true && left !== scorpianPreviousPosition) { // check left is clear\n moveCharacter('left', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move left\n } else if (isDownClear(scorpianCurrentPosition) === true && down !== scorpianPreviousPosition && scorpianCurrentPosition !== 37 && scorpianCurrentPosition !== 39) { // if left blocked, check down is clear\n // console.log('left not clear')\n moveCharacter('down', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move down\n } else if (isRightClear(scorpianCurrentPosition) === true && right !== scorpianPreviousPosition) { // if left and down blocked, check right is clear\n // console.log('down not clear')\n moveCharacter('right', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move right\n } else if (isUpClear(scorpianCurrentPosition) === true) { // if left, down and right blocked, check up is clear\n // console.log('right not clear, moving up')\n moveCharacter('up', scorpianClass, scorpianPreviousPosition, scorpianCurrentPosition) // move up\n }\n }\n } \n }\n \n addGhost(scorpianCurrentPosition, scorpianClass)\n if (cells[scorpianCurrentPosition].classList.contains(playerClass)) {\n touchGhost(playerCurrentPosition)\n if (ghostMode === 'split class' || ghostMode === 'chase class') {\n playerCurrentPosition = playerStartPosition\n }\n }\n setCharacterCoordinates(scorpianClass, scorpianCurrentPosition, a, b)\n }", "think() {\n let targ = {\n x: this.player.target.x,\n y: this.player.target.y,\n };\n if (this.player.command.autospin) {\n let kk = Math.atan2(this.body.control.target.y, this.body.control.target.x) + 0.02;\n targ = {\n x: 100 * Math.cos(kk),\n y: 100 * Math.sin(kk),\n };\n }\n if (this.player.command.godmode) {this.body.invuln = true;}\n if (this.body.invuln) {\n if ((this.player.command.right || this.player.command.left || this.player.command.up || this.player.command.down || this.player.command.lmb) && (this.player.command.godmode != true)) {\n this.body.invuln = false;\n }\n }\n this.body.autoOverride = this.player.command.override;\n return { \n target: targ,\n goal: {\n x: this.body.x + this.player.command.right - this.player.command.left,\n y: this.body.y + this.player.command.down - this.player.command.up,\n },\n fire: this.player.command.lmb || this.player.command.autofire,\n main: this.player.command.lmb || this.player.command.autospin || this.player.command.autofire,\n alt: this.player.command.rmb,\n };\n }", "function movePlayer(roll, player) {\n //console.log(\"Doubles rolled --------------- \" + doublesRolled + \"b4\");\n //mortgageProperty(player);\n console.log(\"Log - Moving the player \" + roll + \" places.\")\n $(\"img\").remove(\".player_\" + player);\n for (x = 0; x < roll; x++) {\n if (playersPositions[player] < 40) {\n playersPositions[player]++;\n players[player].location = parseInt(players[player].location + 1);\n //Free Parking\n if (playersPositions[player] == 20) {\n players[player].money = parseInt(players[player].money) + freeParkingValue\n freeParkingValue = 0;\n }\n\n } else {\n console.log(\"Log - Player \" + player + \" has passed go and has recieved +£200\");\n updateText(\"You have recieved £200 for passing go.\");\n players[player].passed_go = 1;\n players[player].money = parseInt(players[player].money + 200)\n updateMoney(player, players[player].money);\n playersPositions[player] = 1;\n players[player].location = parseInt(0);\n }\n }\n $(\"#\" + tiles[players[player].location + 1]).append('<img class=\"player_' + player + '\"src=\"img/' + currentPlayerIcon[player] + '.png\" width=\"35px\" />').show('slow');\n console.log(\"Player location = \" + players[player].location)\n\n if (players[player].location == 30) {\n sendPlayerToJail(player);\n }\n if (tiles2[players[player].location].canBuy == 1) {\n //-------------------------------------------\n //Buy\n //-------------------------------------------\n checkPurchase(player);\n completeTurn(player);\n } else if (tiles2[players[player].location].ownedBy > 0 && tiles2[players[player].location].mortgaged == 0) {\n //-------------------------------------------\n //Pay rent\n //-------------------------------------------\n if (parseInt(players[player].money - calcRent(players[player].location)) < 1) {\n //cant afford rent\n //if (confirm('You cannot afford to pay £' + tiles2[players[player].location].rent + ' rent. Please mortgage proprties.')) {\n rentPayingActive = true;\n payingPlayer = true;\n cantPay(calcRent(players[player].location), tiles2[players[player].location].ownedBy);\n\n $('#infoBox').html(\"You cannot afford to pay £\" + calcRent(players[player].location) + \" rent. Please mortgage proprties.\");\n completeTurn(player);\n } else {\n payRent(player);\n completeTurn(player);\n }\n } else {\n //-------------------------------------------\n //Both taxes\n //-------------------------------------------\n //Income tax 1\n console.log(\"I should trigger tax!\");\n\n if ((players[currentPlayer].location == 4)) {\n if ((parseInt(players[player].money) - 200) < 0) {\n //rentPayingActive = true;\n updateText(\"You cannot afford £200 income tax. Please mortgage properties or declare bankrupsy.\");\n //console.log(players[player].money + \" p = \" + player);\n cantPay(200, \"bank\");\n completeTurn(player);\n } else {\n payTax(player, 200);\n completeTurn(player);\n }\n\n }\n //Super tax\n if ((players[currentPlayer].location == 38)) {\n if ((parseInt(players[player].money) - 100) < 0) {\n //rentPayingActive = true;\n updateText(\"You cannot afford £100 super tax. Please mortgage properties or declare bankrupsy.\");\n //console.log(players[player].money + \" p = \" + player);\n cantPay(100, \"bank\");\n completeTurn(player);\n } else {\n payTax(player, 200);\n completeTurn(player);\n }\n\n }\n\n //-------------------------------------------\n //Not purchaseable, take appropriate action.\n //-------------------------------------------\n completeTurn(player);\n }\n checkCard(player);\n}", "move(){\n\n //if the ball hit the top/bottom wall, inverse the y direction\n if(this.y + this.dy > this.canvas.height - this.img.height || this.y + this.dy < 0) {\n this.dy = -this.dy;\n }\n\n\n /**\n * hitboxe of the left paddle (current player)\n * Normally, the paddle is divided in differents parts to increase the ball rebound.\n * Unfortunatelly, i don't have implement this function yet.\n */\n if(\n this.x > this.paddle.x &&\n this.x <= (this.paddle.x + this.paddle.img.width) &&\n this.y + this.img.height > this.paddle.y &&\n this.y <= (this.paddle.y + this.paddle.img.height)){\n\n // x + 2 to avoid lags into the paddle\n this.x = this.x + 2 ;\n this.dx = -this.dx;\n this.dy = this.dy;\n\n\n } // fin if left paddle\n\n /**\n * hitboxe of the right paddle (current player)\n * Normally, the paddle is divided in differents parts to increase the ball rebound.\n * Unfortunatelly, i don't have implement this function yet.\n */\n if(\n this.x > this.paddle.x && this.x + this.img.width > (this.paddle2.x) &&\n this.x +this.img.width <= (this.paddle2.x + this.paddle2.img.width) &&\n this.y + this.img.height > (this.paddle2.y) &&\n this.y + this.img.height <= (this.paddle2.y + this.paddle2.img.height)){\n\n // x - 2 to avoid lags into the paddle\n this.x = this.x - 2;\n this.dx = -this.dx;\n this.dy = this.dy;\n } // fin du right paddle\n\n // add the ball direction speed to the ball x/y position (to create move animation)\n this.x += this.dx;\n this.y += this.dy;\n\n /**\n * This part is reserved to the FIRST player\n * When the ball reach a part of the screen, it will send an update signal to all the connected players (except the sender)\n * It's used to reduce the network lag / different ball position between the players\n */\n if(this.game.first){\n // x position reached: update between 20% and 40% of the screen / 60% and 80%\n // y position reached: update betweend 25% and 75% of the screen\n if(this.x + this.dx >= this.canvas.width*0.2 && this.x + this.dx <= this.canvas.width*0.40 || this.x + this.dx >= this.canvas.width*0.6 && this.x + this.dx <= this.canvas.width*0.8 || this.y + this.dy >= this.canvas.height*0.25 && this.y + this.dy <= this.canvas.height*0.75){\n this.game.network.update();\n }\n\n /**\n * these 2 if are used to stop the ball and update score when the ball is out of map\n * when the ball reach the left wall, it will give a point for the opponent\n * when the ball reach the right wall, it will give a point for the current player\n */\n if(this.x + this.dx + this.img.width > this.canvas.width) {\n this.game.network.updateScorePlayer1();\n this.game.network.stopBall()\n }\n\n if(this.x + this.dx + (this.img.width/2)< 0){\n this.game.network.updateScorePlayer2();\n this.game.network.stopBall();\n }\n }\n\n }", "function repositionGameItem(){\n //move the box to a new X position \n positionX += speedX; //update the x position \n$(\"#gameItem\").css(\"left\", positionX); //redraws according to y coordinategit push\n\n //move the box to a new Y position\n positionY += speedY; //update the y position\n $(\"#gameItem\").css(\"top\", positionY); //redraws according to y coordinate\n }", "function drop() {\nif(move(down)==false){\nif(active.pivot.r < 1) {\n setTimeout(gameEnd,100);\n }\n checkLines();\n setTimeout(spawnPiece,100);\n\n}\n}", "move() {\n let to_move = [this.head].concat(this.parts);\n this.dir_q.unshift(this.dir);\n for (let i = 0; i < to_move.length; i++) {\n to_move[i].add(this.dir_q[i]);\n if (to_move[i].x < -width / 2) to_move[i].x = width / 2 - BOX;\n if (to_move[i].x >= (width / 2) - 1) to_move[i].x = -width / 2;\n if (to_move[i].y < -height / 2) to_move[i].y = height / 2 - BOX;\n if (to_move[i].y >= (height / 2) - 1) to_move[i].y = -height / 2;\n }\n }", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "move() {\r\n this.x += this.vX;\r\n this.y += this.vY;\r\n }", "function moveForward(rover){\n console.log(`----${rover.name}----`);\n console.log(\"moveForward was called\");\n switch (rover.direction) {\n case 'N':\n if (rover.y > 0) {\n rover.y--;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.y++\n console.log(`There is an other Rover at (${rover.x},${rover.y-1}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.y++;\n console.log(`There is an ${o} at (${rover.x},${rover.y-1}). Change your way!`);\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n case 'W':\n if (rover.x > 0) {\n rover.x--;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.x++\n console.log(`There is an other Rover at (${rover.x-1},${rover.y}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.x++;\n console.log(`There is an ${o} at (${rover.x-1},${rover.y}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n case 'S':\n if (rover.y < 9) {\n rover.y++;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.y--\n console.log(`There is an other Rover at (${rover.x},${rover.y+1}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.y--;\n console.log(`There is an ${o} at (${rover.x},${rover.y+1}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n case 'E':\n if (rover.x < 9) {\n rover.x++;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.x--\n console.log(`There is an other Rover at (${rover.x+1},${rover.y}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.x--;\n console.log(`There is an ${o} at (${rover.x+1},${rover.y}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n }\n console.log(`Direction: ${rover.direction}`);\n console.log(`Position: (${rover.x},${rover.y})`);\n rover.travelLog.push({x: rover.x, y: rover.y});\n}" ]
[ "0.6904537", "0.6877199", "0.6836366", "0.6660832", "0.6590301", "0.6559333", "0.63856685", "0.63856685", "0.62893313", "0.6280321", "0.62398505", "0.6212006", "0.62041956", "0.61116284", "0.609998", "0.6085453", "0.5985254", "0.597981", "0.5977108", "0.5959626", "0.5957291", "0.5957291", "0.5952953", "0.5912762", "0.59087765", "0.5898866", "0.58734447", "0.5868848", "0.58560383", "0.5855964", "0.5855142", "0.5850827", "0.58494353", "0.584019", "0.58343595", "0.5829699", "0.5820428", "0.5793761", "0.5789963", "0.57848155", "0.57723945", "0.5772056", "0.5770883", "0.5766652", "0.5764069", "0.57513636", "0.5745585", "0.5745481", "0.5738435", "0.57262033", "0.57246757", "0.5720412", "0.5702734", "0.5699457", "0.5687843", "0.56856436", "0.5677826", "0.5674509", "0.5673043", "0.566909", "0.5666902", "0.5666209", "0.5665959", "0.56637853", "0.5661003", "0.5645091", "0.56427056", "0.5637606", "0.5637575", "0.56291354", "0.56249315", "0.5622956", "0.56225634", "0.56192905", "0.56178534", "0.56155187", "0.56138825", "0.56027067", "0.55998784", "0.5598736", "0.559442", "0.55881774", "0.55859643", "0.5584246", "0.5583825", "0.55804473", "0.5567583", "0.55675447", "0.55675447", "0.556753", "0.55673707", "0.5566492", "0.5564449", "0.55628556", "0.5560838", "0.5557582", "0.555683", "0.5556606", "0.55546", "0.5548192" ]
0.58405536
33
cover up win screen
function coverWin() { noStroke(); fill(130, 206, 245); rect(0,0,190,85); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function winScreen() {\n image(introScreenBackground, 0, 0);\n\n push();\n noFill();\n noStroke();\n rect(285, 300, 335, 100);\n pop();\n\n rainRun();\n\n lightningGenerator();\n\n animation(huntAgainAnim, 450, 350);\n\n animation(winMaskAnim, 475, 200);\n}", "function win(){\n bg.g = 0;\n bg.b = 0;\n\n fill(250);\n textAlign(CENTER);\n textSize(50);\n text('THEY FOUND LOVE',bg.w/2,bg.h/2)\n }", "function adjustWindow() {\n // get window size\n winW = $(window).width();\n winH = $(window).height();\n\n // app img animation\n topOffs();\n \n handleScroll();\n}", "function Win(){\n\t\tif (p1lives == 0){\n\t\t\tscreen = 8;\n\t\t}else if(p2lives == 0){\n\t\t\tscreen = 8;\n\t\t}\n\t}", "function winDraw(curWin) {\n $(\".section\").hide();\n $(curWin).show();\n}", "function win() {\n fill(tileWhite.fill.r, tileWhite.fill.g, tileWhite.fill.b); // Same white as white tiles\n displayText(`Congrats!\n The princess will definitely notice you.\n Click anywhere to get more bread!`);\n}", "function redWin(redw, redh) {\r\n\twindowWidth = redw;\r\n\twindowHeight = redh;\r\n\twindow.moveTo(0, 0);\r\n\twindow.resizeTo(windowWidth, windowHeight);\r\n}", "function winScreen() {\n\tctx.fillStyle = \"#0000FF\";\n\tctx.fillRect(0,0,canvas.width,canvas.height);\n\tctx.fillStyle = \"#FFFFFF\";\n\tctx.fillRect(canvas.width/2 - 120,320,240,140);\n\tctx.font = \"72px Arial\";\n\tctx.fillText(\"GAME OVER\", 60, 160);\n\tctx.fillText(\"WINNER\", 100, 260);\n\tctx.font = \"48px Arial\";\n\tctx.fillStyle = \"black\";\n\tctx.fillText(\"REPLAY\", 200, 400);\n}", "function winOrLoseScreen(){\n if (!win){\n GameOverGraphic()\n BGM.pause()\n } else {\n youWinGraphic()\n BGM.pause()\n }\n }", "function topHalf() {\n let window = Window.focused();\n\n if (window) {\n let screen = window.screen().flippedVisibleFrame();\n let fullScreenWidth = screen.width;\n let halfScreenHeight = screen.height / 2;\n\n window.setTopLeft({\n x: screen.x,\n y: screen.y,\n });\n\n window.setSize({\n height: halfScreenHeight,\n width: fullScreenWidth,\n });\n }\n}", "function drawWin(){\r\n\tctx.drawImage(imgwin,0,0,1118,523,0,0,800,400);\r\n}", "function introScreen() {\n SDPresents = new image(DEMO_ROOT + \"/def/resources/senior.png\");\n presentsScreen = SeniorDads.ScreenHandler.Codef(640,400,name,zIndex++);\n \t\tSDPresents.draw(presentsScreen,0,0);\n \t}", "function winScreen() {\n push();\n textSize(30);\n fill(235, 216, 52);\n stroke(0);\n strokeWeight(5);\n textAlign(CENTER, CENTER);\n text(`You popped enough bubbles`, width / 2, height / 2);\n pop();\n}", "function displayWin(){\n\ttrack.currentPage = 1; \n\tplayBackgroundWin();\n\tresetTimer();\n\tpageOptions.reference.innerHTML = \"\";\n\tpageOptions.reference.innerHTML = \"<img src='img/youwin.png' style='display:block;width:90%;height:auto;margin:auto;margin-top:15%'>\"+\n\t\t\t\t\"<img src='' onclick='playBackground()' id='ayy'>\" +\n \"<img src='img/button_menu.png' onclick='pageOptions.setPage()' id='menu'>\";\n\n switch(levelUnlock.currentLevel){\n \tcase 1: levelUnlock.lvl2 = true;\n \t\t\tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage2()' id='continueButton'>\";\n \t\tbreak;\n \tcase 2:\n \t\t\tlevelUnlock.lvl3 = true;\n \t\t\tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage3()' id='continueButton'>\";\n \t\tbreak;\n \tcase 3:\n \t\t\tlevelUnlock.lvl4 = true;\n \t\t\tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage4()' id='continueButton'>\";\n \t\tbreak;\n \tcase 4:\n\t\t \tlevelUnlock.lvl5 = true;\n\t\t \tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage5()' id='continueButton'>\";\n \t\tbreak;\n \tcase 5:\n \t\t\tlevelUnlock.lvl6 = true;\n\t\t \tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage6()' id='continueButton'>\";\n \t\tbreak;\n \tcase 6:\n \t\t\tlevelUnlock.lvl7 = true;\n\t\t \tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage7()' id='continueButton'>\";\n \t\tbreak;\n \tcase 7:\n \t\t\tlevelUnlock.lvl8 = true;\n\t\t \tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage8()' id='continueButton'>\";\n \t\tbreak;\n \tcase 8:\n \t\t\tlevelUnlock.lvl9 = true;\n\t\t \tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage9()' id='continueButton'>\";\n \t\tbreak;\n \tcase 9:\n \t\t\tlevelUnlock.lvl10 = true;\n\t\t \tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage10()' id='continueButton'>\";\n \t\tbreak;\n \tcase 10:\n \t\t\tlevelUnlock.lvl11 = true;\n\t\t \tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage11()' id='continueButton'>\";\n \t\tbreak;\n \tcase 11:\n \t\t\tlevelUnlock.lvl12 = true;\n\t\t \tpageOptions.setLevelUnlock();\n \t\t\tpageOptions.reference.innerHTML+= \"<img src= 'img/button_continue.png' onclick='pageOptions.setPage12()' id='continueButton'>\";\n \t\tbreak;\n\n \tdefault:\n \t\tbreak;\n }\n setAudioImg();\n clock.pause2 = false; \n}", "function showToTop() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (nectarDOMInfo.scrollTop > 350 && !$offCanvasEl.is('.fullscreen.open') ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#to-top').stop().transition({\r\n\t\t\t\t\t\t\t'bottom': '17px'\r\n\t\t\t\t\t\t}, 350, 'easeInOutCubic');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.off('scroll', showToTop);\r\n\t\t\t\t\t\t$window.on('scroll', hideToTop);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function checkWin() {\n if (sticks.get(2).disks.length === 8 && !isWon) {\n alphaBG = 0;\n drawWinAnimation();\n }\n}", "function updateScreen(){\t//funcio (bucle) que s'executa per actualitzar l'estat de la pantalla del joc\n\tcuttingSegments();\t//mira si hi ha segments que es creuin\n\tdrawAll();\t\t\t//dibuixa al canvas\n\tupdateState();\t\t//reescriu el nivell i el % completat\n}", "function user_go_up()\r\n{\r\n\tif(starting_shot == true)\r\n\t{\r\n\t\tmove(\"up\", \"user\");\r\n\t\t//variable_content_viewer();\r\n\t\tdisplay();\r\n\t}\r\n\tif(user_navigate_allow == true)\r\n\t{\r\n\t\tmove(\"up\", \"user\");\r\n\t\t//variable_content_viewer();\r\n\t\tuser_navigate_allow = false;\r\n\t}\r\n}", "function displayIntroScreen() {\n image(imgIntroScreen, 0, 0, windowWidth, windowWidth * 0.4);\n\n}", "function fullScreen() {\n let window = Window.focused();\n\n if (window) {\n let screen = window.screen().flippedVisibleFrame();\n\n window.setTopLeft({\n x: screen.x,\n y: screen.y,\n });\n\n window.setSize({\n height: screen.height,\n width: screen.width,\n });\n }\n}", "showCover() {\n this.add.image(0, 0, 'splash-screen').setOrigin(0);\n }", "function draw_presentsScreen() {\n \tif ( defaultFalse( currentPart.presents ) ) \t\n \t\tpresentsScreen.show();\n \telse \n \t\tpresentsScreen.hide();\n }", "drawOffscreen() { }", "function winSizer() {\r\n\twindowWidth = window.screen.availWidth;\r\n\twindowHeight = window.screen.availHeight;\r\n\twindow.moveTo(0, 0);\r\n\twindow.resizeTo(windowWidth, windowHeight);\r\n}", "function winScreen() {\n push();\n textSize(30);\n fill(235, 216, 52);\n stroke(0);\n strokeWeight(5);\n textAlign(CENTER, CENTER);\n text(`You were correct enough times`, width / 2, height / 2);\n pop();\n}", "function movedown(){\n undraw();\n currentposition+=GRID_WIDTH;\n draw();\n freeze();\n console.log(down);\n }", "function startScreen() {\n screenWin.style.display = 'none';\n board.style.display = 'none';\n}", "function boardWin() {\r\n}", "function drawCompWin(){\n\n}", "function onSnapEnd () {\n board.position(game.fen())\n removeGreySquares()\n}", "function onSnapEnd () {\n board.position(game.fen())\n removeGreySquares()\n}", "function AdjustFlickscreen(){\n\tif (state!==undefined && state.metadata.flickscreen!==undefined){\n\t\toldflickscreendat=[0,0,Math.min(state.metadata.flickscreen[0],level.width),Math.min(state.metadata.flickscreen[1],level.height)];\n\t}\n}", "function updateWin() {\n\tpush();\n\t\ttranslate(screen.w/2,screen.h/2-cellwidth);\n\t\tfill(TEXTCOLOR);\n\t\tnoStroke();\n\t\ttextSize(cellwidth/2);\n\t\ttextAlign(CENTER,BOTTOM);\n\t\ttext(\"Congratulations, you won!\\n\",0,0);\n\t\ttextAlign(LEFT,TOP);\n\t\ttranslate(-cellwidth*2,0);\n\t\ttextSize(cellwidth/4);\n\t\tdisplayscores();\n\tpop();\n}", "function checkOffScreen() {\n if (\n fish1.x > trx + (3 / 4) * padding ||\n fish1.x < blx - (3 / 4) * padding ||\n fish1.y > bly + (3 / 4) * padding ||\n fish1.y < tly - (3 / 4) * padding\n ) {\n setFish1();\n }\n if (\n fish2.x > trx + (3 / 4) * padding ||\n fish2.x < blx - (3 / 4) * padding ||\n fish2.y > bly + (3 / 4) * padding ||\n fish2.y < tly - (3 / 4) * padding\n ) {\n setFish2();\n }\n}", "function fullscreen(){\n\t\tjQuery('header').css({\n\t\t\theight: jQuery(window).height()-58+'px'\n\t\t});\n\t}", "function pgup() {\n\tvar y = window.pageYOffset - window.innerHeight + 20;\n\twindow.scrollTo(window.pageXOffset, y);\n}", "showWinScreen() {\n let duration = this._game.timeElapsed;\n let score = this._game.score;\n this._view.renderWinScreen(duration, score);\n this._view.bindShowMenu(this.showMenu.bind(this));\n this._view.bindSaveScore(this.saveScore.bind(this));\n }", "function updateScreen() {\n ctx.clearRect(0, 0, W, H);\n ctx2.clearRect(0, 0, W, H);\n\n if (!paused) {\n CanvasOffsetX -= parseInt(Math.min(1, skateBoarder.getSpeed()/10)\n * (scale*epsilonScale) * (skateBoarder.vx/fps));\n CanvasOffsetY -= parseInt(Math.min(1, skateBoarder.getSpeed()/10)\n * (scale*epsilonScale) * (skateBoarder.vy/fps));\n drawNewGrid = true;\n }\n\n drawFlag(homeX, homeY);\n drawTrails(trails);\n drawPlayer(skateBoarder);\n\n if (drawNewGrid) {\n drawGrid();\n drawNewGrid = false;\n if (!paused) {\n\n }\n }\n}", "function topLeftHalf() {\n let window = Window.focused();\n\n if (window) {\n let screen = window.screen().flippedVisibleFrame();\n let halfScreenHeight = screen.height / 2;\n let halfScreenWidth = screen.width / 2;\n\n window.setTopLeft({\n x: screen.x,\n y: screen.y,\n });\n\n window.setSize({\n height: halfScreenHeight,\n width: halfScreenWidth,\n });\n }\n}", "function onSnapEnd() {\r\n board.position(game.fen());\r\n}", "function coverUp() {\n var iframe = $(\"#filepicker_dialog\")\n var x = iframe.offset().left;\n var y = iframe.offset().top;\n var cover = $(\"<div class='cover' style=\\\"z-index: 99999999999999; position:absolute;background:white; width:200px; height:75px;top:\"+y+\";left:\"+x+\"\\\"</div>\").appendTo(\"body\")\n }", "function onSnapEnd () {\n\t board.position(game.fen())\n\t}", "function clearScreen() {\n\t\t//draw the well\n\t\tctx.beginPath();\n\t\tctx.fillStyle = BACKGROUND_COLOR;\n\t\tctx.lineWidth = WELL_THICKNESS;\n\t\tctx.strokeStyle = WELL_BORDER_COLOR;\n\t\tctx.rect(WELL_LEFT, WELL_TOP, WELL_WIDTH * BLOCK_SIZE, WELL_DEPTH * BLOCK_SIZE);\n\t\tctx.fill();\n\t\tctx.stroke();\n\t\t\n\t\tctx.beginPath()\n\t\tctx.fillStyle = BACKGROUND_COLOR;\n\t\tctx.lineWidth = WELL_THICKNESS;\n\t\tctx.strokeStyle = WELL_BORDER_COLOR;\n\t\tctx.rect(PREV_LEFT, PREV_TOP, PREV_WIDTH * BLOCK_SIZE, PREV_DEPTH * BLOCK_SIZE);\n\t\tctx.rect(SCORE_LEFT, SCORE_TOP, SCORE_WIDTH * BLOCK_SIZE, SCORE_DEPTH * BLOCK_SIZE);\n\t\tctx.fill();\n\t\tctx.stroke();\n\t}", "function victoryScreen() {\n textSize(160);\n fill(victRed, victGreen, victBlue);\n textAlign(CENTER);\n text(\"YOU WIN!\", width / 2, height / 2);\n victoryColorShift();\n resetButton();\n}", "function winScreen() {\n intro.style.display = \"grid\";\n winner.style.display = \"inline-block\";\n newGame.style.display = \"block\";\n displayTitle.style.display = \"none\";\n start.style.display = \"none\";\n heading.style.display = \"none\";\n cards.style.display = \"none\";\n\n cards.innerHTML = \"\";\n}", "function displayWin(direction, x, y, board){\n for (let i = 0; i < gameProperties.winningChainLength; i++){\n switch (direction){\n case states.winStates.up: \n board.getTile(x, y - i).winTween();\n break;\n\n case states.winStates.upLeft:\n board.getTile(x - i, y - i).winTween();\n break;\n\n case states.winStates.upRight:\n board.getTile(x + i, y - i).winTween();\n break;\n\n case states.winStates.right:\n board.getTile(x + i, y).winTween();\n break;\n\n default:\n throw \"ERROR DISPLAYING WIN STATE\";\n }\n }\n\n for (let x = 0; x < gameProperties.boardWidth; x++){\n for (let y = 0; y < gameProperties.boardHeight; y++){\n board.getTile(x, y).resetHighlight();\n board.getTile(x, y).disableInput();\n }\n }\n}", "function displayToScreen() {\n\n\n\t}", "function displayWin() {\n push();\n background(0);\n textAlign(CENTER);\n textSize(20);\n textFont(myFont);\n fill(255);\n var winText = \"you win\";\n text(winText,width/2,height/2);\n pop();\n}", "function onSnapEnd() {\n board.position(game.fen());\n}", "function fullscreen(){\n\t\tjQuery('#hero').css({\n width: jQuery(window).width(),\n height: jQuery(window).height()\n });\n\t}", "function winScreenButtonClick (e) {\n\t\tlet getMousePos = function (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\t\t}\n\n\t\tlet pos = getMousePos(canvas, e);\n if (pos.x > WIDTH/2 - 100 && pos.x < WIDTH/2 + 100 && pos.y > HEIGHT*2/3 - 30 && pos.y < HEIGHT*2/3 + 20) {\n \t\tscores = [0, 0]\n\t \twindow.removeEventListener(\"mousedown\", winScreenButtonClick, false)\n \t\tmain();\n }\n}", "function bottomHalf() {\n let window = Window.focused();\n\n if (window) {\n let screen = window.screen().flippedVisibleFrame();\n let fullScreenWidth = screen.width;\n let halfScreenHeight = screen.height / 2;\n\n window.setTopLeft({\n x: screen.x,\n y: screen.y + halfScreenHeight,\n });\n\n window.setSize({\n height: halfScreenHeight,\n width: fullScreenWidth,\n });\n }\n}", "function checkWin() {\n\n}", "function showWin(){\n $('.square').css({'background' : '#BDBDBD',\n 'border-color' : '#BDBDBD',\n 'pointer-events' : 'none'});\n\n $('#' + winLine[0]).css({'background' : '#00E676', 'border-color' : '#00E676'});\n $('#' + winLine[0]).addClass('animated flip');\n $('#' + winLine[1]).css({'background' : '#00E676', 'border-color' : '#00E676'});\n $('#' + winLine[1]).addClass('animated flip');\n $('#' + winLine[2]).css({'background' : '#00E676', 'border-color' : '#00E676'});\n $('#' + winLine[2]).addClass('animated flip');\n\n wait = window.setTimeout(function(){\n $('#message').html('Computer Wins!<br>Play Again?');\n $('.board').css('opacity', 0.2);\n $('.pop-up').css({'opacity' : '1', 'pointer-events' : 'auto'});\n }, 2000);\n}", "function VictoryScreen(TopBorderX,TopBorderY){\n background(0);\n fill(58,134,183);\n textSize(75);\n text('CONGRATULATIONS',250,SmaeY);\n textSize(24);\n text('Thank You for Playing!',500,SmaeY+100);\n text('Press 0 to Begin Again',500,SmaeY+150);\n noLoop();\n}", "function onSnapEnd() {\n board.position(game.fen())\n}", "function switchToGameBoard(){\n\tremoveMenu();\n\tshowColorSchemeButtons();\n\t// Change canvas size\n\tg_canvasWidth = g_canvasHtmlElement.width = window.innerWidth;\n\tg_canvasHeight = g_canvasHtmlElement.height = window.innerHeight;\n}", "function finitoScreen(winClass,text){\r\n $finalScreen.addClass(winClass);\r\n $('.message').text(text)\r\n $finalScreen.show();\r\n $boardScreen.hide();\r\n\r\n }", "function hideWin() {\n winContainer.classList.remove('win-screen');\n}", "function up(){\n turd.css('top', parseInt(turd.css('top')) - 10);\n }", "function drawScreen() {\n ctx.drawImage(pump, 100, 20);\n // we can change the size of the image if we want to\n // the last two numbers are the new width and height\n ctx.drawImage(pump, 420, 20, 100, 70);\n ctx.drawImage(pump, 420, 100, 140, 30);\n // we can also choose to only use part of the original image\n // this will be important later when we use sprite sheets\n // key: (Image, sx, sy, sw, sh, dx, dy, dw, dh) s=source d=destination\n ctx.drawImage(pump, 50, 10, 40, 120, 200, 220, 40, 120);\n ctx.drawImage(pump, 100, 30, 100, 120, 250, 240, 100, 120); \n ctx.drawImage(pump, 210, 50, 40, 120, 360, 260, 40, 120);\n \n \n}", "function openWin($target_id) {\n let scrollVal = $(this).scrollTop(); //頁面滾動的高度\n let winHei = $(document).height(); //文件高度\n let screenHei = $(window).height(); //瀏覽器高度\n // console.log(scrollVal);\n // console.log(screenHei);\n // console.log(winHei);\n\n // 作用:防止作品視窗在document以下做開啟,始之維持在document原始高度中開啟\n if ($(document).height() > scrollVal + screenHei) {\n\n addClass(\".work_hide\", \"fixWindow\");\n document.getElementById($target_id).style.top =\n scrollVal + screenHei * 0.03 + \"px\";\n // scrollVal - screenHei + screenHei * 0.1 * 0.2 + \"px\";\n document.getElementById($target_id).style.display = \"block\";\n \n } else {\n\n addClass(\".work_hide\", \"fixWindow\");\n document.getElementById($target_id).style.top =\n scrollVal - screenHei + \"px\";\n document.getElementById($target_id).style.display = \"block\";\n \n }\n}", "function scrollUp() {\n if (win.scrollTop() >= 1100) {\n scrollToTop.fadeIn();\n } else {\n scrollToTop.fadeOut();\n }\n }", "function setupGameStage() {\n if (!isWon) {\n // set canvas width and height\n var rect = canvas.getBoundingClientRect();\n canvas.width = rect.width;\n canvas.height = rect.height;\n\n // Clear canvas, move 0,0 to unblur rect\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.translate(-0.5, -0.5);\n\n // Background\n ctx.fillStyle = '#b8b8b8';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n // Floor\n ctx.fillStyle = '#000000';\n ctx.fillRect(0, Math.max(500, canvas.height - 150), canvas.width, canvas.height);\n\n // Redraw all elements\n drawAll();\n }\n}", "function onSnapEnd () {\n board.position(game.fen())\n}", "function onSnapEnd () {\n board.position(game.fen())\n}", "function onSnapEnd () {\n board.position(game.fen())\n}", "function onSnapEnd () {\n board.position(game.fen())\n}", "function squareCornerWin(){\n}", "function squareCenterWin(){\n\n}", "function bottomLeftHalf() {\n let window = Window.focused();\n\n if (window) {\n let screen = window.screen().flippedVisibleFrame();\n let halfScreenHeight = screen.height / 2;\n let halfScreenWidth = screen.width / 2;\n\n window.setTopLeft({\n x: screen.x,\n y: halfScreenHeight + 22,\n });\n\n window.setSize({\n height: halfScreenHeight,\n width: halfScreenWidth,\n });\n }\n}", "function resize() {\n if (pageIsOpen) {\n // update position of cover\n var cardPosition = currentCard.getBoundingClientRect();\n setCoverPosition(cardPosition);\n scaleCoverToFillWindow(cardPosition);\n }\n windowWidth = window.innerWidth;\n windowHeight = window.innerHeight;\n}", "offscreen() {\n if (this.xSky < -this.w) {\n return true;\n } else {\n return false;\n }\n }", "function topRightHalf() {\n let window = Window.focused();\n\n if (window) {\n let screen = window.screen().flippedVisibleFrame();\n let halfScreenHeight = screen.height / 2;\n let halfScreenWidth = screen.width / 2;\n\n window.setTopLeft({\n x: screen.x + halfScreenWidth,\n y: screen.y,\n });\n\n window.setSize({\n height: halfScreenHeight,\n width: halfScreenWidth,\n });\n }\n}", "_makeTop(){\n\t\tvar render_group = DOS.group;\n\t\tvar min_pos = DOS.min,\n\t\t\tmax_pos = DOS.max;\n\n\t\t// Share y position with aligment.js\n\t\tHaploWindow.min_node_placement_y = min_pos.y;\n\t\tHaploWindow._minpos = min_pos;\n\t\tHaploWindow._maxpos = max_pos;\n\n\t\t// White Rect\n\t\tHaploWindow._top.setPosition(\n\t\t\t// {x:min_pos.x - HaploWindow.white_margin, y: min_pos.y - HaploWindow.white_margin} \n\t\t\t{x: DOS.initial_group_node_offset.x + (min_pos.x - HaploWindow.white_margin),\n\t\t\t y: DOS.initial_group_node_offset.y + (min_pos.y - HaploWindow.white_margin)}\n\t\t);\n\n\t\tHaploWindow._top.rect = addWhiteRect({\n\t\t\twidth: (max_pos.x - min_pos.x),\n\t\t\theight: (max_pos.y - min_pos.y) + 3*HaploWindow.white_margin\n\t\t});\n\n\t\tHaploWindow._top.add( HaploWindow._top.rect );\n\n\t\t// Exit button\n\t\tHaploWindow._exit = addExitButton(\n\t\t\t{x: 20 + HaploWindow._left.getX(),\n\t\t\t y: 20},\n\t\t\t HaploWindow.destroy,\n\t\t\t 2);\n\n\t\tHaploWindow._group.add( HaploWindow._exit );\n\n\n\t\t// Add rendered lines\n\t\trender_group.remove();\n\t\tHaploWindow._top.add( render_group );\n\t\trender_group.setY(-HaploWindow._top.getY());\n\t\trender_group.setX(-HaploWindow._top.getX() + 10);\n\n\t\tHaploWindow._group.add(HaploWindow._top);\n\n\t\tButtonModes.setToComparisonMode();\n\t\t\n\t\tkineticTween({\n\t\t\tnode: HaploWindow._top,\n\t\t\tx: HaploWindow.left_margin_x,\n\t\t\ty: HaploWindow.white_margin,\n\t\t\tduration:0.2,\n\t\t\tonFinish: function(){\n\t\t\t\tHaploWindow._toggleBottom(true);\n\t\t\t}\n\t\t}).play()\n\n\t\tmain_layer.draw();\n\t\thaplo_layer.draw();\t\n\t}", "function snapToScreen($this, event, from)\n\t{\n\t\t// console.log(isKineticBlocked);\n\t\tif (isKineticBlocked)\n\t\t{\n\t\t\tevent.preventDefault();\n\t\t\tif (!KINETIC_PASS)\n\t\t\t{\n\t\t\t\tclearTimeout(unblockTimer);\n\t\t\t\tunblockTimer = setTimeout(function(){/*console.log('unblocked!');*/ isKineticBlocked = false }, DURATION);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar wy = Math.round($window.scrollTop()); // Window Y\n\t\t\tvar wh = Math.round($window.height()); // Window Height\n\t\t\tvar sy = Math.round($this.offset().top); // Section Y\n\t\t\tvar sh = Math.round($this.height()); // Section Height\n\n\t\t\tif ((event.deltaY > 0) && (sy + sh + TRESHOLD > wy) && (sy < wy) // up\n\t\t\t\t||\n\t\t\t\t(event.deltaY < 0) && (sy < wy + wh + TRESHOLD) && (sy > wy)) // down\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar y = sy; // stick to top\n\t\t\t\tif (event.deltaY > 0 && (sy+sh < wy+wh)) y = sy + sh - wh; // stick to bottom (scroll up through long section)\n\t\t\t\t$htmlbody.stop(true, false).animate({scrollTop:y}, DURATION, EASING);\n\t\t\t\tisKineticBlocked = true;\n\t\t\t\tif (KINETIC_PASS) setTimeout(function(){ /*console.log('unblocked!');*/ isKineticBlocked = false }, DURATION);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "drawScreen() {\n var on = \"#ccc\";\n var off = \"#aaa\";\n var neutral = \"#888\";\n\n this.gfx.save();\n\n this.gfx.translate( 50, 50 );\n this.gfx.scale( 3, 3 );\n\n this.gfx.fillStyle = neutral;\n this.gfx.fillRect( -10, -10, this.screen.width*3+20, this.screen.height*3+20 );\n\n for (var x = 0; x < this.screen.width; x++) {\n for (var y = 0; y < this.screen.height; y++) {\n if (this.screen.pixel( x, y )) {\n this.gfx.fillStyle = on;\n } else {\n this.gfx.fillStyle = off;\n }\n this.gfx.fillRect( x*3, y*3, 2, 2);\n }\n }\n\n this.gfx.restore();\n }", "function draw_mainScreen() {\n \tif ( defaultTrue( currentPart.main ) )\t\t// If we're showing the main screen\n \t\t{\n\t \t\tmainScreen.clear(); \t\t\t\t\t// ... clear it.\n\t \t\tmainScreen.show();\n \t\t} \n \telse\n \t\tmainScreen.hide();\t\t\t\t\t\t// Otherwise, hide it.\n }", "enterFullScreen() {\n }", "enterFullScreen() {\n }", "enterFullScreen() {\n }", "function darkenScreen() {\n\tctx.fillStyle = \"rgba(0,0,0,.7)\";\n\tctx.fillRect(0,0,cnv.width,cnv.height);\n\tuictx.fillStyle = \"rgba(0,0,0,.7)\";\n\tuictx.fillRect(0,0,uicnv.width,uicnv.height);\n}", "function toggleHMSClientScreen() {\r\n if(document.getElementById(\"HMSClientScreen\").style.display == \"none\") {\r\n document.getElementById(\"HMSClientScreen\").style.display = \"\";\r\n document.getElementById(\"HMSClientScreen\").style.top = document.documentElement.scrollTop + \"px\";\r\n document.getElementById(\"HMSClientScreen\").style.left = document.documentElement.scrollLeft + \"px\";\r\n document.body.style.overflow = \"hidden\";\r\n } else {\r\n document.getElementById(\"HMSClientScreen\").style.display = \"none\";\r\n document.body.style.overflow = \"\";\r\n };\r\n}", "restore () {\n\t\tthis.$element.removeClass('screenlayer-minimized');\n\t\tthis.show();\n\t}", "function win() { \r\n\r\n}", "function topEdge() {\n $( \"#target\" ).animate({paddingTop:\"-=310px\"});\n }", "function creepyHut(){\n\tcurrentBG = hut;\n\tbackground(hut);\n}", "function hideToTop() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (nectarDOMInfo.scrollTop < 350 || $offCanvasEl.is('.fullscreen.open') ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $animationTiming = ($('#slide-out-widget-area.fullscreen.open').length > 0) ? 1150 : 350;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#to-top').stop().transition({\r\n\t\t\t\t\t\t\t'bottom': '-30px'\r\n\t\t\t\t\t\t}, $animationTiming, 'easeInOutQuint');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.off('scroll', hideToTop);\r\n\t\t\t\t\t\t$window.on('scroll', showToTop);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function fullscreen(){\n $('#hero').css({\n width: $(window).width(),\n height: $(window).height()\n });\n }", "function rickUp(){\n\trUp -= 1;\n\t$('#rick').css('top', rUp+\"em\");\n}", "function intro(){\n backgroundMove();\n crateShow();\n image(introImg, width/2, height/2);\n}", "function setScreen() {\n\t$('#workSpace').css(\"height\", window.innerHeight + 'px');\n}", "function lvlScreen(){\n\tconsole.log('lvlScreen');\n\tdocument.removeEventListener('keydown', enter, false);\n\tdisplayInstruct = false;\n\tbackgroundCtx.clearRect(0, 0, backgroundCan.width, backgroundCan.height);\n}", "function welcomeDisplay1() {\n push();\n background(boxOffice1.image);\n imageMode(CENTER);\n image(sonicSign.image, sonicSign.x, sonicSign.y, 600, 180);\n pop();\n}", "function showWhiteboard()\n {\n activeStroke = null;\n mode = 1;\n boardMode = true;\n\n // set container to board mode\n container.style.pointerEvents = \"auto\";\n container.style.overflowX = \"hidden\";\n container.style.overflowY = \"scroll\";\n\n // show board, adjust height, re-draw scribbles\n drawingCanvas[1].canvas.style.visibility = \"visible\";\n adjustWhiteboardHeight();\n playbackEvents(1);\n }", "function fullsizeimagepos(){\r\n $('.imagefull').css('top',$(window).height()/2 - $('.imagefull').height()/2 - 15)\r\n }", "function make_Screen_White(x, y, w, h) {\n context.beginPath();\n context.rect(x, y, w, h);\n context.closePath();\n context.fillStyle = \"white\";\n context.fill();\n }", "function goup(prev, prevv)\n\t{\n\t\t\tif(prev==(prevv-1))\n\t\t\tdocument.getElementById(prev.toString()).style.backgroundImage=\"url(./img/cornerlayertopright.png)\";\n\t\t\telse if(prev==(prevv+1))\n\t\t\tdocument.getElementById(prev.toString()).style.backgroundImage=\"url(./img/cornerlayertopleft.png)\";\n\t\t\telse\n\t\t\tdocument.getElementById(prev.toString()).style.backgroundImage=\"url(./img/straight_vert.png)\";\n\t}", "function updateScreen() {\n drawPointer();\n moveTo(1000,1000); // moves turtle off the screen\n penUp();\n}", "function show( me ){\n $( me.canvas ).css({ \n 'top': 0 \n })\n }" ]
[ "0.72830415", "0.6549046", "0.6433411", "0.6411357", "0.63852733", "0.63171256", "0.62408155", "0.620453", "0.6204017", "0.6194736", "0.61780787", "0.6149729", "0.61131245", "0.6098682", "0.6025048", "0.602371", "0.60139835", "0.60133535", "0.60095173", "0.59790593", "0.59649885", "0.5956381", "0.59319246", "0.59295815", "0.5906637", "0.5903626", "0.5871926", "0.5851511", "0.58513534", "0.5833074", "0.5833074", "0.5774831", "0.57736796", "0.5768513", "0.576851", "0.5767948", "0.57566935", "0.57548267", "0.57460374", "0.57291156", "0.5719001", "0.5718496", "0.5709586", "0.570827", "0.5693543", "0.56923985", "0.5685329", "0.5679149", "0.5664291", "0.56639975", "0.56577045", "0.56562364", "0.56449705", "0.56394285", "0.5638867", "0.563527", "0.56342155", "0.5633706", "0.5628384", "0.56277543", "0.561732", "0.5616872", "0.5615821", "0.56138676", "0.56051624", "0.56051624", "0.56051624", "0.56051624", "0.55957055", "0.558943", "0.55854136", "0.5584608", "0.55839604", "0.55797994", "0.55792105", "0.55500853", "0.5543815", "0.55425894", "0.5531717", "0.5531717", "0.5531717", "0.55272514", "0.55256474", "0.55253756", "0.55218923", "0.551955", "0.5513503", "0.551238", "0.5508818", "0.54984134", "0.54960406", "0.54960144", "0.5495748", "0.54895574", "0.5480483", "0.5478011", "0.5475522", "0.5474979", "0.5474585", "0.5471819" ]
0.7439585
0
draws strings and triangle flags
function drawStrings(){ noFill(); stroke(255); strokeWeight(1); smooth(); line(370,0,800,435); line(290,0,0,285); line(370,0,800,200); line(290,0,0,500); for(var i = -20; i < 1000; i = i + 60){ fill(255, 80, 80); noStroke(); smooth(); triangle(200 - i, 81 + i, 258 - i, 20 + i, 286 - i, 75 + i); triangle(388 + i, 17 + i, 450 + i, 75 + i, 398 + i, 81 + i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawFlag(x,y,i) {\n var canvas = document.getElementById('canvas');\n if (canvas.getContext) {\n var ctx = canvas.getContext('2d');\n ctx.fillStyle = '#FFFFFF';\n ctx.strokeStyle = '#FFFFFF'\n ctx.font = \"10px Arial\"\n if(i)\n ctx.fillText(i.toString(),x+27,y+27);\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.fillStyle = '#FF0000';\n ctx.strokeStyle = '#FFFFFF'\n ctx.moveTo(x+21,y+0);\n alternateFlag(x,y);\n ctx.closePath()\n ctx.stroke();\n ctx.fill();\n }\n}", "function CanvasTitle3() {\n ctxTri.font = \"35px Helvetica\";\n ctxTri.fillStyle = \"brown\";\n ctxTri.textAlign = \"center\";\n ctxTri.fillText(\"Choose a\",690,35);\n ctxTri.fillText(\"number of\",690,65);\n ctxTri.font = \"45px Helvetica\";\n ctxTri.fillText(\"CIRCLES\",690,100);\n ctxTri.beginPath();\n ctxTri.rect(585,5,210,110);\n ctxTri.strokeStyle = \"red\";\n ctxTri.lineWidth = \"5\"\n ctxTri.stroke();\n ctxTri.closePath();\n}", "drawOptionBox() {\n if (standby) {\n ctx.fillStyle = \"#18381e\"\n } else {\n ctx.fillStyle = \"black\"\n }\n ctx.fillRect(this.x, this.y, this.w, this.h);\n drawWords(this.name, this.x + 10, this.y + 10, this.scale, 0);\n ctx.strokeRect(this.x, this.y, this.w, this.h)\n }", "function display_opt(){\n var i;\n for(i = 0;i < 4;i++){\n ctx.font = '16px arial';\n ctx.textAlign = 'left';\n ctx.fillStyle = txtcolor;\n ctx.fillText(mainF.OPC[i],txtpos[0]+block_s,txtpos[1]+8+i*block_s);\n }\n}", "function drawFlag() {\n fill(255,150,0);\n strokeWeight(5);\n line(flagX,highestPoint,flagX,highestPoint-50);\n triangle(flagX,highestPoint-50,flagX+25,highestPoint-40, flagX, highestPoint-30);\n}", "function writeInstructions() {\n noStroke();\n fill(252, 118, 172);\n textSize(54)\n text('my name is', width / 2, height / 3)\n text('i was born in', width / 2, height * 1 / 2);\n textSize(25);\n text('click on your sign to get your horoscope!', width / 2, height * 2 / 3)\n}", "function drawShedInfo(item, index) {\n var xoffset;\n var pattern014 = [0, 1, 4];\n var pattern0124 = [0, 1, 2, 4];\n var pattern0134 = [0, 1, 3, 4];\n use_plyr_bg_color();\n xoffset = index * 100;\n ctx.moveTo(xoffset, 0);\n ctx.lineTo(xoffset, 100);\n ctx.stroke();\n ctx.font = \"30px Arial\";\n ctx.textAlign = \"center\";\n ctx.fillText(item[0], xoffset + 48, 30);\n ctx.font = \"40px Arial\";\n ctx.textAlign = \"left\";\n ctx.fillText(item[1], xoffset + 10, 90);\n ctx.fillStyle = OLIVE_GREEN;\n ctx.strokeStyle = OLIVE_GREEN;\n ctx.beginPath();\n ctx.moveTo(xoffset + 48, 62);\n ctx.lineTo(xoffset + 72, 50);\n ctx.lineTo(xoffset + 96, 62);\n ctx.lineTo(xoffset + 96, 86);\n ctx.lineTo(xoffset + 72, 98);\n ctx.lineTo(xoffset + 48, 86);\n ctx.closePath();\n ctx.stroke();\n ctx.fill();\n ctx.fillStyle = WHITE;\n ctx.strokeStyle = WHITE;\n ctx.font = \"20px Arial\";\n ctx.textAlign = \"center\";\n ctx.fillText(item[2], xoffset + 72, 80);\n drawTriangle(ctx, xoffset, [48, 53, 53], [74, 71, 77]);\n if (pattern0124.indexOf(index) !== -1) {\n drawTriangle(ctx, xoffset, [96, 91, 91], [74, 71, 77]);\n }\n if (pattern014.indexOf(index) !== -1) {\n drawTriangle(ctx, xoffset, [60, 60, 65], [56, 62, 59]);\n }\n if (pattern0134.indexOf(index) !== -1) {\n drawTriangle(ctx, xoffset, [84, 84, 79], [56, 62, 59]);\n }\n if (pattern014.indexOf(index) !== -1) {\n drawTriangle(ctx, xoffset, [60, 60, 65], [90, 84, 87]);\n }\n if (pattern0134.indexOf(index) !== -1) {\n drawTriangle(ctx, xoffset, [84, 84, 79], [90, 84, 87]);\n }\n ctx.beginPath();\n }", "function drawText()\n\t{\n\t\t// Figure out the correct text\n\t\tvar text = getText();\n\n\t\twid = that.add('text', {\n\t\t\ttext: text,\n\t\t\tcolor: style.color,\n\t\t\tfont: style.font,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Set the width of the widget\n\t\tthat.w = wid.width();\n\n\t\t// Assign a toggler\n\t\twid.applyAction('click', {\n\t\t\tclick: toggleMode\n\t\t});\n\t}", "function draw_info(){\n\t\n\tctx.font = \"12px Verdana\";\n\tctx.strokeStyle = \"#ff0000\";\n\tctx.strokeText(\"Lives: \", 10,490);\n\tctx.strokeText(lives, 50,490);\n\tctx.strokeText(\"Score: \", 70,490);\n\tctx.strokeText(score, 110,490);\n\t\n\t\n\t}", "function text_fill(ctx, info, i, color, flag = 0, text='')\r\n{\r\n ctx.strokeStyle=color;\r\n ctx.font=\"bold 14px Arial\";\r\n ctx.textAlign=\"center\";\r\n ctx.textBaseline=\"middle\";\r\n ctx.fillStyle=\"black\";\r\n if (flag == 0) ctx.fillText( info[i].id,info[i].position[0]/100, info[i].position[1]/100);\r\n\telse if (flag == 1) ctx.fillText( text, info[i].position[0]/100, info[i].position[1]/100);\r\n\telse ctx.fillText( info.id, info.position[0]/100, info.position[1]/100);\r\n}", "function drawTriangle() {\n var i = 0, j = 0;\n var result = \"\\n\";\n do {\n j = 0;\n while(j<=i) {\n result = result + \"#\";\n j++;\n } \n result = result + \"\\n\"\n i++;\n }while(i<7);\n return result;\n}", "draw() {\n let ctx = this.ctx;\n ctx.beginPath();\n ctx.fillStyle = Action.BGCOLOR;\n if (this.activated) {\n ctx.fillStyle = Action.BGACTIVATEDCOLOR;\n }\n CanvasHelper.fillRect(\n ctx,\n this.x, this.y, this.w, this.h,\n Action.PADDING\n );\n\n let fontSize = 30;\n\n ctx.fillStyle = Action.TEXT_COLOR;\n ctx.font = fontSize + \"px serif\";\n ctx.fillText(this.typeSymbol, this.x + this.w / 3, this.y + this.h * 3 / 4);\n }", "doDraw() {\n draw_context.strokeStyle = \"#000\";\n draw_context.fillStyle = \"#eee\";\n draw_context.font = \"40px Times\";\n draw_context.lineWidth = 10;\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n draw_context.fillText(this.text, canvas_element.width/2, this.vertical);\n }", "draw(context) {\n\t\t\tcontext.textAlign = 'center';\n\t\t\tcontext.fillStyle = 'rgba(57, 228, 57,' + this.opacity + ')';\n\t\t\tcontext.fillText(this.name, this.x, this.y);\n\t\t}", "createWords(counter) {\n var a = ['Your', 'health', 'will', 'one', 'day', 'disappear', 'and', 'you', 'will', 'die', 'without', 'meaning'];\n var b = ['There', 'are', 'many', 'men', 'and', 'women', 'who', 'dream', 'of', 'making', 'love', 'to', 'you', 'but', 'you', 'will', 'never', 'get', 'to', 'know', 'them'];\n noStroke();\n textSize (16);\n// below lines modified by code master Finn\n for (var i = 0; i < a.length; i++) {\n fill('rgba(255,255,255,1)');\n text(a[counter], this.x + mouseX/30, this.y);\n fill('rgba(255,255,255,0.1)');\n text(b[counter], this.x + mouseX/70 + 50, this.y+50);\n }\n }", "function draw(){\n background('#BAE1FF'); //powder blue\n rect(20,100,400,400,20);\n //STATS:\n textSize(32); //size\n fill(150, 102, 153); //color of words\n text(`Happiness: ${stat.love}`, 10, 60); //string and position\n textSize(32); //size\n text(`Cleanliness: ${stat.hygiene}`, 10, 90); //string and position\n fill(150, 102, 153); //color of words\n textSize(32); //size\n text(`Hunger: ${stat.food}`, 10, 30); //string and position\n fill(150, 102, 153); //color of word\n fill(150, 102, 153); //color of word\n text(`ATLS 3300 - Object`, 300, 30); //string and position\n\n //Instructions\n textSize(30); //size\n fill(150, 102, 153); //color of words\n text(`Scan a plushy to take care of Mimitchi!`, 450, 150); //string and position\n textSize(30); //size\n text(`Cake: Feed Mimitchi`, 450, 200); //string and position\n text(`Duck Ring: Clean Mimitchi`, 450, 250); //string and position\n text(`Heart: Pet Mimitchi`, 450, 310); //string and position\n \n translate(80, 150);\n getAnimation();\n}", "function niceText(text, horizontal, vertical)\n\t{\n\t\tctx.font = \"16px Arial\";\n\t\tctx.fillStyle = \"#ffffff\";\n\t\t//ctx.strokeText(text, horizontal, vertical);\n\t\tctx.fillText(text, horizontal, vertical);\n\t}", "function drawLabels(vec){\n context.strokeStyle = \"rgb(0,200,0)\"; \n context.font = '18pt Calibri';\n for(var i = 0; i < vec.length; i++){\n context.strokeText(i.toString(), vec[i].x, vec[i].y); \n } \n context.strokeStyle = \"rgb(0,0,0)\"; \n}", "function drawTriangle(size) {\n document.write('<br>');\n \n for(let i=0 ; i< size ; i++){\n for(let a=0; a<i; a++){\n document.write('&nbsp;') \n }\n for(let j=i; j<size; j++){\n //document.write( 'i=' + i + ' and j= ' + j );\n document.write(' $ ');\n }\n \n document.write('<br>');\n }\n }", "function drawGUI(){\n highScore = \"10\"\n leftPadding = 10\n topPadding = 20\n spacing = 20\n\n canvasContext.font = \"20px Open Sans\";\n canvasContext.fillText(\n \"Arrows Fired: \" + arrowsFired, leftPadding, topPadding);\n canvasContext.fillText(\n \"Score: \" + score, leftPadding, topPadding + spacing);\n canvasContext.fillText(\n \"High Score: \" + highScore, leftPadding, topPadding + spacing * 2);\n}", "display() {\n fill(this.color);\n\n triangle(this.x, this.y, this.x + 30, this.y - 55, this.x + 60, this.y);\n strokeWeight(7); //important for line to be visible\n strokeCap(SQUARE);\n stroke(this.color);\n\n //levitating line\n line(this.x, this.lineY - 30, this.x + 60, this.lineY - 30);\n\n //little eyes\n strokeWeight(3);\n stroke(\"white\");\n line(this.x + 10, this.y - 10, this.x + 20, this.y - 10);\n line(this.x + 30, this.y - 10, this.x + 40, this.y - 10);\n\n noStroke(); //reset so stroke doesn't carry into other creatures\n }", "function drawString(ctx, txt, col, fh, tx, ty) {\n\tvar fw = fh*0.666666; \n\tvar lw = fh*0.125; \n\tvar ls = lw/2; \n\tvar xp = 0; \n\tvar cr = lw; \n\tctx.lineCap = \"round\"; \n\tctx.lineJoin = \"round\"\n\tctx.lineWidth = lw; \n\tctx.strokeStyle = col;\n\tfor (var i = 0; i < txt.length; i++) {\n\t\tdrawSymbol(ctx, txt[i], ls, tx+xp, ty, fw, fh);\n\t\txp += (txt[i]!=\".\"?fw+cr:(fw/2)+cr);\n\t}\n}", "function drawNotes(){\n if (state === 'piano'){\n \n fill(255);\n // MAKE A FOR LOOP SOON\n rect(width - 400, height/2, 150, 400);\n rect(width - 550, height/2, 150, 400);\n rect(width - 700, height/2, 150, 400);\n rect(width - 850, height/2, 150, 400);\n rect(width - 1000, height/2, 150, 400);\n rect(width - 1150, height/2, 150, 400);\n rect(width - 1300, height/2, 150, 400);\n \n \n fill(0);\n text('G', width - 400, height/2);\n text('F', width - 550, height/2);\n text('E', width - 700, height/2);\n text('D', width - 850, height/2);\n text('C', width - 1000, height/2);\n text('B', width - 1150, height/2);\n text('A', width - 1300, height/2);\n }\n}", "draw()\n {\n document.body.style.background = \"#66F9FF\";\n\n\n //ctx.fillText(this.title, 100,100);\n }", "instructions() {\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText('Goal: Avoid the monsters. Reach the princess.',10,105);\n }", "function instructionButton(){\n ctx.beginPath();\n ctx.fillStyle = \"#FFFFFF\";\n startPointX.lineWidth = 1;\n ctx.rect(10, 10, 150, 80);\n ctx.fill();\n ctx.textAlign = \"center\";\n ctx.fillStyle = \"#000000\";\n ctx.fillText(\"הוראות\", 85, 40);\n ctx.fillText(\"המשחק\", 85, 72);\n}", "display() {\n fill('#323230');\n noStroke();\n if(this.shape === 'rect') {\n rectMode(CENTER);\n rect(this.x, this.y, this.size, this.size);\n } else if(this.shape === 'circle') {\n circle(this.x, this.y, this.size);\n } else {\n triangle(this.x - this.size / 2, this.y + this.size / 2, this.x + this.size / 2, this.y + this.size / 2, this.x, this.y - this.size / 2);\n }\n }", "function draw() {\n background(0);\n\n push();\n fill(255);\n text(instructionTxt, width / 2, height / 2);\n pop();\n\n displayAnswer();\n}", "function draw() {\n background(211, 211, 211); //color of the background\n fill(0); //color of the text\n\n fill(204, 101, 192, 127);\n rect(600, 80, 100, 100, 20);\n\n fill('lightgreen');\n triangle(900, 200, 800, 200, 850, 700); \n\n fill('red');\n arc(1000, 50, 80, 80, 0, PI + QUARTER_PI, CHORD);\n\n fill('yellow');\n circle(1100, 300, 200);\n\n fill('purple');\n quad(1100, 100, 1400, 200, 1300, 450, 1400, 540, 1100, 700);\n\n fill('black');\n square(1000, 550, 300);\n\n drawHouse();\n\n flower();\n\n weird();\n\n picasso();\n\n}", "draw(context)\n\t{\n\t\tif ( !this.visible )\n\t\t\treturn;\n\n\t\tcontext.font = this.fontSize + \"px \" + this.fontName;\n\t\tcontext.fillStyle = this.fontColor;\n\t\tcontext.textAlign = this.alignment;\n\t\t\n\t\tcontext.setTransform(1,0, 0,1, 0,0); \n\t\tcontext.globalAlpha = this.opacity;\n\n\t\t// shadow draw settings\n\t\tif (this.drawShadow)\n\t\t{\n\t\t\tcontext.shadowColor = this.shadowColor;\n\t\t\tcontext.shadowBlur = this.shadowSize;\n\t\t}\n\n\t\t// add support for multiline text (line breaks indicated by \"\\n\")\n\t\tlet textArray = this.text.split(\"\\n\");\n\t\tlet lineSkip = this.fontSize * this.lineHeight;\n\n\t\t// draw filled in text (multiple times to increase drop shadow intensity)\n\t\tfor (let i = 0; i < textArray.length; i++)\n\t\t{\n\t\t\tcontext.fillText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t\tcontext.fillText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t}\n\n\t\t// disable shadowBlur, otherwise all sprites drawn later will have shadows\n\t\tcontext.shadowBlur = 0;\n\t\t// draw filled text again, to fill over interior shadow blur, that may be a different color\n\t\tfor (let i = 0; i < textArray.length; i++)\n\t\t{\n\t\t\tcontext.fillText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t}\n\n\t\t// draw border last, so not hidden by filled text\n\t\tif (this.drawBorder)\n\t\t{\n\t\t\tcontext.strokeStyle = this.borderColor;\n\t\t\tcontext.lineWidth = this.borderSize;\n\t\t\tfor (let i = 0; i < textArray.length; i++)\n\t\t\t{\n\t\t\t\tcontext.strokeText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t\t}\n\t\t}\t\t\n\t}", "function fill(){\nctx.font = \"20px Arial\";\nctx.fillText(\"Use either Mouse or Keyboard Controls\", 160,500);\n\n}", "function drawScreen() {\n\n intensity = 1.6 // THe golden ratio is peaceful - this sharpens it\n let goldenRatio = .382 * intensity\n\n let width = innerWidth\n let height = innerHeight\n let backgroundColor = '#000000'\n\n context.fillStyle = backgroundColor // set background color in case u want to use mask\n context.fillRect(0, 0, width, height) // try a mask varient and compare performance\n\n// draw foreground image\n\n const c = new Image() \n c.src = \"bostonSat.webp\" \n context.drawImage(c, 0, 0)\n\n// draw triangle cutouts\n\n xWidth = Math.round(width*goldenRatio) // top - set initial distance from top left corner\n yHeight = Math.round(height*goldenRatio)\n\n context.fillStyle = backgroundColor // draw top triangle\n context.beginPath() \n context.moveTo(xWidth, 0) // top right\n context.lineTo(0,0) // top left corner\n context.lineTo(0, yHeight) // bottom left\n context.fill() // draw (last path is implicit)\n\n context.beginPath() // draw bottom triangle\n context.moveTo(width - xWidth, height) // bottom left\n context.lineTo(width,height) // bottom right corner\n context.lineTo(width, height - yHeight) // top right\n context.fill()\n\n//draw text\n\n function dynamicFontSize (originalFontSize = 55, originalCanvsSize = 1360) { // in design params/out adjusted font size\n percentOfFullSize = innerWidth/originalCanvsSize \n adjustedLinearFontSize = originalFontSize*percentOfFullSize //linear trnsform\n adjustedNonlinearFontSize = originalFontSize /(1-Math.log(percentOfFullSize)) //nonlinear transform\n\n cl(adjustedLinearFontSize, adjustedNonlinearFontSize)\n return(adjustedNonlinearFontSize)\n }\n\n currentFont = 'Courier'\n calculatedFont = dynamicFontSize(55, 1360)\n\n calculatedFontString = (`${adjustedNonlinearFontSize}px ${currentFont}`) //string creation\n cl(calculatedFontString)\n\n context.font = calculatedFontString // assign to the object\n context.fillStyle = \"#7aa600\" // green pulled from picture\n context.fillText('Luke Wilcox', 20, 80)\n\n\n \n\n // write all this calculation as a function\n}", "function drawText() {\n //font size weight fill etc\n push();\n textSize(30);\n fill('black');\n strokeWeight(1);\n stroke('black');\n text('Choose a key (1 or 2)', 100, 60);\n pop();\n}", "function display() {\n //wrapEdges();\n background(225,200,255);\n textSize(12);\n textStyle(NORMAL);\n\n if (showarrows) {\n textSize(20);\n strokeWeight(0);\n fill(255,255,255);\n text(\"\",0.8*width,0.8*height+75);\n/*\n fill(0,0,255);\n text(\"Force\",0.8*width,0.8*height+50);\n fill(204,0,204);\n text(\"Acceleration\",0.8*width,0.8*height+75);\n*/\n }\n\n strokeWeight(10);\n var tri_width=7;\n if (showarrows) {\n var x_line=5;\n var y_line=5;\n var line_len=100;\n drawLine(x_line,y_line,x_line,y_line+line_len);\n drawLine(x_line,y_line,x_line+line_len,y_line);\n fill(0);\n drawTriangle(x_line-tri_width/2,y_line+line_len,x_line+tri_width/2,y_line+line_len,x_line,y_line+line_len+10);\n drawTriangle(x_line+line_len,y_line-tri_width/2,x_line+line_len,y_line+tri_width/2,x_line+line_len+10,y_line);\n strokeWeight(0);\n drawText(\"+x\",x_line+line_len+15,y_line);\n drawText(\"+y\",x_line,y_line+line_len+15);\n }\n\n drawLine(0,0,0,height); \n drawLine(0,height,width,height);\n drawLine(width,height,width,0);\n \n \n \n if (iterations%2 == 1) { \n append(xhistory,x);\n append(yhistory,y);\n }\n\n iterations += 1; \n \n if (keyIsPressed) {\n isrunning = true; \n }\n \n MaxLength = 0;\n \tif (xhistory.length > MaxLength) {\n xhistory = subset(xhistory,xhistory.length-MaxLength,xhistory.length);\n yhistory = subset(yhistory,yhistory.length-MaxLength,yhistory.length); \n } \n \n noFill(0); //If more text is written elsewhere make sure the default is black\n stroke(0); // If more lines are drawn elsewhere make sure the default is black\n strokeWeight();\n\t /*\n\t\ttextSize(20);\n\t strokeWeight(1);\n\t\tdrawText(\"Click this screen first!\",0.35*width,0.8*height);\n\t\tdrawText(\"then move the arrow keys!\",0.32*width,0.75*height);\n */\n}", "function draw() {\n drawText();\n}", "drawPickTriangles(frameCtx) {\n }", "drawExtraInfo(context) {\n context.fillStyle = this.textColour;\n context.fillText(this.text, this.x, this.y+7);\n\n if (!this.showExtraInfo) {\n return;\n }\n\n context.beginPath();\n for (let key in this.gridProbes) {\n let gp = this.gridProbes[key];\n\n let x = this.x + gp.distance*Math.cos(this.body.angle + gp.angle); \n let y = this.y + gp.distance*Math.sin(this.body.angle + gp.angle); \n \n context.rect(x, y, 1, 1);\n }\n context.strokeStyle = \"purple\";\n context.stroke();\n context.closePath();\n }", "function drawTriangle() {\n ctx.beginPath();\n ctx.moveTo(75, 50);\n ctx.lineTo(100, 75);\n ctx.lineTo(100, 25);\n ctx.fill();\n }", "drawHUD() {\n this.text.draw();\n }", "function drawFontExample () {\r\n\t\r\n\tvar fontFamily = \"\";\r\n\tif (document.forms[\"fontPaneForm\"].elements[\"fontFamily\"]) {\r\n\t\tfontFamily = \" font-family: \" + document.forms[\"fontPaneForm\"].elements[\"fontFamily\"].value + \"; \";\r\n\t}\r\n\t\r\n\tvar fontSize = \"\";\r\n\tif (document.forms[\"fontPaneForm\"].elements[\"fontSize\"]) {\r\n\t\tfontSize = \" font-size: \" + document.forms[\"fontPaneForm\"].elements[\"fontSize\"].value + \"; \";\r\n\t}\r\n\t\r\n\tvar fontColor = \"\"\r\n\tif (document.forms[\"fontPaneForm\"].elements[\"fontColor\"]) {\r\n\t\tfontColor = \" color: \" + document.forms[\"fontPaneForm\"].elements[\"fontColor\"].value + \"; \";\r\n\t}\r\n\t\r\n\tvar backgroundColor = \"\";\r\n\tif (document.forms[\"fontPaneForm\"].elements[\"backgroundColor\"]) {\r\n\t\tbackgroundColor = \" background-color: \" + document.forms[\"fontPaneForm\"].elements[\"backgroundColor\"].value + \"; \";\r\n\t}\r\n\t\t\r\n\tvar fontWeight = \"\";\r\n\tif (document.forms[\"fontPaneForm\"].elements[\"fontWeight\"]) {\r\n\t\tif (document.forms[\"fontPaneForm\"].elements[\"fontWeight\"].checked == true) {\r\n\t\t\tfontWeight = \" font-weight: bold; \"; \r\n\t\t}\r\n\t}\r\n\t\r\n\tvar fontStyle = \"\";\r\n\tif (document.forms[\"fontPaneForm\"].elements[\"fontStyle\"]) {\r\n\t\tif (document.forms[\"fontPaneForm\"].elements[\"fontStyle\"].checked == true) {\r\n\t\t\tfontStyle = \" font-style: italic; \"; \r\n\t\t}\r\n\t}\r\n\t\r\n\tvar fontDecoration = \"\";\r\n\tif (document.forms[\"fontPaneForm\"].elements[\"fontDecoration\"]) {\r\n\t\tif (document.forms[\"fontPaneForm\"].elements[\"fontDecoration\"].checked == true) {\r\n\t\t\tfontDecoration = \" text-decoration: underline; \"; \r\n\t\t}\r\n\t}\r\n\t\r\n\t// Localization\r\n\tvar d = \"<SPAN style=\\\"\" + fontFamily + fontSize + fontColor + backgroundColor + fontWeight + fontStyle + \r\n\t\t\tfontDecoration + \"\\\">\" + top.A0700ICustomUiFontExample + \"</SPAN> \";\r\n\t\r\n\twriteDiv(\"fontExampleContainer\", d);\r\n}", "draw() {\n // this calls PNGRoom.draw()\n super.draw();\n \n push();\n\n // title text\n fill(255);\n textAlign(LEFT);\n textFont(headlineFont);\n textSize(24);\n\n text(this.titleText, this.drawX , this.drawY - 120);\n \n // Draw text in a box\n //text(this.titleText, width/6, height/6, this.textBoxWidth, this.textBoxHeight );\n \n textFont(bodyFont);\n textSize(20);\n\n text(this.bodyText, this.drawX, this.drawY - 80, width - 480,height - (this.drawY+100) );\n \n pop();\n }", "function draw() {\n\n //textColor changes so it has to be in draw instead of setup\n //starts as transparent clicking i turns it opaque\n textColor = color(0, 0, 0, o);\n textColor2 = color(255,255,255,o);\n\n //main screen only shows up when turning program on\n if (main === true) {\n noStroke();\n fill(0);\n textSize(16);\n text(\"Press i at any time to turn on instructions.\", 150, 175);\n text(\"Pressing i again will turn them off, if the background is white\", 150, 200);\n text(\"you will need to refresh the page by hitting the same number\", 150, 225);\n text(\"to get rid of the instructions.\", 150, 250);\n text(\"To begin press 1,2,3,4, or 5.\", 150, 275);\n \n //title whimsical\n //color changes with mouse position\n fill(mouseX%255,255-mouseY%255,187);\n stroke(0);\n textSize(100);\n text(\"w\",150,500);\n text(\"h\",205,500);\n text(\"i\",240,500);\n text(\"m\",240,500);\n text(\"s\",305,500);\n text(\"i\",335,500);\n text(\"c\",338,500);\n text(\"a\",372,500);\n text(\"l\",407,500);\n textSize(16);\n }\n \n //related to the switch case to switch between modes\n if (bubble === true) {\n bubbles(50);\n }\n if (vortex === true) {\n depth();\n }\n if (box === true) {\n boxes();\n }\n if (stacks === true) {\n stacking();\n }\n if (dots === true) {\n drawing();\n }\n}", "function drawTriangle(t) {\n\tfor (var i = 0; i < 3; i++) {\n\t\tt.moveForward(100);\n\t\tt.turnRight(120);\n\t}\n}", "function display() {\n wrapEdges();\n background(255);\n textSize(12);\n textStyle(NORMAL);\n\n if (showarrows) {\n textSize(20);\n strokeWeight(0);\n fill(255, 0, 0);\n text(\"Velocity\", 0.8 * width, 0.8 * height + 75);\n /*\n fill(0,0,255);\n text(\"Force\",0.8*width,0.8*height+50);\n fill(204,0,204);\n text(\"Acceleration\",0.8*width,0.8*height+75);\n */\n }\n\n strokeWeight(10);\n var tri_width = 7;\n if (showarrows) {\n var x_line = 5;\n var y_line = 5;\n var line_len = 100;\n drawLine(x_line, y_line, x_line, y_line + line_len);\n drawLine(x_line, y_line, x_line + line_len, y_line);\n fill(0);\n drawTriangle(x_line - tri_width / 2, y_line + line_len, x_line + tri_width / 2, y_line + line_len, x_line, y_line + line_len + 10);\n drawTriangle(x_line + line_len, y_line - tri_width / 2, x_line + line_len, y_line + tri_width / 2, x_line + line_len + 10, y_line);\n strokeWeight(0);\n drawText(\"+x\", x_line + line_len + 15, y_line);\n drawText(\"+y\", x_line, y_line + line_len + 15);\n }\n\n\n if (iterations % 5 == 1) {\n append(xhistory, x);\n append(yhistory, y);\n }\n\n iterations += 1;\n\n if (keyIsPressed) {\n isrunning = true;\n }\n\n MaxLength = 50;\n if (xhistory.length > MaxLength) {\n xhistory = subset(xhistory, xhistory.length - MaxLength, xhistory.length);\n yhistory = subset(yhistory, yhistory.length - MaxLength, yhistory.length);\n }\n\n fill(0, 0, 0); //If more text is written elsewhere make sure the default is black\n stroke(0, 0, 0); // If more lines are drawn elsewhere make sure the default is black\n strokeWeight(0);\n\n textSize(20);\n strokeWeight(1);\n drawText(\"Click this screen first!\", 0.35 * width, 0.8 * height);\n drawText(\"then move the arrow keys!\", 0.32 * width, 0.75 * height);\n}", "function drawTextboxText(text, line) {\n if (line < 4) {\n context.font = 'bold ' + TEXTBOX_FONT_DEFAULT_SIZE + 'px sans-serif';\n context.textAlign = 'left';\n context.fillStyle = TEXTBOX_FONT_DEFAULT_COLOR;\n context.fillText(text, lines[line].x, lines[line].y);\n }\n if (line === 4) {\n context.font = 'bold ' + TEXTBOX_FONT_BIG_SIZE + 'px sans-serif';\n context.textAlign = 'center';\n context.fillStyle = TEXTBOX_FONT_BIG_COLOR;\n context.fillText(text, lines[line].x, lines[line].y);\n }\n}", "draw() {\n // this calls PNGRoom.draw()\n super.draw();\n \n push();\n\n // title text\n fill(0);\n textAlign(CENTER);\n textFont(headlineFont);\n textSize(32);\n\n text(this.titleText, width/2 , this.drawY);\n \n // Draw text in a box\n //text(this.titleText, width/6, height/6, this.textBoxWidth, this.textBoxHeight );\n \n textFont(bodyFont);\n textSize(18);\n\n text(this.bodyText, this.drawX, this.drawY + 32, 770, 500);\n \n pop();\n }", "function draw_bk(ctx, info, flag, color1, color2,num=0)\r\n{\r\n\tconsole.log(\"in draw bk\",info,flag,color2);\r\n if (flag ==1)\r\n {\r\n\t\tvar l = num;\r\n\t\tif (num == 0) l = info.length;\r\n for(var i=0;i<info.length;i++){\r\n ctx.lineWidth=3;\r\n\t\t\t\r\n if (info[i].type == \"RoundedChannel\" || info[i].type == \"Connection\") {\r\n ctx.beginPath();\r\n ctx.strokeStyle=color1;\r\n ctx.moveTo(info[i].start[0]/100, info[i].start[1]/100);\r\n ctx.lineTo(info[i].end[0]/100, info[i].end[1]/100);\r\n ctx.stroke();\r\n } else if (info[i].type == \"DiamondReactionChamber\"){\r\n ctx.beginPath();\r\n ctx.fillStyle=color1;\r\n ctx.fillRect(info[i].position[0]/100-info[i].width/200, info[i].position[1]/100-info[i].len/200, info[i].width/100,info[i].len/100);\r\n ctx.stroke();\r\n } else if (info[i].type == \"Valve3D\"){\r\n ctx.beginPath();\r\n ctx.strokeStyle=color1;\r\n ctx.arc(info[i].position[0]/100, info[i].position[1]/100, 10, 0, 2*Math.PI);\r\n text_fill(ctx, info, i, color1);\r\n ctx.stroke();\r\n }else if (info[i].type == \"Pump3D\"){\r\n draw_pump(ctx, info, i, color1);\r\n text_fill(ctx, info, i, color1);\r\n }else if (info[i].type == \"Mixer\"){\r\n\t\t\t\tctx.beginPath();\r\n\t\t\t\tctx.fillStyle=color1;\r\n\t\t\t\tctx.fillRect(info[i].position[0]/100-info[i].width/200, info[i].position[1]/100-info[i].len/200, info[i].width/100,info[i].len/100);\r\n\t\t\t\ttext_fill(ctx, info, i, color1, 1, \"Mixer\");\r\n\t\t\t\tctx.stroke();\r\n\t\t\t}\r\n else{\r\n ctx.beginPath();\r\n text_fill(ctx, info, i, color1);\r\n ctx.arc(info[i].position[0]/100, info[i].position[1]/100, 10, 0, 2*Math.PI);\r\n ctx.stroke();\r\n }\r\n }\r\n }else{\r\n\t\tvar l = num;\r\n\t\tif (num == 0) {\r\n\t\t\tl = info.length;\r\n\t\t\tfor(var i=0;i<l;i++){\r\n\t\t\t ctx.lineWidth=3;\r\n\t\t\t if (info[i].type == \"RoundedChannel\" || info[i].type == \"Connection\") {\r\n\t\t\t ctx.beginPath();\r\n\t\t\t ctx.strokeStyle=color2;\r\n\t\t\t ctx.moveTo(info[i].start[0]/100, info[i].start[1]/100);\r\n\t\t\t ctx.lineTo(info[i].end[0]/100, info[i].end[1]/100);\r\n\t\t\t ctx.stroke();\r\n\t\t\t } else if (info[i].type == \"Pump3D_control\"){\r\n\t\t\t draw_pump(ctx, info, i, color2)\r\n\t\t\t } else {\r\n\t\t\t ctx.beginPath();\r\n\t\t\t ctx.strokeStyle=color2;\r\n\t\t\t ctx.arc(info[i].position[0]/100, info[i].position[1]/100, 10, 0, 2*Math.PI);\r\n\t\t\t text_fill(ctx, info, i, color2);\r\n\t\t\t ctx.stroke();\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tctx.lineWidth=3;\r\n\t\t\tif (info.type == \"RoundedChannel\" || info.type == \"Connection\") {\r\n\t\t\t ctx.beginPath();\r\n\t\t\t ctx.strokeStyle=color2;\r\n\t\t\t ctx.moveTo(info.start[0]/100, info.start[1]/100);\r\n\t\t\t ctx.lineTo(info.end[0]/100, info.end[1]/100);\r\n\t\t\t ctx.stroke();\r\n\t\t\t} else if (info.type == \"Pump3D_control\"){\r\n\t\t\t draw_pump(ctx, info, i, color2)\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(color2);\r\n\t\t\t ctx.beginPath();\r\n\t\t\t ctx.strokeStyle=color2;\r\n\t\t\t ctx.arc(info.position[0]/100, info.position[1]/100, 10, 0, 2*Math.PI);\r\n\t\t\t text_fill(ctx, info, i, color2, 2);\r\n\t\t\t ctx.stroke();\r\n\t\t\t}\r\n\t\t}\r\n }\r\n}", "function drawTriangle()\n{\n var canvas=document.getElementById('myCanvas');\n var context=canvas.getContext('2d');\n \n //BRAZIL FLAG\n \n //DRAW RECTANGLE\n context.fillStyle='#00A859'; //colours the rectangle green\n context.fillRect(0,0,353,247); //sets x, y, width, height. This creates the rectangle needed for the flag.\n \n //DRAW DIAMOND\n context.fillStyle = \"#FFCC29\"; //colours the diamond green\n context.beginPath(); //starts a new path\n context.moveTo(45,124); //moves the path to the point x,y. This is the starting position of the diamond.\n context.lineTo(177,45); //creates a line to and from x,y. The lineTo draws a line \n context.lineTo(308,124);\n context.lineTo(177,202);\n context.closePath(); //closes the path\n context.fill(); //fills the diamond with colour\n \n //DRAW CIRCLE\n context.fillStyle = \"#3E4095\" //colour of the circle\n context.beginPath(); //starts a new path\n context.arc(177,124,50,50,Math.PI*2, true); //draws the circle\n context.fill(); //fills the circle with colour\n context.closePath(); //closes the path\n context.stroke(); \n}", "function renderScaffolding() {\n ctx.beginPath();\n for (var i=0; i<spans.length; i++) {\n var s = spans[i];\n if (s.visibility === \"hidden\") {\n ctx.strokeStyle=\"pink\";\n ctx.moveTo(s.p1.cx, s.p1.cy);\n ctx.lineTo(s.p2.cx, s.p2.cy);\n }\n }\n ctx.stroke();\n}", "function drawDebug() {\n ctx.font = \"11px monospace\";\n ctx.fillStyle = \"#777777\";\n //text, x position, y position\n ctx.fillText(\"DEBUG MODE\", 10, 15);\n ctx.fillText(\"upPressed: \"+upPressed, 15, 30);\n ctx.fillText(\"leftPressed: \"+leftPressed, 15, 45);\n ctx.fillText(\"rightPressed: \"+rightPressed, 15, 60);\n ctx.fillText(\"x: \"+x, 15, 75);\n ctx.fillText(\"dx: \"+dx, 15, 90);\n ctx.fillText(\"y: \"+y, 15, 105);\n ctx.fillText(\"dy: \"+dy, 15, 120);\n ctx.fillText(\"fuelout: \"+fuelout, 15, 135);\n ctx.fillText(\"landed: \"+landed, 15, 150);\n ctx.fillText(\"crashed: \"+crashed, 15, 165);\n ctx.fillText(\"landedVelocityY: \"+landedVelocityY, 15, 180);\n ctx.fillText(\"landedVelocityX: \"+landedVelocityX, 15, 195);\n ctx.fillText(\"thrustArrow: \"+thrustArrow, 15, 210);\n if (thrustArrow > gravity){\n ctx.fillText(\"Thrust is greater than gravity\", 15, 225);\n }else{\n ctx.fillText(\"Thrust less than gravity\", 15, 225);\n }\n ctx.fillText(\"MouseX = \" + canvas_x, 15, 240);\n ctx.fillText(\"MouseY = \" + canvas_y, 15, 255);\n ctx.fillText(\"WindowHeight = \" + window.innerHeight, 15, 270);\n ctx.fillText(\"WindowWidth = \" + window.innerWidth, 15, 285);\n ctx.fillText(\"levelnum = \" + levelnum, 15, 300);\n ctx.fillText(\"fuel= \" + fuel, 15, 315);\n ctx.fillText(\"shadowsize= \" + shadowsize, 15, 330);\n}", "printText () {\n\n push();\n\n translate ( this.xCoord, this.yCoord );\n\n fill ( 250, 250, 250 );\n noStroke();\n\n triangle( 0, - this.size / 3, this.size / 5, -this.size / 2, - this.size / 5, -this.size / 2 );\n ellipse ( 0, - 2 * (this.size / 3), this.size - 20, this.size / 2 );\n\n textAlign( CENTER );\n textStyle ( BOLD );\n textSize ( this.size / 12 );\n fill ( 70, 70, 70 );\n\n text ( this.name, 0, - 15 * ( this.size / 20 ) );\n textSize ( this.size / 16 );\n text ( \"Pre\", -this.size / 5, - 13 * (this.size / 20 ) );\n text ( \"Post\", this.size / 5, - 13 * (this.size / 20 ) );\n\n textSize ( this.size / 12 );\n text ( this.preCovidPercentage + \"%\", - this.size / 5, - 11 * ( this.size / 20 ));\n text ( this.postCovidPercentage + \"%\", this.size / 5, - 11 * ( this.size / 20 ));\n\n pop();\n }", "function draw(){\n\tbackground ('lightblue');\n\n\t// draw characters\n\timage(jak, JakX, JakY);\n\timage(daxter, DaxterX, DaxterY);\n\n\t\t// narration\n\ttextSize(30);\n\ttextAlign(CENTER, CENTER);\n\ttext(story, width/4, 20, width/2);\n}", "show() {\n\t\tnoStroke();\n\t\tfill(150)\n\t\tcircle(this.x,this.y,this.r*2)\n\t\tfill(255)\n\t\ttextSize(30)\n\t\ttextAlign(CENTER, CENTER)\n\t\ttext(this.name, this.x, this.y)\n\t\t/*\n\t\ttext(this.one, 40, 461)\n\t\ttext(this.two, 121, 461)\n\t\ttext(this.three, 40+81*2, 461)\n\t\ttext(this.four, 40+81*3, 461)\n\t\ttext(this.five, 40+81*4, 461)\n\t\ttext(this.six, 40+81*5, 461)\n\t\ttext(this.ti, 40+81*6, 461)\n\t\ttext(this.te, 40+81*7, 461)\n\t\ttext(this.ta, 40+81*8, 461)\n\t\ttext(this.la, 40+81*9, 461)\n\t\ttext(this.le, 40+810, 461)*/\n\t}", "function buttonText() {\n textAlign(CENTER);\n fill(200, 241, 247);\n textSize(110);\n textStyle(BOLD);\n textFont(\"Cambria\");\n text(\"Start\", width / 2, height / 2 + 175);\n\n textAlign(CENTER);\n fill(150, 241, 247);\n textSize(150);\n textStyle(BOLD);\n textFont(\"Cambria\");\n text(\"ALPHA PAINT\", width / 2, height / 2 - 100);\n}", "function findStyle(x, t){\n push();\n fill(180,180,180);\n stroke(20,70,180);\n strokeWeight(8);\n ellipse(x, height/2, width/8,width/8);\n pop();\n textSize(30);\n fill(30, 280, 220);\n text(t, x, height/2); \n rectMode(CENTER); \n rect(x, height/2+height/20, width/50, width/50) ;\n fill(230, 40, 120);\n triangle(x-width/200, height/2+height/20-width/150, x-width/200, height/2+height/20+width/150, x+width/150, height/2+height/20);\n\n}", "function drawInstructions(){\r\n ctx.beginPath();\r\n ctx.fillStyle = \"#8a7763\";\r\n ctx.fillRect(0,0,800,600);\r\n for (elemnt in instructionButtons)\r\n instructionButtons[elemnt].draw();\r\n ctx.font = \"30px Arial\";\r\n ctx.textAlign = \"center\";\r\n ctx.fillStyle = '#000000';\r\n ctx.fillText(\"Connect 4 Instructions\", 350, 35);\r\n ctx.font = \"20px Arial\";\r\n ctx.fillText(\"Each player takes their turn alternatively\", 350, 105);\r\n ctx.fillText(\"The objective of the game is for each player to make a continuous\", 350, 125);\r\n ctx.fillText(\"line of four of their own coloured pieces\", 350, 145);\r\n ctx.fillText(\"to try and make a straight line of four own pieces\", 350, 165);\r\n ctx.fillText(\"The line can be vertical, horizontal or diagonal as long as it makes 4 connected\", 350, 185);\r\n ctx.fillText(\"of the same colour.\", 350, 205);\r\n ctx.fill();\r\n ctx.closePath();\r\n}", "function drawFlags() {\n var canvas = document.getElementById('canvas');\n var context = canvas.getContext('2d');\n for(var i = 0; i < number_of_coordinates; i++) {\n if(i > 0) {\n context.setLineDash([5]);\n context.beginPath();\n context.lineWidth = 2;\n context.strokeStyle = '#FFFFFF';\n context.moveTo(current_coordinate_list[i].x,current_coordinate_list[i].y);\n context.lineTo(current_coordinate_list[i-1].x,current_coordinate_list[i-1].y);\n context.stroke();\n context.setLineDash([]);\n }\n }\n for(var i = 0; i < number_of_coordinates; i++) {\n drawFlag(current_coordinate_list[i].x-20,current_coordinate_list[i].y-35,i+1);\n }\n}", "function drawMenu(){\r\n ctx.beginPath();\r\n ctx.fillStyle = \"#8a7763\";\r\n ctx.fillRect(0,0,800,600);\r\n for (elemnt in menuButtons)\r\n menuButtons[elemnt].draw();\r\n //Title Text\r\n ctx.font = \"30px Arial\";\r\n ctx.textAlign = \"center\";\r\n ctx.fillStyle = '#000000';\r\n ctx.textBaseline = \"bottom\";\r\n ctx.fillText(\"Welcome to connect 4\", 350, 35);\r\n ctx.font = \"20px Arial\";\r\n ctx.fillText(\"Please Select an Option\", 350, 55);\r\n ctx.fill();\r\n ctx.closePath();\r\n}", "function container(title, x, y, w, h){\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.lineWidth = 2;\n ctx.strokeStyle = white;\n ctx.stroke(); \n ctx.font = '13pt apollo';\n var titleW = ctx.measureText(title).width;\n var titleX = x + (w - titleW)/2;\n var titleY = y + 6;\n var backX = (x + (w - titleW)/2)-10;\n var backY = y - 10;\n var backW = titleW + 20;\n var backH = 20\n ctx.fillStyle = black;\n ctx.fillRect(backX, backY, backW, backH);\n ctx.fillStyle = white;\n ctx.fillText(title, titleX, titleY);\n }", "function draw() {\n background(28, 22, 70);\n\n posX = 80;\n posY = 300;\n randomSeed(actRandomSeed);\n\n // iterate through all characters in the text and draw them\n for (var i = 0; i < joinedText.length; i++) {\n // find the index of the current letter in the character set\n var upperCaseChar = joinedText.charAt(i).toUpperCase();\n var index = charSet.indexOf(upperCaseChar);\n if (index < 0) continue;\n\n // calculate parameters for text image\n var charOpacity = 100;\n if (drawOpacity) {\n charOpacity = counters[index];\n }\n\n var my = map(mouseY, 50, height - 50, 0, 1);\n my = constrain(my, 0, 1);\n var charSize = counters[index] * my * 3;\n\n var mx = map(mouseX, 50, width - 50, 0, 1);\n mx = constrain(mx, 0, 1);\n var lineLength = charSize;\n var lineAngle = random(-PI, PI) * mx - HALF_PI;\n var newPosX = lineLength * cos(lineAngle);\n var newPosY = lineLength * sin(lineAngle);\n\n // draw elements\n push();\n translate(posX, posY);\n stroke(0, 137, 160, charOpacity);\n if (drawLines) {\n line(0, 0, newPosX, newPosY);\n }\n\n // draw elipse and text\n noStroke();\n fill(111, 90, 254, charOpacity * 4);\n if (drawEllipses) {\n ellipse(0, 0, charSize / 10, charSize / 10);\n }\n if (drawText) {\n fill(255, 255, 255, charOpacity * 5);\n text(joinedText.charAt(i), newPosX, newPosY);\n }\n pop();\n\n posX += textWidth(joinedText.charAt(i));\n if (posX >= width - 200 && upperCaseChar == \" \") {\n posY += int(tracking * my + 30);\n posX = 80;\n }\n }\n}", "draw() {\n for (let i = 0; i < this.sentence.length; i++) {\n let current = this.sentence.charAt(i);\n\n if (current === \"F\" || current === \"f\") {\n if (p.random() < 0.9) {\n // All the designing happens here!\n let lineColor = p.lerpColor(\n p.color(this.colors[0]),\n p.color(this.colors[1]),\n i / this.sentence.length\n );\n lineColor.setAlpha(150);\n p.stroke(lineColor);\n //strokeWeight(3 + abs((sin((i+timer)/this.sentence.length*PI) * 15)))\n p.strokeWeight(this.branchValue + 1);\n p.line(0, 0, 0, -this.len);\n p.translate(0, -this.len);\n if (i / this.sentence.length > 0.95) {\n if (p.random() > 0.92) {\n flower();\n }\n } else if (this.branchValue < 3) {\n if (p.random() > 0.97) {\n flower();\n } else if (p.random() > 0.9) {\n spot();\n } else if (p.random() > 0.8) {\n p.circle(0, 0, 6, 6);\n }\n }\n }\n } else if (current === \"+\") {\n p.rotate(this.angle * parseInt(this.sentence.charAt(i + 1)));\n i++;\n } else if (current === \"-\") {\n p.rotate(-this.angle * parseInt(this.sentence.charAt(i + 1)));\n i++;\n } else if (current === \"[\") {\n this.branchValue -= 1;\n p.push();\n } else if (current === \"]\") {\n this.branchValue += 1;\n p.pop();\n }\n }\n }", "function showStatus() \n{\n\t/* score */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"score:\"+score, 5, 16);\n\t/* level */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"level:\"+level, 5, 32);\n\t/* bullet left */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"bullet:\"+bnum, 5, 48);\n\t/* blood */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"blood:\"+blood, 5, 64);\n}", "function drawLevelName() {\n game.context.fillStyle = \"black\";\n game.context.fillRect(300, 400, 100, 100)\n\n game.context.fillStyle = \"white\";\n game.context.font = \"10px 'Press Start 2P'\";\n game.context.fillText(levels[indexLevels].name, 300, 450);\n\n}", "function drawBox(text)\n{\n ctx.beginPath();\n ctx.rect(150, 100, 300, 275);\n ctx.fillStyle = '#222';\n ctx.fill();\n\n ctx.beginPath();\n ctx.strokeStyle = 'white';\n ctx.rect(150, 100, 300, 275);\n ctx.stroke();\n\n ctx.fillStyle = 'white';\n ctx.fillText(text, MID_CANVAS, 150);\n}", "function drawAnswers(){\n tile.beginPath();\n for (var i = 0; i < answers.length; i++) {\n if (answers[i].found){\n tile.fillStyle = '#36a500';\n } else {\n tile.fillStyle = '#000000';\n }\n tile.font = '24px serif';\n if (i < 6) {\n tile.fillText(answers[i].string, 25, 524 + i * 28);\n } else if (i < 12) {\n tile.fillText(answers[i].string, 205, 524 + ((i - 6) * 28));\n } else {\n tile.fillText(answers[i].string, 375, 524 + ((i - 12) * 28));\n }\n }\n tile.closePath();\n}", "function drawboard(location, word) {\n for (var i = 0; i < word.length; i++) {\n context.fillText('_ ', (location[0] + i * 20), location[1]);\n }\n }", "function drawTitle(){\n\t\n\t//Adjustment for text\n\tvar Xadj = -1;\n\tvar Yadj = 20;\n\t\n\t//Draws Text\n\tcanvasContext.fillStyle = \"black\";\n\tcanvasContext.font = \"25px georgia\";\n\tcanvasContext.fillText(\"the button\",25+Xadj,25+Yadj);\n\t\n}", "function drawLives(){\r\n ctx.font = fontType;\r\n ctx.fillStyle = \"#0095DD\";\r\n ctx.fillText(\"❤x\"+lives, canvas.width-43, 20);\r\n}", "draw(context) {\r\n\r\n var x = this.sprite.x_pos + this.sprite.x_offset;\r\n var y = this.sprite.y_pos + this.sprite.y_offset;\r\n\r\n context.fillStyle = '#ffffff';\r\n\r\n if (this.sprite.debug) {\r\n if (this.ghost.direction_current != null && this.ghost.direction_future != undefined) {\r\n context.fillText('Direction Current=' + this.ghost.direction_current.name, x + 20 + this.sprite.width, y + 40);\r\n context.fillText('Direction Future=' + this.ghost.direction_future.name, x + 20 + this.sprite.width, y + 60);\r\n }\r\n }\r\n //context.fillText('Target', 300, 280);\r\n super.draw(context);\r\n\r\n }", "function draw() {\n ellipse(100, 100, 100, 100)\n rect(30, 20, 55, 55)\n triangle(30, 75, 58, 20, 86, 75)\n }", "render() {\n\t\tif (!this.visible || !this.ctx) return;\n\t\tthis.ctx.font = this.textStyle.font;\n\t\tthis.ctx.fillStyle = this.textStyle.fillStyle;\n\t\tthis.ctx.textAlign = this.textStyle.textAlign;\n\t\tthis.ctx.fillText(this.text, this.x, this.y);\n\t}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.moveTo(this.position.x - width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x + width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x, this.position.y - width/2);\n\t\tinfo.context.closePath();\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function drawText(text, x, y) {\n context.fillStyle = '#000';\n context.fillText(text, x-1, y-1);\n context.fillText(text, x+1, y+1);\n context.fillText(text, x+1, y-1);\n context.fillText(text, x-1, y+1);\n context.fillStyle = '#fff';\n context.fillText(text, x, y);\n}", "function creditails() {\r\ntextSize(42);\r\nstrokeWeight(1);\r\nfill(clr);\r\ndisclamer = '(C) This Graphic ART generated by computer algorithm using P5.JS library and programmed by Alex Shipulin';\r\ntext(disclamer, width/2, height-25);\r\n}", "display(){\n //Sets the fill color to this.color\n ctx.fillStyle = this.color;\n //Starts drawing the border with a line width of 5\n ctx.beginPath();\n ctx.lineWidth = 5;\n //Draws a blue line from the first corner to the last\n ctx.moveTo(this.borders[0],this.borders[1]);\n\n for (var i = 2; i < (this.borders.length); i += 2){\n ctx.lineTo(this.borders[i],this.borders[i+1]);\n }\n //Closes the room by drawing from the last corner to the first\n ctx.lineTo(this.borders[0],this.borders[1]);\n //Sets the line color to blue\n ctx.strokeStyle = \"blue\";\n ctx.stroke();\n //fills in the borders with this.color\n ctx.fill();\n\n }", "function drawArrow() {\n options[selectedOption].innerHTML = \"&#9658;\"\n for (i = 0; i < options.length; i++) {\n if (i !== selectedOption) {\n options[i].innerHTML = \"&nbsp;\";\n }\n }\n }", "draw(){\n let shapes = this.shapeList.iterator();\n push();\n while(!shapes.isEmpty()){\n shapes.currItem().draw();\n shapes.next();\n }\n pop();\n\n this.drawText();\n }", "function Instructions() {\n background(colorList[0]);\n \n textSize(100);\n textAlign(CENTER);\n fill(colorList[2]);\n text(\"How to Play\", width/2, 100);\n\n textSize(50);\n textAlign(LEFT);\n fill(colorList[4]);\n text(\"Hold W to toggle the Head\\nHold s to toggle the middle body\\nHold a to toggle the right arm\\nHold d to toggle the left arm\\nHold z to toggle the right leg\\nHold x to toggle the left leg\\n\\nMove the mouse horizontally to make\\nthe block that's toggled dance\", 150, 425); \n}", "function drawChar() {\n const lines = round(random(2, 4));\n\n for (let l = 0; l < lines; l++) {\n const charDetail = round(random(3, 6));\n beginShape();\n for (let i = 0; i < charDetail; i++) {\n const pos = floor(random(rez * rez));\n const y = (floor(pos / rez)) / rez;\n const x = (pos % rez) / rez;\n curveVertex(x * charScale, y * charScale);\n }\n endShape();\n }\n}", "function drawInputTrainglesUsingPaths(context, inputTriangles) {\n \n if (inputTriangles != String.null) { \n var c = new Color(0,0,0,0); // the color at the pixel: black\n var w = context.canvas.width;\n var h = context.canvas.height;\n var n = inputTriangles.length; \n //console.log(\"number of files: \" + n);\n\n console.log(inputTriangles)\n // Loop over the input files\n for (var f=0; f<n; f++) {\n \tvar tn = inputTriangles[f].triangles.length;\n \t//console.log(\"number of triangles in this files: \" + tn);\n \t\n \t// Loop over the triangles, draw each in 2d\n \tfor(var t=0; t<tn; t++){\n \t\tvar vertex1 = inputTriangles[f].triangles[t][0];\n \t\tvar vertex2 = inputTriangles[f].triangles[t][1];\n \t\tvar vertex3 = inputTriangles[f].triangles[t][2];\n\n \t\tvar vertexPos1 = inputTriangles[f].vertices[vertex1];\n \t\tvar vertexPos2 = inputTriangles[f].vertices[vertex2];\n \t\tvar vertexPos3 = inputTriangles[f].vertices[vertex3];\n \t\t//console.log(\"vertexPos1 \" + vertexPos1);\n \t\t//console.log(\"vertexPos2 \" + vertexPos2);\n \t\t//console.log(\"vertexPos3 \" + vertexPos3);\n \t\t\n \tcontext.fillStyle = \n \t \"rgb(\" + Math.floor(inputTriangles[f].material.diffuse[0]*255)\n \t +\",\"+ Math.floor(inputTriangles[f].material.diffuse[1]*255)\n \t +\",\"+ Math.floor(inputTriangles[f].material.diffuse[2]*255) +\")\"; // diffuse color\n \n \tvar path=new Path2D();\n \tpath.moveTo(w*vertexPos1[0],h*vertexPos1[1]);\n \tpath.lineTo(w*vertexPos2[0],h*vertexPos2[1]);\n \tpath.lineTo(w*vertexPos3[0],h*vertexPos3[1]);\n \tpath.closePath();\n \tcontext.fill(path);\n\n \t} // end for triangles\n } // end for files\n } // end if triangle files found\n} // end draw input triangles", "function draw() {\n background(204, 231, 227)\n checkState();\n}", "show() {\n\t\tstroke(255, 0, 0);\n\t\tstrokeWeight(3);\n\t\tfill(255, 128, 0);\n\t\trect(this.x, this.y, this.width, this.height);\n\t}", "function drawLabel() {\n p.push();\n p.textFont('Courier New');\n p.textStyle(p.BOLD);\n p.textAlign(p.LEFT);\n p.textSize(15);\n p.fill('black');\n p.noStroke();\n p.text(`Trials: ${p.props.playedGames}/${p.props.countOfGames}`, 20, p.wrapper.offsetHeight - 20);\n p.pop();\n }", "function cleanButton()\n{\n ctx.fillStyle = \"black\";\n ctx.fillRect(650, 20, 130, 70);\n ctx.lineWidth = 3; \n ctx.strokeRect(650, 20, squareSize+80, squareSize+20);\n ctx.font = \"25px Arial\";\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"נקה לוח\",712,63);\n}", "draw() {\n strokeWeight(10);\n point(this.x, this.y);\n text(this.name, this.x + 10, this.y + 10)\n }", "function drawWall(w) {\n if (w.open) return;\n\n ctx.save();\n\n if (w.selected)\n ctx.fillStyle = ctx.strokeStyle = 'red';\n else\n ctx.fillStyle = ctx.strokeStyle = 'black';\n\n ctx.textAlign = 'center';\n ctx.textBaseline = 'hanging';\n ctx.fillText(w.label, w.x, height);\n\n ctx.beginPath();\n ctx.lineWidth = 2;\n ctx.moveTo(w.x, 0);\n ctx.lineTo(w.x, height);\n ctx.stroke();\n ctx.restore();\n }", "function genTriangle(svg, xCoord, yCoord, size, newColor)\n{\n deviceID++;\n\n // make a container to hold the triangle and text box\n var thisLayer = svg.select(\"#layer3\")\n .append(\"g\") \n .attr(\"id\", \"device\" + deviceID + \"container\")\n .attr(\"transform\", function() {\n return \"translate(\" + xCoord + \",\" + yCoord + \")\";\n });\n \n // add the triangle element \n thisLayer.append(\"path\")\n .attr(\"id\", \"device\" + deviceID)\n .attr(\"class\", \"point\")\n .style(\"fill\", DEVICES_COLOR)\n .attr(\"d\", d3.svg.symbol().type(\"triangle-up\"))\n .attr(\"size\", size);\n \n // the text box will be added when the optimization happens\n}", "drawFish(){\n \tstroke(245, 114, 0);\n strokeWeight(1);\n \tfill(245, 114, 0);\n\t\t ellipse(this.x,this.y,30,30);\n triangle(this.x+5, this.y, this.x+30, this.y+15, this.x+30, this.y-15);\n // triangle(30, 75, 58, 20, 86, 75);\n\t}", "function drawSettingsPage() {\n ctx.fillStyle = \"white\";\n ctx.fillRect(0,0, 400, 400); //clear the background\n restartButton.draw();\n restartIndicator.update(restartButton.clicked);\n restartIndicator.draw();\n\n disableSettingsButton.draw();\n\n // increaseStopCondButton.draw();\n // increaseStopCondIndicator.draw();\n // increaseStopCondIndicator.update(increaseStopCondButton.clicked);\n nextStyleButton.draw();\n nextStyleIndicator.draw();\n nextStyleIndicator.update(nextStyleButton.clicked);\n\n var size = \"large\";\n if(currStyle == 1)\n size = \"small\"\n ctx.font = \"18px Arial\";\n var text = \"Interaction area size: \" + size;\n ctx.fillText(text, numTrialsButtonPosX +nextStyleButton.width + 5, numTrialsButtonPosY);\n}", "function drawUI() {\n\t\t\tflashcard.draw(ctx, correctAnswer);\n\t\t\tif(timer != null)\n\t\t\t\ttimer.draw(ctx);\n\t\t\t\n\t\t\tif(fire != null)\n\t\t\t\tfire.draw(ctx);\n\t\t\tctx.fillStyle = \"black\";\n\t\t\tctx.font = \"15px Airstrike\";\n\t\t\tctx.fillText(\"Points\", 50, canvas.height/2+20);\n\t\t\tctx.font = \"25px Airstrike\";\n\t\t\tctx.fillText(\"Speed\", canvas.width-170, canvas.height/2+20);\n\t\t\tctx.fillStyle = \"white\";\n\t\t\tctx.font = \"60px Airstrike\";\n\t\t\tctx.fillText(points, 70, canvas.height/2);\n\t\t\tctx.fillStyle = \"yellow\";\n\t\t\tif(Math.round(speed*45) >= 80)\n\t\t\t\tctx.fillStyle = \"red\";\n\t\t\telse if(Math.round(speed*45) >= 60)\n\t\t\t\tctx.fillStyle = \"orange\";\n\t\t\tctx.fillText(Math.round(speed*45), canvas.width-200, canvas.height/2-10);\n\t\t\tctx.font = \"20px Airstrike\";\n\t\t\tctx.fillText(\"MPH\", canvas.width-110, canvas.height/2-10);\n\t\t}", "function draw_rectangle()\r\n{\r\n\t//tips:24 dot matrix;x=112,y=112;show string is 'make block';1(red)\r\n\tvar str = \"DS24(112,112,'make block',1);\";\r\n\t//draw rectangle >>Upper left corner:x1=85,y1=45;Lower right corner:x2=235,y2=195;4(yellow)\r\n\tvar rectangle = \"BOX(85,45,235,195,4);\";\r\n\ttftlcd.send(clear);\t\r\n\ttftlcd.send(upright);\t\r\n\ttftlcd.send(str);\r\n\ttftlcd.send(rectangle);\r\n\ttftlcd.send(println);\t\r\n}", "function draw()\r\n\t{\r\n\t\t// set the draw fill style colour to black\r\n\t\tcontext.fillStyle = \"#000000\";\r\n\t\t// fill the canvas with black\r\n\t\tcontext.fillRect(0,0,canvas.width,canvas.height);\r\n\t\t// choose a font for our message\r\n\t\tcontext.font = \"40pt Calibri\";\r\n\t\t// set the draw fill colour to white\r\n\t\tcontext.fillStyle = \"#ffffff\";\r\n\t\t// draw the text at the specified position\r\n\t\tcontext.fillText(\"Hello World!\", 150, canvas.height);\r\n\t}", "function draw() {\n background(0);\n fill(244,97,139);\n text(\"☆*Hello World!*☆\",width/2,height/2);\n}", "function formatText() {\n stroke(255);\n fill(255);\n textSize(20);\n textFont('Inconsolata');\n}", "function drawcolorcode() \n\t{\n\t// var canv = document.getElementById('colorcode');\n\t// var figure = canv.getContext('2d');\t\n\n\tleng=2\n\theig=7\n\tst=40\t\n\tik=14\n\tableng=st+leng\n\tvar cctext=''\n\tfor (var i=0;i<=100;i++)\n\t\t{\n\t\tcolor = dbandscore2color(dbs[0],i);\n\t\tbegx=leng*i+st\n\t\tbegy=3+heig*0\n\t\thei=heig-2\n\t\tcctext=cctext+'<rect x='+begx+' y='+begy+' width='+leng+' height='+heig+' style=\"fill:'+color+';stroke-width:0;stroke:rgb(100,100,100)\" />'\n\t\t}\n\t\n\tfont = \"10px Arial\";\n\ttextAlign=\"right\"; \t\n\ttextBaseline =\"top\";\n\tvar labels=''\n\tst2=st-3\n\tlabels=labels+'<text x='+st2+' y=\"9\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"end\" dominant-baseline=\"top\">pfam</text></a>';\n\tlabels=labels+'<text x='+260+' y=\"9\" fill=\"black\" style=\"font-family: Arial\" font-size=\"10\" text-anchor=\"start\" dominant-baseline=\"top\">HMMsearch</text></a>';\n\tlabels=labels+'<text x='+260+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"10\" text-anchor=\"start\" dominant-baseline=\"bottom\">Probability</text></a>';\n\tlabels=labels+'<text x='+40+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">0%</text></a>';\n\tlabels=labels+'<text x='+90+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">25%</text></a>';\n\tlabels=labels+'<text x='+140+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">50%</text></a>';\n\tlabels=labels+'<text x='+190+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">75%</text></a>';\n\tlabels=labels+'<text x='+240+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">100%</text></a>';\n\t\n\tfor (var j=1;j<8;j++)\n\t\t{\n\t\t\n\t\tfor (var i=0;i<=100;i++)\n\t\t\t{\n\t\t\tcolor = dbandscore2color(dbs[j],i);\n\t\t\tx=st+leng*i\n\t\t\ty=ik+heig*j+5\n\t\t\tlabels=labels+'<rect x='+x+' y='+y+' width='+leng+' height='+heig+' style=\"fill:'+color+';stroke-width:0;stroke:rgb(100,100,100)\" />'\n\t\t\t}\n\tyt=ik+heig*j+6.5+5\n\tst2=st-3\n\tlabels=labels+'<text x='+st2+' y='+yt+' fill='+color+' style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"end\" dominant-baseline=\"top\">'+dbs[j]+'</text></a>';\n\t\t\n\t\t}\n\tlabels=labels+'<text x='+260+' y=\"45\" fill=\"black\" style=\"font-family: Arial\" font-size=\"10\" text-anchor=\"start\" dominant-baseline=\"top\">HHsearch</text></a>';\n\t//document.write(cctext)\t\n\t//document.write(labels)\n\tvar total = cctext + labels;\n\treturn total;\n\t\n\t}", "function drawInfoText() {\n push();\n fill(0,0,0);\n noStroke();\n rect(0, height-height*0.0648, width, height);\n fill(98, 245, 31);\n\n // write distance legend and moderate position\n textSize(15);\n text(\"1m\", width-width*0.365, height-height*0.0833);\n text(\"2m\", width-width*0.262, height-height*0.0833);\n text(\"3m\", width-width*0.16, height-height*0.0833);\n text(\"4m\", width-width*0.055, height-height*0.0833);\n\n // write Infomation like degree\n textSize(30);\n text(\"Angle: \" + nowAngle +\" \", width-width*0.48, height-height*0.0277);\n text(\"Distance: \", width-width*0.26, height-height*0.0277);\n if(nowDistance<40) {\n text(\" \" + nowDistance +\" cm\", width-width*0.225, height-height*0.0277);\n }\n\n // write degree legend and moderate position\n textSize(25);\n fill(98, 245, 60);\n translate((width-width*0.495)+width/2*cos(radians(30)), (height-height*0.0907)- width/2*sin(radians(30)));\n rotate(-radians(-60));\n text(\"30\",0,0)\n resetMatrix();\n\n translate((width-width*0.503)+width/2*cos(radians(60)),(height-height*0.0888)-width/2*sin(radians(60)));\n rotate(-radians(-30));\n text(\"60\",0,0);\n resetMatrix();\n\n translate((width-width*0.507)+width/2*cos(radians(90)),(height-height*0.0833)-width/2*sin(radians(90)));\n rotate(radians(0));\n text(\"90\",0,0);\n resetMatrix();\n\n translate(width-width*0.513+width/2*cos(radians(120)),(height-height*0.07129)-width/2*sin(radians(120)));\n rotate(radians(-30));\n text(\"120\",0,0);\n resetMatrix();\n\n translate((width-width*0.5104)+width/2*cos(radians(150)),(height-height*0.0574)-width/2*sin(radians(150)));\n rotate(radians(-60));\n text(\"150\",0,0);\n\n pop();\n}", "function dibujoInicial(){\r\n\tctx.fillStyle = \"#fff\";\r\n\tctx.fillRect(0, 0, 600, 250);\t\r\n\tctx.fillStyle =\"#8A0808\";\r\n\tctx.font=\"25pt Rockwell Condensed\";\r\n\tctx.fillText(\"\",180,50);\r\n\tctx.strokeStyle = \"black\";\r\n\tctx.strokeText(\"\",180,50);\r\n}", "function drawLanded(){\n ctx.font = \"30px Molengo\";\n ctx.fillStyle = \"#00FF00\";\n ctx.fillText(\"You Landed\", x - 50, y - 25);\n}", "function drawTrg(t){\n context.beginPath();\n context.moveTo(t.lx, t.ly);\n context.lineTo(t.rx, t.ry);\n context.lineTo(t.tx, t.ty);\n context.lineTo(t.lx, t.ly);\n\n context.fillStyle = t.c;\n context.fill();\n context.closePath();\n\n }", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}" ]
[ "0.6733783", "0.672757", "0.66360265", "0.6625516", "0.6535745", "0.64687175", "0.64041877", "0.6395423", "0.6386023", "0.6373042", "0.6371528", "0.6361682", "0.63565373", "0.63371265", "0.6294552", "0.62833184", "0.62769043", "0.6270971", "0.62678075", "0.62676424", "0.6265257", "0.625187", "0.6213102", "0.6211992", "0.62107396", "0.6205444", "0.62045455", "0.6195191", "0.61944246", "0.6193856", "0.618217", "0.61818093", "0.6174756", "0.6168906", "0.61532384", "0.61430144", "0.6142259", "0.61091065", "0.60973877", "0.60894954", "0.60796154", "0.607818", "0.60598207", "0.60562897", "0.60548306", "0.605304", "0.6046863", "0.6046011", "0.60459185", "0.60442996", "0.6033499", "0.6031367", "0.6022834", "0.60224515", "0.6022242", "0.6021071", "0.6017574", "0.60141206", "0.6007478", "0.60064346", "0.5997601", "0.5988585", "0.5987462", "0.5987088", "0.5978111", "0.5977838", "0.5975093", "0.5968063", "0.59671664", "0.5960867", "0.5955268", "0.59369963", "0.5918587", "0.5915384", "0.59139466", "0.59104127", "0.59082514", "0.59059286", "0.5904462", "0.59005916", "0.59000003", "0.58977693", "0.589648", "0.5892658", "0.5888667", "0.5885945", "0.5885243", "0.5883344", "0.587393", "0.5870327", "0.5868317", "0.58663327", "0.5862849", "0.58619756", "0.58603585", "0.5857781", "0.5850528", "0.5848162", "0.5847755", "0.58465254" ]
0.6923671
0
places values on machine
function pointsText(){ fill(255); textSize(12); textFont('Helvetica'); //red if(num < 20) fill(241, 136, 113); text('100 100', 300, 530); //orange if(num < 60) fill(237, 162, 85); text('200 200', 300, 485); //yellow if(num < 110) fill(243, 230, 77); text('300 300', 300, 440); //light green if(num < 158) fill(54, 234, 75); text('400 400', 300, 395); //turquoise if(num < 200) fill(54, 234, 201); text('500 500', 300, 350); //turquoise if(num < 242) fill(77, 243, 207); text('600 600', 300, 305); //light blue if(num < 285) fill(77, 210, 243); text('700 700', 300, 260); //blue if(num < 330) fill(171, 162, 247); text('800 800', 300, 215); //purple if(num < 375) fill(221, 162, 247); text('900 900', 300, 170); //pink if(num < 420) fill(238, 162, 247); text('1000 1000', 300, 125); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadValues() {\n\thiscore = parseInt(storage.hiscore2) || 0;\n\tlongest = parseInt(storage.longest2) || 1;\n\tspeed = parseInt(storage.speed2) || DEFAULT_SPEED;\n}", "function getInitialValues()\n\t{\n\t settings.robotDirection = gameMap.getDirection()\n\t settings.columns = gameMap.getWidth();\n\t settings.rows = gameMap.getHeight();\n\n\t for (var x = 0; x < settings.columns; x++) {\n\t for (var y = 0; y < settings.rows; y++) {\n\n\t var row = y;\n\t var col = x;\n\t \n\t var tile = gameMap.getTile([row, col]);\n\n\t if(tile.containsPlayer()){\n\t settings.robotStart = [row,col];\n\t }\n\t \n\t if (tile.containsBattery()) {\n\t settings.batteryStart = [row, col];\n\t }\n\t }\n\t }\n\t}", "function setGlobalVariables() {\n officeName = officeLoc[beach].name;\n beachID = officeLoc[beach].beachID;\n weatherID = officeLoc[beach].weatherID;\n officeLatCoord = officeLoc[beach].lat;\n officeLonCoord = officeLoc[beach].lon;\n transit = officeLoc[beach].transit;\n videoLetterboxed = officeLoc[beach].videoLetterboxed;\n measurements = homeOfficeInfo[0].measurements;\n\n if (measurements === english) {\n heightUnit = 'ft';\n surflineVar = 'e';\n tempUnit = 'f';\n } else if (measurements === metric) {\n heightUnit = 'm';\n surflineVar = 'm';\n tempUnit = 'c';\n }\n}", "sync() {\n\t\tthis._user_defined_southbound_volumes = this._direction_array[0];\n\t\tthis._user_defined_westbound_volumes = this._direction_array[1];\n\t\tthis._user_defined_northbound_volumes = this._direction_array[2];\n\t\tthis._user_defined_eastbound_volumes = this._direction_array[3];\n\t}", "function setDefaultValues()\n{\n return [54, undefined, -127, \"sunshine\"];\n}", "sync() {\n\t\tthis._southbound_PCEs = this._PCE_array[0];\n\t\tthis._westbound_PCEs = this._PCE_array[1]; \n\t\tthis._northbound_PCEs = this._PCE_array[2];\n\t\tthis._eastbound_PCEs = this._PCE_array[3];\n\t}", "map_system() {\n\t\t// First 8K of RAM\n\t\tthis.map_loram(0x00, 0x3F, 0x0000, 0x1FFF, 0);\n\t\t// PPU regs\n\t\tthis.map_kind(0x00, 0x3F, 0x2000, 0x3FFF, 0x2000, MAP_TI.PPU);\n\t\t// CPU regs\n\t\tthis.map_kind(0x00, 0x3F, 0x4000, 0x5FFF, 0x4000, MAP_TI.CPU);\n\t\t// All of this mirrored again at 0x80\n\t\tthis.map_loram(0x80, 0xBF, 0x00, 0x1FFF, 0);\n\t\tthis.map_kind(0x80, 0xBF, 0x2000, 0x3FFF, 0x2000, MAP_TI.PPU);\n\t\tthis.map_kind(0x80, 0xBF, 0x4000, 0x5FFF, 0x4000, MAP_TI.CPU);\n\t}", "function program(){\n\t\ttoggleOnOff(programSwitch);\n\t\tmemplace_data[activeMemPlace] = [];\n\t\tmemplace_addr[activeMemPlace] = [];\n\t\tfor(var i=0; i<=15; i++){\n\t\t\tif (i<=7){ memplace_data[activeMemPlace].push(temp_data[i]); }\n\t\t\tmemplace_addr[activeMemPlace].push(temp_addr[i]);\n\t\t}\n\t\tconsole.log(\"> computer programmed\");\n\t\tconsole.log(\"wrote in memspace : \"+activeMemPlace);\n\t\tconsole.log(\"memory for data (in memspace \"+activeMemPlace+\") : \"+memStat(\"data\"));\n\t\tconsole.log(\"memory for addr (in memspace \"+activeMemPlace+\") : \"+memStat(\"addr\"));\n\t\tconsole.log(\"\");\n\t}", "function saveValues() {\n\tstorage.hiscore2 = hiscore;\n\tstorage.longest2 = longest;\n\tstorage.speed2 = speed;\n}", "set Systems(value) {}", "sync() {\r\n this._southbound_PCEs = this.getZonePCEs().getDirectionByIndex(0);\r\n this._westbound_PCEs = this.getZonePCEs().getDirectionByIndex(1);\r\n this._northbound_PCEs = this.getZonePCEs().getDirectionByIndex(2);\r\n this._eastbound_PCEs = this.getZonePCEs().getDirectionByIndex(3); \r\n }", "function holdValues(cityData) {\n temp = cityData.main.temp.toFixed(1);\n feelsLike = cityData.main.feels_like.toFixed(1);\n dayMax = cityData.main.temp_max.toFixed(1);\n dayMin = cityData.main.temp_min.toFixed(1);\n}", "function refreshLocVariables(){\n\ttargetPoint = false;\n\ttempTin=false;\n\ttin=false;\n\tnearest=false;\n\tnearest_turf=false;\n\tbuffered=false;\n\tptsWithin=false;\n\tmyPoint=false;\n\tcoords_x = []; //define an array to store the lng coordinate\n\tcoords_y = []; //define an array to store the lat coordinate\n\tcoords_z = []; //define an array to store elev coordinate\n\tkeyLocLocation = false;\n}", "function simulatedValues() {\n var now = new Date().getTime();\n\n // Simluate ESP32 data\n var values = {\n wt: getSinValue(0, 120, now),\n tps: getSinValue(0, 150, now += 500),\n bat: getSinValue(0, 150, now += 500),\n fuel: ((getSinValue(0, 100, now += 500) / 100.0) * 400.0) + 490.0,\n rpm: getSinValue(0, 9000, now += 500),\n map: getSinValue(0, 30, now += 500),\n mat: getSinValue(0, 120, now += 500),\n auxt: getSinValue(0, 120, now += 500),\n afr: getSinValue(0, 23, now += 500),\n gpsFix: 0\n };\n\n if (simulateGPSConnected) {\n values.gpsFix = 1;\n values.gpsLatitude = getSinValue(-90, 90, now += 500);\n values.gpsLongitude = getSinValue(-180, 180, now += 500);\n values.gpsLat = 0;\n values.gpsLon = 0;\n values.gpsSpeed = getSinValue(0, 250, now += 500) / 1.852;\n values.gpsAngle = 0;\n values.gpsAlt = 0;\n values.gpsQual = 0;\n values.gpsSats = 0;\t\n }\n\n return values;\n}", "function precal_loc() {\n buffer_loc.forEach((obj)=>{obj.x = (obj.longitude + 180) * 10; obj.y = (90 - obj.latitude) * 10;});\n}", "function parse_variables() {\n\n\t\t\t\twindow.W = W = parseFloat(localStorage.getItem('SPLITTER_W'));\n\t\t\t\twindow.B = B = parseFloat(localStorage.getItem('SPLITTER_B'));\n\t\t\t\twindow.Mf = Mf = parseFloat(localStorage.getItem('SPLITTER_MF'));\n\t\t\t\twindow.Mt = Mt = parseFloat(localStorage.getItem('SPLITTER_MT'));\t\t\t\t\n\n\t\t\t}", "function ParseSystemInfo() {\n\tvar systemInfo = cl.gameState['systemInfo'];\n\n\tcl.serverId = systemInfo['sv_serverid'];\n\n\tvar pmove_fixed = Cvar.AddCvar('pmove_fixed');\n\tvar pmove_msec = Cvar.AddCvar('pmove_msec');\n\n\tpmove_fixed.set(systemInfo['pmove_fixed']);\n\tpmove_msec.set(systemInfo['pmove_msec']);\n}", "function getAndSetUserBoxLocation(){\n \n let screenWidth = window.innerWidth\n let screenHeight = window.innerHeight\n // box.offsetLeft\n // console.log('width: ' + screenWidth + \" height: \" + screenHeight)\n\n let topOffset = box.offsetTop\n let leftOffset = box.offsetLeft\n\n // console.log(\"top: \" + topOffset + \" left: \" + leftOffset)\n\n let partFromTop = (topOffset / screenHeight) * 100\n let partFromLeft = (leftOffset / screenWidth) * 100\n\n console.log(partFromTop + \" \" + partFromLeft)\n\n setMyPlayerData(name, partFromTop, partFromLeft)\n}", "function val2xcoord10(value) {\n\t\tvar xcoord = 0;\n\t\tswitch (value)\n\t\t\t{\n\t\t\t\tcase \"Very low\":\n \t\t\t\t\txcoord = 100;\n \t\t\t\t\tbreak;\n\t\t\t\tcase \"Low\":\n \t\t\t\t\txcoord = 200;\n \t\t\t\t\tbreak;\n\t\t\t\tcase \"Medium\":\n \t\t\t\t\txcoord = 300;\n \t\t\t\t\tbreak;\n\t\t\t\tcase \"High\":\n \t\t\t\t\txcoord = 400;\n \t\t\t\t\tbreak;\n\t\t\t}\n\t\treturn xcoord;\n\t}", "function assignValues(cityValue, latValue, lngValue) {\n city = cityValue;\n lat = latValue;\n lng = lngValue; \n document.getElementById(\"location-text\").value=city;\n}", "private internal function m248() {}", "set resolution(value) {}", "syncArray() {\n\t\tthis._direction_array[0] = this._user_defined_southbound_volumes;\n\t\tthis._direction_array[1] = this._user_defined_westbound_volumes;\n\t\tthis._direction_array[2] = this._user_defined_northbound_volumes;\n\t\tthis._direction_array[3] = this._user_defined_eastbound_volumes;\n\t}", "function sw() {\r\n var src1 = getRegisterVal(\"registerOne\");\r\n var src2 = getRegisterVal(\"registerTwo\");\r\n var offset = parseInt($(\"#immediate\").val());\r\n var loc = src1 + offset;\r\n memory[loc] = src2;\r\n $(\"#m\" + loc).html(src2);\r\n}", "function storeInfo(){\r\n // Meaning of GM Values: (Some of the variable names are in dutch, to stay compatible with older scripts) \r\n //\r\n // DORP (dutch for village): \r\n // id of the current active village. It's 0 when only 1 village is available and does not always accurate.\r\n // \r\n // MARKT (dutch for market):\r\n // an array of length 4 containing the amount of resources currently available for sale on the marketplace. (might often be inaccurate)\r\n //\r\n // PRODUCTIE (dutch for production):\r\n // an array of length 4 containing the production rates of resp. wood, clay, iron and grain. (amount produced per hour)\r\n //\r\n // ALLIANCE:\r\n // dictionary (map) mapping the names of your ally's members to a list of it's villages. \r\n\r\n none = \"0,0,0,0\";\r\n\r\n // Keep track of current city id\r\n x = location.href.match(\"newdid=(\\\\d+)\");\r\n if (x!=null) {\r\n dorp_id=x[1]-0;\r\n GM_setValue(prefix(\"DORP\"),dorp_id);\r\n } else {\r\n dorp_id=GM_getValue(prefix(\"DORP\"),0);\r\n }\r\n\r\n // Store info about resources put on the market if availbale\r\n x = document.getElementById(\"lmid2\");\r\n if (x!=null && x.innerHTML.indexOf(\"\\\"dname\\\"\")>0) {\r\n var res = document.evaluate( \"//table[@class='f10']/tbody/tr[@bgcolor='#ffffff']/td[2]\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n \r\n var cnt = new Array(0,0,0,0);\r\n \r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n c = res.snapshotItem(i).textContent - 0;\r\n t = res.snapshotItem(i).firstChild.src.match(\"\\\\d\") - 1;\r\n cnt[t] += c;\r\n }\r\n markt = eval(GM_getValue(prefix(\"MARKT\"), \"{}\"));\r\n if (markt==undefined) markt={};\r\n markt[dorp_id]=cnt;\r\n GM_setValue(prefix(\"MARKT\"), uneval(markt));\r\n }\r\n\r\n // Store info about production rate if available\r\n //function storeProductionRate(){\r\n if (location.href.indexOf(\"dorf1\")>0) {\r\n var res = document.evaluate( \"//div[@id='lrpr']/table/tbody/tr\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n var prod = new Array(0,0,0,0);\r\n \r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n c = res.snapshotItem(i).childNodes[4].firstChild.textContent.match(\"-?\\\\d+\") - 0;\r\n t = res.snapshotItem(i).childNodes[1].innerHTML.match(\"\\\\d\")[0] - 1;\r\n prod[t] += c;\r\n }\r\n productie = eval(GM_getValue(prefix(\"PRODUCTIE\"), \"{}\"));\r\n if (productie==undefined) productie={};\r\n productie[dorp_id]=prod;\r\n GM_setValue(prefix(\"PRODUCTIE\"), uneval(productie));\r\n }\r\n\r\n // Load ally data\r\n //function captureAllianceData(){\r\n try {\r\n ally = eval(GM_getValue(prefix(\"ALLIANCE\"), \"{}\"));\r\n if (ally==undefined) ally = {};\r\n } catch (e) {\r\n alert(e);\r\n ally = { };\r\n } \r\n if (ally==undefined) ally2={};\r\n\r\n // Store list of your alliance members.\r\n if (location.href.indexOf(\"allianz\")>0 && location.href.indexOf(\"s=\")<0) {\r\n var res = document.evaluate( \"//td[@class='s7']/a\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n if (res.snapshotLength>0) {\r\n ally2= ally;\r\n ally = {}\r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n x = res.snapshotItem(i);\r\n name = x.textContent;\r\n id = x.href.match(\"\\\\d+\")[0];\r\n cnt = x.parentNode.parentNode.childNodes[5].textContent;\r\n if (ally2[name] != undefined) {\r\n y = ally2[name];\r\n y[0] = id;\r\n y[1] = cnt;\r\n ally[name] = y;\r\n } else {\r\n // [id, pop, {city1: [city1,x,y],city2: [city2,x,y],...} ]\r\n ally[name] = [id, cnt, {}];\r\n }\r\n }\r\n GM_setValue(prefix(\"ALLIANCE\"), uneval(ally));\r\n }\r\n } \r\n\r\n // Get alliance member data\r\n if (location.href.indexOf(\"spieler\")>0) {\r\n who = document.body.innerHTML.match(\"<td class=\\\"rbg\\\" colspan=\\\"3\\\">[A-Z][a-z]+ ([^<]+)</td>\");\r\n if (who) {\r\n who = who[1];\r\n if (ally[who] != undefined || who == USERNAME) {\r\n var res = document.evaluate( \"//td[@class='s7']/a\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n cities = {};\r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n x = res.snapshotItem(i);\r\n name = x.textContent;\r\n y = x.parentNode.parentNode.childNodes[4].textContent.match(\"\\\\((-?\\\\d+)\\\\|(-?\\\\d+)\\\\)\");\r\n y[0] = name;none = \"0,0,0,0\";\r\n\r\n y[1] -= 0;\r\n y[2] -= 0;\r\n cities[name] = y;\r\n }\r\n if (ally[who]==undefined) ally[who]=[0,0,{}];\r\n ally[who][2] = cities;\r\n GM_setValue(prefix(\"ALLIANCE\"), uneval(ally));\r\n }\r\n }\r\n }\r\n }", "function setPosition(position){\n let latitude = position.coords.latitude;//storing latitude\n let longitude = position.coords.longitude;//storing longitude\n console.log(latitude)\n console.log(longitude)\ngetAQI(latitude, longitude);\n }", "function setCustomValues(analyticsFacts) {\n var values = getCustomValues(analyticsFacts);\n\n if (typeof values != 'undefined') {\n try {\n /* Add all of the site specific variables here */\n\n // Server. ex: server = uk.myherbalife.com\n s_omntr.server = values.host;\n\n // Page Name. ex: pageName = myhl:us:en:ordering:hoppingCart\n // https://www.myherbalife.com/Ordering/ShoppingCart.aspx\n s_omntr.pageName = values.pageName;\n\n // Page Name Copy. Conversion Variable \n s_omntr.eVar3 = values.pageNameBreadCrumbs;\n\n // Page Title. Traffic Variable ex prop33 = toolsAndTrainingOverview\n s_omntr.prop33 = values.pageTitle;\n s_omntr.eVar33 = \"D=c33\";\n\n // Local PageTitle. Traffic Variable ex prop35 = herramientas y capacitacion\n s_omntr.prop35 = values.localPageTitle;\n s_omntr.eVar35 = values.localPageTitle;\n\n // Section. ex: s_channel = myherbalife:toolsandtraining\n s_omntr.channel = values.parentSection;\n\n // Region. Traffic Variable ex: s_prop1 = myhl3\n //s_omntr.prop1 = values.region;\n\n // Country. Traffic Variable ex: prop2 = myhl3:us \n s_omntr.prop2 = values.country;\n s_omntr.eVar12 = \"D=c2\";\n\n // Language. Traffic Variable ex: prop6 = en\n s_omntr.prop6 = values.language;\n\n // Locale. Traffic Variable ex: prop29 = en-US\n s_omntr.prop29 = values.locale;\n s_omntr.eVar29 = values.locale;\n\n // Sub Sections (Level 1). Traffic Variable ex: prop3 = myhl:na:us:toolsandtraining \n s_omntr.prop3 = values.sectionLevel1;\n s_omntr.eVar13 = \"D=c3\";\n\n // Sub Sections (Level 2). Traffic Variable ex: prop4 = myhl:na:us:toolsandtraining:resourcelibrary\n if (values.sectionLevel2 != \"\") {\n s_omntr.prop4 = values.sectionLevel2;\n s_omntr.eVar14 = \"D=c4\";\n }\n\n // Sub Sections (Level 3). Traffic Variable ex: prop5 = myhl:na:us:toolsandtraining:resourcelibrary:tutorialsandquizzes\n if (values.sectionLevel3 != \"\") {\n s_omntr.prop5 = values.sectionLevel3;\n s_omntr.eVar15 = \"D=c5\";\n }\n\n // Sub Sections (Level 4). Traffic Variable ex: prop16 = myhl:na:us:toolsandtraining:resourcelibrary:tutorialsandquizzes:subsection4\n if (values.sectionLevel4 != \"\") {\n s_omntr.prop16 = values.sectionLevel4;\n }\n\n // Sub Sections (Level 5). Traffic Variable ex: prop17 = myhl:na:us:toolsandtraining:resourcelibrary:tutorialsandquizzes:subsection4:subsection5\n if (values.sectionLevel5 != \"\") {\n s_omntr.prop17 = values.sectionLevel5;\n }\n\n // Hierarchy. ex: hier1 = myhl:na:us:toolsandtraining|myhl:na:us:toolsandtraining:resourcelibrary|myhl:na:us:toolsandtraining:resourcelibrary:tutorialsandquizzes \n s_omntr.hier1 = values.hierarchy1;\n\n // Currency Code. ex: currencyCode = USD\n s_omntr.currencyCode = values.currencyCode;\n\n // Distributor Profile.\n if (values.distributorId != \"\") {\n // DS ID. Traffic Variable ex prop19 = STAFF \n s_omntr.prop19 = values.distributorId;\n // Distributor ID. Conversion Variable ex: eVar22 = STAFF\n s_omntr.eVar22 = values.distributorId;\n\n if (values.distributorTeam != \"\") {\n // DS Team. Traffic Variable ex: prop26 = PT \n s_omntr.prop26 = values.distributorTeam;\n // DS Team. Conversion Variable ex eVar8 = PT\n s_omntr.eVar8 = values.distributorTeam;\n // Levels pathing. Traffic Variable ex: prop18 = PT:myhl:na:us:toolsandtraining\n s_omntr.prop18 = values.distributorTeam + \":\" + values.pageName;\n }\n if (values.countryOfProcessing != \"\") {\n // Country of Processing. Traffic Variable ex prop25 = US\n s_omntr.prop25 = values.countryOfProcessing;\n // Country of Processing. Conversion Variable ex eVar25 = US\n s_omntr.eVar25 = values.countryOfProcessing;\n }\n if (values.dsIsBizworksSubscriber != \"\") {\n // Bizworks Subscriber. Traffic Variable ex: prop27 = false\n s_omntr.prop27 = values.dsIsBizworksSubscriber;\n // Bizworks Subscriber. Conversion Variable ex: eVar27 = false\n s_omntr.eVar27 = values.dsIsBizworksSubscriber;\n }\n if (values.dsIsDwsOwner != \"\") {\n // Ds Owns DWS. Traffic Variable ex: prop34 = false \n s_omntr.prop34 = values.dsIsDwsOwner;\n // Ds Owns DWS. Conversion Variable ex: eVar34 = false\n s_omntr.eVar34 = values.dsIsDwsOwner;\n }\n }\n\n // Logged in Status.\n if (values.loggedStatus != \"\") {\n // Custom eVar28. Conversion Variable ex: eVar28 = logged in\n s_omntr.eVar28 = values.loggedStatus;\n // copy eVar28 \"logged in\" status. Traffic Variable ex: prop28 = logged in \n s_omntr.prop28 = values.loggedStatus;\n }\n\n //Waiting Room\n if (values.WaitingRoom) {\n s_omntr.events = \"event10\";\n }\n\n\n // Product View\n if (values.productDetail != \"\") {\n // Product Name. Traffic Variable ex: prop15 = formula 1 instant healthy meal nutritional shake mix\n s_omntr.prop15 = values.productName;\n s_omntr.events = \"prodView\";\n s_omntr.products = values.productDetail;\n }\n\n //Shopping Cart\n if (values.products != \"\") {\n // Products. ex: products = \";formula 1 nutritional shake mix-french vanilla 750g (3106);1;19.87,;formula 1 nutritional shake mix-wild berry 750g (3108);2;39.74\";\n s_omntr.products = values.products;\n if (values.purchaseId == \"scView\") {\n s_omntr.events = \"scView\";\n } else if (values.purchaseId == \"scCheckout\") {\n s_omntr.events = \"scCheckout\";\n } else if (values.purchaseId != \"\" && values.purchaseId != \"scView\" && values.purchaseId != \"scCheckout\") {\n s_omntr.events = \"purchase\";\n s_omntr.purchaseId = values.purchaseId; // Purchase ID. Traffic Variable ex: eVar9 = DA00020508\n s_omntr.eVar9 = s_omntr.purchaseId;\n }\n }\n /* End */\n if (values.events) {\n s_omntr.events = s_omntr.apl(s_omntr.events, values.events, ',', 1);\n }\n return true;\n\n } catch (err) {\n return false;\n }\n } else {\n return false;\n }\n }", "function SoloValue() {}", "function storePositionforDrinkups() {\n var place = autocomplete.getPlace();\n var position= {\n coords: {latitude:place.geometry.location.lat(),longitude:place.geometry.location.lng()}\n };\n changeMapLocationforDrinkups(position.coords.latitude,position.coords.longitude,15);\n\n initializeMarkers(position);\n}", "bouton_centrage_pos() {}", "function getLocCode() {\r\n\tplayerLocCode = playerDetails.locCode;\r\n}", "function getCoords() {\r\n\r\n\t// use real coords in the future\r\n\t// in the future use this -> navigator.geolocation.getCurrentPosition(function(geo) { })\r\n\treturn { \r\n\t\tlatitude: '' + 33.501 + parseInt(Math.random() * 1000),\r\n\t\tlongitude: '' + -82.51 + parseInt(Math.random() * 1000)\r\n\t}\r\n}", "function getMemInformation() {\n xapi.config.get('FacilityService Service 5 Name').then((config) => {\n stored_Information = config.split(\"~\");\n mem.block_0.value = stored_Information[0];\n mem.block_1.value = stored_Information[1];\n mem.block_2.value = stored_Information[2];\n mem.block_3.value = stored_Information[3];\n mem.block_4.value = stored_Information[4];\n mem.block_5.value = stored_Information[5];\n mem.block_6.value = stored_Information[6];\n mem.block_7.value = stored_Information[7];\n mem.block_8.value = stored_Information[8];\n mem.block_9.value = stored_Information[9];\n mem.block_10.value = stored_Information[10];\n mem.block_11.value = stored_Information[11];\n mem.block_12.value = stored_Information[12];\n mem.block_13.value = stored_Information[13];\n mem.block_14.value = stored_Information[14];\n mem.block_15.value = stored_Information[15];\n mem.block_16.value = stored_Information[16];\n mem.block_17.value = stored_Information[17];\n mem.block_18.value = stored_Information[18];\n mem.block_19.value = stored_Information[19];\n });\n}", "function lw() {\r\n var src1 = getRegisterVal(\"registerOne\");\r\n var src2 = getRegisterVal(\"registerTwo\");\r\n var offset = parseInt($(\"#immediate\").val());\r\n src2 = memory[src1 + offset];\r\n setRegisterVal(\"registerTwo\", src2);\r\n\r\n}", "function determineCrystalPosition(){\n var crystalOne = crystalValues[0];\n var crystalTwo = crystalValues[1];\n var crystalThree = crystalValues[2];\n var crystalFour = crystalValues[3];\n console.log(crystalOne, crystalTwo, crystalThree, crystalFour)\n }", "function getSetMem(node, sTable) {\n if (/^[0-9]$/.test(node.name)) {\n //Load single digit into Acc, then store\n let addr = memManager.allocateStatic();\n byteCode.push(\"A9\", \"0\" + node.name, \"8D\", addr[0], addr[1]);\n return addr;\n }\n else if (node.name === \"ADD\") {\n //Calculate addition, return the location of result\n return parseAdd(node, sTable);\n }\n else if (node.name === \"true\") {\n //Load true (01) into Acc, then store\n return memManager.getTrueVal();\n }\n else if (node.name === \"false\") {\n //Location of default \"00\" (false)\n return memManager.getFalseVal();\n }\n else if (/^[a-z]$/.test(node.name)) {\n //Return location of variable value\n return sTable.getLocation(node.name);\n }\n else if (node.name === \"CHARLIST\") {\n //Allocate string in heap, store pointer, return location of pointer\n let pointer = parseCharList(node);\n let addr = memManager.allocateStatic();\n byteCode.push(\"A9\", pointer, \"8D\", addr[0], addr[1]);\n return addr;\n }\n }", "function displayComputer(computer) {\r return computer.cpu+ \" \" + computer.screenSize;\r}", "function setUpCurrentVar() {\r\n g_current_var['section'] = g_search_info_level2['currentsection'];\r\n g_current_var['rangekmstart'] = g_all_result['mindis'];\r\n g_current_var['rangekmend'] = g_all_result['maxdis'];\r\n //For Flag Positioning\r\n var lastindex = g_all_result['usedlength'];\r\n g_current_var['flagfirstlat'] = g_all_result[0]['lat'];\r\n g_current_var['flagfirstlong'] = g_all_result[0]['long'];\r\n g_current_var['flaglastlat'] = g_all_result[lastindex]['lat'];\r\n g_current_var['flaglastlong'] = g_all_result[lastindex]['long'];\r\n\r\n }", "function mainSetMem(args, base) {\n\n\tbase = parseInt(base, 10);\n\t//krnTrace(\"MOTOTOO: \" + args);\n\tvar argsArray = args.split(' ');\n\n\tfor (x in argsArray) {\n\t\tvar offset = parseInt(x) + base; //add the base to current location\n\t\t\n\t\t//krnTrace(offset);\n\t\tthis.Memory[offset] = argsArray[x];\n\t}\n\n\t_current_pcb.base = base;\n\n\tthis.display();\n\n}", "function placeValues (temp, tempMin, tempMax, pressure, scale) {\n\t\n\t if (scale === 'F') {\n\t\t $( \"#button-conversion\" ).text('to \\xB0C' );\n\t\t scale = ' \\xB0F.';\n\t\t } else {\n\t\t$( \"#button-conversion\" ).text('to \\xB0F' );\n\t\t\t scale = ' \\xB0C.' ;} \n\t \n\t\t $(\"#temp\").text(\"Temp: \" + temp + scale );\n\t\t $(\"#pressure\").text(\"Pressure: \"+ pressure + ' hPa.');\n\t\t $(\"#temp_max\").text(\"Min. Temp: \"+ tempMin + scale);\n\t\t $(\"#temp_min\").text(\"Max. Temp: \"+ tempMax + scale);\n\t \t\t\n\t\n\t}", "syncArray() {\n\t\tthis._PCE_array[0] = this._southbound_PCEs;\n\t\tthis._PCE_array[1] = this._westbound_PCEs; \n\t\tthis._PCE_array[2] = this._northbound_PCEs;\n\t\tthis._PCE_array[3] = this._eastbound_PCEs;\n\t}", "place_piece(value, z) {\n this.gamespot[z] = value;\n }", "function getBrowserGeoLoc(){\n getLocation();\n showPosition();\n }", "function test_utilization_host() {}", "computeBestSupportingPosition() {\n\n\t\tthis._supportSpotCalculator.computeBestSupportingPosition();\n\n\t}", "function s_vpr(vs,v){if(s_wd[vs])s_wd[vs]=s_wd[vs];else s_wd[vs]=''\r\nif(vs.substring(0,2) == 's_')vs=vs.substring(2);s_wd['s_vpv_'+vs]=v\r\ns_wd['s_vpm_'+vs]=1}", "function posValue(){\n\t\tvar topArray = [],\n\t\tleftArray = [0, 320, 640, 960];\n\t\tfor (var i = 0; i < $(\"#index_content .home_article\").length; i++) {\n\t\t\tif (i < columnNum) {\n\t\t\t\t$(\".article_\"+i).css(\"top\", \"0\");\n\t\t\t\t$(\".article_\"+i).css(\"left\", leftArray[i]+\"px\");\n\t\t\t\ttopArray[i] = Number($(\".article_\"+i).css(\"height\").replace(\"px\", \"\"));\n\t\t\t} else {\n\t\t\t\tvar small = Math.min.apply(null, topArray),\n\t\t\t\tsmallPos = topArray.indexOf(small);\n\t\t\t\t$(\".article_\"+i).css(\"top\", small+\"px\");\n\t\t\t\t$(\".article_\"+i).css(\"left\", leftArray[smallPos]+\"px\");\n\t\t\t\ttopArray[smallPos] = small + Number($(\".article_\"+i).css(\"height\").replace(\"px\", \"\"));\n\t\t\t}\n\t\t}\n\t\tvar big = Math.max.apply(null, topArray);\n\t\t$(\"#index_content\").css(\"height\", big+\"px\");\n\t}", "protected internal function m252() {}", "function setupPhysical() {\n document.querySelector(\"#physical\").onclick = function() {\n if( !navigator.geolocation ) createToast(\"Your device doesn't support geolocation\");\n else {\n navigator.geolocation.getCurrentPosition( function(position) {\n makeRequest(\"POST\", \"/physical\", { lat: position.coords.latitude, lng: position.coords.longitude }, \n function(responseText) {\n createToast( JSON.parse(responseText).message );\n }, errorToast);\n }, function() {\n createToast(\"Could not fetch location\");\n }, {\n enableHighAccuracy: true\n });\n }\n }\n}", "function setValue(location, val){\n \n \n if (location[0] === 'F'){\n var idx = parseInt(location.substring(1));\n fpRegFile[idx] = val;\n }\n if (location[0] === '$'){\n var idx = parseInt(location.substring(1));\n // Ensure the value is an integer\n intRegFile[idx] = Math.floor(val);\n }\n var parsedInput = location.match(/(\\d*)\\(\\$(\\d+)\\)/);\n if (parsedInput){\n index = parseInt(intRegFile[parsedInput[2]]);\n offset = parseInt(parsedInput[1]);\n dataMem[index+offset] = val;\n }\n return val;\n}", "function getYourPos(){\n function getLatLong(position){\n // yourLat = position.coords.longitude;\n // yourLng = position.coords.latitude;\n map.setView([yourLng,yourLat]); //This was not previously working, but do I need to have the 13 here? Maybe that's why?\n }\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getLatLong)\n } else {\n // \"Not supported.\"\n // Have a prompt that tells users their location was not detected, and ask them to enter it manually.\n // People could call their case worker to get those details.\n // Would that defeat the purpose?\n // Possibly not worth it, if the intention is to make people more reliant on their own, and not use their case worker.\n }\n }", "function geoloc() {\n let coords = navigator.geolocation.getCurrentPosition((pos) => {\n coords = pos;\n let lat = coords.coords.latitude;\n let long = coords.coords.longitude;\n ll = `?_ll=${lat},${long}`;\n document.querySelector(\".change-hour h1 span\").textContent = \"ma position\";\n getDatas(process);\n });\n}", "set Mipmaps(value) {}", "set Local(value) {}", "pushWord(value) {\n this.pushByte(z80_base_1.hi(value));\n this.pushByte(z80_base_1.lo(value));\n }", "function CreateDefaultShedPositionArray()\r\n{\r\n Alloy.Globals.ShedModeShedPosition =\r\n {\r\n \"LATITUDE\": \"\" , // Empty\r\n \"LONGITUDE\": \"\" , // Empty\r\n \"ALTITUDE\": \"\" , // Empty\r\n \"PROVINCE\": \"\" , // Empty\r\n \"MUNICIPALITY\": \"\" , // Empty\r\n \"PLACE\": \"\" , // Empty\r\n \"ADDRESS\": \"\" , // Empty\r\n \"CIVIC_NO\": \"\" // Empty\r\n } ;\r\n}", "paramVals([x, y, z]) {\n return {\n a: x === PMode.Position ? this.memory[this.ip + 1] : this.ip + 1,\n b: y === PMode.Position ? this.memory[this.ip + 2] : this.ip + 2,\n c: z === PMode.Position ? this.memory[this.ip + 3] : this.ip + 3,\n };\n }", "function AddParametersFriendLocation(){\n\tvar i =0\n\tfor (i = 0; i < friendLocation.length; i++) {\n\t\t\tfriendLocation[i].dist = distance(homeLocation[0].lat,homeLocation[0].lon,friendLocation[i].lat,friendLocation[i].lon, \"K\");\n\t\tfriendLocation[i].data = vectorOfPoints(homeLocation[0].lat,homeLocation[0].lon,friendLocation[i].lat,friendLocation[i].lon,friendLocation[i].location,friendLocation[i].dist, manipulation=0,\n\t\t\tfontLocation=mapSettings[0].fontLocation, fontSizeLocationn=mapSettings[0].fontSizeLocation, fontDistancen=mapSettings[0].fontDistance,fontSizeDistance=mapSettings[0].fontSizeDistance,friendLocation[i].spendings );\n\t}\n}", "function processedSFData() {\n\t\tthis.moteid = idMote;\n\t\tthis.sensorType = sensorType;\n\t\tthis.lastTimestamp = lastTimeStamp;\n\t\tthis.lastValue = lastValue;\n\t\tthis.arrayValuesDay = valuesDay;\n\t\tthis.populationDay = populationDay;\n\t\tthis.arrayValuesWeek = valuesWeek;\n\t\tthis.populationWeek = populationWeek;\n\t\tthis.platform = platform;\n\t\tthis.unit = unit;\n\t}", "function setStationLocations() {\n stations[0] = new Station(62 * windowWidth/575, windowHeight * 2 / 7);\n stations[1] = new Station(156 * windowWidth/575, windowHeight * 2 / 7);\n stations[2] = new Station(255 * windowWidth/575, windowHeight * 2 / 7);\n stations[3] = new Station(366 * windowWidth/575, windowHeight * 2 / 7);\n stations[4] = new Station(478 * windowWidth/575, windowHeight * 2 / 7);\n stations[5] = new Station(442 * windowWidth/575, windowHeight * 6 / 9);\n stations[6] = new Station(339 * windowWidth/575, windowHeight * 6 / 9);\n stations[7] = new Station(233 * windowWidth/575, windowHeight * 6 / 9);\n stations[8] = new Station(134 * windowWidth/575, windowHeight * 6 / 9);\n stations[9] = new Station(44 * windowWidth/575, windowHeight * 6 / 9);\n}", "function getIntel() {\n for (let key in Memory.warControl) {\n if (Memory.warControl[key]) {\n if (Memory.warControl[key].type === 'decon') {\n if (!Memory.warControl[key].siegePoint) {\n let exit = Game.map.findExit(key, STAGING_ROOM);\n let exits = Game.map.describeExits(key);\n Memory.warControl[key].siegePoint = exits[exit];\n }\n continue;\n }\n if (Memory.warControl[key].type === 'clean') {\n if (!Memory.warControl[key].siegePoint) {\n let exit = Game.map.findExit(key, STAGING_ROOM);\n let exits = Game.map.describeExits(key);\n Memory.warControl[key].siegePoint = exits[exit];\n }\n continue;\n }\n if (Memory.warControl[key].type === 'defend' || Memory.warControl[key].type === 'swarm') {\n continue;\n }\n //check if scouted\n if (Memory.roomCache[key] && Memory.roomCache[key].cached + EST_TICKS_PER_DAY > Game.time) {\n //check if room is owned\n if (Memory.roomCache[key] && Memory.roomCache[key].owner) {\n Memory.warControl[key].type = 'siege';\n if (!Memory.warControl[key].siegePoint) {\n let exit = Game.map.findExit(key, STAGING_ROOM);\n let exits = Game.map.describeExits(key);\n Memory.warControl[key].siegePoint = exits[exit];\n }\n if (Memory.roomCache[key].towers === 0 || Memory.roomCache[key].towers === undefined) {\n Memory.warControl[key].level = 1;\n } else if (Memory.roomCache[key].towers === 1) {\n Memory.warControl[key].level = 2;\n } else if (Memory.roomCache[key].towers === 2) {\n Memory.warControl[key].level = 3;\n } else if (Memory.roomCache[key].towers === 3) {\n Memory.warControl[key].level = 4;\n }\n } else {\n Memory.warControl[key].type = 'raid';\n Memory.warControl[key].threat = 0;\n }\n } else {\n Memory.warControl[key].type = 'scout';\n }\n }\n }\n}", "function getPositions(){\n this.PlayerMove = playerOption;\n this.ComputerMove = [Math.floor(Math.random() * whoWonTheBattle.length)];\n getFinalPosition();\n }", "function initValues(){\n}", "getBrowserLocation(callback) {\n navigator.geolocation.getCurrentPosition(locationData => {\n let userLocation = this.props.userLocation;\n\n if (locationData && locationData.coords) {\n const {\n longitude,\n latitude,\n } = locationData.coords;\n\n userLocation = [latitude, longitude];\n }\n\n callback(userLocation);\n });\n }", "return() {\n this.setPc(this.registers[_glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$ra\"]]);\n }", "return() {\n this.setPc(this.registers[_glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$ra\"]]);\n }", "function to_coords(val) {\n return {'x': val % 16,\n 'y': Math.floor(val/16) };\n }", "_storeDefaultValues() {\n\t\tthis.defaultValues = {\n\t\t\tunit: this._getDefaultUnits(),\n\t\t\tslidersLinked: this.slidersLinked,\n\t\t\tvalues: this.getValues()\n\t\t};\n\t}", "function storePosition(position) {\n console.log(\"Latitude: \" + position.coords.latitude + \" Longitude: \" + position.coords.longitude);\n \n localStorage.setItem('airport', 'ATL');\n localStorage.setItem('map', 'C');\n localStorage.setItem('destination', 'C33');\n localStorage.setItem('userLat', position.coords.latitude);\n localStorage.setItem('userLon', position.coords.longitude);\n\n console.log(localStorage.getItem('airport'));\n console.log(localStorage.getItem('map'));\n console.log(localStorage.getItem('destination'));\n console.log(localStorage.getItem('userLat'));\n console.log(localStorage.getItem('userLon'));\n}", "function getLocalizacao() {\r\n \r\n if(navigator.geolocation){ \r\n navigator.geolocation.getCurrentPosition(mapSetup);\r\n }\r\n}", "static private internal function m121() {}", "function errorLocation() {\n setupMap([38.189980, 24.023176])\n}", "function generateCoordinates() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n addPosition, \n geoError,\n { timeout: 10000, enableHighAccuracy: true }\n );\n } else {\n program.showMessage(\"\", \"Vafrinn styður ekki staðsetningartækni\");\n }\n }", "function makeComputer(computers) {\r return {\r \tcpu: '64mb',\r \tscreenSize:'17 inch'\r }\r}", "function getSystem()\n{\n\tvar system = new Array([111,'1号平台','门户服务器'], [111,'1号平台','上游服务器'], [111,'1号平台','下游服务器'], [111,'1号平台','内容传输服务器']);\n\treturn system;\n}", "function calculateGlobalValues() {\r\n _globalViewportW = verge.viewportW(), _globalViewportH = verge.viewportH(), _globalHalfViewportH = (_globalViewportH / 2).toFixed(0)\r\n}", "function setElementPlaces () {\n var title = $('#message_title_preview');\n var text = $('#message_text_preview');\n\n // Title and message preview box position\n // over the chosen image\n var title_p = title.position();\n var text_p = text.position();\n\n // We count from bottom left corner\n var title_y = title_p.top + title.height();\n var text_y = text_p.top + text.height() - 30; // Manual fix\n\n // Position of elements\n $('#placeOf_message_title_y').val(title_y);\n $('#placeOf_message_title_x').val(title_p.left);\n $('#placeOf_message_text_y').val(text_y);\n $('#placeOf_message_text_x').val(text_p.left);\n\n // Size of elements\n $('#sizeOf_message_title_w').val(title.width());\n $('#sizeOf_message_title_h').val(title.height());\n $('#sizeOf_message_text_w').val(text.width());\n $('#sizeOf_message_text_h').val(text.height());\n\n }", "loadValue(register, value) {\n if (isLowLevelRegister(register)) {\n this[INNER_VM].loadRegister(register, value);\n }\n\n switch (register) {\n case $s0:\n this.s0 = value;\n break;\n\n case $s1:\n this.s1 = value;\n break;\n\n case $t0:\n this.t0 = value;\n break;\n\n case $t1:\n this.t1 = value;\n break;\n\n case $v0:\n this.v0 = value;\n break;\n }\n }", "function setValue(location, val){\n if (location[0] === 'F'){\n var idx = parseInt(location.substring(1));\n fpRegFile[idx] = val;\n }\n if (location[0] === '$'){\n var idx = parseInt(location.substring(1));\n // Ensure the value is an integer\n intRegFile[idx] = Math.floor(val);\n }\n var parsedInput = location.match(/(\\d*)\\(\\$(\\d)\\)/);\n if (parsedInput){\n index = parseInt(intRegFile[parsedInput[2]]);\n offset = parseInt(parsedInput[1]);\n dataMem[index+offset] = val;\n }\n return val;\n}", "set systems(values) {\n for (const sys of values) {\n this._systems.register(sys)\n }\n }", "function getPosition() {\n if (navigator.geolocation) {\n $(\".button-fill-coords\").html(\"Fetching Values...\");\n navigator.geolocation.getCurrentPosition(showPosition, showError);\n } else {\n test.html(\"Geolocation not supported on this browser.\");\n }\n// console.log(\"bonjour...\"); //fpr testing purposes\n }", "function showPosition(position) {\n // User latitude\n KC_LAT = position.coords.latitude;\n\n // User longtude\n KC_LON = position.coords.longitude;\n\n}", "function calculate_coordinates () {\n\t }", "function main() {\n console.log(\"\");\n console.log(\"\");\n console.log(\"HERE MICROSERVICE (here.com weather)\");\n if (!process.env.WEATHER_LOCATIONS) {\n console.log(\"ENV WEATHER_LOCATIONS is required\");\n process.exit(1);\n }\n if (!WEATHER_APP_ID || !WEATHER_APP_CODE) {\n console.log(\n \"ENV variables WEATHER_APP_ID and WEATHER_APP_CODE are required. See README.md\"\n );\n process.exit(1);\n }\n\n console.log(\"\");\n const hosts = {},\n locations = process.env.WEATHER_LOCATIONS.split(\",\");\n\n // locations are kind:value format, sparated by commas. The kind values can be zipcode or name.\n // possible values for zipcode are numeric zip code. The value for name is a city (e.g. London).\n for (const location of locations) {\n debug(\"starting\", location);\n hosts[location] = new WeatherHost(location);\n }\n}", "insert(value) {\n\t\tthis.heap.push(value);\n\t\t// calling heapify function to reconstruct array to heap property\n\t\tthis.heapify();\n\t}", "function generatePositionData(){\n\t\n\tvar message = new Object();\n message.sessionName = sessionName;\n message.longitude = longitude = (Math.random()/1000)+25.4559615;\n message.latitude = latitude = (Math.random()/1000)+65.0564222;\n message.state = connection;\n \n if(connection === \"Online\" && synchronizing === false)\n \tsendPosition(message);\n else if(connection === \"Offline\")\n \tsaveLocally(message);\n \t\n showCoordinates();\n}", "set PSP2(value) {}", "function defaultValues(){\n\tbluValue=0;\n\thueRValue=0;\n\tinvtValue=0;\n\tbrightnValue=1;\n\tsepiValue=0;\n\tgraysaValue=0;\n\topaciValue=1;\n\tsatuvalue=1;\n\tcontrstValue=1;\n}", "function _setupStartingLocation2wPlaceObject(eventObject,gposition){\n var position;\n if (platform === 2)\n\tposition = new convert2pluglatLng(gposition);\n else\n position = gposition;\n //this is to make sure the data is tehre\n var placeObject = new placeDetailObject(eventObject);//creating a palceobject\n placeObject.place_id = eventObject.placeId;\n placeObject.geometry = {};\n placeObject.geometry.location = gposition;\n placeObject.name=eventObject.placeName;\n\n startingLocation2.googlePosition=gposition;\n startingLocation2.position=position;\n startingLocation2.place_id=placeObject.placeId;\n startingLocation2.place=placeObject;\n startingLocation2.setVisible(true);\n startingLocation2.types=placeObject.types;\n startingLocation2.record=placeObject.record;\n //startingLocation2.setPosition(position,true,true);\n return position;\n}", "function _insertEntryValues(the_inputs, the_tx, the_immediate_parent_key_value, the_current_remote_entry, the_current_remote_entry_key, the_current_remote_timestamp) {\n\n\t\t\tvar i;\n\t\t\tvar iLength = the_inputs.length;\n\t\t\tvar query;\n\t\t\tvar ref;\n\t\t\tvar obj;\n\t\t\tvar location_obj;\n\t\t\tvar latitude;\n\t\t\tvar longitude;\n\t\t\tvar altitude;\n\t\t\tvar accuracy;\n\t\t\tvar bearing;\n\t\t\tvar tx = the_tx;\n\t\t\tvar immediate_parent_key_value = the_immediate_parent_key_value;\n\t\t\tvar current_remote_entry = the_current_remote_entry;\n\t\t\tvar current_remote_entry_key = the_current_remote_entry_key;\n\t\t\tvar current_remote_timestamp = the_current_remote_timestamp;\n\t\t\tvar remote_ref_value;\n\t\t\tvar remote_ref_value_location;\n\n\t\t\t//loop all the input fields\n\t\t\tfor ( i = 0; i < iLength; i++) {\n\n\t\t\t\tref = inputs[i].ref;\n\n\t\t\t\t//per each ref, check if the remote entry has a value\n\t\t\t\tif (current_remote_entry.hasOwnProperty(ref)) {\n\n\t\t\t\t\t//location object needs to be converted to string\n\t\t\t\t\tif ( typeof (current_remote_entry[ref]) === \"string\") {\n\t\t\t\t\t\tremote_ref_value = current_remote_entry[ref];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//location is a json object listing the components, so convert it to string\n\t\t\t\t\t\tlocation_obj = current_remote_entry[ref];\n\t\t\t\t\t\tremote_ref_value_location = _parseLocationObjToString(location_obj);\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t//the current input ref is not part of the downloaded data set therefore set it to an empty string\n\t\t\t\t\tremote_ref_value = \"\";\n\t\t\t\t}\n\n\t\t\t\t//build query to insert values\n\n\t\t\t\tquery = \"\";\n\t\t\t\tobj = inputs[i];\n\n\t\t\t\tquery += 'INSERT INTO ec_data (';\n\t\t\t\tquery += 'input_id, ';\n\t\t\t\tquery += 'form_id, ';\n\t\t\t\tquery += 'position, ';\n\t\t\t\tquery += 'parent, ';\n\t\t\t\tquery += 'label, ';\n\t\t\t\tquery += 'ref, ';\n\t\t\t\tquery += 'value, ';\n\t\t\t\tquery += 'is_title, ';\n\t\t\t\tquery += 'entry_key, ';\n\t\t\t\tquery += 'type, ';\n\t\t\t\tquery += 'created_on, ';\n\t\t\t\tquery += 'is_remote, ';\n\t\t\t\tquery += 'is_data_synced, ';\n\t\t\t\tquery += 'is_media_synced) ';\n\t\t\t\tquery += 'VALUES (\"';\n\t\t\t\tquery += obj._id + '\", \"';\n\t\t\t\tquery += form_id + '\", \"';\n\t\t\t\tquery += obj.position + '\", \"';\n\t\t\t\tquery += immediate_parent_key_value + '\", \"';\n\t\t\t\tquery += obj.label + '\", \"';\n\t\t\t\tquery += ref + '\", \"';\n\t\t\t\tquery += remote_ref_value + '\", \"';\n\t\t\t\tquery += obj.is_title + '\", \"';\n\t\t\t\tquery += current_remote_entry_key + '\", \"';\n\t\t\t\tquery += obj.type + '\", \"';\n\t\t\t\tquery += current_remote_timestamp + '\", \"';\n\t\t\t\tquery += 1 + '\", \"';\n\t\t\t\tquery += 1 + '\", \"';\n\t\t\t\tquery += 1 + '\");';\n\t\t\t\ttx.executeSql(query, [], _insertNewRowSQLSuccessCB, _errorCB);\n\n\t\t\t}//for all input fields\n\n\t\t}", "indirect (cpu) {\n let start = this.loadWord(cpu.pc);\n let address = this.loadIndirect(start);\n return address;\n }", "constructor(Brand, Ram, Storage, Prossesor) { \n this.PC_Brand = Brand;\n this.PC_Ram = Ram;\n this.PC_Storage = Storage;\n this.PC_Prossesor = Prossesor;\n }", "constructor() { // Las clases necesitan un constructor, en este asignaremos las variables DENTRO DEL SCOPE GLOBAL\n this.valueA = 0;\n this.valueB = 0;\n }", "function initValues() {\n dataToBeStored = new Set();\n labelMapLength = elemById(\"labelList\").getElementsByTagName(\"li\").length - 1;\n labelMap = {};\n requestPage = 1;\n displayIssue = 0;\n}", "preprocessor (value , name ) {\n this._ipServerAddress = ipAddress.create(value);\n return this._ipServerAddress.toString();\n }", "function prepLocations(){\n\n\tconsole.log('Prepping locations now...');\n\n\t// Configure the geolocator.\n\tvar options = {\n\n enableHighAccuracy: true,\n timeout: 5000,\n maximumWait: 10000, // max wait time for desired accuracy\n maximumAge: 10000, // disable cache\n addressLookup: true, // requires Google API key if true\n desiredAccuracy: 30, // meters\n fallbackToIP: true, // fallback to IP if Geolocation fails or rejected\n };\n\n // Locate the user via any method necessary (GPS or IP data).\n geolocator.locate(options, function (err, location) {\n\n \t// Simple error logging.\n if (err) return console.log(err);\n\n console.log('Location found! Polling Google for nearby brunch spots now...');\n\t\tconsole.log(location);\n\n\t\tonLocationFound(location);\n });\n}", "function location(x,y) {\n\tvar z = x + \" \" + y;\n\tconsole.log(z);\n}", "function initializeValues() {\n\tleft = leftArr[position];\n\tright = rightArr[position];\n\tmiddle = left + parseInt((right - left) / 2);\n\tcurrentL = left;\n\tcurrentR = middle + 1;\n\ttempArr = [];\n\tloadPokemonData();\n}", "function bi_windup() {\n\t\tif (bi_valid > 8) {\n\t\t\tput_short(bi_buf);\n\t\t} else if (bi_valid > 0) {\n\t\t\tput_byte(bi_buf);\n\t\t}\n\t\tbi_buf = 0;\n\t\tbi_valid = 0;\n\t}", "callSite(values, raw) {\n\n values.raw = raw || values;\n return values;\n }", "function geolocateByIP() {\n\tif (google.loader.ClientLocation) {\n\t\tvar location = google.loader.ClientLocation;\n\t\tcurrentAddress = location.address.city + ', ' + location.address.region;\n\t\tstoreMyLocation(location.latitude, location.longitude);\n\t} else {\n\t\tcurrentAddress = 'San Fransisco, CA';\n\t\tstoreMyLocation(37.75, -122.45);\n\t}\n}" ]
[ "0.54652053", "0.53157675", "0.5308366", "0.5219491", "0.5216074", "0.51918596", "0.5122067", "0.51019967", "0.50287986", "0.50066113", "0.4999236", "0.49338388", "0.4891782", "0.48901996", "0.48518118", "0.48508415", "0.484748", "0.48347765", "0.4833985", "0.48181623", "0.4801225", "0.47953686", "0.4785332", "0.47807652", "0.47716102", "0.47368088", "0.47349504", "0.47094053", "0.4702168", "0.46944472", "0.46658272", "0.46651858", "0.4661282", "0.4660036", "0.46596247", "0.4659407", "0.4657757", "0.46475002", "0.46419352", "0.46281457", "0.46204174", "0.4615222", "0.4614384", "0.461308", "0.46102402", "0.4609167", "0.45886865", "0.45855218", "0.45846984", "0.45780244", "0.45647442", "0.45645702", "0.45588157", "0.45587048", "0.4548686", "0.45334792", "0.45304394", "0.45098642", "0.45097366", "0.45078033", "0.45066905", "0.45049083", "0.45040587", "0.44988805", "0.44974083", "0.44974083", "0.44924983", "0.44913986", "0.4484429", "0.44825983", "0.44809788", "0.44777858", "0.44700482", "0.44657207", "0.44655928", "0.44631258", "0.4462077", "0.44601315", "0.4457955", "0.4457608", "0.4455841", "0.44556138", "0.44518447", "0.44512424", "0.44506368", "0.44504464", "0.4449474", "0.44486716", "0.44476968", "0.44454506", "0.44439936", "0.4440215", "0.4435029", "0.44328266", "0.44327936", "0.44326657", "0.4432056", "0.44286007", "0.44283676", "0.44261685", "0.44237116" ]
0.0
-1
should refactor to look cleaner; aka abstract
slice(startingPoint, endPoint) { let newList = new List(); if (endPoint == undefined) { for (let i = startingPoint; i < this.length; i++) { newList.push(this[i]); } } if (typeof endPoint == 'number') { for (let i = startingPoint; i < endPoint; i++) { newList.push(this[i]); } } return newList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transient private protected internal function m182() {}", "private public function m246() {}", "obtain(){}", "transient protected internal function m189() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "transient private protected public internal function m181() {}", "static private protected internal function m118() {}", "static transient final protected internal function m47() {}", "function _____SHARED_functions_____(){}", "static private internal function m121() {}", "static transient private protected internal function m55() {}", "static transient final private internal function m43() {}", "__previnit(){}", "function customHandling() { }", "transient final private protected internal function m167() {}", "static transient private protected public internal function m54() {}", "transient final private internal function m170() {}", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "static transient final protected public internal function m46() {}", "transient private public function m183() {}", "static transient final private protected internal function m40() {}", "add(...args){ \n // value.constuctor.name; - return Class name \"Track,Artist,Album\";\n // value.name - return class.name \"Linkin park exemple\";\n // IF :for classes! if one value - this CLASS. if more value: first - Class, nexts - parameters this Class;\n //ELSE: For class parameters. If we have more then one parameters = > [new Class,...parametrs for this class ];\n let myArguments = [];\n myArguments.push(...args); \n // TRACK \n if(myArguments[0].constructor.name === \"Track\"){\n if(myArguments.length === 1){\n this.Track.push(myArguments[0]); \n }\n //FOR TRACK WE DON'T HAVE NECESSARY ADD ADDITIONAL PARAMETERS. IT'S NOT LOGICAL\n else{ return \"Pls using update for Track.\" } \n };\n\n // ALBUM\n if(myArguments[0].constructor.name === \"Album\"){\n if(myArguments.length === 1){\n this.Album.push(myArguments[0]);\n }\n else{\n this.Album.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n } \n }\n } \n });\n } \n };\n //ARTIST\n if(myArguments[0].constructor.name === \"Artist\"){\n if(myArguments.length === 1){\n this.Artist.push(myArguments[0]);\n }\n else{\n this.Artist.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n }\n if(myArguments[i][i-1].constructor.name === \"Album\"){\n element.albums = element.albums.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n }\n if(myArguments[i].constructor.name === \"Album\"){\n element.albums.push(myArguments[i]);\n }\n \n }\n } \n });\n } \n }; \n }", "prepare() {}", "static transient private public function m56() {}", "function _construct()\n\t\t{;\n\t\t}", "static transient private internal function m58() {}", "static method(){}", "function oi(){}", "static final private internal function m106() {}", "constructur() {}", "static get order() { throw new Error('unimplemented - must use a concrete class'); }", "function SuperclassBare() {}", "function SuperclassBare() {}", "static transient final protected function m44() {}", "static private protected public internal function m117() {}", "function ea(){}", "transient final private protected public internal function m166() {}", "_validate() {\n throw new Error('_validate not implemented in child class');\n }", "function AeUtil() {}", "function miFuncion (){}", "static final private protected public internal function m102() {}", "function oi(a){this.Of=a;this.rg=\"\"}", "method() {\n throw new Error('Not implemented');\n }", "_add () {\n throw new Error('not implemented')\n }", "function comportement (){\n\t }", "constructor (){}", "baseOperation1() {\n console.log(\"AbstractClass says: I am doing the bulk of the work\");\n }", "function fm(){}", "function SeleneseMapper() {\n}", "static protected internal function m125() {}", "static transient final private protected public function m38() {}", "function DWRUtil() { }", "function theImplementation(automata){\n\n}", "myBestMethod(){\n\n }", "static final private protected internal function m103() {}", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static transient final private protected public internal function m39() {}", "function Derived() {} // private", "transient final private public function m168() {}", "initialize() {\n // Needs to be implemented by derived classes.\n }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "Use(){\n throw new Error(\"Use() method must be implemented in child!\");\n }", "constructor () {\r\n\t\t\r\n\t}", "getStrToEol() {\n throw new Error('this method should be impelemented in subclass');\n }", "toString(){\n\t\treturn 'not implemented';\n\t}", "overrideClassFunctions(subClassName=\"State Senator\"){\n var self = this;\n switch(subClassName){\n case \"US Representative\":\n self.selectedExtractID = usRepresentativeExtractIDFunction;\n self.meshFunction = usRepresentativeMeshFunction;\n break;\n default:\n self.selectedExtractID = genericExtractIDFunction;\n self.meshFunction = genericMeshFunction;\n }\n }", "constructor () { super() }", "prepare() {\n }", "getEntity() {}", "function MapDataUtils(){\n\t\t\n\t\t/**\n\t\t * Extracts path-coord. from polyline.\n\t\t * @param polyline : PolylineHolder\n\t\t * @return [google.maps.LatLng]\n\t\t */\n\t\tthis.extractPath = function(polyline){\t\t\t\n\t\t\tthrow new Error('This is abstract');\n\t\t};\n\t\t\n\t\t/**\n\t\t * Request for geocoding of the given address.\n\t\t * @param args : {address : string} or string\n\t\t * @param callback : function(err, {latitude: integer, longitude: integer, noResult: boolean})\n\t\t */\n\t\tthis.findCoordFromAddress = function(args, callback){\n\t\t\tthrow new Error('This is abstract');\n\t\t};\n\t}", "function Utils(){}", "static transient final private public function m41() {}", "function Alerter() {}", "function Common(){}", "prepareBaseData() { super.prepareBaseData(); }", "Pick(){\n throw new Error(\"Pick() method must be implemented in child!\");\n }", "method(){}", "function Rebelizer() {\n\n}", "execute() {\n throw new Error(\"Must be implemented in subclass\");\n }", "prepare() {\n super.prepare()\n }", "processItems() {}", "getStrFromBol() {\n throw new Error('this method should be impelemented in subclass');\n }", "getResult() {}", "function Utils() {}", "function Utils() {}", "function ExtraMethods() {}", "mosaicoSeccion(x, y, wd, ht){\n throw new Error(\"Metodo no implementado en clase abstracta\");\n }", "build () {}", "function Adaptor() {}", "f(pointState, pointsSystem) {\n\t\tconsole.warn(\"Abstract method invoked with params:\", pointState, pointsSystem);\n\t\tthrow new Error(\"Abstract\");\n\t}", "static final protected internal function m110() {}", "function Adapter() {}", "_init() {\n throw new Error('_init not implemented in child class');\n }", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }" ]
[ "0.61183774", "0.6102037", "0.61002564", "0.6086831", "0.59353596", "0.59352374", "0.58296084", "0.5763495", "0.5577565", "0.5539857", "0.5520026", "0.547941", "0.5465834", "0.5465151", "0.54382026", "0.54220337", "0.5388082", "0.5359314", "0.5322517", "0.53029436", "0.52998734", "0.52905715", "0.524933", "0.5226786", "0.5191672", "0.5186674", "0.5146594", "0.5077195", "0.5074862", "0.5056457", "0.50363415", "0.5033863", "0.5031364", "0.50290483", "0.50092334", "0.50092334", "0.5000918", "0.4998926", "0.49804193", "0.49765447", "0.49549738", "0.49468595", "0.4945895", "0.4936614", "0.4931929", "0.4921423", "0.49184915", "0.49171978", "0.4912892", "0.49013555", "0.48942754", "0.48809847", "0.48702136", "0.48607206", "0.48473048", "0.48438984", "0.4843716", "0.48427022", "0.4842332", "0.4842332", "0.4842332", "0.48299852", "0.48245296", "0.48196423", "0.48162988", "0.4814216", "0.4814216", "0.4814216", "0.47977275", "0.4794793", "0.47926185", "0.478861", "0.47589877", "0.47549453", "0.47539252", "0.47520226", "0.4744632", "0.47373378", "0.47357586", "0.47302297", "0.47255123", "0.47250155", "0.47149506", "0.47103196", "0.47098452", "0.47013792", "0.46967262", "0.46961305", "0.46951276", "0.4693575", "0.46900013", "0.46900013", "0.4688154", "0.46609694", "0.46569178", "0.4656567", "0.4646782", "0.4645929", "0.46426693", "0.46390757", "0.46335557" ]
0.0
-1
should refactor to look cleaner; aka abstract
reduce(callback, initVal) { let startPoint; let accumulatedVal; if (initVal == undefined) { startPoint = 1; initVal = this[0]; accumulatedVal = initVal; console.log(initVal); } else { startPoint = 0; accumulatedVal = initVal; } for (let i = startPoint; i < this.length; i++) { console.log(accumulatedVal); accumulatedVal = callback(accumulatedVal, this[i]); } return accumulatedVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transient private protected internal function m182() {}", "private public function m246() {}", "obtain(){}", "transient protected internal function m189() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "transient private protected public internal function m181() {}", "static private protected internal function m118() {}", "static transient final protected internal function m47() {}", "function _____SHARED_functions_____(){}", "static private internal function m121() {}", "static transient private protected internal function m55() {}", "static transient final private internal function m43() {}", "__previnit(){}", "function customHandling() { }", "transient final private protected internal function m167() {}", "static transient private protected public internal function m54() {}", "transient final private internal function m170() {}", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "static transient final protected public internal function m46() {}", "transient private public function m183() {}", "static transient final private protected internal function m40() {}", "add(...args){ \n // value.constuctor.name; - return Class name \"Track,Artist,Album\";\n // value.name - return class.name \"Linkin park exemple\";\n // IF :for classes! if one value - this CLASS. if more value: first - Class, nexts - parameters this Class;\n //ELSE: For class parameters. If we have more then one parameters = > [new Class,...parametrs for this class ];\n let myArguments = [];\n myArguments.push(...args); \n // TRACK \n if(myArguments[0].constructor.name === \"Track\"){\n if(myArguments.length === 1){\n this.Track.push(myArguments[0]); \n }\n //FOR TRACK WE DON'T HAVE NECESSARY ADD ADDITIONAL PARAMETERS. IT'S NOT LOGICAL\n else{ return \"Pls using update for Track.\" } \n };\n\n // ALBUM\n if(myArguments[0].constructor.name === \"Album\"){\n if(myArguments.length === 1){\n this.Album.push(myArguments[0]);\n }\n else{\n this.Album.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n } \n }\n } \n });\n } \n };\n //ARTIST\n if(myArguments[0].constructor.name === \"Artist\"){\n if(myArguments.length === 1){\n this.Artist.push(myArguments[0]);\n }\n else{\n this.Artist.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n }\n if(myArguments[i][i-1].constructor.name === \"Album\"){\n element.albums = element.albums.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n }\n if(myArguments[i].constructor.name === \"Album\"){\n element.albums.push(myArguments[i]);\n }\n \n }\n } \n });\n } \n }; \n }", "prepare() {}", "static transient private public function m56() {}", "function _construct()\n\t\t{;\n\t\t}", "static transient private internal function m58() {}", "static method(){}", "function oi(){}", "static final private internal function m106() {}", "constructur() {}", "static get order() { throw new Error('unimplemented - must use a concrete class'); }", "function SuperclassBare() {}", "function SuperclassBare() {}", "static transient final protected function m44() {}", "static private protected public internal function m117() {}", "function ea(){}", "transient final private protected public internal function m166() {}", "_validate() {\n throw new Error('_validate not implemented in child class');\n }", "function AeUtil() {}", "function miFuncion (){}", "static final private protected public internal function m102() {}", "function oi(a){this.Of=a;this.rg=\"\"}", "method() {\n throw new Error('Not implemented');\n }", "_add () {\n throw new Error('not implemented')\n }", "function comportement (){\n\t }", "constructor (){}", "baseOperation1() {\n console.log(\"AbstractClass says: I am doing the bulk of the work\");\n }", "function fm(){}", "function SeleneseMapper() {\n}", "static protected internal function m125() {}", "static transient final private protected public function m38() {}", "function DWRUtil() { }", "function theImplementation(automata){\n\n}", "static final private protected internal function m103() {}", "myBestMethod(){\n\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static transient final private protected public internal function m39() {}", "function Derived() {} // private", "transient final private public function m168() {}", "initialize() {\n // Needs to be implemented by derived classes.\n }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "Use(){\n throw new Error(\"Use() method must be implemented in child!\");\n }", "constructor () {\r\n\t\t\r\n\t}", "getStrToEol() {\n throw new Error('this method should be impelemented in subclass');\n }", "toString(){\n\t\treturn 'not implemented';\n\t}", "overrideClassFunctions(subClassName=\"State Senator\"){\n var self = this;\n switch(subClassName){\n case \"US Representative\":\n self.selectedExtractID = usRepresentativeExtractIDFunction;\n self.meshFunction = usRepresentativeMeshFunction;\n break;\n default:\n self.selectedExtractID = genericExtractIDFunction;\n self.meshFunction = genericMeshFunction;\n }\n }", "constructor () { super() }", "prepare() {\n }", "getEntity() {}", "function MapDataUtils(){\n\t\t\n\t\t/**\n\t\t * Extracts path-coord. from polyline.\n\t\t * @param polyline : PolylineHolder\n\t\t * @return [google.maps.LatLng]\n\t\t */\n\t\tthis.extractPath = function(polyline){\t\t\t\n\t\t\tthrow new Error('This is abstract');\n\t\t};\n\t\t\n\t\t/**\n\t\t * Request for geocoding of the given address.\n\t\t * @param args : {address : string} or string\n\t\t * @param callback : function(err, {latitude: integer, longitude: integer, noResult: boolean})\n\t\t */\n\t\tthis.findCoordFromAddress = function(args, callback){\n\t\t\tthrow new Error('This is abstract');\n\t\t};\n\t}", "function Utils(){}", "static transient final private public function m41() {}", "function Alerter() {}", "function Common(){}", "prepareBaseData() { super.prepareBaseData(); }", "Pick(){\n throw new Error(\"Pick() method must be implemented in child!\");\n }", "function Rebelizer() {\n\n}", "method(){}", "execute() {\n throw new Error(\"Must be implemented in subclass\");\n }", "getStrFromBol() {\n throw new Error('this method should be impelemented in subclass');\n }", "processItems() {}", "prepare() {\n super.prepare()\n }", "getResult() {}", "function Utils() {}", "function Utils() {}", "function ExtraMethods() {}", "mosaicoSeccion(x, y, wd, ht){\n throw new Error(\"Metodo no implementado en clase abstracta\");\n }", "function Adaptor() {}", "build () {}", "f(pointState, pointsSystem) {\n\t\tconsole.warn(\"Abstract method invoked with params:\", pointState, pointsSystem);\n\t\tthrow new Error(\"Abstract\");\n\t}", "static final protected internal function m110() {}", "function Adapter() {}", "_init() {\n throw new Error('_init not implemented in child class');\n }", "_get () {\n throw new Error('_get not implemented')\n }" ]
[ "0.61188775", "0.6102659", "0.6100088", "0.60874933", "0.59362", "0.593559", "0.58301926", "0.5763861", "0.5578302", "0.55405974", "0.5520328", "0.54802805", "0.5467223", "0.5465896", "0.5438504", "0.5421485", "0.5386911", "0.5359492", "0.532328", "0.53034437", "0.5299812", "0.5291094", "0.52495635", "0.52270776", "0.51910454", "0.518613", "0.5147197", "0.50773054", "0.5076472", "0.5055955", "0.50368935", "0.5034432", "0.5030987", "0.50289285", "0.50091946", "0.50091946", "0.5001276", "0.49998733", "0.498057", "0.49770248", "0.49540746", "0.49476305", "0.49465242", "0.49374077", "0.49327987", "0.4920787", "0.49177447", "0.4917653", "0.4913588", "0.49012792", "0.4894357", "0.48809293", "0.48711458", "0.486117", "0.48480722", "0.48443687", "0.48434746", "0.4842951", "0.4841472", "0.4841472", "0.4841472", "0.48309475", "0.48251447", "0.48199135", "0.48163083", "0.4814686", "0.4814686", "0.4814686", "0.47969544", "0.4794811", "0.47939673", "0.47888806", "0.47583196", "0.47544113", "0.47530448", "0.47520176", "0.47447652", "0.47374472", "0.4736111", "0.47306487", "0.47259155", "0.47248757", "0.47147286", "0.47097808", "0.4709713", "0.47012064", "0.46964586", "0.4696141", "0.46956012", "0.46940684", "0.4690143", "0.4690143", "0.46874458", "0.46620578", "0.46565", "0.4656357", "0.4647256", "0.46466267", "0.46418738", "0.46385005", "0.46331668" ]
0.0
-1
fetch data from DB
fetchProject(){ axios.get('https://pilotsapp.herokuapp.com/project/getById/' + sessionStorage.getItem('projectID')) .then((response) => { console.log(response.data); this.setState({ project: response.data, loading: true }) }) .catch(error => { console.log(error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEasyLoadRecordsFromDb(){\n\t\t$http.get(\"/easyloadList\").then(\n\t\t\t\tfunction(res){\n\t\t\t\t\t$scope.easyLoadRecords = res.data;\n\t\t\t\t\tconsole.log(\"data found from data base\");\n\t\t\t\t\tconsole.log(res);\n\t\t\t\t},\n\t\t\t\tfunction(err){\n\t\t\t\t\tconsole.log(\"data not found from database something wrong\");\n\t\t\t\t})\n\t}", "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "allData() {\n const sql = 'SELECT * FROM office';\n return this.db.many(sql);\n }", "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "function getDataFromDb(req,res) {\r\n let SQL = 'SELECT * FROM digimon;';\r\n client.query(SQL).then((data)=>{\r\n res.render('digimonExam/favourite', {results:data.rows});\r\n }).catch((err)=>errorHandler(err,req,res));\r\n}", "async function getCliverData(req, res, uid) {\n\t//Oracle query for getting data from userr table\n\tconst query = `SELECT u_id, total_rating, total_trips from Cliver WHERE u_id = '${uid}'`;\n\t// console.log(query);\n\n\ttry {\n\t\t//Try to perform a connection to the oracle database using the credentials above\n\t\tconnection = await oracledb.getConnection(dbconnection);\n\n\t\t//Executes the query and stores the obtained data\n\t\tresult = await connection.execute(query);\n\n\t\tconsole.log('Connected to get cliver data');\n\t} catch (error) {\n\t\t//If any error occurs while connecting or fetching data\n\t} finally {\n\t\tif (connection) {\n\t\t\tawait connection.close(); //Closes the connection\n\t\t\tconsole.log('Connection ended');\n\t\t}\n\t\tres.status(200).send(result.rows); //Sends back the data with success status 200\n\t}\n}", "async function getDataFromDatabase() {\n const response = await fetch('/api');\n const data = await response.json();\n return new Promise((resolve, reject) => {\n if (data) {\n resolve(data);\n } else {\n reject(\"Er is iets misgegaan bij het ophalen van favorieten\");\n }\n })\n}", "static fetchAll(db) {\n \n return new Promise(function (resolve, reject) {\n db.query(\"SELECT * FROM persons\", function (err, rows) {\n if (!err) {\n resolve(rows);\n } else {\n reject(err);\n }\n });\n });\n\n }", "async function getDriverData(req, res, uid) {\n\t//Oracle query for getting data from userr table\n\tconst query = `SELECT u_id, total_earning from Driver WHERE u_id = '${uid}'`;\n\t// console.log(query);\n\n\ttry {\n\t\t//Try to perform a connection to the oracle database using the credentials above\n\t\tconnection = await oracledb.getConnection(dbconnection);\n\n\t\t//Executes the query and stores the obtained data\n\t\tresult = await connection.execute(query);\n\n\t\tconsole.log('Connected to get driver data');\n\t} catch (error) {\n\t\t//If any error occurs while connecting or fetching data\n\t} finally {\n\t\tif (connection) {\n\t\t\tawait connection.close(); //Closes the connection\n\t\t\tconsole.log('Connection ended');\n\t\t}\n\t\tres.status(200).send(result.rows); //Sends back the data with success status 200\n\t}\n}", "getAll() {\n\t\tlet db = this.db;\n\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tresolve(db.value());\n\t\t});\t\t\n\t}", "function getData(){\n return runSOQL('SELECT+name+from+Account');\n}", "function getData() {\n let name = qs(\"select\").value;\n let url = URL_BASE + name + \"/\";\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(genData)\n .catch(handleError);\n }", "static async fetchAll() {\n const results = await db.query(\n `\n SELECT ntr.id,\n ntr.name,\n ntr.category,\n ntr.quantity,\n ntr.calories,\n ntr.image_url,\n ntr.user_id AS \"userId\",\n u.email AS \"userEmail\",\n ntr.timestamp AS \"timestamp\" \n FROM nutrition AS ntr\n JOIN users AS u ON u.id = ntr.user_id\n ORDER BY ntr.timestamp DESC \n `\n )\n return results.rows\n }", "async function selectAllData() {\n let sql = 'SELECT sn,label FROM enterprise_info';\n console.log(sql);\n let dataList = await query(sql);\n return dataList;\n}", "function ReadDB () {\r\n const transactions = Budgetdb.transaction([\"pending\"], \"readwrite\")\r\n const stores = transactions.objectStore(\"pending\")\r\n // getAll() method for matching specified parameter OR\r\n // all objects in store if no parameters specified \r\n const getAll = stores.getAll()\r\n // get all object stores onsuccess event if result.length > 0\r\n getAll.onsuccess = () => {\r\n if (getAll.result.length > 0) {\r\n // fetch bulk to post getAll results via json stringify\r\n fetch(\"/api/transaction/bulk\", {\r\n method: \"POST\",\r\n body: JSON.stringify(getAll.result),\r\n headers: {\r\n Accept: \"application/json, text/plain, */*\",\r\n \"Content-Type\": \"application/json\"\r\n }\r\n })\r\n .then(response => response.json())\r\n // clears stores of pending transactions once stored to db\r\n .then(() => {\r\n const transactions = Budgetdb.transaction([\"pending\"], \"readwrite\")\r\n const stores = transactions.objectStore(\"pending\")\r\n stores.clear()\r\n })\r\n }\r\n }\r\n}", "readAllData(params, division_db, token) {\n const self = this;\n const deferred = Q.defer();\n // const sql = ` use [${division_db}]; select dbo.employee.*,dbo.employee.StatusDate as HireDate,dbo.employee.InactiveDate as TermDate, dbo.employee.className as Country,dbo.classification.Description as Class,\n // paychexID as paychexID,MiddleInit as MiddleInitial,independentContractor as IndependentContractor,doNotRehire as DoNotRehire,str_Gender as Gender,str_reason as Reason\n // from dbo.employee\n // LEFT JOIN dbo.classification ON dbo.employee.ClassificationID=dbo.classification.ClassificationID `;\n // const sql = ` use [${division_db}]; select dbo.employee.* from dbo.employee`;\n const sql = ` use [${division_db}]; select dbo.employee.* from dbo.employee`;\n\n self.db\n .request()\n .query(sql)\n .then(result => {\n deferred.resolve(result.recordset);\n })\n .catch(err => {\n console.trace(err); // todo : will do to logger later\n deferred.reject(err);\n });\n return deferred.promise;\n }", "function read(req, res) {\n const query = connect.con.query('SELECT idSponsor, nome, logo, categoria, active FROM sponsor order by idSponsor desc',\n function(err, rows, fiels) {\n console.log('query: ', query.sql);\n if(err) {\n console.log('err: ', err);\n res.status(jsonMessages.db.dbError.status).send(jsonMessages.db.dbError);\n } else {\n if(rows.length == 0) {\n res.status(jsonMessages.db.noRecords.status).send(jsonMessages.db.noRecords);\n } else {\n res.send(rows);\n }\n }\n });\n}", "fetchData() {\n this.initLoading();\n\n this.setFilters(this.qs_url, this.generateBaseFilters());\n this.data.filters = this.getFilters(this.qs_url);\n\n let qs = this.setQuerySet(this.view, this.qs_url).filter(this.getFiltersPrepared(this.qs_url)).prefetch();\n this.setQuerySet(this.view, this.qs_url, qs);\n\n this.getInstancesList(this.view, this.qs_url).then(instances => {\n this.setLoadingSuccessful();\n\n this.setInstancesToData(instances);\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n\n }).catch(error => {\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "async show() {\n // select * from ticket\n const result = await this.app.mysql.select('ticket', {\n orders: [['id','desc']],\n limit: 6,\n offset: 0,\n });\n\n return result;\n }", "function getAllData() {\n fetch(\"/items\", {\n headers: { 'Content-Type': 'application/json' },\n method: \"GET\",\n })\n .then(res => {\n if(res.ok) return res.json();\n })\n .then(res => {\n data = res;\n createTable(res);\n })\n .catch(error => console.error(error.message));\n }", "fetchData() {\n this.initLoading();\n this.getInstance(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n this.data.instance = instance;\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n }).catch(error => {\n debugger;\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "function execute(req, res, cb) {\n let params = req.param('parameters');\n console.log('fetching data ...')\n\n DBService.getCourses(params, function(err, data){\n if (err || !data || data.length == 0) {\n res.badRequest(Responses.err_response());\n return cb(err, null);\n }\n else {\n if (data.length > 6) return cb(null, data.slice(0, 5));\n return cb(null, data);\n }\n });\n}", "async readObra(){\n const sql = 'SELECT * FROM obras';\n const result = await pool.query(sql);\n return result.rows;\n }", "fetchAll() {\n return this.data;\n }", "function read_data(){\n let sql_read = \"SELECT DISTINCT(score),name FROM score ORDER BY score DESC LIMIT 5 ;\";\n return new Promise((resolve, reject) => {\n db.query(sql_read, (err, result) => {\n resolve(JSON.stringify(result));\n });\n });\n}", "static async getAll() {\n let projection = {\n shipmentStatus: 1,\n referenceNo: 1,\n courier: 1,\n receivedBy: 1,\n nosOfSamples: 1\n };\n try {\n let result = await DatabaseService.getAll(collectionName, projection);\n return result;\n } catch (err) {\n throw err;\n }\n }", "function fetch(request, response, type, err, contents)\n{\n \"use strict\";\n var query = \"SELECT * FROM Book \"+\n \"LEFT JOIN Author ON Author.code = Book.author \"+\n \"WHERE Book.genre = 'poetry' \"+\n \"AND Author.dob >= \"+goldenAgeStart+\" \"+\n \"AND Author.dob <= \"+goldenAgeEnd+\" \"+\n \"ORDER BY surname, yearPublished, title;\";\n\n db.all(query, ready);\n\n function ready(err, data)\n {\n if(err) throw err;\n begin(response, type, err, contents, data);\n }\n}", "static fetchT1() {\n return db.execute('SELECT player.name as ID,player.real_name,player.position,`character`.name as \"main\",clan.name as \"戰隊\",player.photo FROM player,clan,`character` where player.belong_clan=clan.cid AND clan.cid=1 AND player.main = `character`.chid;');\n }", "function getEntries() {\n console.log(\"Getting Entries\");\n dbShellStudents.transaction(function(tx) {\n tx.executeSql(\"select id,name,image from students order by name\",[],renderEntries,dberrorhandler);\n }, dberrorhandler);\n}", "async getAll(){\n return await conn.query(\"SELECT * FROM Fitness_RoutineExercises\")\n }", "function getData() {\n var queryParams = {\n propertySelection: \"179,7,10888003,8,\" + $scope.cfg.fieldIdToDisplay,//, // ids of fields to fetch\n queryExpression: \"'7' != 3\" //Status is not rejected\n //queryExpression: \"'8' != developer\" //Status is not rejected\n };\n\n var foo = rxRecordInstanceDataPageResource.withName($scope.cfg.recordDefinitionName);\n foo.get(100, 0, queryParams).then(\n function (allRecords) {\n $scope.myData = allRecords.data;\n }\n );\n }", "function fetchData (){\n $resource('data/data.json').query(\n function(res) {\n $scope.insurances = res;\n console.log(\"$scope.insurances : \", $scope.insurances);\n },\n function(err) {\n console.log(\"err : \", err);\n }\n );\n }", "function getObjectData() {\n\n // console.log(\"Running getObjectData\");\n\n if (dbConnection) {\n\n var dbo = dbConnection;\n dbo\n .collection(\"stats\")\n .find(\n { name: \"lists\" },\n { projection: { _id: 0, objects: 1 } }\n )\n .toArray(function (err, result) {\n if (result && result[0] && result[0]['objects']) {\n var objectList = result[0]['objects'];\n } else {\n var objectList = [];\n }\n for (object of objectList) {\n objectApiCall(object)\n }\n if (err) throw err;\n });\n }\n\n}", "async function getData() {\n try {\n const res = await fetch('https://cdn.rawgit.com/akabab/superhero-api/0.2.0/api/all.json')\n const data = await res.json()\n setDatabase(data)\n } catch (error) {\n console.log(error)\n }\n }", "static async getAllTopicData() {\n try { // tells our service to wait for that response and then return that value\n const response = await db.any(\n `SELECT topic_name, ranking_title FROM topics \n JOIN rankings\n ON topics.topic_score = rankings.id\n ORDER BY topics.topic_name\n `\n )\n return response;\n } catch(error) {\n console.error('ERROR: ', error);\n return error;\n }\n }", "function getData() {\n var defered = q.defer();\n connection.query(sqlStatement, defered.makeNodeResolver());\n return defered.promise;\n }", "function getData(req, res) {\n const query = {};\n\n RecordModel.find(query, (findError, recordsArray) => {\n if (findError) {\n res.status(500);\n res.send('City Records says: Error finding records');\n } else {\n res.json(recordsArray);\n }\n });\n}", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "async function fetchData()\r\n{\r\n let url='https://opentdb.com/api.php?amount=10&type=multiple';\r\n try \r\n {\r\n let res = await fetch(url);\r\n return await res.json();\r\n } \r\n catch (error) \r\n {\r\n console.log(error);\r\n }\r\n}", "function getData(callback){//make this a promise?\n db.collection(\"haikus\", function(err, collection){\n collection.find().toArray(function(err, items){\n if(err){\n console.log(err);\n }\n callback(items);\n });\n });\n }", "function getData() {\r\n var loadedData = loadData(); //variable to load data from database.\r\n return loadedData; //return data.\r\n}", "static fetchRestaurants() {\r\n return fetch(DBHelper.DATABASE_URL)\r\n .then( response => {\r\n if (response.ok){\r\n return response.json();\r\n }\r\n }).catch(function(err){\r\n console.log('Fetch error', err);\r\n });\r\n }", "function getAllTheData() {\n var render = function (tx, rs) {\n // rs contains our SQLite recordset, at this point you can do anything with it\n // in this case we'll just loop through it and output the results to the console\n for (var i = 0; i < rs.rows.length; i++) {\n /* alert(JSON.stringify(rs.rows.item(i)));*/\n }\n }\n\n app.selectAllRecords(render);\n}", "function getAllTheData() {\n var render = function (tx, rs) {\n // rs contains our SQLite recordset, at this point you can do anything with it\n // in this case we'll just loop through it and output the results to the console\n for (var i = 0; i < rs.rows.length; i++) {\n /* alert(JSON.stringify(rs.rows.item(i)));*/\n }\n }\n\n app.selectAllRecords(render);\n}", "getData(){}", "static async getAll() {\n const results = await db.query(`\n SELECT * FROM companies\n `)\n return results.rows\n }", "readAll() {\n var objectStore = db.transaction('person').objectStore('person');\n\n objectStore.openCursor().onsuccess = function (event) {\n var cursor = event.target.result;\n\n if (cursor) {\n console.log('Id: ' + cursor.key);\n console.log('Name: ' + cursor.value.name);\n console.log('Age: ' + cursor.value.age);\n console.log('Email: ' + cursor.value.email);\n cursor.continue();\n } else {\n console.log('No hay más datos');\n }\n };\n }", "static getAll(){\n // Retourne promise\n return new Promise((resolve, reject) => {\n // Requete Select \n db.query(\"SELECT * FROM salles\", (err, rows) => {\n if(err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n })\n }", "function fetchData(callback,sqlQuery){\n\tconsole.log(\"\\nSQL Query::\"+sqlQuery);\n\tvar connection=getConnectionFromPool();\n\tconnection.query(sqlQuery, function(err, rows, fields) {\n\t\tif(err){\n\t\t\tconsole.log(\"ERROR: hereeeee \" + err.message);\n\t\t\tpool.push(connection);\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"DB Results:\"+rows);\n\t\t\tpool.push(connection);\n\t\t\tcallback(err, rows);\n\t\t}\n\t});\n\tconsole.log(\"\\nConnection closed..\");\n\t\n}", "function fetchReadings (knex, req, res)\n{\n var data = req.body;\n\n knex\n .select()\n .from('patient_' + data.id)\n .then(function (results) {\n var ret = {\n csv: ''\n };\n var cnt = 0;\n Array.prototype.forEach.call(results, function (row)\n {\n var rowParse = '';\n for (var key in row)\n {\n if (key == 'timestamp')\n rowParse += row[key];\n else\n rowParse += ',' + row[key];\n }\n cnt++;\n if (cnt != results.length)\n rowParse += '\\n';\n ret.csv += rowParse;\n });\n util.respond(res, 200, ret);\n });\n}", "lista(callback) {\n this._db.query('select * from resposta', function(err, recordset) {\n callback(err, recordset);\n });\n }", "static getAll() {\r\n return new Promise((next) => {\r\n db.query('SELECT id, nom FROM outil ORDER BY nom')\r\n .then((result) => next(result))\r\n .catch((err) => next(err))\r\n })\r\n }", "async function get(db, nam, o) {\n var o = _.merge({}, OPTIONS, o), db = db||o.db;\n db = typeof db==='string'? await setup(db, o):db;\n var nam = nam||o.input||(await getUpload(db, o)).title;\n if(o.log) console.log('-get:', nam);\n var row = await db.get('SELECT * \"pages\" WHERE \"title\" = ? LIMIT 1', nam);\n if(o.log) console.log(' .row:', row);\n return row;\n}", "async function getAll() {\n const rows = await db.query(\n 'SELECT * FROM mata_kuliah',[]\n );\n // console.log(rows);\n const data = helper.emptyOrRows(rows);\n const status = \"OK\";\n const info = \"Data Berhasil di Dapatkan\";\n\n return {status, info, data};\n}", "function getUserFromDb() {\r\n console.log('clientApp: getting user data from db');\r\n $http({\r\n method: \"GET\",\r\n url: 'acct/getUser'\r\n }).then(function (response) {\r\n //console.log('clientApp: retrieved user:', response);\r\n //console.log('clientApp: current user: ',response.data.email);\r\n //console.log('clientApp: current sisbot: ',response.data.curSisbot);\r\n //console.log('clientApp: current available sisbots: ',response.data.sisSerials);\r\n vm.sisSerials = response.data.sisSerials;\r\n vm.curSisbot = response.data.curSisbot;\r\n\r\n displayUIdata();\r\n })\r\n }", "async fetchAll() {\n try {\n // Make the request\n const response = await axios.get(\n `${this.DB_READ_URL}/${this.DB_DEFAULTS_CONFIG.plugin_id}/${this.DB_DEFAULTS_CONFIG.collection_name}/${this.DB_DEFAULTS_CONFIG.organization_id}`,\n );\n\n if (response.data.data == null) {\n return { data: [] };\n }\n\n // Return the response\n return response.data;\n } catch (error) {\n if (\n error.response.data.status === 404\n && error.response.data.message === 'collection not found'\n ) {\n return { data: [] };\n }\n\n throw new CustomError(`Unable to Connect to Zuri Core DB [READ ALL]: ${error}`, '500');\n }\n }", "async read(id) {\n // if no args, get all\n if (id === undefined) {\n try {\n const connection = await mysql.createConnection(this.dbConfig);\n const query = await connection.query('SELECT * FROM department');\n connection.end();\n return query[0];\n } catch (error) {\n console.error(error);\n }\n } else {\n try {\n const connection = await mysql.createConnection(this.dbConfig);\n const query = await connection.query(\n `SELECT * FROM department WHERE id = ${id}`\n );\n this.id = query[0][0].id;\n this.name = query[0][0].name;\n connection.end();\n return query[0];\n } catch (error) {\n console.error(error);\n }\n }\n }", "function fetchData(sqlQuery, param, successFn, errFn){\r\n console.log(\"\\nSQL Query::\"+sqlQuery);\r\n connMgr.getConn(function (connection) {\r\n connection.query(sqlQuery,param, function(err,res,as){\r\n if(err) throw err;\r\n if(successFn)successFn(res);\r\n if(res != undefined)\r\n console.log('Last insert ID:', res.insertId);\r\n }, errFn);\r\n });\r\n}", "get() {\n let options = {\n method: 'GET',\n url: this.url + this.table,\n qs: this.qs\n };\n\n return new Promise((resolve, reject) => {\n this.request(options, (err, response, body) => {\n if(err) {\n return reject(err);\n }\n\n try {\n if(response.statusCode !== 200) {\n return reject(new Error(`Unexpected response status ${response.statusCode}`));\n }\n\n let jsonRes = body.records;\n resolve(jsonRes);\n } catch(e) {\n return reject(e);\n }\n });\n });\n }", "function getAll() {\n return connSql.then(function(conn){\n let resultat = conn.query(\"SELECT * FROM chambre\");\n return resultat\n });\n}", "_getResults_Read_(req, res) {\n let returnedData = {}; // to construct response\n let rowID = req.params.id; // to Recieve table ID\n\n Model._GET_getResults_DATA_(rowID)\n .then(result => {\n // Check Error\n if (result.errno) throw result.sqlMessage;\n\n // Constructing Response\n returnedData['response_code'] = 0;\n returnedData['response_message'] = 'Success';\n returnedData['data'] = JSON.parse(result);\n // logMessage(Info, JSON.stringify(returnedData));\n res.send(200, returnedData); // Return Res\n })\n .catch(error => {\n // Constructing Response\n returnedData['response_code'] = 10;\n returnedData['response_message'] = 'Error: DataBase Error';\n\n logMessage(logError, error);\n res.send(500, returnedData); // Return Res\n });\n }", "static fetchAll() {\n return dbPromise.execute('SELECT * FROM shelves');\n }", "function GetDataSet (values){\n\treturn new Promise(resolve => { \t\t\n\t\tvar result = db.find({\n\t\t\t selector: values,\t\t\t\n\t\t\t});\n\t\tresolve(result);\t\t\t\n})}", "static retrieveAll(callback) {\n db.query('SELECT * from reservation;', function (err, res) {\n if (err.error)\n return callback(err);\n callback(res);\n });\n }", "function getEmployees(){\n fetch('http://localhost:8080/ERS/employees')\n .then(res => res.json())\n .then(data => {\n employees = data;\n console.log(\"接收到所有的员工数据\" + employees);\n appendEmployeesToTable(employees);\n });\n}", "function retriveData() {\r\n jqueryNoConflict.getJSON(dataSource, renderLocationScreen);\r\n }", "async readEmpresa(){\n const sql = 'SELECT * FROM usuarios INNER JOIN empresas ON usuarios.id_usuario = empresas.id_empresa';\n const result = await pool.query(sql);\n return result.rows;\n }", "async read() {\n let contenido = await modelo.find({});\n return contenido;\n }", "async read() {\n let contenido = await modelo.find({});\n return contenido;\n }", "function getData() {\r\n fetch('http://www.omdbapi.com?s='+guardian+'&apikey=893a62a')\r\n .then(Response => Response.json())\r\n .then(data => {\r\n moviesData = data.Search\r\n console.log(moviesData);\r\n render(moviesData);\r\n })\r\n }", "readActiveData(params, division_db, token) {\n const self = this;\n const deferred = Q.defer();\n // const sql = ` use [${division_db}]; select dbo.employee.*,dbo.employee.StatusDate as HireDate,dbo.employee.InactiveDate as TermDate, dbo.employee.className as Country,dbo.classification.Description as Class,\n // paychexID as paychexID,MiddleInit as MiddleInitial,independentContractor as IndependentContractor,doNotRehire as DoNotRehire,str_Gender as Gender\n // from dbo.employee\n // LEFT JOIN dbo.classification ON dbo.employee.ClassificationID=dbo.classification.ClassificationID `;\n\n const sql = ` use [${division_db}]; select dbo.employee.*,dbo.employee.StatusDate as HireDate,dbo.employee.InactiveDate as TermDate, dbo.employee.className as Country,dbo.classification.Description as Class,\n paychexID as paychexID,MiddleInit as MiddleInitial,independentContractor as IndependentContractor,doNotRehire as DoNotRehire,str_Gender as Gender, str_reason as Reason\n from dbo.employee\n LEFT JOIN dbo.classification ON dbo.employee.ClassificationID=dbo.classification.ClassificationID where NOT str_reason='TERMINATED' and Status='A' `;\n\n self.db\n .request()\n .query(sql)\n .then(result => {\n deferred.resolve(result.recordset);\n })\n .catch(err => {\n console.trace(err); // todo : will do to logger later\n deferred.reject(err);\n });\n return deferred.promise;\n }", "static async getAll() {\n let result = await db.query(\n `SELECT username, first_name, last_name, email FROM users`\n );\n return result.rows;\n }", "function dbReadData( query, callback){\n dbCon.query( query, function( error, result, fields){\n if( error) handleError( error);\n else callback( result);\n });\n }", "function getData() {\n\t\t$scope.loading = true;\n\n\t\t// Load existing data into display table\n\t\t$http.get('dataStore.php').success(function(response) {\n\n\t\t\tif (response.success) {\n\t\t\t\tvar dataToStore = [];\n\t\t\t\tfor (var i = 0; i < response.data.length; i++) {\n\t\t\t\t\tdataToStore.push({\n\t\t\t\t\t\thandle : response.data[i].handle,\n\t\t\t\t\t\tname\t : response.data[i].name,\n\t\t\t\t\t\ttext\t : response.data[i].text,\n\t\t\t\t\t\tcreatedAt: new Date(response.data[i].createdAt)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t$scope.statusData = dataToStore;\n\t\t\t}\n\n\t\t\t$scope.loading = false;\n\t\t});\n\t}", "function getAll() {\n return connSql.then(function(conn){\n let resultat = conn.query('SELECT * FROM posts WHERE posted = \"1\" ORDER BY posts.date DESC');\n return resultat\n });\n}", "async function fetcher() {\n let data = {};\n try {\n data = await query()\n }\n catch (error) {\n setError(error)\n return\n }\n console.log(\"DATAAA\", data)\n setLoading(false)\n setData(data)\n setDone(true)\n }", "function getEntreprise(req, res, next) {\n var id = parseInt(req.params.id);\n db.query(\"SELECT * FROM entreprises WHERE id = ?\", id, function (error, results, fields) {\n if (error)\n res.status(500)\n .json({\n status: \"ko\",\n data: \"error\"\n })\n else\n res.status(200)\n .json({\n status: \"ok\",\n data: results\n })\n\n });\n}", "_get(date, cb) {\n const _self = this\n const request = date === 'all' ?\n db.transaction(['table_number']).objectStore('table_number').getAll() : db.transaction(['table_number']).objectStore('table_number').get(date)\n request.onsuccess = (e) => {\n if (request.result) {\n cb && cb.call(_self, request.result)\n } else {\n request.onerror = (e) => _tip(date === 'all' ? '数据库没有任何记录!' : '未找到该期记录!', 'danger')\n }\n }\n request.onerror = (e) => _tip('事务失败!', 'danger')\n }", "function getStudents() {\n return db.query(\"SELECT * FROM students\").then((result) => result.rows);\n}", "fetchData() {\n this.initLoading();\n this.setAndGetInstanceFromSandBox(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n this.data.instance = instance;\n }).catch(error => {\n this.setLoadingError(error);\n debugger;\n });\n\n this.getParentInstancesForPath();\n }", "function getDBData(name, callback){\n connection.query('SELECT * FROM ' + name, function (err, results) {\n if(err){\n callback(err, null);\n } \n else{\n callback(null, results);\n } \n }); \n // connection.release();\n}", "function selectDataHandler(req,res){\nlet sql= `SELECT * FROM digi_test ;`;\nclient.query(sql).then(result=>{ // here we needed the (result ) because this function have results not like the func before because inserting process have no result \n\nres.render('pages/favorite' , {data: result.rows}) // path of favorite page to render on it \n\n})\n \n}", "function readData(req, res) {\n console.log(\"read data\")\n var p = config.getDB().then(function(db){\n db.collection(\"chartinsert\").find({user_id:req.userId}).toArray(function(err,data){\n if(err) res.status(500).json({success:false,message:'something went wrong.'})\n else{\n // console.log(data)\n res.status(200).json({success:true, message:'executed successfully', data:data})\n }\n })\n })\n \n}", "fetch() {\r\n return new Promise((resolve, reject) => {\r\n const t = time.measure.start()\r\n this.docClient.scan({ TableName: this.table }, (err, data) => {\r\n time.measure.end(t, `Fetch (scan) from table ${this.table}`)\r\n if (err) {\r\n reject(err)\r\n } else {\r\n resolve(data.Items)\r\n }\r\n })\r\n })\r\n }", "static readAllFromDB(dbElementName) {\r\n\t\treturn DBHelper.openDB('restaurant-review-DB').then(db => {\r\n\t\t\treturn db\r\n\t\t\t\t.transaction(dbElementName)\r\n\t\t\t\t.objectStore(dbElementName)\r\n\t\t\t\t.getAll();\r\n\t\t});\r\n\t}", "function dbReadStockAll()\n{\n var db = dbGetHandle()\n var results;\n\n db.transaction(function (tx) {\n results = tx.executeSql('SELECT rowid, idNumber, product_name, product_price FROM stock_DB order by rowid desc')\n })\n return results\n}", "async function fetchData() {\n const response = await API.get(\"findTask/\");\n\n setTasks(response.data);\n console.log(\"👉 Returned data:\", response);\n }", "function getDistanceData() {\n return ddb.get({\n TableName: 'distance_data',\n Key: {region: 'Minnesota'}, //grabs the object from the first table\n }).promise();\n}", "getData(active){\n\t\treturn this.rowManager.getData(active);\n\t}", "function getTheMovieDatabase() {\n fetch(urlForm)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n printItemList(data.results);\n });\n}", "findEmployees() {\n return this.connection.query(\"SELECT * FROM employee\");\n\n }", "get_all_patient_info() {\n return this.pool.getConnection().then(connection => {\n var res = connection.query(patient_sql.get_all_patient_info_sql);\n connection.release();\n return res;\n });\n\n }", "function dataDb() {\n const arr2 = [];\n fetch(\"/getdata\")\n .then(data => data.json())\n .then(data => {\n data.forEach(i => arr2.push(i));\n });\n return arr2;\n}", "function get_data() {}", "function getInfofromDB(){\n\tvar newData = new dataJs({\n\t\tid : ' ',\n\t\ttime : ' '\n\t\t});\n\tnewData.get('517',function(err,data){\n\t\tlast_id = data.id;\n\t\tconsole.log(last_id);\n\t\tgetJSON();\n\t});\n}", "function fetchData(callback, sqlQuery) {\n console.log(\"\\nSQL Query::\" + sqlQuery);\n\n var connection = getConnectionFromPool();\n connection.query(sqlQuery, function (err, rows, fields) {\n if (err) {\n console.log(\"ERROR: \" + err.message);\n pool.push(connection);\n }\n else { // return err or result\n console.log(\"DB Results:\" + rows);\n pool.push(connection);\n callback(err, rows);\n }\n });\n console.log(\"\\nConnection closed..\");\n}", "async getAll(){\n return await conn.query(\"SELECT * FROM Fitness_Workouts\");\n }", "async getAll() {\n try {\n const db = await this.conexion.conectar();\n const collection = db.collection('Encargados');\n const findResult = await collection.find({}).toArray();\n await this.conexion.desconectar();\n return (findResult);\n }\n catch (e) {\n throw e;\n }\n }", "function getEmployees() {\n const query = \"SELECT * FROM employee\";\n return queryDB(query);\n}", "static read(req, res) {\n\n const getIdUser = req.params.user\n\n if (!getIdUser) {\n res.status(422).json({\n message: \"error data could not be processed\"\n })\n } else {\n GEN_DATA_AGUNAN.findOne({ where: { UserId: getIdUser } })\n .then((data) => {\n if (!data) {\n res.status(404).json({\n message: \"Data Not Found\",\n data: data\n })\n } else {\n res.status(201).json({\n message: \"Fetch Get One Agunan Success\",\n data: data\n })\n }\n })\n .catch((err) => {\n res.status(500).json({\n message: \"Internal Server Error\",\n log: err\n })\n })\n }\n }" ]
[ "0.70414996", "0.68321455", "0.68208855", "0.68088824", "0.67154986", "0.6709531", "0.6675608", "0.6658904", "0.65868527", "0.6551383", "0.65474236", "0.6511769", "0.6498104", "0.64715815", "0.6465587", "0.6461441", "0.64442295", "0.64366806", "0.6407264", "0.6407051", "0.63828224", "0.63751924", "0.6375154", "0.636443", "0.63520867", "0.6300979", "0.6299675", "0.6298417", "0.62953043", "0.6294991", "0.6290866", "0.62887645", "0.6283562", "0.62757117", "0.62721825", "0.6270788", "0.6263656", "0.62626487", "0.62626487", "0.6258568", "0.62305236", "0.6215482", "0.6215317", "0.6204902", "0.6204902", "0.6202737", "0.61878383", "0.61791897", "0.6178051", "0.617534", "0.61524606", "0.61482525", "0.6140812", "0.61391807", "0.6138292", "0.61378133", "0.6136273", "0.6132129", "0.61317194", "0.6130394", "0.61291456", "0.6123302", "0.610618", "0.6103946", "0.61017185", "0.60983604", "0.60981315", "0.6095717", "0.60906845", "0.60906845", "0.6082894", "0.607995", "0.6072438", "0.60633695", "0.60601175", "0.60590416", "0.6055111", "0.6048526", "0.604446", "0.6040309", "0.60375303", "0.6035143", "0.60346866", "0.60273176", "0.60172206", "0.601185", "0.600047", "0.5995239", "0.59931517", "0.5986235", "0.5981405", "0.59771144", "0.59741306", "0.59720206", "0.5970885", "0.5970677", "0.59684443", "0.59649503", "0.59591126", "0.59564763", "0.595644" ]
0.0
-1
save data onto DB
save(e) { e.preventDefault(); axios.put('https://pilotsapp.herokuapp.com/project/updateProject/' + this.state.project._id, { ...this.state.project }).then(response => { console.log(response.data); NotificationManager.success(`'${this.state.project.title}' has been updated successfully`, '', 3000) }) .catch(error => { console.log(error); NotificationManager.error('An error has occured', 'Error', 3000) }); this.setState({ edit: false, loading: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveToDatabase() {\n idb.add(dbKeys.stations, JSON.stringify(stationList));\n idb.add(dbKeys.lastFrequency, lastFrequency);\n }", "save() {\n this.db.write();\n }", "save(data) {\n this.db.save(data);\n }", "async save() {\n const priv = privates.get(this);\n const tableName = priv.get(\"tableName\");\n if (tableName) {\n const formData = new FormData(this.form);\n if (formData.get(\"saveDetails\") !== \"on\") {\n return;\n }\n const dataToSave = Object.assign({}, this.data, this.toObject());\n if (!db.isOpen()) {\n await db.open();\n }\n await db[tableName].put(dataToSave);\n this.data = dataToSave;\n }\n }", "function saveData(data) {\n const transaction = db.transaction([\"open\"], \"readwrite\");\n\n const store = transaction.objectStore(\"open\");\n\n store.add(data);\n}", "save() {}", "function saveData() {\n\tstate.save();\n}", "save() {\n this.db._write(this.data);\n return this.db;\n }", "function saveDataIntoDB(url) {\n // Feed the database\n var dbObj = getEntityCustomData('infoKey', dataBaseID, null);\n if(dbObj) {\n var myName = MyAvatar.displayName ? MyAvatar.displayName : \"Anonymous\";\n dbObj.dbKey[dbObj.dbKey.length] = {name: myName, score: scoreAssigned, clip_url: url};\n setEntityCustomData('infoKey', dataBaseID, dbObj);\n print(\"Feeded DB: \" + url);\n }\n }", "save() {\n\t\treturn this.db2data().then(()=>AppData.saveCollection(this.path, this.data))\n\t}", "function saveToDataBase(data) {\n console.log(data);\n}", "save(data) {\n this.data = Object.assign({}, this.data, data);\n return this.store.set(data);\n }", "function saveData(data) {\n fs.writeFileSync(TASK_STORAGE_PATH, JSON.stringify(data));\n console.log(`Saved to database.`)\n list();\n}", "_save_to_db() {\n\t\tmongoose.connect(this.config.mongodb);\n\t\tRates.insertMany(this.rates)\n\t\t\t.then(function (docs) {\n\t\t\t\tconsole.log('%d stored docs', docs.length);\n\t\t\t})\n\t\t\t.catch(function (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t});\n\t}", "function saveBorrowing() {\n retrieveValues();\n saveToServer();\n}", "async function saveInDb() {\n\t\ttry {\n\t\t\tawait Snapshot.create({\n\t\t\t\tTitle: req.body.title,\n\t\t\t\tText: fullUnitedText,\n\t\t\t\tDictionary: JSON.stringify(fullInfo.dictionary),\n\t\t\t\tWikipedia: JSON.stringify(fullInfo.wiki)\n\t\t\t});\n\n\t\t\tres.status(201).end()\n\t\t} catch (e) {\n\t\t\tres.status(500).send({error: e})\n\t\t}\n\t}", "function writeDataIntoDB(database) {\n database.save(function (err) {\n if (err) throw err;\n console.log('Write in DB successfully');\n })\n}", "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "saveDB() {\n const dbpath = path.join(__dirname, \"../db/data.json\");\n fs.writeFileSync(dbpath, JSON.stringify(this.toJson));\n }", "async function saveData(data) {\n\tfor (let countryData of data) {\n\t\t// check that country is not yet exists\n\t\tlet sql = `SELECT id FROM country WHERE id = ?`;\n\t\tconst countries = await db.query(sql, [countryData.id]);\n\t\t// if there is no such country then save it to DB\n\t\tif (countries.length == 0) {\n\t\t\tsql = `INSERT INTO country SET ?`;\n\t\t\tconst data = {\n\t\t\t\tid: countryData.id,\n\t\t\t\tshort_name: countryData.extra ? countryData.extra.fifa : null,\n\t\t\t\tfull_name: countryData.name,\n\t\t\t\t// TODO: fix\n\t\t\t\t// flag_svg: countryData.extra.flag\n\t\t\t}\n\t\t\tawait (db.query(sql, data));\n\t\t}\n\t}\n}", "save(){\n\t\tvar dataString = JSON.stringify(this.getData());\n\t\tfs.writeFile('app/json/saveData.txt', dataString);\n\t}", "async save() {\n // Check if anything has changed or stop here.\n const originData = await loadDataObject(this.dataKey)\n\n if (this.data === originData) {\n console.log('Nothing changed here for ' + this.dataKey)\n return\n }\n\n // Convert the modified data for the backend.\n const convertedData = await convertNewData(\n this.dataKey,\n JSON.parse(JSON.stringify(this.data))\n )\n\n // Update the data on the backend.\n try {\n await ApiConnector.update(this.dataKey, convertedData)\n } catch (err) {\n // TODO: Show the error to the user.\n console.log('Message: ' + err.message)\n }\n }", "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "function _saveLocalRecord() {\n\n // get all vars (don't worry if they've been changed).\n var columnList = [];\n columnList.push({ column: \"playername\", value: firstname });\n columnList.push({ column: \"coachname\", value: coachname });\n columnList.push({ column: \"clubname\", value: clubname });\n columnList.push({ column: \"path\", value: path });\n columnList.push({ column: \"thumbnail\", value: thumbnail });\n columnList.push({ column: \"shottype\", value: viewModel.get(\"shotTypeIndex\") });\n columnList.push({ column: \"ratingtype\", value: viewModel.get(\"ratingTypeIndex\") });\n columnList.push({ column: \"playerid\", value: playerId });\n columnList.push({ column: \"coachid\", value: coachId });\n columnList.push({ column: \"clubid\", value: clubId });\n var dateCheck = viewModel.get(\"date\");\n var timeCheck = viewModel.get(\"time\");\n columnList.push({ column: \"date\", value: new Date(dateCheck + \" \" + timeCheck) });\n \n // build query. Add each item to the query procedurally\n var query = \"INSERT INTO \" + LocalSave._tableName + \" (\";\n var first = true;\n for (var i = 0; i < columnList.length; i++) {\n var item = columnList[i];\n if (!first) {\n query += \", \";\n }\n query += item.column;\n first = false;\n }\n query += \") VALUES (\";\n first = true;\n var valList = [];\n for (var i = 0; i < columnList.length; i++) {\n var item = columnList[i];\n if (!first) {\n query += \", \";\n }\n query += \"?\";\n first = false;\n valList.push(item.value);\n }\n query += \");\";\n\n // run query.\n var complete = new Promise(function (resolve, reject) {\n db.queryExec(query, valList,\n function (id) {\n console.log(\"Saved new shot with id \" + id);\n resolve(id);\n },\n function (err) {\n reject(err);\n });\n });\n\n // handle query after it has completed\n complete.then(\n function (val) {\n if (page.android) {\n var Toast = android.widget.Toast;\n Toast.makeText(application.android.context, \"New Shot Saved\", Toast.LENGTH_SHORT).show();\n }\n // leave page\n var navigationOptions = {\n moduleName: \"record-shot-page\",\n backstackVisible: false\n };\n frameModule.topmost().navigate(navigationOptions);\n },\n function (err) {\n _unlockFunctionality();\n });\n}", "async save() {\n await db.query(\n `UPDATE jobs SET title=$1, salary=$2, equity=$3, company_handle=$4 WHERE id = $5`, [this.title, this.salary, this.equity, this.company_handle, this.id]);\n }", "function saveData() {\n\t\tif(!key){\n\t\t\tvar id \t\t\t\t\t\t= Math.floor(Math.random()*1000001);\n\t\t}else{\n\t\t\tid = key;\n\t\t}\n\t\t\n\t\tgetRadioValue ();\n\t\tgetCheckbox();\n\t\tvar item\t\t\t\t\t\t= {};\n\t\t\t item.kname\t\t\t\t= [\"Kid's Name:\", $(\"kname\").value];\n\t\t\t item.pname\t\t\t\t= [\"Parent's Name:\", $(\"pname\").value];\n\t\t\t item.phone\t\t\t\t= [\"Phone #:\", $(\"phone\").value];\n\t\t\t item.email\t\t\t\t= [\"Email:\", $(\"email\").value];\n\t\t\t item.date\t\t\t\t= [\"Play Date:\", $(\"date\").value];\n\t\t\t item.sex\t\t\t\t= [\"Sex:\", sexValue];\n\t\t\t item.choice\t\t\t= [\"Best Time of Week:\", $(\"choice\").value];\n\t\t\t item.select\t\t\t= [\"Best Time of Day:\", $(\"dayTimes\").value];\n\t\t\t item.allergies\t\t= [\"Needs:\", hasAllergy];\n\t\t\t item.comments\t\t\t= [\"Notes:\", $(\"comments\").value];\n\t\t\t item.outgoing\t\t\t= [\"How Outgoing? 1-10:\", $(\"outgoing\").value];\n\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\talert(\"Saved!\");\n\t}", "save(data) {\n\n\t\tlet parseThis = this.state.data;\n\t\tlet x = parseThis.map(element => {\n\t\t\treturn element.score;\n\t\t\t// console.log(parseThis)\n\t\t})\n\n\t\taxios.post(\"http://localhost:8080/table\", x)\n\t\t\t.then(res => {\n\t\t\t\t// const emotionCopy = {...data, id: res.data.id};\n\t\t\t\t// console.log(\"I am EMOTION----->\",data)\n\t\t\t\tthis.setState({\n\t\t\t\t\tresults: this.state.results.push(x),\n\t\t\t\t\tmode: 'emotion',\n\t\t\t\t\t// current: emotionCopy\n\t\t\t\t})\n\t\t\t\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tconsole.log(err)\n\t\t\t})\n\t }", "function saveData(data)\n{\n\tobjectData = data;\n}", "function saveData() {\n $.post({\n url:'http://localhost:9292/save',\n type:'POST',\n dataType:'json',\n data:{\n current_temperature: thermostat.temperature,\n energy_usage: thermostat.energyUsage(),\n energy_mode: thermostat.isEnergyModeOn(),\n authenticity_token: window._token\n },\n });\n }", "function save(state, data) {\n console.log('saving...');\n console.log('who: ' + state.who());\n console.log('when: ' + state.when());\n console.log('text: ' + state.text());\n console.log('tags: ' + state.tags());\n console.log('last transaction: ' + state.txId());\n state.txId.set(state.txId() + 1);\n console.log('new transaction: ' + state.txId());\n}", "async function saveData (data) {\r\n\ttry {\r\n\t\tlet newBook = new newBoek( {\r\n\t\t\ttitel: data.titel,\r\n\t\t\tauteur: data.auteur,\r\n\t\t\tgenre: data.genre,\r\n\t\t\tentryDate: Date()\r\n\t\t});\r\n\t\tawait newBook.save();\r\n\t\tconsole.log(`added book ${newBook}`);\r\n\t} catch (error) {\r\n\t\tconsole.log('saveData failed ' + error);\r\n\t}\r\n}", "function saveAction(){\n\t\tvar data = getInput();\n\t\tif(data.id == \"\") {\n\t\t\t// delete the id property as it's\n\t\t\t// automatically set by database.\n\t\t\tdelete data.id;\n\t\t\tupdateDB(\"add\", data);\n\t\t}\n\t\telse {\n\t\t\tdata.id = Number(data.id);\n\t\t\tupdateDB(\"edit\", data);\n\t\t}\n\t\tclearInput();\n\t}", "function saveData() {\n const transaction = db.transaction([\"transactions\"], \"readwrite\");\n const transactionStore = transaction.objectStore(\"transactions\");\n const allData = transactionStore.getAll();\n\n allData.onsuccess = () => {\n if (allData.result.length > 0) {\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(allData.result),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => {\n return response.json();\n })\n .then(() => {\n const transaction = db.transaction(\n [\"transactions\"],\n \"readwrite\"\n );\n const transactionStore =\n transaction.objectStore(\"transactions\");\n transactionStore.clear();\n });\n }\n };\n}", "save () { this.store.saveSync() }", "function save() {\r\n var site_name = document.getElementById(\"site_Name\").value;\r\n dev_name = document.getElementById(\"dev_Name\").value;\r\n var test_num = document.getElementById(\"try_num\").value;\r\n var language = document.getElementById(\"language\").value;\r\n\r\n database.ref('test/' + dev_name).set({\r\n siteName : site_name,\r\n developer : dev_name,\r\n testNumber : test_num,\r\n lSitLanguage : language\r\n });\r\n\r\n alert('saved');\r\n }", "storeData(jsonData) {\n fs.writeFileSync(dbPath, JSON.stringify(jsonData));\n }", "function save (data) {\n data.save('brushed', brushed)\n}", "function save() {\n storage.write(filename, data);\n }", "save () { if (this.name) saveValue(this.name, this.items); }", "save(){\n //\n }", "save() {\n }", "function saveData(conn,callback){\n sampleEmployee.save(function(err){\n callback(err,conn);\n });\n\n}", "saveConfigToDb() {}", "async store(data) {\n console.log('filling', data);\n this.fill(data);\n this.property('updatedAt', Date.now());\n await this.save();\n }", "saveData() {\n if (this.s.unavailable()) {\n return;\n }\n\n for (const val of this.dispField.items) {\n this.s.set(val, this.dispField.checked(val));\n }\n\n this.s.set(\"unit\", this.unitField.get());\n this.s.set(\"format\", this.formatField.get());\n this.s.set(\"sort\", this.sortableField.toArray());\n }", "static async save(data) {\n try {\n let result = await DatabaseService.save(collectionName, data);\n return result;\n } catch (err) {\n throw err;\n }\n }", "_save() {\n if (this.store && localStorage) {\n localStorage.setItem(this.store, JSON.stringify(this.records));\n }\n }", "function saveData(data, path) {\n save(data, path, (err, data) => {\n if (err) throw err;\n\n })\n}", "function saveToDatabase(obj) {\n var request = new XMLHttpRequest();\n request.onreadystatechange = processResponse;\n request.open('POST', 'http://localhost/member/save', true); // Be explicit with the URL; could use /member/save only to assume server is localhost\n request.send(obj);\n}", "function saveTransfer() {\n retrieveValues();\n saveToServer();\n}", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "function writeFileContent(data) {\n console.log(\"Write file data to db\");\n\n FileData.find({})\n .exec(function (err, fileData) {\n if (err) {\n console.log(err);\n } else {\n if (fileData.length == 0) {\n //save file data into db\n var newFileData = new FileData()\n\n newFileData.data = data\n\n newFileData.save(function (err) {\n if (err) {\n console.log(err);\n }\n })\n }\n else {\n //update file data into db\n FileData.update({}, {\n $set: {\n data: data\n }\n },\n {\n new: true\n },\n function (err, updatedDetails) {\n if (err) {\n console.log(err);\n }\n });\n }\n }\n });\n}", "function save(data) {\n var url = URL + 'save';\n var deferred = $q.defer();\n\n $http.put(url, data).success(function (data) {\n deferred.resolve(data);\n }).error(function (error) {\n deferred.reject(error);\n });\n return deferred.promise;\n }", "save() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "function saveData(key) {\n\t\t// Set Random Key for Stored Data //\n\t\tif(!key) {\n\t\t\tvar id = Math.floor(Math.random()*10001);\n\t\t}else{\n\t\t\tid = key;\n\t\t}\n\t\t// Call Functions //\n\t\tgetCheckboxValue();\n\t\tgetSelectedRadio();\n\t\tvar item \t\t\t\t= {};\n\t\t\titem.training \t\t= [\"Training Style: \", $('#training').value];\n\t\t\titem.wname\t\t\t= [\"Workout Name: \", $('#wname').value];\n\t\t\titem.favorite\t\t= [\"Favorite: \", favoriteValue];\n\t\t\titem.howlong\t\t= [\"How Long: \", $('#howlong').value + \" minutes\"];\n\t\t\titem.timeofday\t\t= [\"Preferred Time: \", timeValue];\n\t\t\titem.completiondate\t= [\"Completion Date: \", $('#completiondate').value];\n\t\t\titem.comments\t\t= [\"Self-Motivation: \", $('#comments').value];\n\t\t\t\n\t\t// Save Data into Local Storage with JSON.stringify //\n\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\talert(\"Workout Saved!\");//\n\t\t// Set dialog using Dialog //\n\t\t//$('#dialog').attr(\"title\", \"Saved!\").text(\"Your workout has been saved.\").dialog('open');\n\t}", "async postSave () {\n\t}", "function save() {\r\n \t\t// get busy\r\n \t\tgetBusy();\r\n \t\t\r\n \t\t/****/\r\n \t\t\r\n \t\t\r\n \t\t/*****/\r\n \t\t\r\n \t\tangular.forEach(vm.examenes, function(examen, key) {\r\n \t\t\tif(examen.create) {\r\n \t\t\t\tcreate({\r\n\t\t\t\t\t\ttmp: {\r\n\t\t\t\t\t\t\tcodigoCausaExterna: vm.examenDetail.codigoCausaExterna,\r\n\t\t\t\t\t\t\tcodigoClaseServicio: vm.examenDetail.codigoClaseServicio,\r\n\t\t\t\t\t\t\tvalorCostoEps: '',\r\n\t\t\t\t\t\t\tvalorCuotaModeradora: ''\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t_embedded: {\r\n\t\t\t\t\t\t\texamenTipo:{\r\n\t\t\t\t\t\t\t\tid: examen.tipo,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tafiliado: {\r\n\t\t\t\t\t\t\t\tid: $stateParams.afiliadoId\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tmedico: vm.examenDetail.medico\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\texamen: {}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n \t\t\t}\r\n \t\t})\r\n\t\t\t$state.go('main.afiliado.edit.examen.list', {afiliadoId: $stateParams.afiliadoId});\r\n \t\t\r\n \t}", "save(cb) {\n return this.db.save(cb);\n }", "function save_data() {\r\n\tsessionStorage.setItem('pieces', JSON.stringify(Data.pieces))\r\n\tsessionStorage.setItem('stamps', JSON.stringify(Data.stamps))\r\n\tsessionStorage.setItem('categories', JSON.stringify(Data.categories))\r\n\tsessionStorage.setItem('tuto', JSON.stringify(Data.tuto))\r\n}", "function storeDataInDatabase(surveyId, controlId, value, db) {\n\tvar query = \"INSERT INTO surveyData('surveyId','controId','value') \"\n\t\t\t\t+\"VALUES ('\"+surveyId+\"','\"+controlId+\"','\"+value+\"')\";\n\tdb.transaction(\n\t\tfunction (tx) {\n\t\t\ttx.executeSql(query, [],successMsg ,onError);\n\t\t});\n}", "writeData( key, data ) {\n\t\tBdApi.saveData( this.getShortName(), key, data );\n\t}", "function WriteDB(the_record){\n connection.query('select count(id) from record', function (error, results, fields) {\n if (error) throw error\n var num = results[0]['count(id)'];\n var t1 = new Date();\n var time = t1.getFullYear() * 10000 + (t1.getMonth()+1)*100 + t1.getDate();\n\n connection.query(`INSERT INTO record(lineId, id, time) VALUES (\"${the_record.id}\", ${num}, ${time});`);\n connection.query(`INSERT INTO location(id, lat, lng, statu, address) VALUES (${num}, ${the_record.lat}, ${the_record.lon}, '0', '${the_record.address}');`);\n UploadFolder(oAuth2Client, num.toString(), num, the_record);\n })\n}", "static async save(data) {\n try {\n\n let result = await DatabaseService.save(collectionName, data);\n return result.ops[0];\n } catch (err) {\n throw err;\n }\n }", "function saveData() {\n var user = firebase.auth().currentUser;\n var curDate = new Date();\n var curTime = curDate.getTime();\n var userID = user.uid;\n\n var docData = {\n lat: latData,\n lon: lonData,\n timeStamp: curTime\n };\n\n db.collection(userID + ' tracking').doc(curTime.toString()).set(docData);\n }", "save() {\n let columns = Object.keys(this.data);\n let sql;\n // build sql string\n if (this.data[this.primaryKey]) {\n sql = Squel.update().table(this.table);\n } else {\n sql = Squel.insert().into(this.table);\n }\n\n columns.map( (column) => {\n // ignore primary key column\n if (column != this.primaryKey) {\n let value = this.data[column];\n sql.set(column, value);\n }\n });\n\n // update mode: set where condition\n if (this.data[this.primaryKey])\n sql.where(`${this.primaryKey} = ${this.data[this.primaryKey]}`);\n\n // execute sql\n sql = sql.toString();\n\n return new Promise( (resolve, reject) => {\n getSQLiteDB(this.table).executeSql(sql, [], (results) => {\n // update model's primaryKey on insertId\n if (results.insertId && !this.data[this.primaryKey])\n this.data[this.primaryKey] = results.insertId;\n\n resolve(true);\n });\n });\n }", "function saveSauvegarde(id,nbCoupe,aireAtteinte,temps,score) {\n // création d'un objet contenant les données\n // il sert d'\"enregistrement\" dans la base\n var sauvegarde = {\n\t\tid:id,\n nbCoupe: nbCoupe,\n aireMinimaleAtteinte: aireAtteinte,\n\t\ttemps:temps,\n\t\tscore:score\n }\n\n // on ouvre la base, et on déclare les listeners\n var request = indexedDB.open(\"spacelash2\", 1);\n request.onerror = errorOpen;\n request.onupgradeneeded = createDatabase;\n\n request.onsuccess = function(event) {\n // ici la base a été ouverte avec succés, il faut ajouter l'enregistrement\n\n // on récupère l'objet database\n var db = event.target.result; \n\n // on ouvre une transaction qui permettra d'effectuer\n // les opérations sur la base\n var transaction = db.transaction([\"sauvegarde\"], \"readwrite\");\n transaction.oncomplete = function(event) {\n \n \n };\n\n transaction.onerror = function(event) {\n window.alert('erreur de transaction ');\n };\n\n // on récupère l'object store dans lequel on veut stocker l'objet\n var sauvegardeStore = transaction.objectStore(\"sauvegarde\");\n\n // on créé l'ordre d'ajouter un enregistrement\n // sera effectivement executé lors de la fermeture de la transaction\n var req = sauvegardeStore.put(sauvegarde);\n req.onsuccess = function(event) {\n \n }\n req.onerror = function(event) {\n window.alert('erreur ajout');\n }\n }\n}", "function save_order() {\n\tdb.sql(\"insert into orders (customer) values(?)\", [order.customer], function(r) {\n // inserts into orders table a customer\n\t\tif(r.error) {\n alert(\"Save Error: \"+o2j(r.error));\n\t\t\t// If there is an error, then alert that there was a save error \n}\n\t\telse {\n\t\t\tvar id = r.insert_id\n\t\t\t// set id = the id within the database\n\t\t\tfor(var i = 0; i < order.lines.length; i++) {\n \t // loop through lines array\n\t\t\t\torder.lines[i].order_id = id;\n\t\t\t\t// add id to order_id\n \t\t\twrite(order.lines[i].order_id);\n\t\t\t\t// write out the order id of the order that has just been saved\n\t\t\t\tdb.sql(\"insert into items (order_id, product, price, qty) values(?, ?, ?, ?)\", [order.lines[i].order_id, order.lines[i].product, order.lines[i].price, order.lines[i].qty], function(r) {\n\t\t\t\t// insert into items table the order_id, product, price, and quantity\n\t\t\t\t\tif(r.error) {\n\t\t\t\t\t\talert(\"Save Error: \" + o2j(r.error));\n\t\t\t\t\t\t// if there is an error alert that there is a save error\n\t\t\t\t\t}\t\n \t\t\t});\n\t\t\t}\t\n\t\t}\n\t});\t\n}", "function saveData(attributes) {\n\n\t// MySQL\n\t$.post('handledata.php', {\"attributes\":attributes}, function(data){alert(data);});\n}", "static saveToDB(restaurants){\r\n const dbPromise = DBHelper.openDB();\r\n dbPromise.then(db => {\r\n if(!db) return ;\r\n const transaction = db.transaction(\"restaurantList\", \"readwrite\");\r\n const store = transaction.objectStore(\"restaurantList\");\r\n restaurants.forEach(restaurant => {\r\n store.put(restaurant);\r\n });\r\n return transaction.complete;\r\n });\r\n }", "function saveToDB(records, promises) {\n promises.push(DBconn.query('INSERT INTO posts_questions (id, Location) VALUES ?', [records]));\n}", "function storeWeather(bodyObj)\n{ \n let dat = new Date(0);\n let newObj = JSON.parse(bodyObj);\n let insObj = {};\n\n if (newObj.cod == '200')\n {\n insObj.country=newObj.sys.country;\n insObj.state='';\n insObj.city=newObj.name;\n insObj.longitude=newObj.coord.lon;\n insObj.latitude=newObj.coord.lat;\n insObj.weaDesc=newObj.weather[0].description;\n insObj.weaIcon=newObj.weather[0].icon + \".png\";\n insObj.avgTemp=(newObj.main.temp - 273.15).toFixed(2);\n insObj.minTemp=(newObj.main.temp_min - 273.15).toFixed(2);\n insObj.maxTemp=(newObj.main.temp_max - 273.15).toFixed(2);\n insObj.pressure=(newObj.main.pressure + \" Hetropascals\");\n insObj.humidity=newObj.main.humidity;\n insObj.windSpeed=newObj.wind.speed;\n insObj.windDegree=newObj.wind.deg; \n insObj.weatherDate=new Date(dat.setUTCSeconds(newObj.dt));\n dat = new Date(0);\n insObj.sunrise=new Date(dat.setUTCSeconds(newObj.sys.sunrise));\n dat = new Date(0);\n insObj.sunset=new Date(dat.setUTCSeconds(newObj.sys.sunset));\n \n console.log('Inserting data to Weather db....');\n let weatherRec = new WeatherData(insObj);\n let result = weatherRec.save();\n }\n}", "function write_in_db (internal_data) {\n database.collection(\"people_presence_db\").insertOne(internal_data, function(err,res) {\n if(err) throw err;\n //console.log(res.connection)\n //console.log(res.ops)\n //client.close();\n })\n }", "save()\n\t{\n\t\tdatabase.ref('Users/' + this.#id).set({\n\t\t\tname : this.#name,\n\t\t\tsurname : this.#surname,\n\t\t\tnickname : this.#nickname,\n\t\t\temail: this.#email\n\t\t});\n\t}", "function saveStateData(state, data){\n var reportState;\n if(state.get(\"type\") == \"Report\"){\n reportState = state;\n } else {\n state.set(\"data\", data);\n reportState = state.collection.findWhere({\"type\": \"Report\"});\n }\n if(reportState){\n var timestamp = new Date().toISOString();\n reportState.save({\n \":id\": reportState.get(\":id\"),\n \":type\": reportState.get(\":type\"),\n \"data\": data+\"\",\n timestamp: timestamp+\"\"\n }, {\n wait: true,\n patch: true\n });\n }\n}", "function save_results(e_val, a_val, c_val, n_val, o_val) {\n let user_results = {\n e_val: e_val,\n a_val: a_val,\n c_val: c_val,\n n_val: n_val,\n o_val: o_val\n };\n //Get working with DB\n const url = \"/test\";\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", url, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify(user_results));\n}", "save() {\n return db.execute('INSERT INTO products (title,price,imageUrl,description) VALUES(?,?,?,?)',\n [this.title,this.price,this.imageUrl,this.description]);\n }", "async function saveCollectionData() {\n await updateDoc(doc(db, \"spaces\", spaceId), {\n collections: arrayUnion(title)\n }).then(() => {\n console.log(\"Data saved\");\n\n // Update current space\n updateCurrentSpace(spaceId);\n }).catch((error) => {\n console.log(error);\n });\n }", "function saveRecord() {\n\n var finalP = finalPrice.toString();\n var op = parseFloat(enteredPrice);\n \n setRecord((record) => [...record, enteredPrice]);\n setRecord((record) => [...record, discount]);\n setRecord((record) => [...record, finalP]);\n setIndex(index + 1);\n //setDisplay();\n }", "function save(data) {\n if (data.id) {\n return update(data.id, data).then(function (result) {\n return data;\n });\n } else {\n return create(data).then(function (result) {\n data.id = result.id;\n return data;\n });\n }\n }", "saveItem(event, data) {\n data = convertToLowerCase(data);\n itemsDB.insert(data, (err, newDoc) => {\n yearsDB.find({}, (err, docs) => {\n docs.forEach(doc => {\n let setupData = {\n item: newDoc._id,\n year: doc._id,\n rent: 1,\n avakHammali: 1,\n javakHammali: 1\n };\n setupsDB.insert(setupData, (err, newDoc) => {\n let response = {};\n response.error = err;\n this.mainWindow.webContents.send('saveItemResponse', response);\n });\n });\n });\n });\n }", "function saveData(id)\n\t{\n\t\tvar f = document.fuploadr;\n\t\tvar data = ImageStore[id];\n\t\t\n\t\tdata.title\t\t = f.title.value;\n\t\tdata.description = f.description.value;\n\t\tdata.tags\t\t = f.tags.value;\n\t\tdata.is_public\t = getChecked(f.is_public, 0);\n\t\tdata.is_friend\t = getChecked(f.is_friend, 0);\n\t\tdata.is_family\t = getChecked(f.is_family, 0);\n\t\tdata.safety_level = f.safety_level.value;\n\t\tdata.hidden\t\t = getChecked(f.hidden, 1);\n\t\t//data.content_type = f.content_type.value;\n\t}", "function saveExtract(data) {\n var extract = new Extract({\n user: Mongoose.mongo.ObjectId('57d5f6d9bbd72a1f3b85f106'),\n data: [data]\n });\n extract.save((err) => {\n if (err) console.log(err);\n });\n\n}", "function save(){\r\n\tconsole.log(\"Auto-saving Database..\");\r\n\tjsonfile.writeFile(\"./channels.json\", channels, function (err) {\r\n\t\tif (err){\r\n\t\t\tconsole.log(err);\r\n\t\t}\r\n\t})\r\n\tchanges=false;\r\n\tconsole.log(\"Autosave Complete\");\r\n}", "saveData(){\n\t\t\t\tlocalStorage.clear();\n\t\t\t\tlet postData = {\n\t\t\t\t\t\t\t\t\t invoice: {\n\t\t\t\t\t\t\t\t\t customers: [\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t name: this.state.name,\n\t\t\t\t\t\t\t\t\t email: this.state.email,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdate: window.selectedDate,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tamountTotal: this.state.amountTotal.toFixed(2),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlineItems: this.state.lineItemsArray\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\tlocalStorage.setItem('storeData', JSON.stringify(postData));\n\t\t\t\tnotify.show(\"Invoice successfully saved/sent\", \"success\", 2000,\"#0E1717\");\n\t\t\t\twindow.setTimeout(function(){location.reload()},1000)\n\t\t}", "function save() {\n try {\n let mydata = JSON.stringify(obj);\n fs.writeFile(\"database2.json\", mydata, \"utf8\", () => {});\n } catch (error) {\n console.log(error);\n }\n}", "async save() {\n const options = {\n TableName: process.env.userTableName,\n Item: ddb.prepare(this.toJSON())\n };\n await ddb.call('putItem', options);\n return this.toJSON();\n }", "_saveData(){\n this.forwardButton.classList.remove('inactive');\n this.backButton.classList.remove('inactive');\n this.homeContainer.classList.remove('inactive');\n this.homeContainer.innerHTML = \"HOME\";\n const entry = this.diaryEntry.value;\n this.diaryService.post(this.journalID,this.date, this.promptIndex,entry);\n }", "function saveTweetIntoDataBase(avatar, tweetid, username, name, tweet, favorites, retweets, dateTweeted) {\n const newTweet = new db.Tweet({ avatar: avatar, tweetid: tweetid, username: username, name: name, tweet: tweet, favorites: favorites, retweets: retweets, dateTweeted: dateTweeted, dateObject: moment(dateTweeted).toDate()});\n newTweet.save((err) => {\n console.log('tweet saved');\n })\n}", "function _saveDataToFile(data){\n\n}", "function saveDrawnInstituteToDatabase() {\n // test, if textfields are filled out properly\n if(checkInput()){\n // retrieve the geometry out of the drawnItems\n var institutgeoJSON = drawnItems.toGeoJSON();\n // add properties\n institutgeoJSON.features[0].properties.name=neu.myName;\n institutgeoJSON.features[0].properties.img=neu.url;\n // create new databaseobject-object and later will the param json\n neu.json = JSON.stringify(institutgeoJSON);\n sendData();\n }\n}", "function saveData(data){\n\n try {\n fs.writeFile('public/json/current_inquiry.json', JSON.stringify(data), (err) => {\n if(err)\n throw err;\n console.log('Data Saved');\n });\n } catch(err) {\n console.log(err);\n }\n}", "function saveNewOp() {\n let newEntry = {\n date: new Date().toJSON(),\n cat: pageDialog.category.value,\n amount: pageDialog.amount.value,\n desc: pageDialog.desc.value\n };\n entriesDb.insert(newEntry);\n displayEntries();\n }", "save() {\n this._toggleSaveThrobber();\n try {\n this._readFromForm();\n var resp = this.dao.save();\n if (!resp) {\n alert(\"Error while saving taxon.\")\n } else {\n var jsonObj = JSON.parse(resp);\n if (jsonObj[0].response == false ) {\n alert(jsonObj[1].response);\n } else {\n console.log(this.dao)\n // make sure the latin name input field is showing the correct name, reload data from server\n document.getElementById('latin_name').value = this.dao.unique_name;\n alert('Saved');\n }\n }\n } catch(e) {\n alert(e);\n console.log(e);\n }\n this._toggleSaveThrobber();\n }", "function putEntry(data) {\n db.get(\"data_entries_point\").push(data).write();\n}", "save() {\n if (this._history.length > 9){\n this._history.shift();\n }\n this._history.push(this.internalData);\n // Make the commit to setup the index and the state\n this.commit();\n }", "function saveObjectIntoDB(Object){\r\n\r\nconsole.log(\"saved: \"+Object);\r\nObject.save(function(error) {\r\n if (error) {\r\n console.error(error);\r\n return false;\r\n }\r\n })\r\n return true;\r\n \r\n}", "function saveObjectIntoDB(Object){\r\n\r\nconsole.log(\"saved: \"+Object);\r\nObject.save(function(error) {\r\n if (error) {\r\n console.error(error);\r\n return false;\r\n }\r\n })\r\n return true;\r\n \r\n}", "guardarDB (){\n const payload ={\n historial: this.historial\n };\n\n fs.writeFileSync(this.dbPath, JSON.stringify(payload));\n\n }", "function save(key, value) { return local.save(key, value); }", "function save() {\n vm.donateModel.post().then(function () {\n Materialize.toast('Animal cadastrado com sucesso.', 3000);\n $location.path('/core/animals');\n });\n }", "async function saveCollectionData() {\n await updateDoc(doc(db, \"collections\", collectionId), {\n resources: arrayUnion(title)\n }).then(() => {\n console.log(\"Data saved\");\n\n // Update current space\n updateCollection(collectionId);\n }).catch((error) => {\n console.log(error);\n });\n }" ]
[ "0.75214964", "0.7456907", "0.7452484", "0.73422784", "0.73188263", "0.7239271", "0.71831363", "0.7061881", "0.70491725", "0.69115555", "0.68896484", "0.68648165", "0.68035847", "0.6792386", "0.6764229", "0.6759208", "0.6720696", "0.67119277", "0.66773874", "0.6663222", "0.66493565", "0.6622191", "0.661598", "0.66023624", "0.65963376", "0.65676916", "0.65311295", "0.65207654", "0.6517373", "0.65068954", "0.6490796", "0.64791834", "0.6472962", "0.64679444", "0.64618534", "0.6455969", "0.6452022", "0.6430149", "0.6427644", "0.64179057", "0.64051193", "0.64033914", "0.6401679", "0.6400411", "0.6399285", "0.63760424", "0.63718146", "0.6370844", "0.6368107", "0.6356357", "0.6349792", "0.6345599", "0.6320124", "0.6318499", "0.6313412", "0.628754", "0.6271244", "0.6269613", "0.6264669", "0.6262003", "0.6256231", "0.62527114", "0.6247712", "0.6239349", "0.6232584", "0.6228496", "0.6221251", "0.6219829", "0.62188673", "0.6216067", "0.6212334", "0.62052894", "0.6198632", "0.61981696", "0.619611", "0.6195499", "0.6194236", "0.6186152", "0.61767924", "0.61763537", "0.61632246", "0.6159111", "0.6158609", "0.6152484", "0.61468476", "0.6145339", "0.6141113", "0.6135318", "0.6134215", "0.61136824", "0.60944796", "0.6094179", "0.6093991", "0.6091971", "0.6085045", "0.60841453", "0.60841453", "0.6082843", "0.6080174", "0.6080076", "0.60757655" ]
0.0
-1
Add an outgoing command to the commandqueue
addToQueue(f, pushFront = false) { if (pushFront) { this.commandQueue.unshift(f); } else { this.commandQueue.push(f); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMpd(cmd, arg1, arg2){\n\t\targ1 = arg1 || null;\n\t\targ2 = arg2 || null;\n\t\n\t\tif(addqueue.length == 0){\n\t\t\taddqueue.push({command: cmd, arg1: arg1, arg2: arg2});\n\t\t\tstartCommandQueue(); \n\t\t}\n\t\telse{\n\t\t\taddqueue.push({command: cmd, arg1: arg1, arg2: arg2});\n\t\t}\n\t}", "function queueCommands() {\n app\n .command('queue <cmd>')\n .description('Interract with the queue')\n .action(queueActions)\n}", "[types.ADDMESSAGEQUEUE](state, queue) {\n state.messageQueue.push(queue)\n }", "queueGo() {\n let commands = [wcCommands.go()];\n\n this.queue.push(...commands);\n\n debug('Queueing Go Command');\n }", "addCommand(command) {\n this.buffer.push(command)\n }", "function sendQueueEntry() {\n if (this._is_connected && this._queue.length) {\n this._uniqueSocket.write(this._queue[0][0], this._encoding, () => {\n\n // Get rid of sent message only if write was successful.\n let shifted_entry = this._queue.shift();\n\n // Second element of queue entry can be resolve function of promise,\n // if entry was pushed to queue as a result of IpcClient#whenEmitted call.\n if (shifted_entry[1] !== null && typeof shifted_entry[1] === \"function\") {\n shifted_entry[1](); // Resolve promise.\n }\n\n if (!this._queue.length) {\n this._emptying_queue = false;\n }\n else {\n sendQueueEntry.call(this);\n }\n });\n }\n else {\n this._emptying_queue = false;\n }\n}", "push(_function, _arguments) {\n if (typeof _arguments !== 'undefined') {\n this.commandQueue.push([_function, _arguments]);\n }\n else {\n this.commandQueue.push(_function);\n }\n }", "function sendBcastQueueEntry() {\n if (this._is_connected && this._bcast_queue.length) {\n this._bcastSocket.write(this._bcast_queue[0][0], this._encoding, () => {\n\n // Get rid of sent message only if write was successful.\n let shifted_entry = this._bcast_queue.shift();\n\n // Second element of queue entry can be resolve function of promise,\n // if entry was pushed to queue as a result of IpcClient#whenEmitted call.\n if (shifted_entry[1] !== null && typeof shifted_entry[1] === \"function\") {\n shifted_entry[1](); // Resolve promise.\n }\n\n if (!this._bcast_queue.length) {\n this._emptying_bcast_queue = false;\n }\n else {\n sendBcastQueueEntry.call(this);\n }\n });\n }\n else {\n this._emptying_bcast_queue = false;\n }\n}", "function push(cmd, data, cb) {\n // Insure that we have minimally empty data and default callback \n data = data || {};\n cb = cb || function(err) {\n if (err) console.log(err);\n };\n\n // Lookup the layout of this command/request\n var tapi = api[cmd] === undefined ? null : api[cmd];\n if (!tapi) {\n cb(new Error(\"Invalid command '\" + cmd + \"'\"), {});\n return;\n }\n\n buildRequest(tapi, data, (err, options) => {\n if (err) { // ut-oh - got an error building the request\n cb(err, options);\n return;\n }\n else { // Push on the queue\n trelloEntries.push({\n byatc: {\n cmd: cmd,\n log: cmd + ': '\n },\n options: options,\n cb: cb\n });\n }\n });\n\n\n }", "sendTo(target, command, message, callback) {\n const stateChangedHandler = (id, state) => {\n if (id === `messagebox.${fromAdapterID}`) {\n callback(state.message);\n this.removeListener(\"stateChange\", stateChangedHandler);\n }\n };\n this.addListener(\"stateChange\", stateChangedHandler);\n this.dbConnection.pushMessage(`system.adapter.${target}`, {\n command: command,\n message: message,\n from: fromAdapterID,\n callback: {\n message: message,\n id: this.sendToID++,\n ack: false,\n time: Date.now(),\n },\n }, (err, id) => console.log(\"published message \" + id));\n }", "function queue(data, callback)\n\t{\n\t\tvar command = {data: data, callback: callback};\n\n\t\t// TODO not always safe -- producer/consumer problem, may run into a deadlock...\n\n\t\t// immediately post message if the queue is empty\n\t\tif (_.isEmpty(_commandQueue))\n\t\t{\n\t\t\t// add the command to the map to access the callback when \"done\"\n\t\t\t_commandMap[command.data.scriptId] = command;\n\t\t\t// send the command\n\t\t\t_targetWindow.postMessage(data, _origin);\n\t\t}\n\t\t// add command to the queue (message will be post after a \"done\" event)\n\t\telse\n\t\t{\n\t\t\t// add the command to the queue\n\t\t\t_commandQueue.push(command);\n\t\t}\n\t}", "commandsQueue(commandObj) {\n\t\tlet self=this;\n\t\tfor(let command in commandObj) {\n\t\t\t/*\n\t\t\t * DEFINE.COMMAND_INSTANT, basically a queue item we need to get running\n\t\t\t */\n\t\t\tif(commandObj[command].options.queueRun===self.DEFINE.COMMAND_INSTANT) {\n\t\t\t\tself.queue.push(self.deepCopy(commandObj[command]));\n\t\t\t}\n\t\t\t/*\n\t\t\t * Is the a prepare queue that will be triggered at some later stage\n\t\t\t */\n\t\t\tif(commandObj[command].options.queuePrepare!== undefined) {\n\t\t\t\tself.prepare[commandObj[command].options.queuePrepare]=self.deepCopy(commandObj[command]);\n\t\t\t\tconsole.log('Added Prepared Queue ['+commandObj[command].options.queuePrepare+']');\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * Trigger a queue process\n\t\t */\n\t\tself.queueProcess();\n\t}", "sendConsoleCmd(cmd){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"EXEC\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t\tparams: cmd\n\t\t});\n\n\t\tthis.activeConnection.commands.push(cmd);\n\t}", "function pushWriteRequest(cmd){\n\tif(writeBuffer.length < BUFFER_SIZE){\n\t\twriteBuffer.push(cmd);\n\t}\n}", "queue(action){\n Mediator.queue.push(action);\n }", "processCommand() {\n if (this.command_stack.length > 0) {\n // check if writing is locked\n if (this.lock === false) {\n // not locked - issue a command and lock the write process\n let command = this.command_stack[0];\n command.processed_at = new Date();\n this.write(command.command);\n this.lock = true;\n } else {\n setTimeout(this.processCommand.bind(this), this.next_command_delay);\n }\n } else {\n // no commands in the stack - unlock command write access\n this.lock = false;\n }\n }", "function handleCommand(data) {\n\t\tcID++;\n\t\tvar channel = data.channel;\n\t\tvar command = {\n\t\t\tid: cID,\n\t\t\tcommand: data.input\n\t\t};\n\t\tcommands[channel].push(command);\n\t\tif(commands[channel][commands[channel].length - 1] === command) {\n\t\t\tsendToReceivers(channel, 'command', commands[channel][commands[channel].length - 1]);\n\t\t}\n\t\tupdateSockets();\n\t}", "function write() {\n\t// Bail if the write queue is invalid\n\tif (!check_queue_write()) return;\n\n\t// Create message from buffer\n\tlet buffer = proto.proto.create(intf.intf.queue_write[intf.intf.queue_write.length - 1]);\n\n\tif (typeof buffer === 'undefined' || buffer === null || buffer === '') return;\n\n\tintf.intf.port.write(buffer, (error) => {\n\t\t// Bail and retry if there was a write error\n\t\tif (error) {\n\t\t\terror_out('writing', error);\n\n\t\t\t// Re-kick it\n\t\t\tsetImmediate(write);\n\n\t\t\treturn;\n\t\t}\n\n\t\tintf.intf.port.drain(() => {\n\t\t\t// After a successful write and drain, remove the last element from the write queue\n\t\t\tintf.intf.queue_write.pop();\n\n\t\t\t// Re-kick it\n\t\t\t// setImmediate(write);\n\t\t\tprocess.nextTick(write);\n\t\t});\n\t});\n}", "sendCommand(command) {\n command._src = this.config.src;\n function commandErrorHandler(err) {\n debug('COMMAND ERROR')\n debug(err, command)\n if (err instanceof timeout) {\n console.error('Timeout: ', command);\n } else {\n console.log(err);\n }\n }\n // Send command with promised reply\n // If you use this function, use it exclusively and don't forget to call _onData() if you override onData()\n\n var promise = timeout(new Promise((resolve, reject) => {\n command.resolve = resolve;\n command.reject = reject;\n }), this.config.timeout)\n .catch(commandErrorHandler);\n\n // use the command chain to send command only when previous commands have finished\n // this way replies can be correctly attributed to commands\n this.commandChainPromise = this.commandChainPromise\n .then(() => {\n this.lastCommand = command;\n debug('SET LAST COMMAND')\n return new Promise((resolve,reject)=> {\n debug(new Buffer.from(command.toBuffer()))\n this.ser.write(command.toBuffer(),(err)=>{\n if(err) {\n reject(err)\n } else {\n resolve()\n }\n });\n });\n })\n .then(() => promise)\n\n //.then(()=>process.exit(1))\n return promise\n //.then(()=>console.log('WEEEEEEEEEEEEEEE ARE RESOLVED'))\n .catch(commandErrorHandler);\n }", "addConnCommand(key, value) {\n if (this._msgCommand == null) {\n this._msgCommand = {};\n }\n if (key != null) {\n this._msgCommand[key] = value;\n }\n this.requireSend();\n }", "registerCommand(command){\n this.get('commands').push(command);\n\n command.register && command.register(this);\n }", "_addToQue(...args) {\n let method = args[0].shift();\n this.quedTasks.push({\n method: method,\n args: args[0]\n });\n }", "add(item) {\n\t\tthis.queue.set(item, item);\n\t}", "function add_queue(id){\n\n socket.emit('add_student', {\"net_id\":id.id});\n}", "AddToQueue(song, msg) {\n if(this.queue.length < 1) {\n this.queue.push(song);\n this.Play(msg);\n }\n else {\n msg.channel.send(\"`\" + song.name + \"` **added to queue.**\");\n this.queue.push(song);\n }\n }", "_distributeMessage(command, msg) {\n var message = {\n command: command,\n data: msg\n }\n message = JSON.stringify(message);\n Object.keys(this._connections).forEach(function(key) {\n var socket = this._connections[key].socket;\n socket.write(message);\n }, this);\n }", "_emitCommandsd() {\n const commands = [];\n\n for (const [cmd, { description }] of this.commands) {\n commands.push({ cmd, description });\n }\n\n process.send({ type: 'commands', commands });\n }", "function add(){\n var str = base64.encode(new Date().valueOf());\n queueSvc.createMessage(\"zhf-bash-1-queue\", str, function(error, results, response){\n if(!error){\n console.log(\"Success - createMessage\");\n } else {\n console.error(\"Error - createMessage\", error);\n }\n });\n}", "addnew() { return this.append(basics.objapply(BotCommand, [this.bot].concat(Array.from(arguments)))); }", "addCommand(name, command) {\n\t\tconst comm = new command(this);\n\t\tcomm.name = name;\n\t\tthis.commands.push({\n\t\t\tname: name,\n\t\t\tcommand: comm\n\t\t});\n\t}", "add(newItem) {\n // Create a new Node from the item received\n const node = new Node();\n node.set(newItem);\n\n // If the queue head is empty, add the new item received to the head and the tail\n if (this.head == null) {\n this.head = node;\n this.tail = node;\n\n // Log out the operation\n console.log('Item with ID : ' + this.head.data['id'] + ' and name ' + this.head.data['name'] + ' added to head. Total number in the queue: ' + this.count());\n\n // Begin emitting objects for the attached observer\n if (this.observer != null) {\n\n // Setup a timer to pop every 300 ms\n // this.timer.subscribe(this.this$PiFrame.timerSubscription);\n this.timerSubscription = this.timer.subscribe(() => this.executeSubscription(), () => {}, () => {});\n }\n } else {\n\n // Set the new received node as the 'next' node of the current node\n this.tail.next = node;\n\n // Update the current tail with the one received\n this.tail = node;\n\n // Log out the operation\n console.log('Item with ID : ' + this.tail.data['id'] + ' and name ' + this.tail.data['name'] + ' added to tail. Total number in the queue: ' + this.count());\n }\n }", "function addTweetToQueue(e) {\n if (isReply(e)) {\n // eslint-disable-next-line no-console\n console.log('====================')\n // eslint-disable-next-line no-console\n console.log(`=IS REPLY RETURNING=`)\n // eslint-disable-next-line no-console\n console.log('====================')\n return\n }\n tweets.push({\n tweet: e.text,\n tweetId: e.id_str,\n user: e.user.screen_name,\n timeIn: new Date(newTimeIn()),\n timeOut: new Date(newTimeOut()),\n event: e // EVERYTHING!!!\n })\n // eslint-disable-next-line no-console\n console.log(`Item added to queue, current length=${tweets.length}`)\n}", "send (message, reactions, saveId) {\r\n console.log(`Sending '${message}'`);\r\n this.sendQueue.push({\r\n message: message,\r\n reactions: reactions,\r\n saveId: saveId\r\n });\r\n }", "addCommand(command) {\n if (!(command instanceof Yuuko_1.Command))\n throw new TypeError('Not a command');\n for (const name of command.names) {\n for (const otherCommand of this.commands) {\n if (otherCommand.names.includes(name)) {\n throw new TypeError(`Two commands have the same name: ${name}`);\n }\n }\n }\n this.commands.push(command);\n this.emit('commandLoaded', command);\n return this;\n }", "function bufferMessage(depId, msg, seq) {\n state.buffer.push({ depId: depId, msg: msg, seq: seq })\n }", "handleOutboundInput() {\n for (var x = 0; x < this.outboundMessages.length; x++) {\n this.socket.emit(this.outboundMessages[x].command, this.outboundMessages[x].data);\n }\n this.outboundMessages = [];\n }", "function sendCmd(deviceName, commandID) {\n Scheduler.queue(\"command\", deviceName, commandID);\n}", "add(element) { \n // adding element to the queue \n this.items.push(element); \n }", "startCommandQueue() {\n setTimeout(() => {\n let hasFunc = false;\n // Start an interval that every 100ms attempts to send a beam-chat-api command\n this.commandQueueInterval = setInterval(() => {\n if (this.socket) {\n let fn = this.commandQueue.shift();\n if (fn) {\n fn();\n hasFunc = true;\n }\n else if (hasFunc) {\n console.log(\"Queue is Empty\");\n hasFunc = false;\n }\n }\n }, 100);\n }, 1000);\n }", "enqueue(item) {\n this.items.push(item); // adds an item to the queue\n }", "_enqueueCommand(method, params, sessionId, callback) {\n const id = this._nextCommandId++;\n const message = {\n id,\n method,\n sessionId,\n params: params || {}\n };\n this._ws.send(JSON.stringify(message), (err) => {\n if (err) {\n // handle low-level WebSocket errors\n if (typeof callback === 'function') {\n callback(err);\n }\n } else {\n this._callbacks[id] = callback;\n }\n });\n }", "write(cb) {\n getQueue().write(cb);\n }", "queueMessage(type='empty', message='', duration=1500) {\n if (type !== 'empty' && this.queue.length + 1 <= this.queueLimit) {\n this.queue.push({ type, message, duration, active: false, done: false });\n }\n\n let current = this.queue[0]; \n if (current && !current.active && !current.done) {\n this.queue[0].active = true;\n this.show(current.type, current.message, current.duration, function() {\n this.queue[0].done = true;\n this.queue.shift();\n this.queueMessage();\n });\n }\n\n }", "function fx_add_to_queue(fx, args) {\n var chain = fx.ch, queue = fx.options.queue;\n\n if (!chain || fx.$ch) {\n return (fx.$ch = false);\n }\n\n if (queue) {\n chain.push([args, fx]);\n }\n\n return queue && chain[0][1] !== fx;\n}", "function sendWriteRequest(){\n\tif(typeof(socket) != 'undefined' && writeBuffer.length > 0){\n\t\tsocket.emit('command', writeBuffer.shift());\n\t}\n}", "enqueueTask(task) {\n const { queue: q , requestFlush } = this;\n if (!q.length) {\n requestFlush();\n this.flushing = true;\n }\n // Equivalent to push, but avoids a function call.\n q[q.length] = task;\n }", "queueReverse(){}", "function attachToQueue() {\n const queue = queues['makeOfferQueue']\n queue.process(processor)\n queue.resume() // Start if paused\n}", "function addToMessageQueue(element)\n{\n messageQueue[messageQueue.length] = element;\n if(messageQueue.length == 1) functionNexMessage();\n}", "enqueue(newItem) {\n this.q.push(newItem)\n }", "addTransactionToQueue(transaction){\n this.transactionQueue.push(transaction)\n }", "sendCommand(command) {\n console.log('INFO: Invoke command: ', command)\n console.log('INFO: Preparer: ', prepareMessages)\n \n var message = prepareMessages.format(command);\n if (message) {\n console.log(\"INFO: Process command: \" + command, message);\n\n if (this.writeCharacteristic) {\n this.writeCharacteristic.write(message, false, function(err) {\n if (!err) {\n console.log('INFO: Command sent');\n }\n else {\n console.log('ERROR: Error sending command');\n }\n });\n } else {\n console.log('ERROR: Error sending command');\n }\n }\n }", "unshift(_function, _arguments) {\n if (typeof _arguments !== 'undefined') {\n this.commandQueue.unshift([_function, _arguments]);\n }\n else {\n this.commandQueue.unshift(_function);\n }\n }", "function enqueue(msg)\n\t {\n\t queue.push(msg);\n\t if (!tickUpcoming) {\n\t setImmediate(tick);\n\t }\n\t }", "function enqueue(msg)\n\t {\n\t queue.push(msg);\n\t if (!tickUpcoming) {\n\t setImmediate(tick);\n\t }\n\t }", "async executeSocketCommand(cmd) {\n\n let cmdPromise = new B((resolve) => {\n logger.debug('COMMAND: ' + cmd);\n\n var totaldata = [];\n var endMarker = new Buffer(\"youiend\");\n let socketClient = this.socket;\n\n let dataHandler = function(data) {\n\n // logger.debug('RESPONSE: ' + data);\n // determine if this includes an end parker\n // get last few values of buffer\n if (data.length >= endMarker.length) {\n var dataend = new Buffer(endMarker.length);\n var startIndex = data.length - endMarker.length;\n data.copy(dataend, 0, startIndex, startIndex + endMarker.length);\n //logger.debug('DATAEND' + dataend.toString());\n if (dataend.equals(endMarker)) {\n // remove data end\n var lastData = data.slice(0, startIndex);\n //logger.debug('LAST DATA: ' + lastData.toString());\n totaldata.push(lastData);\n\n //remove handler\n socketClient.removeListener('data', dataHandler);\n\n // resolve\n resolve(Buffer.concat(totaldata));\n }\n else {\n totaldata.push(data);\n }\n }\n };\n\n socketClient.write(cmd, \"UTF8\",() => {\n\n socketClient.on('data', dataHandler);\n\n });\n });\n\n\n\n return await cmdPromise;\n }", "enqueue(item) {\n this.queue.push(item);\n this.size += 1;\n }", "function Queues(){}", "function executeQueuedCommands() {\n console.log('executing queued commands');\n\n _commandPhase.forEach(function(playerKey) {\n var playerPhase = _gamePhase[playerKey];\n var parsedCmd = playerPhase.commandQueue.shift();\n\n if (parsedCmd !== undefined) {\n var commandFunction = commandObj[parsedCmd.command];\n commandFunction(playerPhase.character, parsedCmd.command, parsedCmd.argument, playerPhase.socket)\n }\n });\n }", "function PutDestinationCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "add(job) {\n this.queue.push(job);\n }", "addCommand(commandType, callback) {\n this.commands.push({\n type: commandType,\n callback: callback,\n })\n }", "function add () {\n if(queue.length)\n append(content, render(queue.shift()), top, sticky)\n }", "function add () {\n if(queue.length)\n append(content, render(queue.shift()), top, sticky)\n }", "processNextCommand() {\n var nextCmd = this._script.commands.shift();\n if (! nextCmd) {\n return;\n }\n\n // Process the next command when the current\n // command resolves.\n $.when(this.commandHandler.handle(nextCmd)).then(() => {\n this.processNextCommand();\n });\n }", "append(cmd)\n\t{\n\t\tconst err = types.typecheck(BotCommand, cmd);\n\t\tif (err.verify())\n\t\t{\n\t\t\tthis.commands.push(cmd);\n\t\t\treturn excd.cs[0]\n\t\t}\n\t\treturn err;\n\t}", "function send(buffer) {\n\t// Add buffer to the beginning of the write queue\n\tintf.intf.queue_write.unshift(buffer);\n\n\t// Start write process if need be\n\tif (intf.intf.writing === false) write();\n}", "function shiftQueue(){\n\t\t\t\t\tvar q = queue.shift();\n\t\t\t\t\tvar uri = q[0], func = q[1], args = q[2];\n\t\t\t\t\tfunction callback( value, func ){\n\t\t\t\t\t\tfunc = func || 'onResult';\n\t\t\t\t\t\t// ensure callback isn't executed twice\n\t\t\t\t\t\tif( uri !== null ){ \n\t\t\t\t\t\t\tclearTimeout(t);\n\t\t\t\t\t\t\tresponseMessage = amf.message( value, uri+'/'+func, '' );\n\t\t\t\t\t\t\tresponsePacket.messages.push( responseMessage );\n\t\t\t\t\t\t\turl = null;\n\t\t\t\t\t\t\tif( ++processed === qlen ){\n\t\t\t\t\t\t\t\trespond();\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\tfunction onTimeout(){\n\t\t\t\t\t\tcallback('method timeout', 'onStatus');\n\t\t\t\t\t}\n\t\t\t\t\t// hand off to method - any return value other than undefined assume to be a syncronous method\n\t\t\t\t\ttry {\n\t\t\t\t\t\targs.unshift( callback );\n\t\t\t\t\t\tvar t = setTimeout( onTimeout, timeout || 10000 );\n\t\t\t\t\t\tvar value = func.apply( null, args );\n\t\t\t\t\t\tif( value !== undefined ){\n\t\t\t\t\t\t\tcallback( value );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch( Er ){\n\t\t\t\t\t\tconsole.warn('Error on AMF method: ' + Er.message);\n\t\t\t\t\t\tcallback( Er.message, 'onStatus' );\n\t\t\t\t\t}\n\t\t\t\t}", "async triggerOutgoingHandlers() {\n let buffer;\n do {\n if (this.executingOutgoingHandlers >= this.concurrency) {\n return;\n }\n buffer = this.outgoing.shift();\n if (buffer) {\n this.triggerOutgoingHandler(buffer);\n }\n } while (buffer);\n }", "async triggerOutgoingHandlers() {\n let buffer;\n do {\n if (this.executingOutgoingHandlers >= this.concurrency) {\n return;\n }\n buffer = this.outgoing.shift();\n if (buffer) {\n this.triggerOutgoingHandler(buffer);\n }\n } while (buffer);\n }", "commandsBind(commandObj) {\n\t\tlet self=this;\n\t\tfor(let command in commandObj) {\n\t\t\t/*\n\t\t\t * Bind queue elements will not me marked to run instantly so we pick those\n\t\t\t */\n\t\t\tif(commandObj[command].options.queueRun!==self.DEFINE.COMMAND_INSTANT) {\n\t\t\t\t/*\n\t\t\t\t * Find its dom entry using the selector we added\n\t\t\t\t */\n\t\t\t\tlet element=self.getElement(\"[data-queueable=CMD\"+commandObj[command].ucid+\"]\");\n\n\t\t\t\t/*\n\t\t\t\t * Add the event. We flip it over to an instant event now because we want\n\t\t\t\t * it triggered.\n\t\t\t\t *\n\t\t\t\t * The user may have specified an event and if so it will be a comma separated list\n\t\t\t\t */\n\t\t\t\tlet event=commandObj[command].options.queueEvent||\"click\";\n\t\t\t\tlet events=event.split(\",\");\n\t\t\t\tfor(let e in events) {\n\t\t\t\t\telement.addEventListener(events[e], function () {\n\t\t\t\t\t\tcommandObj[command].options.queueRun = self.DEFINE.COMMAND_INSTANT;\n\t\t\t\t\t\tself.commandsQueue.apply(self, [[commandObj[command]]]);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "addToWaitingResponseQueue(action) {\n if (this.queueForWaitingResponse.indexOf(action) === -1) {\n this.queueForWaitingResponse.push(action);\n }\n }", "async processQueue() {\n // Only process if the shouldProcessQueue flag is set, and if the queue is\n // not empty.\n if (!this.shouldProcessQueue || this.queue.length === 0) {\n return;\n }\n\n const {\n action: {\n meta: {\n optimistic: { command }\n }\n },\n stateChange\n } = this.queue.shift();\n\n try {\n await this.api(...command);\n } catch (err) {\n console.warn(`Error calling API: ${JSON.stringify(err)}`);\n this.onError(err, stateChange);\n }\n await new Promise(resolve => setTimeout(resolve(), 500));\n this.processQueue();\n }", "function sendCmd(cmd) {\n if (sb) {\n console.log('Send ' + cmd);\n sb.send(\"cmdString\", \"string\", cmd);\n }\n}", "addQueue (fbID, reqUser) {\n redis.getHash(reqUser)\n .then(list => {\n list.userQueue += `,${fbID}`;\n redis.setHash(reqUser , list);\n });\n }", "async processQueue () {\n if (this.queue.length > 0) {\n const sendPayload = JSON.stringify(this.queue.pop())\n await this.matrix.sendMessage(this.roomId, 'm.action', sendPayload)\n }\n if (this.queue.length === 0) {\n this.processing = false\n }\n }", "function SendCommand() {\n\t// Don't send any message if not connected.\n\tif (clc.state < CA.CONNECTED) {\n\t\treturn;\n\t}\n\n\tCreateNewCommands();\n\tWritePacket();\n}", "createQueueItem(newQueueItem) {\n return this.perform('post', '/queue', newQueueItem);\n }", "_addTxOutItem(userKey, amount){\n\t\tthis.txOut.push({key: userKey, amount: amount});\n\t}", "function addToQueue(addMsg){\n\t\tfor (var i = 0; i < msgQueue.length; i++){\n\t\t\tvar msg = msgQueue[i];\n\t\t\tif (addMsg.timetag < msg.timetag){\n\t\t\t\tmsgQueue.splice(i, 0, addMsg);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t//otherwise add it to the end\n\t\tmsgQueue.push(addMsg);\n\t}", "addMessage(message, priority = false){\n priority ? this.msgQueue.unshift(message) : this.msgQueue.push(message);\n\n //se o loop estiver parado, reinicia\n if( ! this.chatLoop ){\n this.chatLoop = this.startLoop();\n }\n }", "function sendCommand(commandNum) {\n //console.log('In sendCommand. Command: ' + commandNum);\n sp.open(function(error) {\n if (error) {\n console.log('There was an error');\n } else {\n //console.log('Open');\n sp.write(commandNum);\n console.log('Sent Command ID: ' + commandNum);\n }\n });\n}", "enqueue(data) {\n if (this.hasRoom()) {\n this.queue.addTail(data);\n this.size++;\n console.log(\n `'${data}' was added to the queue! The queue is now ${this.size}`\n );\n } else throw new Error(`The Queue has no more room to add new data!`)\n }", "function move(command) {\r\n socket.send(command);\r\n}", "get isCommandsQueueEnabled() {\n return false;\n }", "addCommand(name, func) {\n return this.commands.push({\n name: name,\n func: func\n });\n }", "function onOutgoingSipMessage(sipRequestAsReceived, prSipResponse) {\n sendMessage.evtOutgoingMessage.post({\n \"sipRequest\": sipRequestAsReceived,\n prSipResponse: prSipResponse\n });\n}", "addMessage(message) {\n // this.newMessages.next(message);\n // HACK: REPLACE this SERVICE IT IS DEFUNCT... FOR NOW just bypass\n this.chat.sendMsg(message);\n }", "function requestqueue() {\n\t\t// If the queue is already running, abort.\n\t\tif(requesting) return;\n\t\trequesting = true;\n\t\tlink.request({\n\t\t\turl: \"api/events\",\n\t\t\tmethod: \"POST\",\n\t\t\tparams: {\n\t\t\t\tsid: gSessionID\n\t\t\t},\n\t\t\tcallback: queuecallback\n\t\t});\n\t}", "addTarget(id) {\n if (!this.targetQueue.includes(id)) {\n this.targetQueue.push(id);\n }\n this.target = getPlayerById(this.targetQueue[0]);\n this.printCurrentTarget();\n }", "function handleBcastQueue() {\n if (this._is_connected && this._bcast_queue.length && !this._emptying_bcast_queue) {\n this._emptying_bcast_queue = true;\n sendBcastQueueEntry.call(this);\n }\n}", "commandTimeout() {\n // if there are commands in the queue - pop the earliest command from the queue as a timeout\n if (this.command_stack.length > 0) {\n let last_command = this.command_stack.shift();\n this.log(`command ${last_command.command} timed out`);\n last_command.response_at = new Date();\n this.emit('timeout', last_command);\n this.lock = false;\n setTimeout(this.processCommand.bind(this), this.next_command_delay);\n }\n }", "function add_to_queue(video, message) {\r\n\r\n\tif(aliases.hasOwnProperty(video.toLowerCase())) {\r\n\t\tvideo = aliases[video.toLowerCase()];\r\n\t}\r\n\r\n\tvar video_id = get_video_id(video);\r\n\r\n\tytdl.getInfo(\"https://www.youtube.com/watch?v=\" + video_id, (error, info) => {\r\n\t\tif(error) {\r\n\t\t\tmessage.reply(\"La vidéo n'a pas été trouvé\");\r\n\t\t} else {\r\n\t\t\tqueue.push({title: info[\"title\"], id: video_id, user: message.author.username});\r\n\t\t\tmessage.reply('\"' + info[\"title\"] + '\" a été ajouté à la liste');\r\n\t\t\tif(!stopped && !is_bot_playing() && queue.length === 1) {\r\n\t\t\t\tplay_next_song();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "enqueue(process) { // puts the item into the queue\n process.setParentQueue(this); // set the parent queue to 'this' queue\n this.processes.push(process); // use array push \n return process; // return the result of the push \n }", "function addToQueue(fn) {\n if (working) {\n queue.push(fn);\n } else {\n fn();\n }\n}", "[types.DELMESSAGEQUEUE](state) {\n state.messageQueue.shift()\n }", "function sendCommand(cmd) {\n\tvar command = [0, cmd];\n\tvar info = {\n\t\tdirection: 'out',\n\t\tendpoint: 2,\n\t\tdata: new Uint8Array(command).buffer\n\t};\n\n\tchrome.usb.interruptTransfer(mp_device, info, sendCompleted);\n}", "enqueue(element) {\n // adding element to the queue \n this.items.push(element);\n }", "enqueue(element) {\n // adding element to the queue \n this.items.push(element);\n }", "enqueue(element) {\n // adding element to the queue \n this.items.push(element);\n }" ]
[ "0.61343837", "0.6128398", "0.61260223", "0.61045974", "0.59778506", "0.59112126", "0.578785", "0.5748376", "0.57008773", "0.5678219", "0.5622899", "0.55686474", "0.5538657", "0.55282575", "0.55134666", "0.5490953", "0.54762465", "0.547345", "0.54557717", "0.5448049", "0.5423041", "0.5379991", "0.5367899", "0.5359793", "0.53546095", "0.535396", "0.53460896", "0.5326409", "0.53136975", "0.5262596", "0.5252877", "0.5251784", "0.5235781", "0.51896155", "0.5187741", "0.5178978", "0.51507676", "0.5134901", "0.5127213", "0.51131576", "0.5103944", "0.5091054", "0.5087216", "0.50848186", "0.5067349", "0.50591964", "0.50565726", "0.5047668", "0.5041997", "0.5035531", "0.50312597", "0.5030215", "0.5027152", "0.5023973", "0.5023973", "0.50202906", "0.50193405", "0.5011796", "0.5002963", "0.50026345", "0.4995546", "0.49832097", "0.49826726", "0.49826726", "0.49723876", "0.49665892", "0.49391967", "0.49309114", "0.49277762", "0.49277762", "0.49271002", "0.49198285", "0.4909855", "0.4909383", "0.48974302", "0.48879346", "0.48588803", "0.48572364", "0.48516312", "0.48461592", "0.4838746", "0.48369348", "0.48359817", "0.48263243", "0.48258287", "0.4824905", "0.4822731", "0.48222482", "0.4820625", "0.48120704", "0.48103467", "0.48036772", "0.48021096", "0.4799075", "0.47982845", "0.47952887", "0.47910058", "0.47897196", "0.47897196", "0.47897196" ]
0.5450606
19
Send a global chat message
sendChatMessage(message, pushFront = false) { this.addToQueue(() => { this.socket.call("msg", [message]).catch((reason) => { if (reason === "Please wait before sending more messages." || reason === "Please wait a moment before sending more messages.") { this.sendChatMessage(message, true); console.log("Re-queuing message to chat " + reason); } else { console.log("Error Sending Message to chat for reason: " + reason); } }); }, pushFront); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendMessage() {\n \t\tvar message = data.value;\n\t\tdata.value = \"\";\n\t\t// tell server to execute 'sendchat' and send along one parameter\n\t\tsocket.emit('sendchat', message);\n\t}", "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "function sendChat ( msg ) {\n\n\tvar player = pg.player;\n\n\tplayer.send( msg );\n\n\tshowMessage( player.account.name, msg );\n}", "function SendToChat(text) {\n client.say(current_channel, text);\n}", "function sendMessage() {\n if(data.value === \"\")\n return;\n var message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit('sendchat', message);\n }", "function sendchat (number, msg, group)\n{\n if (typeof (webphone_api.plhandler) === 'undefined' || webphone_api.plhandler === null)\n webphone_api.addtoqueue('SendChat', [number, msg]);\n else\n webphone_api.plhandler.SendChat(number, msg, group);\n}", "function sendMessage(msg, chan)\n\t{\n\t\tif(msg !== ''){\n\t\t\tmod.toServer('C_CHAT', 1, {\n\t\t\t\tchannel: chan,\n\t\t\t\tmessage: msg\n\t\t\t});\n\t\t}\n\t}", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n var senddata = message.split(\"|\");\n var targetid = senddata[0];\n message = senddata[1];\n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n\n // tell server to execute 'new message' and send along one parameter\n\n socket.emit('controll special user', { uid: targetid, msg:message });\n }\n }", "sendChat (message) {\n this.send({\n type: 'chat',\n content: message.content\n })\n }", "function sendChat(player, txt, roomNum){\n var chatMsg = {\n id_user : player,\n message : txt,\n room : roomNum\n };\n\n\tajaxCall('POST', {a:'chat',method:'setChat', data:chatMsg}, null);\n}", "function sendMessage() {\n // Create a new message object\n var message = {\n text: vm.messageText\n };\n\n // Emit a 'gameMessage' message event\n Socket.emit('gameMessage', message);\n\n // Clear the message text\n vm.messageText = '';\n }", "function chatBotMessage() {\r\n newBotMsg(getBotMessage())\r\n console.log(\"chatbot message\")\r\n}", "function sendMessage() {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n addChatMessage({\n userName: userName,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n chattingSocket.emit('chat', {\n userName: userName,\n message: message\n });\n }\n}", "function sendMessage() {\n let message = $inputMessage.value;\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n addChatMessage({ username, message }, { kind: \"sent\" });\n // tell server to execute 'new message' and send along one parameter\n\n let payload = {\n username: username,\n message: message\n }\n if (!dev) {\n socket.emit('new message', payload);\n }\n }\n }", "function sendMessage() {\n text = $('#txtMsg').val();\n if (text == \"\") return;\n $('#txtMsg').val('');\n $.post('/chat/send_chat', { msg: text });\n getNewMessages();\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message,\n namecolor: namecolor,\n floatdir: 'right',\n msgbgcolor: '#94C2ED'\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "sendChatMessage(data) {\n socket.emit('new-chat-message', data);\n }", "function sendMessage(){}", "function send( text ) {\n\tvar to_send = \"t:\".concat(Date.now());\n\tto_send = to_send.concat(\":\");\n\tto_send = to_send.concat(text);\n\tServer.send( 'message', to_send);\n}", "function send(msg) { // send: msg\n if (socket.readyState === READY_STATE_OPEN) { socket.send(msg); }\n\n console.log('chatService(wsBaseUrl).send('+msg+')');\n }", "function send(){\n\tvar message = messageBox.value;\n\tmessageBox.value = '';\n\tvar idChannel = $('#which').attr('channel');\n\t$.post(\"TchatServlet?action=sendMessage&content=\" + message + \"&channel=\" + idChannel);\n\tconsole.log('new message just sent !')\n}", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n console.log(\"sendMessage\")\n }", "sendMessage(sender, msg) {\n const message = {\n sender: sender,\n content: msg\n };\n this._serverSideClient.publish(`/chat`, JSON.stringify(message));\n }", "function sendMessage() {\n if (!that.connection.isConnected()) {\n displayMessage(\"<span style='color: red'>Verbindung beendet oder noch nicht geöffnet.</span>\");\n return;\n }\n\n var textMessage = getChatMessageFromInput();\n\n if (!textMessage) {\n $(\"gameInputField\").focus();\n return;\n }\n\n var message = new GameMessage(GameMessage.GameChatMessage);\n message.text = \"<b>\" + User.load().getUsername() + \": </b> \" + textMessage;\n\n that.connection.send(message);\n\n // adding \"Ich: \" in front of every printed message from the user so\n // that he knows it was his\n displayMessage(\"<b>Ich: </b>\" + textMessage);\n\n }", "function messageSend(message) {\n sendMessage(message, roomID);\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "function sendMessage() {\n\n channel.push('shout', { \n name: name.value || \"guest\", // get value of \"name\" of person sending the message. Set guest as default\n message: msg.value, // get message text (value) from msg input field.\n inserted_at: new Date() // date + time of when the message was sent\n });\n\n msg.value = ''; // reset the message input field for next message.\n}", "function sendCommand(text,to) {\n if (st == Strophe.Status.CONNECTED) { \n var stanza = new Strophe.Builder( \"message\", {\"to\": to,\n \"type\": \"chat\"} ).c(\"body\").t(text);\n connection.send(stanza);\n } \n}", "sendUserMessage(text) {\n this.state.currentUser.sendMessage({\n text,\n roomId: this.state.currentRoom.id\n });\n }", "function sendMessage () {\n var message = $inputMessage.val();\n if(message.charAt(0) == '@'){\n var pmuser = message.substr(1,message.indexOf(' ')).trim();\n message = message.substr(message.indexOf(\" \") + 1);\n $inputMessage.val('@'+pmuser+' ');\n addChatMessage({\n username: username,\n message: message,\n pmuser: pmuser\n }); \n socket.emit('new message', message,pmuser);\n }\n else {\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message,\n pmuser: null\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message,null);\n }\n }\n }", "sendMessage(text) {\n const msg = {\n type: \"newMessage\",\n chatId: this.chatId(),\n user: this.state.user,\n text: text\n };\n this.ws.send(JSON.stringify(msg));\n }", "function postMessage(text) {\n if(wgCanonicalSpecialPageName == 'Chat') {\n mainRoom.socket.send(new models.ChatEntry({roomId:this.roomId,name:wgUserName,text:text}).xport());\n }\n}", "function sendChat(message) {\n return bot.channels.get(config.theShowChannelId).send(message)\n }", "function _send(message, chatstate) {\n var elem = $msg({\n to: contact.jid,\n from: jtalk.me.jid,\n type: \"chat\"\n });\n\n if (message) elem.c(\"body\", message);\n if (chatstate) {\n elem.c(chatstate, {xmlns: Strophe.NS.CHATSTATE});\n }\n\n connection.send(elem);\n }", "function sendChatMessage() {\n let text = (txtChatEntry.value || \"\").trim();\n\n if (text.length > 0) {\n // Reset the chat entry\n txtChatEntry.value = \"\";\n\n localPeer.dataChannel.Send(text);\n DisplayMessage(text);\n }\n}", "function sendChat(client, server, message, room) {\n client[server.name].send(new xmpp.Element('message', { to: room + '/' + server.nickname, type: 'groupchat' }).c('body').t(message));\n}", "function sendMessage () {\n var message = $inputMessage.val();\n message = cleanInput(message);\n var username = $usernameInput.val();\n // This section clears out input fields:\n $inputMessage.val('');\n addNewChatMessage({\n username: username,\n message: message\n });\n let data = {username,message};\n socket.emit('new message', data);\n }", "function sendChat (msg){\r\n document.getElementById (\"mod_comm_input\").value = msg;\r\n uW.Chat.sendChat ();\r\n}", "function updateGlobal(socket, message) {\n // socket.broadcast.emit('updateChat', 'SERVER', socket.username + ' has ' + message);\n}", "function sendChat() {\n\n if (chatSend.value == '') return; // If there is no text to send, do nothing\n\n let message = chatSend.value.trim(); // Remove excess white-space of either end of the text\n\n if (message.charAt(0) == '@') { // Check if someone is sending the message to someone specific\n let space = message.indexOf(' ');\n let target = message.slice(1, space); // This String contains the target user\n\n let messageWhisper = message.slice(space + 1, message.length); // This is the message to be sent\n\n let messageJSON = JSON.stringify({type: \"chat\", message: messageWhisper, whisper: true});\n\n for (let id in connections) {\n if (connections[id].name == target) { // If the user is the target\n if (connections[id].dataChannel)\n connections[id].dataChannel.send(messageJSON);\n addChat(username.value + '->' + target, '<whisper>' + messageWhisper + '</whisper>');\n chatSend.value = ''; // Clear the text box\n return;\n }\n }\n }\n\n // If it is not a targeted message, then just send the text itself\n let messageJSON = JSON.stringify( { type: \"chat\", message: message, whisper: false } );\n\n for (let id in connections) {\n connections[id].dataChannel.send(messageJSON);\n }\n\n addChat(username.value, chatSend.value);\n chatSend.value = ''; // Clear the text box\n}", "function sendMessage (message) {\n connection.sendMessage({\n message: message\n });\n renderMessage(message);\n }", "function sendMsg() {\r\n if (inputMsg.value()) {\r\n let data = {\r\n room: currentRoom,\r\n msg: inputMsg.value()\r\n };\r\n socket.emit(\"sendingMsg\", data);\r\n addMsg(inputMsg.value(), \"self\");\r\n inputMsg.value('');\r\n }\r\n}", "function sendChatText(text) {\n //Check connection status\n if(offline){\n //Send message offline\n sendAndSaveMessage(roomNo, name, text);\n }\n else{\n //Emit to socket.io\n socket.emit('chat', roomNo, name, text);\n }\n}", "function sendMessage() {\n\tvar inputText = document.getElementById('chatinput').value;\n\tvar message = {'type': 'message', 'message': inputText};\n\tconn.send(JSON.stringify(message));\n\t\n\taddMessageToScreen(inputText, \"You\");\n\t\n\t//Clear input field\n\tdocument.getElementById('chatinput').value = '';\n}", "function send_message(status, msg) {\n\tPebble.sendAppMessage({'status': status, 'message': msg});\n}", "function sendMessage() {\n let text = messageInput.value.trim();\n if (text === \"\") {\n return;\n }\n messageInput.value = \"\";\n\n if (text !== history.commands[0]) {\n history.commands.unshift(text);\n }\n history.index = -1;\n\n let to = text.match(/^@\\S+/);\n\n if (to) {\n to = to[0].split(\"@\")[1];\n }\n sock.emit(\"message\", { to: to, text: text });\n }", "function sendMessage(message)\r\n { \r\n try\r\n {\r\n ChatWindow.SendMessage(getMyWebID(),getOtherWebID(), escape(getMyNick()), escape( message ) ,sendMessage_CallBack);\r\n }\r\n catch(ex)\r\n { \r\n \r\n }\r\n }", "function sendChat (msg){\r\n document.getElementById (\"mod_comm_input\").value = msg;\r\n unsafeWindow.Chat.sendChat ();\r\n}", "function sendMessage(msg) {\n events.trigger(events.ui.clearUnread);\n\n var id, clientMessage, type, messageCompleteTimeout = null;\n\n if (typeof msg === 'object' && 'content' in msg && msg[0] !== '/') {\n type = 'replace';\n id = msg.id;\n clientMessage = msg;\n\n clientMessage.room = client.chat.state.activeRoom;\n } else {\n type = 'append';\n id = utility.newId();\n\n clientMessage = {\n id: id,\n replaced: false,\n content: msg,\n room: client.chat.state.activeRoom\n };\n }\n\n if (msg[0] !== '/') {\n // if you're in the lobby, you can't send mesages (only commands)\n if (client.chat.state.activeRoom === undefined) {\n addErrorToActiveRoom(utility.getLanguageResource('Chat_CannotSendLobby'));\n return false;\n }\n\n // Added the message to the ui first\n var viewModel = {\n name: client.chat.state.name,\n hash: client.chat.state.hash,\n message: processor.processPlainContent(clientMessage.content),\n id: clientMessage.id,\n date: new Date(),\n highlight: '',\n isMine: true\n };\n\n if (type === 'append') {\n addChatMessage(viewModel, clientMessage.room);\n ui.incrementMessageCount();\n } else {\n replaceMessageElement(viewModel);\n }\n\n // If there's a significant delay in getting the message sent\n // mark it as pending\n messageCompleteTimeout = window.setTimeout(function () {\n if ($.connection.hub.state === $.connection.connectionState.reconnecting) {\n failMessage(id);\n } else {\n // If after a second\n markMessagePending(id);\n }\n },\n messageSendingDelay);\n\n pendingMessages[id] = messageCompleteTimeout;\n }\n\n rc.historyLocation = 0;\n\n sendClientMessage(clientMessage, messageCompleteTimeout);\n historyPush(type, clientMessage);\n }", "function sendChatBtn() {\n\t\t\t\tsendLine();\n\t\t\t\tsetVisitorTyping(false);\n\t\t\t}", "send(message) {\n let room;\n if (message.room) {\n ({ room } = message);\n } else if (message.id) { //Maybe we were sent a user object or channel object. Use the id, in that case.\n room = message.id;\n }\n\n const options = { as_user: true, link_names: 1, thread_ts: (message.thread != null ? message.thread_ts : undefined) };\n\n if (typeof message !== 'string') {\n return this.web.chat.postMessage(room, message.text, _.defaults(message, options));\n } else {\n return this.web.chat.postMessage(room, message, options);\n }\n }", "servermsg_room(text){\n console.log(`Room msg for ${this.username}: ${text}`);\n io.in(this.room).emit('chat:message', {username: '<system>', text});\n }", "function sendMessage() {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n\n //Check if we want to send private message\n if (message.indexOf(\"/p \") == 0) {\n var to_start = message.indexOf(\"/p \") + 3;\n var user_to = message.substr(to_start).trim();\n user_to = user_to.substr(0, user_to.indexOf(\" \")).trim();\n\n var mess = message.substr(to_start).trim();\n mess = mess.substr(mess.indexOf(\" \")).trim();\n\n var data = {\n username: username,\n to: user_to,\n message: mess,\n private: true\n };\n\n addChatMessage(data);\n\n var privateIp = \"\";\n\n users.forEach(function (el, i) {\n if (el.name == user_to) {\n privateIp = el.ip;\n }\n });\n\n /*\n var test = {\n key1: 42,\n key2: 'foo'\n };\n test.getKeyByValue( 42 ); // returns 'key1'\n */\n\n // tell server to execute 'new message' and send along one parameter\n socket.send('msg', mess, privateIp);\n lastmessage = mess;\n } else {\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.send('msg', message);\n lastmessage = message;\n }\n\n }\n }", "function sendMessage() {\n \n\n}", "send(message) {\n if(this.currentConversation){\n //this.emit('send', message, this.currentConversation);\n this.log(this.userProfile.nickname+\": \"+message);\n this.currentConversation.send(message);\n }\n else {\n this.log(\"No conversation specificed! Please specify a conversation before sending.\");\n }\n }", "function sendMessage() {\n}", "function sendMessage(chat_id, text) {\n var url = 'https://api.telegram.org/bot'+botToken+'/sendMessage';\n unirest.post(url)\n .headers({'Accept': 'application/json', 'Content-Type': 'application/json'})\n .send({ \"chat_id\": chat_id, \"text\": text })\n .end(function (response) {\n //console.log(\"[SENDMSG - OK] Message sent to chat: \"+chat_id + \" with text '\"+text+\"'\");\n console.log(\"[SENDMSG - OK] Message sent to chat: \"+chat_id);\n });\n}", "function sendText() {\n if (textChat.value != \"\") {\n writeText(textChat.value);\n pushText(textChat.value);\n }\n textChat.value = \"\";\n }", "function sendMessage(currentLobby, to, msg, type) {\r\n if (type === USER) {\r\n if (currentLobby.sendOptionuser == 1) {\r\n to.chat(msg);\r\n } else if (currentLobby.sendOptionuser == 2) {\r\n to.poke(msg);\r\n }\r\n } else if (type === SUPPORTER) {\r\n if (currentLobby.sendOptionsupporter == 1) {\r\n to.chat(msg);\r\n } else if (currentLobby.sendOptionsupporter == 2) {\r\n to.poke(msg);\r\n }\r\n }\r\n }", "function sendChatAction(value){\n\n socket.emit(\"chat message\", value) \n}", "function send_messenger(){\n var text_messenger = $('#text_messenger').val();\n doGetBotResponse(text_messenger, false);\n }", "function sendMessage(sender, msg) {\n var chatName = (sender == 'user')? 'You':'Pepper';\n $(\".chat-wrapper\").append(\n '<div class=\"' + sender + ' chat-container\">'+\n '<label>' + chatName + '</label>'+\n '<p>' + msg + '</p>' +\n '</div>'\n );\n $('#chatbox').scrollTop( $('.chat-wrapper').height() );\n}", "function sendMessage(message) {\n\tdrone.publish({\n\t room: roomName,\n\t message\n\t});\n }", "_messageSend() {\n socket.emit('chat-msg', {\n name: sessionStorage.getItem('user'),\n message: this.state.message,\n team_id: this.props.team_id\n })\n this.setState({ message: '' }) // initialize msg box after send msg\n }", "function handleSendButton() {\n var msg = {\n text: chatBox.value,\n msgType: PEER_TEXT,\n id: uniqueId,\n name: myName,\n date: Date.now()\n };\n chatBox.value = \"\";\n var time = new Date(msg.date);\n var timeStr = time.toLocaleTimeString();\n if (msg.text.length) {\n for(var peer_id in dataChannels) {\n //simply try to send for each. Its okay if any one fails\n try {\n trace('sending to ' + peer_id);\n dataChannels[peer_id].send(JSON.stringify(msg));\n }catch(e) {\n trace(peer_id + ' Error sending msg: ' + e);\n }\n }\n updateChat(msg);\n }\n}", "function sendToLobby(message){\n\t\tvar obj = {\"player\":\"Server\",\"role\":\"game\",\"message\":message};\n\t\tio.to('lobby').emit('message', obj);\n\t}", "function chatBotSendMsg(msg, room) {\n firebase.database().ref('chat/'+room).push({\n img: config.chatBot.img,\n username: config.chatBot.username,\n text: msg,\n group: 'chatbot',\n uid: 'TrgkhCFTfVWdgOhZVUEAwxKyIo33',\n timestamp: firebase.database.ServerValue.TIMESTAMP\n })\n}", "function SendChatData() \n{\t\n\tif (g_oSAFRemoteDesktopClient != null) \n\t{\n\t\tif (false == g_bNewBinaries)\n\t\t{\n\t\t\t//\n\t\t\t// Send chat data to user (using Old interfaces)\n\t\t\t//\n\t\t\tg_oSAFRemoteDesktopClient.SendChannelData(c_szChatChannelID, chatText.value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//\n\t\t\t// Send chat data to user (using New interfaces)\n\t\t\t//\n\t\t\tg_oChatChannel.SendChannelData( chatText.value );\n\t\t}\n\t\t\n\t\t//\n\t\t// Update chat history window\n\t\t//\n\t\tincomingChatText.value = incomingChatText.value + L_cszExpertID + chatText.value;\n\t\t\n\t\t//\n\t\t// Clear chat msg window\n\t\t//\n\t\tchatText.value=\"\";\n\t\t\n\t\t//\n\t\t// Scroll down\n\t\t//\n\t\tincomingChatText.doScroll(\"scrollbarPageDown\");\n\t}\n}", "function onChatMessage(msg) {\n this.broadcast.emit('chat message', msg);\n}", "function sendChatMessage(){\n\t\tevent.preventDefault();\n\t\t// extract value from chat-message and assign it to value\n\t\t//we need to handle messageToServer. Tell it where to put it.\n\t\tvar messageToSend = document.getElementById('chat-message').value;\n\t\tsocketio.emit('messageToServer',{\n\t\t\tmessage: messageToSend,\n\t\t\tname: \"Anonymous\"\n\t\t});\n\t\t//Reset form after submit\n\t\tdocument.getElementById('chat-message').value = \"\";\n\t}", "function sendMessage(message){\n\n let msg = {\n user: name,\n message: message.trim() //to trim the extra spaces in textarea\n }\n\n //now we have to append the msg into the box with username specifying msg type\n\n appendMessage(msg, 'outgoing_msg')\n textarea.value = \"\" //as soon as msg is sent, empty the text area\n scrollBottom()\n\n //send to server via web-socket\n socket.emit('message', msg) //now this can be listen in server.js\n \n}", "function sendMessage () {\n var message = $inputMessage.val();\n console.log(message);\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n console.log(message + ' and connected');\n $inputMessage.val('');\n addChatMessage({\n name: name,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n \n if (canPlay) {\n if (message === cleanInput('start')) {\n startRound();\n }\n } else if (playing) {\n if (message === cleanInput(answer)) {\n personal_score += score; \n }\n }\n }\n }", "function sendMessage () {\n var message = $('#input_' + target).val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $('#input_' + target).val('');\n \n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', {\n message: message,\n target: target,\n displayName: displayName,\n });\n }\n }", "function sendMessage(message, room) {\n console.log(\"Client sending message: \", message, room);\n socket.emit(\"message\", message, room);\n}", "function sendMessage(message){\n console.log('Sending message: ', message);\n socket.emit('message', message);\n}", "function sendText() {\n // Construct a msg object containing the data the server needs to process the message from the chat client.\n var msg = {\n type: \"message\",\n text: document.getElementById(\"text\").value,\n id: clientID,\n };\n}", "function sendMessage(message){\n socket.emit('message', message);\n}", "function sendMessage() {\n\t//Pebble.sendAppMessage({\"status\": 0});\n //testRequest();\n //testRequestTime();\n\t\n\t// PRO TIP: If you are sending more than one message, or a complex set of messages, \n\t// it is important that you setup an ackHandler and a nackHandler and call \n\t// Pebble.sendAppMessage({ /* Message here */ }, ackHandler, nackHandler), which \n\t// will designate the ackHandler and nackHandler that will be called upon the Pebble \n\t// ack-ing or nack-ing the message you just sent. The specified nackHandler will \n\t// also be called if your message send attempt times out.\n}", "function sendMessage (message, room) {\n console.log('Client sending message: ', message, room);\n socket.emit('message', message, room);\n}", "function sendUTFToAll(sender, message) {\n saveToDb(sender.id, 'broadcast', message)\n\n var time = new Date()\n var msg = {\n time: time,\n message: htmlEntityFilter.filter(message),\n senderId: sender.id,\n sender_name: sender.name\n }\n\n for (var i = 0; i < connections.length; i++) {\n connections[i].connection.sendUTF(\n JSON.stringify({type: 'message', data: msg})\n )\n }\n}", "sendMessage (channelId, text) {\n this.postMessage({\n channel: channelId,\n text\n })\n }", "function sendChat(\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n /**\n * The event object. */\n event\n)\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n{\n if (event) {\n event.preventDefault();\n }\n var jqChatText = $('#chatInp > input.chatTo'),\n ltext = jqChatText.val(),\n jqChatSpan, id, ename;\n if (ltext.length < 1) {\n return false;\n }\n jqChatSpan = $('#chatInp > span');\n id = jqChatSpan.attr('id');\n if (id.length < 1) {\n app.log(4, 'Error in chat, no id.');\n }\n else {\n if (id.match('group')) {\n Callcast.SendPublicChat(encodeURI(ltext));\n }\n else if (id.match('feedback')) {\n Callcast.SendFeedback(encodeURI(ltext));\n }\n else {\n ename = jqChatSpan.attr('ename');\n Callcast.SendPrivateChat(encodeURI(ltext), ename);\n }\n app.log(2, 'Sending chat to ' + id + \" \" + ltext);\n jqChatSpan.removeAttr('id');\n jqChatSpan.removeAttr('ename');\n }\n jqChatText.val('');\n closeWindow();\n}", "function sendMessage() {\n sendNewMessage({ dsText: valueInput.trim(), usuario: getUsuarioLogado() });\n setValueInput('');\n }", "sendMessage() {\n\n const userMessage = {\n message: this.newMessage,\n status: 'sent',\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\n }\n\n if (!this.newMessage) {\n return;\n } else {\n this.contacts[this.currentChat].messages.push(userMessage);\n this.newMessage = '';\n }\n\n // risposta cpu dopo un secondo\n setTimeout(this.receiveMessage, 3000);\n }", "function sendMessage() {\n json.activeSince = moment();\n \n var message = JSON.stringify(json);\n \n console.log('Music ' + SOUNDS[json.instrument] + ' message : ' + message);\n\n socket.send(message, 0, message.length, protocol.PORT, protocol.MULTICAST_ADDRESS, function (err, bytes) {\n if (err) throw err;\n });\n}", "servermsg_private(text){\n console.log(`User msg for ${this.username}: ${text}`);\n this.socket.emit('chat:message', {username: '<system private>', text});\n }", "sendSystemMessage(message) {\r\n var messages = [];\r\n messages.push(message);\r\n\r\n var packet = {\r\n \"type\": \"SYSTEM\",\r\n \"position\": this.messages.length,\r\n \"messages\": messages,\r\n \"time\": new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit'})\r\n };\r\n\r\n this.messages.push(packet); // Put message into room history\r\n\r\n this.notify(\"chat\", packet);\r\n }", "SendMessage() {}", "SendMessage() {}", "SendMessage() {}", "SendMessage() {}", "function sendMessage(message) {\n console.log('Client sending message: ', message);\n socket.emit('message', message);\n }", "function sentMsgConsole(messageChatched) {\n console.log(\"inviato \", messageChatched);\n}", "function SendChatMessage(Socket, Message) {\n\tvar time = new Date().toTimeString(); \n\tvar payload = { \n \t\t\"COLOR\" : '#ffa500',\n\t\t\"MESSAGE\" : Message, \n\t\t\"CHAT_CHANNEL\" : 2 \n\t};\n\tvar signedPacket = { \n \t\t\"PLAYER_ID\" : 'SERVER',\n\t\t\"PLAYER_NAME\" : 'SERVER',\n\t\t\"TIME\" : time,\n\t\t\"PAYLOAD\" : payload \n\t};\n\n\tio.to(Socket.id).emit('CHAT_MESSAGE_RECIEVED', JSON.stringify(signedPacket));\n}", "function handleSendMessage(e, c) {\n // Disable chat if disconnected\n if (peer.disconnected) {\n e.target.disabled = true;\n document.getElementById(\"chat-message\").disabled = true;\n }\n\n // Ensure message present\n let message = document.getElementById(\"chat-message\").value;\n if (message === \"\") return;\n\n // Escape html in message\n message = message.replace(\">\", \"&gt\").replace(\"<\", \"&lt\");\n\n // Send the message\n c.send({\"type\": \"chat\", \"message\": message});\n\n // Add message to self log\n let log = document.getElementById(\"chat-log\");\n log.innerHTML = `<p class=\"chat-message\"><span class=\"from-self\">You:</span> ${message}</p><hr/>` + log.innerHTML;\n}", "sendMessage(message, elementName, nickname) {\n const msg = Object(strophe_js__WEBPACK_IMPORTED_MODULE_1__[\"$msg\"])({\n to: this.roomjid,\n type: 'groupchat'\n }); // We are adding the message in a packet extension. If this element\n // is different from 'body', we add a custom namespace.\n // e.g. for 'json-message' extension of message stanza.\n\n if (elementName === 'body') {\n msg.c(elementName, message).up();\n } else {\n msg.c(elementName, {\n xmlns: 'http://jitsi.org/jitmeet'\n }, message).up();\n }\n\n if (nickname) {\n msg.c('nick', {\n xmlns: 'http://jabber.org/protocol/nick'\n }).t(nickname).up().up();\n }\n\n this.connection.send(msg);\n this.eventEmitter.emit(_service_xmpp_XMPPEvents__WEBPACK_IMPORTED_MODULE_6___default.a.SENDING_CHAT_MESSAGE, message);\n }", "function sendMessage(message){\n\t\tconsole.log('Client sending message: ', message);\n\t\tsocket.emit('message', message);\n}", "handleChat(text) {\n this.room.broadcast({\n name: this.name,\n type: 'chat',\n text: text\n });\n }" ]
[ "0.7974548", "0.77753586", "0.77753586", "0.7769914", "0.77296084", "0.7705663", "0.75947464", "0.75587934", "0.743872", "0.7425171", "0.742344", "0.72918445", "0.72867286", "0.72767866", "0.72729826", "0.7269697", "0.72687376", "0.72603786", "0.72470915", "0.7199084", "0.7198589", "0.71930486", "0.7191246", "0.7185721", "0.7169981", "0.7147459", "0.71408826", "0.71408826", "0.71408826", "0.7139344", "0.71175283", "0.71114594", "0.7096033", "0.7095928", "0.7091536", "0.7064162", "0.7042322", "0.7037942", "0.7028451", "0.70209646", "0.70181036", "0.69803095", "0.69794303", "0.6970272", "0.6966173", "0.69558513", "0.69406503", "0.69291234", "0.69241244", "0.6924032", "0.69098496", "0.6909836", "0.69079494", "0.6900321", "0.6900259", "0.68668026", "0.6862686", "0.6851671", "0.68440336", "0.6843043", "0.6840769", "0.68397856", "0.68328375", "0.68285066", "0.6815823", "0.68128234", "0.6798094", "0.67912793", "0.678907", "0.67749083", "0.67738473", "0.67638016", "0.67634064", "0.6762102", "0.6761057", "0.67586505", "0.6756975", "0.67512184", "0.6740874", "0.6740019", "0.6736739", "0.6734735", "0.67203045", "0.67078817", "0.6707193", "0.67006975", "0.66973954", "0.66920704", "0.6683165", "0.6680543", "0.6677874", "0.6677874", "0.6677874", "0.6677874", "0.66636866", "0.6660912", "0.6659715", "0.665803", "0.6645704", "0.66439134", "0.6641514" ]
0.0
-1
Send a message to a particular user
sendUserMessage(user, message, pushFront = false) { user = ChatWrapper.CleanUsername(user); this.addToQueue(() => { this.socket.call("whisper", [user, message]).catch((reason) => { if (reason === "Please wait before sending more messages." || reason === "Please wait a moment before sending more messages.") { this.sendUserMessage(user, message, true); console.log("Re-queuing message to user " + reason); } else { console.log("Error Sending Message to user for reason: " + reason); } }); }, pushFront); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendMessageToUser(userId, message) {\n web.conversations\n .list({ exclude_archived: true, types: \"im\" })\n .then(res => {\n const foundUser = res.channels.find(u => u.user === userId);\n if (foundUser) {\n rtm\n .sendMessage(message, foundUser.id)\n .then(msg =>\n console.log(\n `Message sent to user ${foundUser.user} with ts:${msg.ts}`\n )\n )\n .catch(console.error);\n } else {\n console.log(\"User doesnt exist or is the bot user!\");\n }\n });\n }", "sendUserMessage(text) {\n this.state.currentUser.sendMessage({\n text,\n roomId: this.state.currentRoom.id\n });\n }", "sendUserMessage(user, message) {\r\n var messages = [];\r\n messages.push(message);\r\n\r\n var packet = {\r\n \"type\": \"USER\",\r\n \"position\": this.messages.length,\r\n \"uuid\": user.getUuid(),\r\n \"name\": user.getName(),\r\n \"messages\": messages,\r\n \"color\": this.userUuids.indexOf(user.getUuid()),\r\n \"time\": new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit'})\r\n };\r\n\r\n this.messages.push(packet); // Put message into room history\r\n\r\n this.notify(\"chat\", packet);\r\n }", "function sendtoUser(sender, text) {\n text = {text:text}\n //the message we want to send\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token:token},\n method: 'POST',\n json: {\n recipient: {id:sender},\n message: text,\n }\n }, function(error, response, body) {\n if (error) {\n console.log('Error sending messages: ', error)\n } \n else if (response.body.error) {\n console.log('Error: ', response.body.error)\n }\n })\n}", "function onSendClicked() {\n var target=vw.getPeerName();// NOT from mc.userParams.targetUsername, so that you can chat and speak with different users \n if ( ! target) {\n //vw.showAlert(\"Peer user name required\");\n alert(\"Peer user name required\");\n return false;\n }\n var msg = {\n text: vw.getTextInp(),\n type: \"message\",\n id: up.clientID,\n date: Date.now(),\n user: up.user,\n }; \n //alert(target);\n if (target) msg.target=target;\n signallingConnection.sendRelay(msg);\n vw.clearTextInp();\n}", "function send(message) {\n try {\n //attach the other peer username to our messages\n if (connectedUser) {\n message.name = connectedUser;\n }\n connect.current.send(JSON.stringify(message));\n } catch (err) {\n swal({\n title: \"Alert!\",\n text: err,\n type: \"error\",\n confirmButtonText: \"Retry\",\n }).then(() => {\n history.push(\"/CustCallIndex\");\n });\n }\n\n }", "function userClick(user) {\n if (store.get('profile').user_id == user.user_id) {\n return;\n }\n logger.info('[TEST] Messaging ' + (user.name || user.nickname));\n }", "function sendPM(client, server, message, user) {\n client[server.name].send(new xmpp.Element('message', { to: user, type: 'chat' }).c('body').t(message));\n}", "function sendPrivateMsg(user1, user2, bot, guild) {\n bot.users.fetch(user1, false).then((user) => {\n user.send(\n`>>> You have been matched with <@${user2}>, from ${guild.name}\nIn order to speak with them you must send them a message.\nIf you would like to continue using this service, please re-react to the message in ${guild.name}`);\n });\n\n bot.users.fetch(user2, false).then((user) => {\n user.send(\n`>>> You have been matched with <@${user1}>, from ${guild.name}\nIn order to speak with them you must send them a message.\nIf you would like to continue using this service, please re-react to the message in ${guild.name}`);\n });\n}", "function sendUserToAll (cmd, user) {\n sendToAll({\n cmd: cmd,\n users: [user]\n })\n }", "sendTo(id, message) {\n var player = this.players.find((p) => p.id === id);\n player.connection.send(JSON.stringify(message));\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n var senddata = message.split(\"|\");\n var targetid = senddata[0];\n message = senddata[1];\n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n\n // tell server to execute 'new message' and send along one parameter\n\n socket.emit('controll special user', { uid: targetid, msg:message });\n }\n }", "function send(message) {\n if (connectedUser) {\n message.name = connectedUser;\n }\n\n connection.send(JSON.stringify(message));\n}", "function send(message) {\n if (connectedUser) {\n message.name = connectedUser;\n }\n\n connection.send(JSON.stringify(message));\n}", "_sendMessageFromUser (value) {\n let message = this._createNewMessage('you', this._validValue(value));\n this._viewNewMessage(message);\n this._goodCrashAnswers();\n }", "function sendMessageToUser(address, type, res, isImportant = false) {\n\n\tconsole.log(`Sending message to user: isImportant=${isImportant}`);\n\tvar quote = faker.fake(\"{{lorem.sentence}}\");\n\tvar msg = new builder.Message().address(address);\n\n\tif (isImportant) msg.channelData = { notification: { alert: 'true' } };\n\n\tif (type === 'text') msg.text(quote);\n\tif (type === 'hero') msg.addAttachment(utils.createHeroCard(builder));\n\tif (type === 'thumb') msg.addAttachment(utils.createThumbnailCard(builder));\n\n\tif (type === 'text') res.send('Look on MS Teams, just sent: ' + quote);\n\tif (type === 'hero') res.send('Look on MS Teams, just sent a Hero card');\n\tif (type === 'thumb') res.send('Look on MS Teams, just sent a Thumbnail card');\n\n\ttry {\n\t\tif (msg.attachments[0]) msg.attachments[0].content.tap = builder.CardAction.openUrl(null, 'http://teams.microsoft.com/l/', 'Open Teams');\n\t}\n\tcatch (e) {\n\t\tres.send('Setting tap action failed');\n\n\t}\n\n\tbot.send(msg, function (err) {\n\t\t// Return success/failure\n\t\tres.status(err ? 500 : 200);\n\t\tres.end();\n\t});\n}", "function sendMessage(to, message, id) {\n let msg = candy.starwave.createMessage(message, to, undefined, id);\n candy.starwave.sendMessage(msg);\n}", "function sendChatMessage() {\n // Create user object for the current page\n let user = new User({\"userID\" : profileUserID});\n\n // If their is a userid for the current profile page then send that using the post request\n let getParams = new URLSearchParams(window.location.search);\n\n // Send Message\n user.sendMessage(requestToken, user.userID, encodeURIComponent( quill.container.firstChild.innerHTML.replace(\"\\\\n\", \"\")));\n\n // Clear the message box\n quill.setText('')\n\n // Update the contents of the chatbox\n updateChat();\n}", "sendMessage({ sender, receiver, message }) {\n\t\tconsole.log(`${sender.userName} dice ${message} a ${receiver.userName}`);\n\t}", "function notifyUser(user) {\n robot.messageRoom(user.name, 'Hey, your turn to deploy!');\n }", "async function sendMessage(message, toUserId) {\n const msg = await ShareBnBApi.send(toUserId, message);\n return msg;\n }", "sendMessage(userID, message) {\n Dispatcher.handleViewAction({\n type: ActionTypes.SEND_MESSAGE,\n userID: userID,\n message: message,\n timestamp: +new Date(),\n })\n }", "function send_message(element){\n\n\tlet message_type = element.dataset.type;\n\tlet from_user_id = element.dataset.fromuser;\n\tlet to_user_id = element.dataset.touser;\n\tlet to_channe_id = element.dataset.tochannel;\n\tlet message = element[0].value;\n\n\tif(message_type == 'direct'){\n\t\tlet keyTerm = ['message_type', 'from_user_id', 'to_user_id', 'message'];\n\t\tlet data = [message_type, from_user_id, to_user_id, message];\n\n\t\tmake_post_request('user/send/message', keyTerm, data, message_template);\n\t}\n\n\tif(message_type == 'channel'){\n\t\tlet keyTerm = ['message_type', 'from_user_id', 'to_channe_id', 'message'];\n\t\tlet data = [message_type, from_user_id, to_channe_id, message];\n\n\t\tmake_post_request('user/send/message', keyTerm, data, message_template);\n\t}\n\n\telement[0].value = '';\n\telement[0].focus();\n}", "function notifyChat(message) {\n users.forEach(user => {\n user.write(message);\n });\n}", "function sendMessage (myUser, socket) {\r\n var message = $('#inputMessage').val();\r\n // Prevent markup from being injected into the message\r\n message = cleanInput(message);\r\n // if there is a non-empty message and a socket connection\r\n if (message) {\r\n $('#inputMessage').val('');\r\n var sendData = {\r\n username: myUser.username,\r\n profileImage:myUser.profileImage,\r\n message: message\r\n };\r\n addChatMessage(sendData);\r\n // tell server to execute 'new message' and send along one parameter\r\n socket.emit('new message', sendData);\r\n }\r\n}", "function sendTo(user_id, phoneNr, callback) {\n createOTP(function(otp) {\n // addOTPtoOTPDatabase(user_id, otp, function(err) {\n // if(!err) {\n sendOTPMessage(phoneNr, otp, function(err, res, body) {\n if(!err) {\n callback(null, otp);\n } else {\n callback(err, null);\n }\n })\n // } else {\n // callback(err, null);\n // }\n // })\n })\n}", "function sendMessage(value) {\n Chat.sendMessage({\n sender: username,\n type: 'color',\n value: value\n });\n}", "function sendMessage(value) {\n Chat.sendMessage({\n sender: username,\n type: 'color',\n value: value\n });\n}", "function sendMessage(content){\n\tsocket.emit('relay_me', {username:username, content:content});\n}", "async function sendToStaff (user) {\n try {\n // prepare message\n let markdown = `${user.email} (${user.id}) has finished provisioning in the Webex CC v4 instant demo.`\n const url = 'https://webexapis.com/v1/messages'\n const token = globals.get('toolbotToken')\n const options = {\n method: 'POST',\n headers: {\n Authorization: 'Bearer ' + token\n },\n body: {\n roomId: globals.get('webexV4ProvisionRoomId'),\n markdown\n }\n }\n // send message\n await fetch(url, options)\n } catch (e) {\n console.log(`failed to notify staff of provision on Webex:`, e.message)\n }\n}", "send(message) {\n let room;\n if (message.room) {\n ({ room } = message);\n } else if (message.id) { //Maybe we were sent a user object or channel object. Use the id, in that case.\n room = message.id;\n }\n\n const options = { as_user: true, link_names: 1, thread_ts: (message.thread != null ? message.thread_ts : undefined) };\n\n if (typeof message !== 'string') {\n return this.web.chat.postMessage(room, message.text, _.defaults(message, options));\n } else {\n return this.web.chat.postMessage(room, message, options);\n }\n }", "function pm(user, message) {\n if(!user) return send(\"Sorry! You must use the user's ID that you want me to PM!\");\n if(!message) return send(\"I can't DM someone and empty message! Pease check the message you want me to DM again!\")\n return send(\"{pm:\" + user + \"} \" + message);\n}", "execute(userName, slackBot) {\n const botMessageParams = {\n as_user: false,\n username: 'Wordy Bot',\n };\n\n slackBot.postMessageToUser(userName, this.message, botMessageParams);\n }", "send(message) {\n if(this.currentConversation){\n //this.emit('send', message, this.currentConversation);\n this.log(this.userProfile.nickname+\": \"+message);\n this.currentConversation.send(message);\n }\n else {\n this.log(\"No conversation specificed! Please specify a conversation before sending.\");\n }\n }", "function sendMessage() {\n\n channel.push('shout', { \n name: name.value || \"guest\", // get value of \"name\" of person sending the message. Set guest as default\n message: msg.value, // get message text (value) from msg input field.\n inserted_at: new Date() // date + time of when the message was sent\n });\n\n msg.value = ''; // reset the message input field for next message.\n}", "function sendMessage(msg, to) {\n console.log(userdata, index)\n // userdata[index].msgs.push({ \"from\": \"sent\", \"text\": msg, \"time\": Date.now() })\n // client.messages\n // .create({\n // body: msg,\n // from: '+12404282838',\n // to: to\n // // to: '+14697401920'\n // })\n // .then(message => console.log(message.sid));\n // return\n}", "function send(message)\n{\n //concatenate remote peer username to message\n if (connectedUser)\n {\n message.name = connectedUser;\n }\n //format message as JSON and send\n signalingServer.send(JSON.stringify(message));\n}", "function sendTo(conn, message) {\n\tconn.send(JSON.stringify(message));\n}", "function sendMessage(username, usermsg) {\n let type;\n let msg;\n if(usermsg.img){\n type = \"image\";\n msg = usermsg.img;\n $(\".img-preview\").hide();\n }else{\n type = \"string\";\n msg = usermsg.val();\n }\n sendPing(startPoint.x + (canvas.vptCoords.tl.x + canvas.vptCoords.tr.x) / 2, startPoint.y + (canvas.vptCoords.tl.y + canvas.vptCoords.bl.y) / 2, \"chat\");\n socket.emit(\"fromclient\", {\n username: username,\n type: type,\n msg: msg,\n });\n}", "function notify(user, message) {\n cb.sendNotice(message, user)\n}", "function postSmoochMessage(smoochAppId, smoochUserId, message) {\n console.log(`====> TO SMOOCH: ${message} -> Smooch app id: ${smoochAppId}, Smooch user id: ${smoochUserId}`);\n smooch.appUsers.sendMessage({\n appId: smoochAppId,\n userId: smoochUserId,\n message: {\n text: message,\n role: 'appMaker', // appMaker => App to Facebook, appUser => App to PureCloud\n type: 'text'\n }\n }).then((response) => {\n console.log('API RESPONSE:\\n', response);\n }).catch((err) => {\n console.log('API ERROR:\\n', err);\n });\n}", "async function sendChatMessage(accesstoken, to, msg){\n\tif (accesstoken == null || to == null || msg == null)\n\t\treturn(config.MSG_FORM_INVALID);\n\tlet user1 = await profile.verifyAccessToken(accesstoken);\n\tlet user2 = await sql.findId(to);\n\tif (user1 != null && user1.Id != null){\n\t\tif (user1.Liked != null && user1.Liked.includes(to)\n\t\t&& user1.LikedBy != null && user1.LikedBy.includes(to)){\n\t\t\tif (user2 != null && user2.Id != null){\n\t\t\t\tlet result = await sql.sendChatMessage(user1.Id, user2.Id, msg);\n\t\t\t\treturn (null);\n\t\t\t} else return(['Receiver is no longer an active user'])\n\t\t} else return(['Users are not connexted']);\n\t}else return(user1);\n}", "function sendChat ( msg ) {\n\n\tvar player = pg.player;\n\n\tplayer.send( msg );\n\n\tshowMessage( player.account.name, msg );\n}", "function sendEmail(user, password){\n\n server.send({\n text: \"Hello \" + user.name + \", as per your request, here is your temporary password: \" + password,\n from: \"[email protected]\",\n to: email,\n subject: \"Password reseted\"\n }, function (err, message) {\n if(err){\n response.errorInternalServer(res, err);\n }\n else{\n response.successOK(res, \"Message sent\");\n console.log(message);\n }\n });\n}", "function call() {\n // Not currently in a room\n disableElements(\"call\");\n var message = {\n id : 'call',\n from : document.getElementById('userName').value,\n to : document.getElementById('otherUserName').value\n };\n sendMessage(message);\n}", "async sendUserOp (userId, op, requestId) {\n\t\t// send pubnub update on user's me-channel\n\t\tconst message = {\n\t\t\tuser: Object.assign(op, { id: userId }),\n\t\t\trequestId\n\t\t};\n\t\tconst channel = `user-${userId}`;\n\t\ttry {\n\t\t\tawait this.pubnub.publish(\n\t\t\t\tmessage,\n\t\t\t\tchannel\n\t\t\t);\n\t\t}\n\t\tcatch (error) {\n\t\t\t// this doesn't break the chain, but it is unfortunate\n\t\t\tthis.warn(`WARNING: Unable to publish user op to channel ${channel}: ${JSON.stringify(error)}`);\n\t\t}\n\t}", "newMessage(userName, messageText) {\n const newMessageObj = {\n type: 'user',\n username: userName,\n content: messageText\n };\n console.log('about to send:', newMessageObj);\n this.socket.send(JSON.stringify(newMessageObj));\n }", "sendMail(message) {\r\n return this.clone(User, \"sendMail\").postCore({\r\n body: jsS(message),\r\n });\r\n }", "sendMessageToUser(user, msgType, msgPayload) {\n\t\tlet userId = String(user.id || user);\n\t\tconsole.log('ws: → to user', userId, msgType);\n\n\t\tif (this._users[userId] !== undefined) {\n\t\t\tlet connections = this._users[userId].connections;\n\t\t\tlet connectionIds = Object.keys(connections);\n\t\t\tfor (let connectionId of connectionIds) {\n\t\t\t\tthis.sendMessageToConnection(user, connectionId, msgType, msgPayload);\n\t\t\t}\n\t\t}\n\t}", "function sendMessageToUser(email, msg) {\n const query = \"SELECT * FROM user_data WHERE email LIKE '\" + email + \"'\";\n database.query(query).then(userData => {\n const phone = userData[0].phone;\n sns.sendMessage(phone, msg).then(() => {\n console.log(\"User notified.\");\n }).catch(err => {\n console.log(\"Couldn't send Sms.\");\n });\n }).catch(err => {\n console.error(err.stack);\n });\n}", "function sendUserInfo() {\n var task = new Task(\"setUser\");\n task.user_id = user.id;\n task.username = user.username;\n var jsonStringTask = JSON.stringify(task);\n webSocket.send(jsonStringTask);\n}", "function echo(message) {\n var fromId = message.from.id;\n var resp = 'User ID ' + message.from.id + ' says \"' + message.text + '\"';\n bot.sendMessage(fromId,resp);\n}", "function messageSend(message) {\n sendMessage(message, roomID);\n }", "function sendMessage(room_id, user_id) {\n\t\n\t//REST api uri\n\tvar sendmessageRoomURI = roomsURI + \"/\" + room_id + \"/messages\"\n\t$(\"#chat-room-send-input\").val();\n\t\n\t//Send message\n\tconsole.log(sendmessageRoomURI);\n\tvar posting = $.post(sendmessageRoomURI, {\n\t\tuserId : user_id,\n\t\tmessageContent : $(\"#chat-room-send-input\").val()\n\t});\n\n}", "function sendTo(connection, message){\n\tconnection.send(JSON.stringify(message));\n}", "function sendEmail(user_email, firstName, message) {\n\n var data = {\n to: '[email protected]',\n from: user_email,\n template: 'contact-email',\n subject: 'Nouveau Message',\n context: {\n name: firstName,\n email: user_email,\n message: message\n }\n };\n smtpTransport.sendMail(data);\n}", "function sendMessage(currentLobby, to, msg, type) {\r\n if (type === USER) {\r\n if (currentLobby.sendOptionuser == 1) {\r\n to.chat(msg);\r\n } else if (currentLobby.sendOptionuser == 2) {\r\n to.poke(msg);\r\n }\r\n } else if (type === SUPPORTER) {\r\n if (currentLobby.sendOptionsupporter == 1) {\r\n to.chat(msg);\r\n } else if (currentLobby.sendOptionsupporter == 2) {\r\n to.poke(msg);\r\n }\r\n }\r\n }", "greetUser() {\n Channel.botMessage(`\\nHello, ${this.user}!\\n\\n`)\n }", "async function sendMessageToSmooch(visitorId, text) {\n\tawait smooch.appUsers.sendMessage(SMOOCH_APP_ID, visitorId, {\n\t\ttext, type: 'text', role: 'appMaker'\n\t});\n\n\tconsole.info('Called sendMessageToSmooch for', visitorId);\n}", "function sendTo(connection, message) { \n connection.send(JSON.stringify(message)); \n}", "execute(message, args) {\n const taggedUser = message.mentions.users.first();\n message.channel.send(`Jo ${taggedUser.username}, iemand probeert je de ober uit te trappen`);\n }", "sendMsg() {\n\t\tif (this.state.selectedUser !== '') {\n\t\t\tconst message = this.refs.msg.value;\n\t\t\tthis.refs.msg.value = '';\n\t\t\taxios.get('/api/current-user')\n\t\t\t.then(({data})=> {\n\t\t\t\tconst username = data.username; //Remove once finished\n\t\t\t\tsocket.emit('direct-send', {username: username, message: message, selectedUser: this.state.selectedUser});\n\t\t\t});\n\t\t}\n\t}", "handleOnUserMessage() {\n var user = this; // der aktuelle User\n user.socket.on(\"message\", function(message){\n console.log(\"[User`\"+user.Username+\"`] sent message: \" + message);\n user.room.handleOnUserMessage(user, message);\n });\n}", "function notifyHabitica(msg) {\n var data = {\n message: msg,\n toUserId: Vars.UserData.Credentials.uid\n };\n callAPI(\"POST\", 'members/send-private-message', JSON.stringify(data));\n}", "function message (data) {\n let name = data.source.name\n let screenName = data.source.screen_name\n \n // DM user\n\n console.log('Messaged by: ' + name + ' @' + screenName)\n}", "async sendMessage (toSend) {\n\t\tif (!this._isActive) throw new Error(`Connection is not active!`);\n\n\t\tconst packet = {\n\t\t\thead: {\n\t\t\t\ttype: this._role,\n\t\t\t\tversion: \"0.0.1\",\n\t\t\t},\n\t\t\tdata: toSend,\n\t\t};\n\n\t\tthis._ctx.dc.send(JSON.stringify(packet));\n\t}", "function messageTransmit (message) { // eslint-disable-line no-unused-vars\n soField.value = ['User \"' + message.user + '\": ' + message.message, soField.value].join('\\n');\n }", "function sendSocketMessage(userId, message){\n if(sockets[userId]){\n console.log(\"Sending to Socket: \",userId, sockets[userId]);\n try{\n sails.sockets.emit(sockets[userId],\"groupMessage\",message);\n }\n catch(e){\n console.log(\"Exception: \",e);\n }\n }\n }", "function sendMessage(number, message){\n client.sendMessage({\n\n to:number, // Any number Twilio can deliver to\n from: NUMBER, // A number you bought from Twilio and can use for outbound communication\n body: message // body of the SMS message\n\n}, function(err, responseData) { //this function is executed when a response is received from Twilio\n\n if (err) {\n console.log(err);\n console.log(responseData.from);\n console.log(responseData.body);\n }\n});\n}", "function printMessage(fromUser, message) {\n var $user = $('<span class=\"username\">').text(fromUser + ':');\n if (fromUser === username) {\n $user.addClass('me');\n }\n var $message = $('<span class=\"message\">').text(message);\n var $container = $('<div class=\"message-container\">');\n $container.append($user).append($message);\n $chatWindow.append($container);\n $chatWindow.scrollTop($chatWindow[0].scrollHeight);\n }", "function printMessage(fromUser, message) {\n const $container = $('<div class=\"c-message\">');\n const $message = $('<span class=\"c-message__content\">').text(message);\n\n if (fromUser === username) {\n const $user = $(`<div class=\"c-message__username\" title=\"${fromUser}\">`)\n .html('<span\">You</span>')\n .addClass('is-owner');\n\n $container.append($user).append($message);\n } else {\n const userAbbreviation = getNameAbbreviation(fromUser);\n const $user = $(`<div class=\"c-message__username\" title=\"${fromUser}\">`)\n .html(`<span>${userAbbreviation}</span>`);\n\n $container\n .addClass('is-client-message')\n .append($message)\n .append($user);\n }\n\n $chatWindow.append($container);\n $chatWindow.scrollTop($chatWindow[0].scrollHeight);\n }", "function sendTypingToChat(user) {\r\n return (chatId, isTyping) => {\r\n io.emit(`${TYPING}-${chatId}`, {user, isTyping})\r\n }\r\n}", "function sendToLobby(message){\n\t\tvar obj = {\"player\":\"Server\",\"role\":\"game\",\"message\":message};\n\t\tio.to('lobby').emit('message', obj);\n\t}", "function sendGuess(user) {\n // Configure the packet to be sent\n let data = {\n type: \"guess\",\n state: {\n goal: state.goal,\n word: state.word,\n letters: state.letters,\n },\n };\n // Broadcast the message to all users in the channel\n gatheract.sendMessage(data, user);\n}", "function sendMessage(message)\r\n { \r\n try\r\n {\r\n ChatWindow.SendMessage(getMyWebID(),getOtherWebID(), escape(getMyNick()), escape( message ) ,sendMessage_CallBack);\r\n }\r\n catch(ex)\r\n { \r\n \r\n }\r\n }", "sendMessage(req, res) {\n const message = req.param('message')\n const socketToRecieve = req.param('socket')\n\n sails.sockets.broadcast(socketToRecieve, 'LiveChatMessage', {\n message,\n name: req.session.livechat.displayName || req.user.firstName + ' ' + req.user.lastName\n })\n }", "addMessage (content, username, userColor) {\n this.socket.send(JSON.stringify({\n type: 'incomingMessage', \n username, \n content,\n userColor\n }));\n }", "function sendMessage (message) {\n connection.sendMessage({\n message: message\n });\n renderMessage(message);\n }", "function sendMessage () {\n var message = $inputMessage.val();\n if(message.charAt(0) == '@'){\n var pmuser = message.substr(1,message.indexOf(' ')).trim();\n message = message.substr(message.indexOf(\" \") + 1);\n $inputMessage.val('@'+pmuser+' ');\n addChatMessage({\n username: username,\n message: message,\n pmuser: pmuser\n }); \n socket.emit('new message', message,pmuser);\n }\n else {\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message,\n pmuser: null\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message,null);\n }\n }\n }", "function printMessage(fromUser, message) {\n var $user = $('<span class=\"username\">').text(fromUser + ':');\n if (fromUser === username) {\n $user.addClass('me');\n }\n var $message = $('<span class=\"message\">').text(message);\n var $container = $('<div class=\"message-container\">');\n $container.append($user).append($message);\n $chatWindow.append($container);\n $chatWindow.scrollTop($chatWindow[0].scrollHeight);\n }", "function sendMessage(message, drone) {\n drone.publish({\n room: roomName,\n message\n })\n}", "function printMessage(fromUser, message) {\n // if (message.search(\"@anon\")>=0)\n // {\n // fromUser=\"hidden\";\n // }\n var $user = $('<span class=\"username\">').text(fromUser + ':');\n if (fromUser === username) {\n $user.addClass('me');\n }\n var $message = $('<span class=\"message\">').text(message);\n var $container = $('<div class=\"message-container\">');\n $container.append($user).append($message);\n\n $chatWindow.append($container);\n //console.log(message)\n\n\n\n $chatWindow.scrollTop($chatWindow[0].scrollHeight);\n //wait(10000);\n //$chatWindow.append(\"yo\");\n }", "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message\n });\n}", "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message\n });\n}", "function sendTypingToChat(user) {\n return (chatId, isTyping) => {\n io.emit(`${TYPING}-${chatId}`, { user, isTyping });\n };\n}", "function send(message) {\n // Iterate through all potential clients\n clients.forEach(function(client) {\n // User is still connected, send message\n if(client._open) {\n client.send(message);\n }\n // Prune out disconnected user\n else {\n delete client;\n }\n });\n}", "function SendToChat(text) {\n client.say(current_channel, text);\n}", "function printMessage(fromUser, message) {\n var $message = $('<span class=\"message\">').text(message);\n var $container = $('<div class=\"message-container\">');\n\n if (fromUser === username) {\n $container.addClass('me');\n }\n\n $container.append($message);\n $chatWindow.append($container);\n $chatWindow.scrollTop($chatWindow[0].scrollHeight);\n }", "function echo(message) {\n \n bot.sendMessage({\n\t chat_id: message.chat.id,\n\t text: 'User ID ' + message.from.id + ' says \"' + message.text + '\"',\n });\n}", "sendMessage(message) {\n if (this.handler) {\n this.handler.sendMessageFor(message, this.identity);\n }\n }", "function sendMessage(message) {\n\tdrone.publish({\n\t room: roomName,\n\t message\n\t});\n }", "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message,\n });\n }", "function sendMessage(target, context, message) {\r\n if (context[\"message-type\"] === \"whisper\") {\r\n client.whisper(target, message);\r\n } else {\r\n client.say(target, message);\r\n }\r\n}", "send(bot, mode = 2, ...message) {\n let ranidb = require(\"ranidb\");\n let users = new ranidb(\"./db/users.json\").getAll();\n Array.from(users).forEach((user) => {\n if ((user.mode || 2) === mode || mode === 0) {\n bot.telegram.sendMessage(user.id, ...message);\n }\n });\n }", "function sendCommand(text,to) {\n if (st == Strophe.Status.CONNECTED) { \n var stanza = new Strophe.Builder( \"message\", {\"to\": to,\n \"type\": \"chat\"} ).c(\"body\").t(text);\n connection.send(stanza);\n } \n}", "function send_messge(messge_object,user_id,callback){\n // checking validations //\n messge_model.validate_messge_object(messge_object,function(err,validation_response){\n if(err == null ){\n // validate if reciever exists or not //\n user_controller.validate_user(messge_object.to_user,user_id,function(v_error,v_resonse){\n if(v_error == null ){\n if(v_resonse == -1){\n callback(v_error,\"Failed to send. You are blocked by \"+messge_object.to_user);\n }\n else if (v_resonse == 0) {\n callback(v_error,\"ERROR :: User with username \"+messge_object.to_user+\" doesn't exists. Please enter correct username.\");\n }\n else{\n // execute db update i.e send message.\n db.update(\"insert into messages (sender_id,reciever_id,subject,content) values (?,?,?,?)\",\n [user_id,v_resonse,messge_object.subject,messge_object.content],function(error,response){\n if (error == null)\n callback(error,\"Message has been sent.\");\n else\n callback(error,\"ERROR :: \"+error);\n });\n }\n }else{\n callback(v_error,\"ERROR :: \"+v_error);\n }\n });\n }\n else{\n callback(err,\"ERROR:\"+err);\n }\n });\n}", "function send(user)\n{\n\t//---call the current date---//\n\tvar d = new Date();\n\t\n\t//---catch the content of the textArea---//\n\tvar msgTextArea = $(\"#textA\").val();\n\t\n\t//---Clear the textArea---//\n\t$(\"#textA\").val('');\n\t\n\t//---set the data array which will be send by the POST method---//\n\tvar formData = {user: user, date: getStringDate(d), msg: msgTextArea};\n\t\n\t//---Send AJAX query---//\n\t$.ajax(\n\t{\n\t\turl : \"AjaxAddMsg.php\",\n\t\ttype: \"POST\",\n\t\tdata : formData,\n\t\terror: function ()\n\t\t{\n\t\t\talert(\"erreur server !!!\");\n\t\t}\n\t});\n\t\n\t//---Refresh message---//\n\tloadXMLDoc(\"msgQuery\");\n}", "function sendMsgTo(userLoggedin, msgTxt,pvtMsgType,usrName, pageType){\r\n\r\n \t if(validateMsg(userLoggedin,msgTxt)==-1)\r\n \t\t return -1;\r\n \t \r\n\t var toUsrName=document.getElementById(\"users\");\r\n var selIdx= toUsrName.selectedIndex;\r\n \r\n \t if(selIdx==-1)\r\n \t {\r\n \t\t alert(\"Please selected the user\");\r\n \t\t return 0;\r\n \t }\r\n \t \r\n // User to whom message is to be sent \t \r\n var touser = toUsrName.options[selIdx].value;\r\n \r\n //user who is sending message\r\n var usrName=document.getElementById(usrName).value;\r\n // message that needs to be sent\r\n \r\n \t if(touser==usrName)\r\n \t {\r\n \t\t alert(\"You cannot send message to yourself\");\r\n \t\t return 0;\r\n \t }\r\n \t \r\n \t \r\n \t var msgTxt = document.getElementById(\"msgTxt\").value;\r\n \t \r\n// \t alert(\"userLoggedin=\" + userLoggedin +\", msgTxt =\" + msgTxt + \", pvtMsgType =\" + pvtMsgType + \",usrName =\" + usrName +\", pageType=\"+ pageType);\r\n document.getElementById(\"msgTxt\").value=\"\";\r\n socket.emit(pvtMsgType, {\r\n \"name\": usrName,\r\n \"msgTxt\": msgTxt,\r\n \"to\" :touser,\r\n \"pageType\":pageType\r\n });\r\n \r\n\t}", "function replyWithMessage(message, user) {\n\n web.im.open(user).then((directMessage) => {\n\n web.chat.postMessage(directMessage.channel.id, message, {\n \"attachments\": [\n {\n \"color\": \"good\", \n \"title\": \"The Right Words for the Job\",\n \"title_link\": \"https://medium.com/women-in-product/genderwords-b0be0cc8251f\",\n \"text\": \"How Gendered Language Affects the Workplace\",\n \"author_name\": \"Deb Liu\"\n }\n ]\n });\n });\n}", "function sendMessage(){}" ]
[ "0.74648356", "0.743412", "0.73770374", "0.70162135", "0.69861406", "0.68941504", "0.68892694", "0.687978", "0.6875167", "0.6859003", "0.68459374", "0.6843708", "0.68323773", "0.68323773", "0.6814418", "0.6806661", "0.67542964", "0.6745113", "0.67390233", "0.67185134", "0.67169523", "0.6686139", "0.6669566", "0.6638264", "0.66122204", "0.66090244", "0.6604937", "0.6604937", "0.65982735", "0.6592596", "0.65868133", "0.6568619", "0.6562148", "0.65594053", "0.65491056", "0.65386677", "0.65356797", "0.65328515", "0.6529716", "0.65135634", "0.651352", "0.650865", "0.65083176", "0.65012705", "0.6499539", "0.64951444", "0.6493651", "0.64838684", "0.6474265", "0.64668643", "0.64590067", "0.6452521", "0.64511853", "0.64334923", "0.6426486", "0.64169586", "0.6410869", "0.6404892", "0.6402548", "0.6397313", "0.6379376", "0.6359164", "0.6348399", "0.6320269", "0.63052064", "0.6288822", "0.6287638", "0.6284158", "0.6257166", "0.6252506", "0.62466854", "0.6236294", "0.62361836", "0.62281495", "0.6224487", "0.6222529", "0.62159646", "0.6209372", "0.6204357", "0.6203677", "0.62006396", "0.6195778", "0.61841935", "0.61841935", "0.61695164", "0.61669296", "0.6156831", "0.61504865", "0.61493576", "0.6148605", "0.6145428", "0.61450493", "0.6141733", "0.61371243", "0.61362725", "0.61356944", "0.6130158", "0.61235785", "0.61226", "0.61206824" ]
0.66041464
28
Remove a particular message from the chat
removeMessage(id) { this.socket.call("deleteMessage", [id]).catch((reason) => { console.log("Delete Message Error: " + reason); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove() {\n MessagingModule.removeMessage(this.conversation, this.uuid);\n }", "function removeMessage( id ) {\n message.remove( id );\n}", "removeMessage(id){\n this.messages.delete(id);\n }", "function deleteMessage(element) {\n const id = element.attr('id');\n query('type=deleteMessage&id=' + id.replace('m', ''));\n element.remove();\n}", "async delete_message(msgid) {\n \n }", "async function remove(msg) {\n const { id: user_id, is_bot } = msg.left_chat_member;\n const { id: group_id } = msg.chat;\n\n // if odoj bot deleted, delete group and all of its member data\n if (is_bot && user_id == process.env.BOT_ID) {\n await Group.findOneAndDelete({ group_id });\n await User.deleteMany({ group_id });\n await Record.deleteMany({ group_id });\n }\n\n // delete member in database and pull its id from group data\n else {\n const user = await User.findOneAndDelete({ user_id });\n await Group.updateOne({ group_id }, { $pull: { members: user._id } });\n }\n}", "_deleteMessageElement(message) {\n const registeredMessage = messageRegistry.get(message);\n const messageElement = registeredMessage && registeredMessage.messageElement;\n if (messagesContainer && messageElement) {\n messagesContainer.removeChild(messageElement);\n }\n messageRegistry.delete(message);\n }", "function deleteMsg(e) {\n let root = e.parentNode.parentNode.parentNode.parentNode;\n let mid = root.getAttribute('id').replace('msg-', '');\n $.post(\"/chatroom/deleteMsg\", {mid: mid, cid: chatroomId, user: username}, function () {\n root.parentNode.removeChild(root);\n }, \"json\");\n}", "function delete_message()\n {\n var activity_id=$('.message.messow.open').attr('id').split('msac')[1];\n var delete_message= confirm(\"Do you really want to delete this message?\");\n if(delete_message)\n {\n $.ajax({\n url: '/messages',\n type:'delete',\n data:{'activity_id':activity_id}\n });\n $('#comment_area').fadeOut('');\n $('.comment-input').hide();\n $('#msac'+activity_id).fadeOut('slow',function(){$(this).remove()});\n }\n }", "async clearMessage(messageKey) {\n const tag = Math.round(Math.random() * 1000000);\n const attrs = [\n 'chat',\n { jid: messageKey.remoteJid, modify_tag: tag.toString(), type: 'clear' },\n [\n ['item', { owner: `${messageKey.fromMe}`, index: messageKey.id }, null]\n ]\n ];\n const result = await this.setQuery([attrs]);\n const chat = this.chats.get(Utils_1.whatsappID(messageKey.remoteJid));\n if (chat) {\n const value = chat.messages.get(Utils_1.GET_MESSAGE_ID(messageKey));\n value && chat.messages.delete(value);\n }\n return result;\n }", "function deleteMsg(numToDel, channel, exclusions = []){\r\n // channel = bot.channels.find(\"name\", channel) // deprecated\r\n channel = bot.channels.find(x => x.name === channel) // same thing\r\n if (typeof exclusions === 'string' || exclusions instanceof String){ // encapsulates string in a list if it's just a string\r\n exclusions = [exclusions]\r\n }\r\n\r\n channel.fetchMessages({limit: numToDel}).then(messages => {\r\n var lastMsg = 0\r\n messages.forEach(function(value, key) {\r\n // console.log(messages.get(key).author.username == 'Lukec436_Ziemniak')\r\n if (lastMsg == key){ // in case channel.fetchmessages fetches duplicate messages\r\n return // because this is a function passed into forEach\r\n } else{\r\n lastMsg = key\r\n }\r\n\r\n for(var i = 0; i < exclusions.length; i++){\r\n // console.log(messages.get(key).author.username + \" : \" + exclusions[i])\r\n if (messages.get(key).author.username == exclusions[i]){\r\n return // stop looking at this message\r\n }\r\n }\r\n messages.get(key).delete(1000)\r\n .catch(console.error);\r\n // console.log(\"deleting \" + messages.get(key).author.username + \" : \" + messages.get(key).content)\r\n })\r\n // messages[1].delete(1000)\r\n })\r\n}", "_deleteMessageElement(key) {\n const registeredMessage = messageRegistry.get(key);\n const messageElement = registeredMessage && registeredMessage.messageElement;\n if (messagesContainer && messageElement) {\n messagesContainer.removeChild(messageElement);\n }\n messageRegistry.delete(key);\n }", "_deleteMessageElement(key) {\n const registeredMessage = messageRegistry.get(key);\n const messageElement = registeredMessage && registeredMessage.messageElement;\n if (messagesContainer && messageElement) {\n messagesContainer.removeChild(messageElement);\n }\n messageRegistry.delete(key);\n }", "_removeMsg(id) {\n if (this._sentmsg[id]) {\n if (this._sentmsg[id].refTimeout) {\n clearTimeout(this._sentmsg[id].refTimeout);\n }\n delete this._sentmsg[id];\n }\n }", "function removeMSG(msg) {\n setTimeout(function () {\n var Idx = msg.Msg;\n var isConf = !!msg.UID;\n\n var message = document.getElementById(isConf ? \"conf-\" + msg.UID + \"-\" + Idx : \"priv-\" + Idx);\n\n if (message){\n message.innerHTML = \"\";\n }\n }, 100);\n }", "removeMsg(uuid) {\n state.destroy(uuid);\n m.redraw();\n }", "function removeUserField(msg) {\n var arr = msg.match(chat_re);\n if (arr == null)\n return msg;\n else\n return arr[2];\n}", "_deleteMessageElement(key) {\n this._messageRegistry.get(key)?.messageElement?.remove();\n this._messageRegistry.delete(key);\n }", "delete() {\n if (typeof this.ctxPtr !== 'undefined' && this.ctxPtr !== null) {\n Module._vscr_ratchet_message_delete(this.ctxPtr);\n this.ctxPtr = null;\n }\n }", "function deleteMessage() {\n var target = $(\".delete-message\")\n target.click(function () {\n $(this).parents(\".box-messaggio\").remove();\n })\n}", "function deleteMessages(){\n\tvar chats = document.getElementById(\"chats\");\n\twhile(chats.children.length>0){\n\t\tchats.removeChild(chats.lastElementChild);\n\t}\n}", "function deleteMessage(id) {\n var div = document.getElementById(id);\n // If an element for that message exists we delete it.\n if (div) {\n div.parentNode.removeChild(div);\n }\n }", "function unregChatInfo(message) {\n if (\n (message.chat.type === 'group') && // make sure the event originated from a group\n (message.left_chat_participant.id === telegram.getId()) // the event is about the default bot\n ) {\n // remove registered info about this chat group\n db.Chats.destroy({ where: { id: message.chat.id } })\n .then(() => {\n // send a message to inform the admin\n telegram.sendMessage({\n chat_id: telegramConfig.masterAccount.id,\n text: `${telegram.name()} has been removed from ${message.chat.title} group`\n });\n }).catch((error) => {\n console.log('an error had occured');\n console.log(JSON.stringify(error, null, ' '));\n });\n }\n}", "async deleteMessage(k, messageKey) {\n if (typeof k === 'object') {\n messageKey = k;\n }\n const json = {\n protocolMessage: {\n key: messageKey,\n type: Constants_1.WAMessageProto.ProtocolMessage.ProtocolMessageType.REVOKE\n }\n };\n const waMessage = this.prepareMessageFromContent(messageKey.remoteJid, json, {});\n await this.relayWAMessage(waMessage);\n return waMessage;\n }", "function destroyMessages(event){\n var id = event.target.id;\n var ref = db.ref('messages/' + id);\n ref.remove();\n}", "function deleteFirstMessage() {\n var y = scroller.scrollTo(),\n h1 = $.$('body').attr( 'scrollHeight' ),\n h2;\n \n message.remove( 0 );\n \n h2 = $.$('body').attr( 'scrollHeight' );\n \n // Keep scroll position from \"drifting\" when scrolled back.\n scroller.scrollTo( Math.max( 0, y - h1 + h2 ), true, true );\n}", "function deleteMessage(id) {\n var div = document.getElementById(id);\n // If an element for that message exists we delete it.\n if (div) {\n div.parentNode.removeChild(div);\n }\n}", "function deleteMessage(id) {\n var div = document.getElementById(id);\n // If an element for that message exists we delete it.\n if (div) {\n div.parentNode.removeChild(div);\n }\n}", "function removeItem(e) {\n\t\tvar id = jQuery(this).parents('li').attr('data-id');\n\t\tif(id){\n\t\t\tfirebase.database().ref().child('/messages/'+id).remove();\n\t\t}\n\t}", "unregisterMessage(msg) {\n let self = this;\n\n if (typeof msg !== \"string\") {\n throw new TypeError(`Unregister Message Error: Message argument should be of type string`);\n }\n\n delete self.messages[msg];\n delete self.listeners[msg];\n }", "function getRemovedMessage(message) {\n let messageId = message.message_id;\n // if the removed message exists in receivedMessages, transfer it to removedMessages\n if(receivedMessages[messageId]) {\n addRemovedMessage(messageId);\n }\n // if the removed message exists in local storage, return it\n if(removedMessages[messageId]) {\n let message = removedMessages[messageId];\n let messageBody = message.body;\n if(message.has_attachment) { // the message has a link\n let attachment = message.attachments[0];\n let link = \"\";\n if(attachment.share) {\n link = attachment.share.uri;\n }\n if(attachment.thumbnail_url) {\n link = attachment.thumbnail_url;\n }\n if(attachment.preview_url) {\n link = attachment.preview_url; \n }\n if(attachment.large_preview_url) {\n link = attachment.large_preview_url;\n }\n if(attachment.url) {\n link = attachment.url;\n }\n // if the message has a body, return the body and the link, else just the link itself\n return message.body.length > 0 ? `${messageBody} ${link}` : link;\n }\n return messageBody;\n }\n return null; // the message doesn't exist in local storage\n}", "function removeChatTyping (data) {\n // getTypingMessages(data).fadeOut(function () {\n // $(this).remove();\n // });\n console.log(\"removeChatTyping\")\n }", "function deleteChat(id) {\n return db.query(('DELETE FROM chats WHERE id=?', id));\n}", "function removeChatboxByChatId(chatId){\n console.log(\"Hiding... \" + chatId);\n hideChatty(chatId);\n $.sirkel.activeBoxes[chatId].hide();\n $.sirkel.openBoxes[chatId] = false;\n $.sirkel.activeMarkers[chatId].setVisible(false);\n //getChatContainer(chatId).removeClass('new-message');\n }", "function deletemessagefromotherusers({ id }) {\n messagestore.map((msg, index) => {\n if (msg.id === id) {\n messagestore.splice(index, 1);\n }\n })\n filteredmessages = messagestore;\n setchats([messagestore])\n scrollmessages();\n }", "_deleteMessageElement(key) {\n var _a, _b;\n\n (_b = (_a = this._messageRegistry.get(key)) === null || _a === void 0 ? void 0 : _a.messageElement) === null || _b === void 0 ? void 0 : _b.remove();\n\n this._messageRegistry.delete(key);\n }", "function clearMessages() {\n\t$('.message').remove();\n}", "removeContactMessage(contactid) {\n\n return axios.delete(API_URL + 'remove/?contactId=' + contactid, {\n headers: authenticationHeader()\n });\n\n }", "deleteMessage(userId) {\n this.messageServive.deleteConvo(userId).subscribe(deletedMSG => {\n if (deletedMSG) {\n this.infoMsg = 'Conversation DELETED';\n this.isReply = true;\n this.viewAllMessages();\n setTimeout(() => {\n this.isReply = false;\n this.messageReply = '';\n }, 3000);\n }\n });\n }", "function clearMsg() {\n const msgElement = document.querySelector('.msg');\n if (msgElement !== null) {\n msgElement.remove();\n }\n}", "remove() {\n this.sender.remove();\n this.receiver.remove();\n this.session.remove();\n }", "function destroy(msg)\r\n{\r\n var thisData = getRoom(msg[\"room\"]);\r\n while (thisData.length) {\r\n\t\t thisData.pop();\r\n\t }\r\n delete roomObj[msg[\"room\"]];\r\n web.io.emit(\"servermessage\", {\r\n \"room\": msg[\"room\"],\r\n \"command\": \"destroy\"\r\n });\r\n}", "function removeChatTyping(data) {\n getTypingMessages(data).fadeOut(() => {\n $(this).remove();\n });\n }", "function removeChatTyping (data) {\n getTypingMessages(data).fadeOut(function () {\n $(this).remove();\n });\n }", "function removeChatTyping (data) {\n getTypingMessages(data).fadeOut(function () {\n $(this).remove();\n });\n }", "function removeChatTyping (data) {\n getTypingMessages(data).fadeOut(function () {\n $(this).remove();\n });\n }", "function removeChatTyping (data) {\n getTypingMessages(data).fadeOut(function () {\n $(this).remove();\n });\n }", "function deleteMessage(id) {\n var div = document.getElementById(id);\n // If an element for that message exists we delete it.\n if (div) {\n div.parentNode.removeChild(div);\n }\n}", "deleteMessage(id) {\n axios.delete(`messages/${id}`)\n .then(() => this.setState({\n messages: this.state.messages\n .filter(message => message.id !== id)\n }));\n }", "async remove() {\n clearTimeout(this.timer);\n try {\n await this.message.clearReactions();\n } catch (e) {\n console.log(e);\n }\n jet.slideTabs.delete(this.userID);\n }", "cancellaMessagio(index){\n this.contacts[this.contattoAttivo].messages.splice(index, 1);\n }", "function removeChatTyping (data) {\n getTypingMessages(data).fadeOut(function () {\n $(this).remove();\n });\n }", "deleteMessageCallBack(message){\n this.props.deleteMessage(message.nummess);\n }", "function deleteMessage(id) {\n // console.log(id);\n // const id = event.target.dataset.id\n fetch(`${BASE_URL}/${id}`, {\n method: 'DELETE',\n })\n .then(response => response.json())\n .then(result => console.log('Success:', result))\n .catch(error => console.error('Error:', error));\n}", "removeMsg(e, callback){\r\n\t\tif (e.status == \"masuk\" || e.status == \"terkirim\") {\r\n\t\t\tlet newComFetch = new ComFetch();\r\n\t\t\tlet data = {};\r\n\t\t\tlet resource = api_uri+'JSON/';\r\n\t\t\tif (e.status == \"masuk\") {\r\n\t\t\t\tdata = {\r\n\t\t\t\t\t\t\"pmto_deleted\": 1,\r\n\t\t\t\t\t\t}\r\n\t\t\t\tresource = api_uri+'JSON/PrivmsgsTo/'+e.id;\r\n\t\t\t}else if (e.status == \"terkirim\") {\r\n\t\t\t\tdata = {\r\n\t\t\t\t\t\t\"privmsg_deleted\": 1,\r\n\t\t\t\t\t\t}\r\n\t\t\t\tresource = api_uri+'JSON/Privmsgs/'+e.id;\r\n\t\t\t}\r\n\t\t\tnewComFetch.setHeaders({Authorization:this.jwt_signature});\r\n\t\t\tnewComFetch.setRestURL(base_url);\r\n\t\t\tnewComFetch.setMethod('POST');\r\n\t\t\tnewComFetch.setResource(resource);\r\n\t\t\tnewComFetch.setSendData(data);\r\n\t\t\tnewComFetch.sendFetch((resp) => { callback(resp); });\r\n\t\t }\r\n\t}", "deleteAskMessage(reqId , askId){\n return this.schema.updateOne({ _id: reqId },{'$pull': { 'askMessages': {'askId': askId}}});\n }", "function clear(msg)\r\n{\r\n var thisData = getRoom(msg[\"room\"]);\r\n while (thisData.length) {\r\n\t\t thisData.pop();\r\n\t }\r\n web.io.emit(\"servermessage\", {\r\n \"room\": msg[\"room\"],\r\n \"command\": \"clear\"\r\n });\r\n}", "remove() {\n this.offMessage();\n return Native.removeChannel(this.namespace);\n }", "function deleteMessage(target) {\n var parent = target.parentNode,\n key = parseInt(parent.dataset.key),\n panel = parent.parentNode,\n panelBody = panel.lastChild,\n transaction = db.transaction(['osMsgStore'], 'readwrite'),\n request,\n text = panelBody.innerText || panelBody.textContent,\n confirmation = confirm('Are you sure you want to delete the message starting with: ' + text.substr(1).substring(0, 5));\n\n if (!confirmation) {\n return false;\n }\n\n request = transaction.objectStore('osMsgStore').delete(key);\n\n transaction.oncomplete = function(event) {\n panel.className = panel.className.replace(' panel-appear', '');\n setMessageCount();\n setTimeout(function() {\n panel.remove();\n }, 1000);\n };\n return false;\n }", "function deleteMessagethread(messagethreadId) {\n var url = \"/api/petshelter/messagethread/\" + messagethreadId;\n return $http.delete(url);\n }", "function delete_message(){\n\t\t$('.delete_message').click(function(e){\n\t\t\te.preventDefault();\n\t\t\tvar message_id = $(this).data('id');\n\t\t\tvar url = $('#messages-select-form').attr('action');\n\n\t\t\tif(confirm('Želite li da obrišete ovu poruku?')){\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\turl: url,\n\t\t\t\t\tdata: { message_id:message_id },\n\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\tif(!data.error){\n\t\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: function(data){\n\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t\tconsole.log('Some mistake during the sending request.');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "function clearMessage() {\n $(\".chat-wrapper\").empty();\n}", "function addRemovedMessage(messageId) {\n removedMessages[messageId] = receivedMessages[messageId];\n delete receivedMessages[messageId];\n setRemovedMessages(removedMessages);\n setReceivedMessages(receivedMessages);\n}", "removeDescription(hostElement, message) {\n if (!message || !this._isElementNode(hostElement)) {\n return;\n }\n if (this._isElementDescribedByMessage(hostElement, message)) {\n this._removeMessageReference(hostElement, message);\n }\n // If the message is a string, it means that it's one that we created for the\n // consumer so we can remove it safely, otherwise we should leave it in place.\n if (typeof message === 'string') {\n const registeredMessage = messageRegistry.get(message);\n if (registeredMessage && registeredMessage.referenceCount === 0) {\n this._deleteMessageElement(message);\n }\n }\n if (messagesContainer && messagesContainer.childNodes.length === 0) {\n this._deleteMessagesContainer();\n }\n }", "onMessagesRemoved() {}", "function chatOut (msg) {\n var nickname = $(\"#nickname\")[0].value;\n if (msg == \"\" || !msg)\n return;\n chatRef.push({\n id: id,\n name: (nickname ? nickname : id),\n message: msg,\n timestamp: new Date().getTime()\n })\n}", "deleteChat(jid) {\n return this.modifyChat(jid, 'delete');\n }", "function removeChatTyping(username) {\n self.messages = self.messages.filter(function (element) { return element.username != username || element.content != \" is typing\" })\n }", "async function deleteMessage(msg) { \n const params = new URLSearchParams();\n params.append('messageId', msg.id);\n fetch('/delete-data', {method: 'POST', body: params})\n .then(response => response.text()).then((text) => {\n const confirmationElement = document.getElementById('confirm');\n confirmationElement.innerHTML=\"\";\n confirmationElement.style.display='inline-block';\n confirmationElement.innerHTML = `<i>${text}</i>`;\n setTimeout(function () {\n document.getElementById('confirm').style.display='none';}, 5000);\n });\n}", "_removeMessageListener() {\n handlers.remove(this.componentId);\n }", "function deleteMessage(your_params_here){\r\n \r\n}", "function action_removeBoardInfo(board_id){\n var msgObj = {\n boardID: board_id,\n from: userSelf.email\n };\n\n socket.emit('removeboard', msgObj);\n}", "function deleteMessage(messageId) {\n var url = \"/api/petshelter/message/\" + messageId;\n return $http.delete(url);\n }", "function removeChatTyping(data) {\n $('.msg_container_base .spinner[data-target='+data.username+']').addClass('hide');\n getTypingMessages(data).fadeOut(function () {\n $(this).remove();\n });\n }", "clearMessageText() {\r\n let action = { type: Messages_UI_State_Action_1.messagesUIActionTypes.CLEAR_MESSAGE_CONTENTS, payload: {} };\r\n this.storeAccess.dispatchAction(action);\r\n }", "function removeValidMessage() {\n let validMsg = document.querySelector(\"#valid-message\")\n if (validMsg) {\n validMsg.remove()\n }\n}", "findMessageWithCode(code) {\n var message = null;\n // Search for the index of the message\n var index = this.messages_received.findIndex((m) => {\n return (m.code === code);\n });\n // If message exist\n if (index >= 0) {\n // get and remove the message from the list\n message = this.messages_received.splice(index, 1)[0];\n }\n // Return the message\n return (message);\n }", "removeActiveMsgClick() {\n this.activeMsg = -1;\n }", "function deleteMessage(user, channel, printerr) {\r\n client.deletemessage(channel, user.id).then((data) => {\r\n \r\n }).catch((err) => {\r\n if (printerr) client.say(channel, 'AN ERROR!? ' + err);\r\n });\r\n}", "function removeMessage() {\r\n\t// Clear all messaging elements.\r\n\t $('#messaging, #status').each(function(){\r\n\t\t if ($(this).html() != \"\") {\r\n\t\t\t $(this).html(\"\");\r\n\t \t}\r\n\t });\r\n\t\r\n\t// Reset any 'invalid' classes on labels and fields.\r\n\t$('.invalid').each(function(){\r\n\t\t$(this).removeClass('invalid');\r\n\t});\r\n\t\r\n}", "function Display_removeChatUser(_id) {\n\tvar chatUser = document.getElementById(_id);\n\tvar chatUserList = document.getElementById(\"chatUserList\");\n\tchatUserList.removeChild(chatUser);\n}", "function checkForRemovedMessage(messageId) {\n let currentUserId = Modules.CurrentUser.getID();\n let messages = Modules.MessengerState.getMessagesFromIDs(currentUserId, [messageId]);\n if(messages && messages[0]) {\n let updatedMessage = messages[0];\n // the message was removed, so delete it from receivedMessages and add it to removedMessages\n if(updatedMessage.message_unsendability_status === REMOVED_MESSAGE_UNSENDABILITY_STATUS) {\n addRemovedMessage(messageId);\n }\n }\n}", "destroy() {\n client._removeMessageTypeModel(this);\n delete this.message;\n super.destroy();\n }", "function participantRemoveClick(chatId, regId) {\n // Remove the menu since it was clicked.\n var menu = $(\"#participantsPane\").find(\"#messageDropdown\");\n if (menu.length) {\n menu.remove();\n }\n\n // Remove the participant.\n messenger.participantRemove(chatId, regId);\n}", "deleteMessage() {\n // eslint-disable-next-line no-alert\n if (window.confirm('Haluatko varmasti poistaa viestin?')) {\n // eslint-disable-line no-alert\n deleteMessage(this.id).then((data) => {\n this.updateWith(data);\n });\n }\n }", "function removeInbox(id){\n\tvar query = {_id: id};\n\t \n\tvar options = {exact: true};\n\t \n\tWL.JSONStore.get(COLLECTION_INBOX).remove(query, options)\n\t\n\t.then(function (numberOfDocsRemoved) {\n\t\t//alert('message delete success');\n\t\t//alert('data nya ' + numberOfDocsRemoved);\n\t\tAppsLog.log('message delete success');\n\t\t\n\t\ttry {\n\t\t\tWL.JSONStore.get(COLLECTION_INBOX).findAll()\n\t\t\t\n\t\t\t.then(function (result) {\n\t\t\t\t//alert('hasilnya' + result);\n\t\t\t\tg_inbox = result;\n\t\t\t\t\n\t\t\t\t//alert('messagenya dari adapter : ' + JSON.stringify(g_inbox));\n\t\t\t})\n\n\t\t\t.fail(function (errorObject) {\n\t\t\t\tAppsLog.log('error delete inbox...' + errorObject);\n\t\t\t});\t\n\t\t\t\n\t\t}\n\t\t\n\t\tcatch (e) {\n\t\t\tAppsLog.log('failed ... ' + e);\n\t\t}\n\t // handle success\n\t})\n\t\n\t.fail(function (error) {\n\t // handle failure\n\t});\n}", "function singAsReaded(auth,messageId){\n const gmail = google.gmail({version:'v1',auth});\n gmail.users.messages.modify({\n userId:'me',\n id:messageId,\n requestBody:{\n removeLabelIds:['UNREAD']\n }\n },(err,res)=>{\n debugger;\n })\n}", "function deleteMessage(messageId) {\n var key = datastore.key(['Messages', messageId]);\n\n return datastore.delete(key).then(function () {\n return true;\n }).catch(function (error) {\n return false;\n });\n}", "function MessageDelete(msgIndex)\n{\n\t \n\tconsole.log(msgIndex)\n\t var r = confirm(\"Are you sure you want to delete?\");\n if (r == true) {\n\t\t\t\t setTimeout(function() {\n\t\t\t\t\t\t var index=parseInt(msgIndex);\n\t\t\t\t\t\tgeneralChannel.getMessages(1,index,).then(function(m){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tconsole.log(\"getmessage\",m);\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdeleteMessage(m)\n\t\t\t\t\t\t}) \n\t\t\t\n\t\t\t }, 10);\n } \n \n}", "function deleteMessage(id){\n return new Promise((resolve,reject)=>{\n if(!id){\n reject(\"id inválido\")\n return false\n }\n store.remove(id)\n .then(()=>{\n resolve()\n })\n .catch(e=>{\n reject(e)\n })\n })\n}", "async deleteMessage(messageId) {\n try {\n let result = await this.axiosInstance.delete(`/messages/${messageId}`);\n return result;\n } catch (err) {\n helpMeInstructor(err);\n return err;\n }\n }", "closeChat() {\n if (this.messagesRef ) {\n this.messagesRef.off();\n }\n }", "function deleteThisChat(hash) {\n $('#' + hash).remove();\n $('#chat-switch .' + hash).remove();\n}", "closeChat() {\n if (this.messagesRef) {\n this.messagesRef.off();\n }\n }", "closeChat() {\n if (this.messagesRef) {\n this.messagesRef.off();\n }\n }", "function removeFromContact(oneUser) {\n // oneUser = {\n // username : username,\n // email: email,\n // id: id\n // };\n\n var curState = getUserContactState(oneUser.email);\n var userState = \"\";\n\n switch (curState) {\n case \"NOT_EXIST\" :\n addMsgFromSys(\"This user not added to your contact!\");\n break;\n case \"ADDED\" :\n case \"DECLINED\" :\n case \"INVITED\" :\n case \"CONTACTED\" :\n default:\n userState = \"REMOVED\";\n break;\n }\n\n var msgObj = {\n from: {\n username: userSelf.username,\n email: userSelf.email,\n password: userSelf.password\n },\n toRemove: {\n state: userState,\n username: oneUser.username,\n email: oneUser.email\n }\n };\n\n socket.emit('removeFromContact', msgObj);\n}", "remove () {\n this.guild.remove('member', this.data.id)\n }", "function remove(req,res) {\n Message.findByIdAndDelete(req.params.id)\n .then(request => {\n if (!request.user === req.currentUser._id) return res.status(401).json({ message: 'Unauthorized' })\n return request.remove()\n })\n .then(()=> res.sendStatus(204))\n .catch(err => {\n res.status(400).sjon(err)\n logger.error(err)\n })\n}", "function receiveMessage(event){\n\n if (event.data==\"remove\"){\n\n var element = document.getElementById('overlay');\n\n // Remove iFrame\n element.parentNode.removeChild(element);\n\n // Enable scrolling\n document.getElementsByTagName('body')[0].style.overflow = \"visible\";\n\n // Remove listener\n window.removeEventListener(\"message\", receiveMessage);\n }\n\n}", "deleteMessageById(id) {\n Common.assertNotNull(id);\n const step = this.getStepByMessageId(id);\n if (step) {\n const index = this.model.diagram.steps.indexOf(step);\n if (index !== -1) {\n this.model.diagram.steps.splice(index, 1);\n }\n }\n this.renumber();\n }" ]
[ "0.82337105", "0.8127739", "0.77755564", "0.7425156", "0.731952", "0.727713", "0.7268239", "0.7101123", "0.7043073", "0.69181865", "0.6857531", "0.6835183", "0.6835183", "0.67983973", "0.67933697", "0.67862046", "0.6784029", "0.6771716", "0.6754467", "0.6644745", "0.66358185", "0.6625571", "0.6596246", "0.65941113", "0.65895814", "0.6584231", "0.6581346", "0.6581346", "0.65786463", "0.65517306", "0.6541463", "0.6525003", "0.65195477", "0.65142965", "0.6512118", "0.6508531", "0.6490631", "0.64837587", "0.64766335", "0.6470203", "0.6468969", "0.6465913", "0.64544696", "0.64517015", "0.64517015", "0.64517015", "0.64517015", "0.6450951", "0.64243674", "0.64120555", "0.6393826", "0.6389748", "0.6388001", "0.6385723", "0.63782597", "0.6376605", "0.63570774", "0.63489544", "0.63454473", "0.631525", "0.6297115", "0.6288059", "0.62721163", "0.6261843", "0.6261639", "0.6247672", "0.6216109", "0.62159455", "0.6209361", "0.6204449", "0.6197058", "0.6181382", "0.6178869", "0.6178548", "0.6169618", "0.616595", "0.6161051", "0.6132578", "0.61312944", "0.6128175", "0.6124012", "0.61204433", "0.61003673", "0.6095934", "0.6057493", "0.6027305", "0.60261357", "0.6016567", "0.6008666", "0.600839", "0.60044765", "0.59890753", "0.59666413", "0.5961084", "0.5961084", "0.59607023", "0.59598625", "0.59561044", "0.59559864", "0.5947842" ]
0.7646948
3
Start processing the command queue to funnel outgoing messages
startCommandQueue() { setTimeout(() => { let hasFunc = false; // Start an interval that every 100ms attempts to send a beam-chat-api command this.commandQueueInterval = setInterval(() => { if (this.socket) { let fn = this.commandQueue.shift(); if (fn) { fn(); hasFunc = true; } else if (hasFunc) { console.log("Queue is Empty"); hasFunc = false; } } }, 100); }, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n if (!this.stopped && !this.stopping) {\n this.channel.on('close', () => {\n if (this.forcelyStop || (!this.pausing && !this.paused)) {\n if (!this.trapped)\n this.emit('done');\n this.emit('close');\n }\n this.stopped = false;\n });\n this.channel.on('stream', (packet) => {\n if (this.debounceSendingEmptyData)\n this.debounceSendingEmptyData.run();\n this.onStream(packet);\n });\n this.channel.once('trap', this.onTrap.bind(this));\n this.channel.once('done', this.onDone.bind(this));\n this.channel.write(this.params.slice(), true, false);\n this.emit('started');\n if (this.shouldDebounceEmptyData)\n this.prepareDebounceEmptyData();\n }\n }", "async start() {\n if (this.status == QueueStatus.running)\n return;\n this.status = QueueStatus.running;\n let msg = '';\n do {\n try {\n msg = await this.bzpopmin(this.qName, 0); // Monitor queue forever\n // Proceed only on incoming message and re-monitor for next\n msg = JSON.parse(msg[1]); // msg:>> [queueName, msgContent]\n this.onMessage(msg);\n this.queueLimit && this.checkQueueLimit();\n } catch (error) {\n await this.handleQueueErrors(msg, error)\n }\n } while (this.status == QueueStatus.running);\n\n }", "startProcessMessages() {\n logger.debug(\"Exporter.start(): starting processing...\")\n const originators = this.config[\"originators\"]\n for (let i = 0; i < originators.length; i++) {\n this.processMessages(originators[i])\n }\n }", "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) { }\n }", "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) { }\n }", "_sendRequest () {\n if (!this._clientQueue.length) {\n this._currentCommand = false\n return this._enterIdle()\n }\n this._clearIdle()\n\n // an operation was made in the precheck, no need to restart the queue manually\n this._restartQueue = false\n\n var command = this._clientQueue[0]\n if (typeof command.precheck === 'function') {\n // remember the context\n var context = command\n var precheck = context.precheck\n delete context.precheck\n\n // we need to restart the queue handling if no operation was made in the precheck\n this._restartQueue = true\n\n // invoke the precheck command and resume normal operation after the promise resolves\n precheck(context).then(() => {\n // we're done with the precheck\n if (this._restartQueue) {\n // we need to restart the queue handling\n this._sendRequest()\n }\n }).catch((err) => {\n // precheck failed, so we remove the initial command\n // from the queue, invoke its callback and resume normal operation\n let cmd\n const index = this._clientQueue.indexOf(context)\n if (index >= 0) {\n cmd = this._clientQueue.splice(index, 1)[0]\n }\n if (cmd && cmd.callback) {\n cmd.callback(err)\n this._canSend = true\n this._parseIncomingCommands(this._iterateIncomingBuffer()) // Consume the rest of the incoming buffer\n this._sendRequest() // continue sending\n }\n })\n return\n }\n\n this._canSend = false\n this._currentCommand = this._clientQueue.shift()\n\n try {\n this._currentCommand.data = compiler(this._currentCommand.request, true)\n this.logger.debug('C:', () => compiler(this._currentCommand.request, false, true)) // excludes passwords etc.\n } catch (e) {\n this.logger.error('Error compiling imap command!', this._currentCommand.request)\n return this._onError(new Error('Error compiling imap command!'))\n }\n\n var data = this._currentCommand.data.shift()\n\n this.send(data + (!this._currentCommand.data.length ? EOL : ''))\n return this.waitDrain\n }", "processMessages() {\n if (this._currentlyProcessing) {\n // Prevent bloating the call stack.\n return;\n }\n this._currentlyProcessing = true;\n while (this._messageQueue.size > 0) {\n let [sender, descriptor, body, target] = this._messageQueue.dequeue(1);\n for (let listenerKey of this._descriptors.getAnscIt(descriptor)) {\n let {\n name: subscriberName, handler, source: senderName\n } = this._listeners[listenerKey];\n if (target !== undefined && target !== subscriberName) {\n continue;\n }\n if (senderName !== undefined && senderName !== sender) {\n continue;\n }\n \n handler(body, descriptor, sender);\n }\n }\n this._currentlyProcessing = false;\n }", "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) {}\n }", "async processQueue () {\n if (this.queue.length > 0) {\n const sendPayload = JSON.stringify(this.queue.pop())\n await this.matrix.sendMessage(this.roomId, 'm.action', sendPayload)\n }\n if (this.queue.length === 0) {\n this.processing = false\n }\n }", "start() {\n this.debug('starting listening to queue');\n this.running = true;\n // Using setTimeout instead of nextTick because we want this to happen\n // after all the other jazz in the event loop happens, rather than starving\n // it by always forcing it to happen before using nextTick\n setTimeout(async () => {\n this.emit('starting');\n await this.__receiveMsg();\n }, 0);\n }", "start() {\n const that = this;\n this.transport.socket.on('data', (data) => {\n that.bufferQueue = Buffer.concat([that.bufferQueue, Buffer.from(data)]);\n if (that.bufferQueue.length > RTConst.PROTOCOL_HEADER_LEN) { // parse head length\n const packetLen = that.bufferQueue.readUInt32BE(0);\n const totalLen = packetLen + RTConst.PROTOCOL_HEADER_LEN;\n if (that.bufferQueue.length >= totalLen) {\n // it is a full packet, this packet can be parsed as message\n const messageBuffer = Buffer.alloc(packetLen);\n that.bufferQueue.copy(messageBuffer, 0, RTConst.PROTOCOL_HEADER_LEN, totalLen);\n that.incomeMessage(RTRemoteSerializer.fromBuffer(messageBuffer));\n that.bufferQueue = that.bufferQueue.slice(totalLen); // remove parsed message\n }\n }\n });\n }", "start() {\n process.on(\"message\", (message) => {\n if (typeof message !== \"object\" || !message.id) {\n return;\n }\n this.emit(message.id, message.data);\n });\n }", "_processMessages() {\n let connection;\n let i, len;\n\n // do nothing if already closed\n if (this._closed) {\n return;\n }\n\n // do nothing if queue is empty\n if (!this._queue.length) {\n if (!this.idling) {\n // no pending jobs\n this.idling = true;\n this.emit('idle');\n }\n return;\n }\n\n // find first available connection\n for (i = 0, len = this._connections.length; i < len; i++) {\n if (this._connections[i].available) {\n connection = this._connections[i];\n break;\n }\n }\n\n if (!connection && this._connections.length < this.options.maxConnections) {\n connection = this._createConnection();\n }\n\n if (!connection) {\n // no more free connection slots available\n this.idling = false;\n return;\n }\n\n // check if there is free space in the processing queue\n if (!this.idling && this._queue.length < this.options.maxConnections) {\n this.idling = true;\n this.emit('idle');\n }\n\n let entry = (connection.queueEntry = this._queue.shift());\n entry.messageId = (connection.queueEntry.mail.message.getHeader('message-id') || '').replace(/[<>\\s]/g, '');\n\n connection.available = false;\n\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n messageId: entry.messageId,\n action: 'assign'\n },\n 'Assigned message <%s> to #%s (%s)',\n entry.messageId,\n connection.id,\n connection.messages + 1\n );\n\n if (this._rateLimit.limit) {\n this._rateLimit.counter++;\n if (!this._rateLimit.checkpoint) {\n this._rateLimit.checkpoint = Date.now();\n }\n }\n\n connection.send(entry.mail, (err, info) => {\n // only process callback if current handler is not changed\n if (entry === connection.queueEntry) {\n try {\n entry.callback(err, info);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n });\n }", "_processMessages() {\n let connection;\n let i, len;\n\n // do nothing if already closed\n if (this._closed) {\n return;\n }\n\n // do nothing if queue is empty\n if (!this._queue.length) {\n if (!this.idling) {\n // no pending jobs\n this.idling = true;\n this.emit('idle');\n }\n return;\n }\n\n // find first available connection\n for (i = 0, len = this._connections.length; i < len; i++) {\n if (this._connections[i].available) {\n connection = this._connections[i];\n break;\n }\n }\n\n if (!connection && this._connections.length < this.options.maxConnections) {\n connection = this._createConnection();\n }\n\n if (!connection) {\n // no more free connection slots available\n this.idling = false;\n return;\n }\n\n // check if there is free space in the processing queue\n if (!this.idling && this._queue.length < this.options.maxConnections) {\n this.idling = true;\n this.emit('idle');\n }\n\n let entry = (connection.queueEntry = this._queue.shift());\n entry.messageId = (connection.queueEntry.mail.message.getHeader('message-id') || '').replace(/[<>\\s]/g, '');\n\n connection.available = false;\n\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n messageId: entry.messageId,\n action: 'assign'\n },\n 'Assigned message <%s> to #%s (%s)',\n entry.messageId,\n connection.id,\n connection.messages + 1\n );\n\n if (this._rateLimit.limit) {\n this._rateLimit.counter++;\n if (!this._rateLimit.checkpoint) {\n this._rateLimit.checkpoint = Date.now();\n }\n }\n\n connection.send(entry.mail, (err, info) => {\n // only process callback if current handler is not changed\n if (entry === connection.queueEntry) {\n try {\n entry.callback(err, info);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n });\n }", "_processMessages() {\n let connection;\n let i, len;\n\n // do nothing if already closed\n if (this._closed) {\n return;\n }\n\n // do nothing if queue is empty\n if (!this._queue.length) {\n if (!this.idling) {\n // no pending jobs\n this.idling = true;\n this.emit('idle');\n }\n return;\n }\n\n // find first available connection\n for (i = 0, len = this._connections.length; i < len; i++) {\n if (this._connections[i].available) {\n connection = this._connections[i];\n break;\n }\n }\n\n if (!connection && this._connections.length < this.options.maxConnections) {\n connection = this._createConnection();\n }\n\n if (!connection) {\n // no more free connection slots available\n this.idling = false;\n return;\n }\n\n // check if there is free space in the processing queue\n if (!this.idling && this._queue.length < this.options.maxConnections) {\n this.idling = true;\n this.emit('idle');\n }\n\n let entry = (connection.queueEntry = this._queue.shift());\n entry.messageId = (connection.queueEntry.mail.message.getHeader('message-id') || '').replace(/[<>\\s]/g, '');\n\n connection.available = false;\n\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n messageId: entry.messageId,\n action: 'assign'\n },\n 'Assigned message <%s> to #%s (%s)',\n entry.messageId,\n connection.id,\n connection.messages + 1\n );\n\n if (this._rateLimit.limit) {\n this._rateLimit.counter++;\n if (!this._rateLimit.checkpoint) {\n this._rateLimit.checkpoint = Date.now();\n }\n }\n\n connection.send(entry.mail, (err, info) => {\n // only process callback if current handler is not changed\n if (entry === connection.queueEntry) {\n try {\n entry.callback(err, info);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n });\n }", "_sendMessages () {\n while (!this._queue.isEmpty() && this._connection.isConnected()) {\n this._connection.send(this._queue.pop())\n }\n }", "start () {\n // stop old running task\n if (this._worker_executor !== undefined) {\n this.stop()\n }\n debug('Push interactor started')\n this._worker_executor = setInterval(this._worker.bind(this), cst.STATUS_INTERVAL)\n this._ipm2.bus.on('*', this._onPM2Event.bind(this))\n }", "async run_cmd_queue() {\n for (;;) {\n if (this.cmd_queue.length === 0) {\n return;\n }\n const { command, resolve, reject } = this.cmd_queue[0];\n const reply = await this.process_cmd(command);\n if (reply.errorcode) {\n class JDWPCommandError extends Error {\n constructor(reply) {\n super(`JDWP command failed '${reply.command.name}'. Error ${reply.errorcode}`);\n this.command = reply.command;\n this.errorcode = reply.errorcode;\n }\n }\n reject(new JDWPCommandError(reply));\n } else {\n resolve(reply);\n }\n this.cmd_queue.shift();\n }\n }", "function processQueue() {\n emptyQueue = true;\n drainQueue(true);\n }", "async triggerOutgoingHandlers() {\n let buffer;\n do {\n if (this.executingOutgoingHandlers >= this.concurrency) {\n return;\n }\n buffer = this.outgoing.shift();\n if (buffer) {\n this.triggerOutgoingHandler(buffer);\n }\n } while (buffer);\n }", "async triggerOutgoingHandlers() {\n let buffer;\n do {\n if (this.executingOutgoingHandlers >= this.concurrency) {\n return;\n }\n buffer = this.outgoing.shift();\n if (buffer) {\n this.triggerOutgoingHandler(buffer);\n }\n } while (buffer);\n }", "async start() {\n this.childProcess = ChildProcess.fork(`${__dirname}/checkQueue.js`);\n this.startChildProcess();\n this.childProcess.on('message', async (message)=>{\n let urlData = message['urlData'];\n if (urlData) {\n if (urlData) {\n broadcast(this.queue, urlData);\n }\n }\n });\n }", "start() {\n // maybe add routine for removing old messages still in queue to avoid backup\n // on catastrophic neighbor failures\n var node = this._node;\n this._active = true;\n this._connecting = true;\n this._ipc.connectToNet(node.id(), node.host(), node.port());\n this._ipc.of[node.id()].on(\"connect\", this._handleConnect.bind(this));\n this._ipc.of[node.id()].on(\"disconnect\", this._handleDisconnect.bind(this));\n }", "execute() {\n if (this.isRunning)\n return;\n let request = this.queue.shift();\n if (request === undefined) {\n this.isRunning = false;\n return;\n }\n let e = request;\n this.isRunning = true;\n this.options = request.options;\n this.completionHandlers[this.options.url] = request.handler;\n this.xmlHtpRequest.open(this.options.method, this.options.url, true);\n this.setJsonHeaders();\n this.xmlHtpRequest.send();\n this.queue = this.queue.filter(h => { h.options.url !== e.options.url; });\n }", "async processQueue() {\n // Only process if the shouldProcessQueue flag is set, and if the queue is\n // not empty.\n if (!this.shouldProcessQueue || this.queue.length === 0) {\n return;\n }\n\n const {\n action: {\n meta: {\n optimistic: { command }\n }\n },\n stateChange\n } = this.queue.shift();\n\n try {\n await this.api(...command);\n } catch (err) {\n console.warn(`Error calling API: ${JSON.stringify(err)}`);\n this.onError(err, stateChange);\n }\n await new Promise(resolve => setTimeout(resolve(), 500));\n this.processQueue();\n }", "function processQueue(){\n\t\trequestAnimFrame(processQueue);\n\t\tvar now = Date.now();\n\t\twhile (msgQueue.length > 0 && msgQueue[0].timetag < now){\n\t\t\tvar first = msgQueue.shift();\n\t\t\tif (first.address === \"_set\"){\n\t\t\t\tfirst.data();\n\t\t\t} else {\n\t\t\t\t_send(first);\n\t\t\t}\n\t\t}\n\t\t//send an update message to all the listeners\n\t\tupdateMessage.data = now - lastUpdate;\n\t\t_send(updateMessage);\n\t\tlastUpdate = now;\n\t}", "function attachToQueue() {\n const queue = queues['makeOfferQueue']\n queue.process(processor)\n queue.resume() // Start if paused\n}", "queueGo() {\n let commands = [wcCommands.go()];\n\n this.queue.push(...commands);\n\n debug('Queueing Go Command');\n }", "_continueProcessing() {\n if (this._closed) {\n this.close();\n } else {\n setTimeout(() => this._processMessages(), 100);\n }\n }", "_continueProcessing() {\n if (this._closed) {\n this.close();\n } else {\n setTimeout(() => this._processMessages(), 100);\n }\n }", "_continueProcessing() {\n if (this._closed) {\n this.close();\n } else {\n setTimeout(() => this._processMessages(), 100);\n }\n }", "receive() {\n if (this.stopMe) {\n return;\n }\n this.mq.receiveMessage({qname: config.queueName}, (err, msg) => {\n if (err) {\n throw err;\n }\n if (msg.id) {\n this.errorDetection(msg);\n this.mq.deleteMessage({qname: config.queueName, id: msg.id}, () => {\n this.receive();\n });\n process.stdout.write('\\x1B[2KReceiving: <<< [' + msg.message + ']\\r');\n }\n else {\n // console.log(\"No messages for me...\");\n this.receive();\n }\n });\n }", "drainMessageQueue_() {\n // It's possible that we finish registering and receiving messages from WSS\n // before our peer connection is created or started. We need to wait for the\n // peer connection to be created and started before processing messages.\n //\n // Also, the order of messages is in general not the same as the POST order\n // from the other client because the POSTs are async and the server may handle\n // some requests faster than others. We need to process offer before\n // candidates so we wait for the offer to arrive first if we're answering.\n // Offers are added to the front of the queue.\n if (!this.pc_ || !this.started_ || !this.hasRemoteSdp_) {\n return;\n }\n for (let i = 0, len = this.messageQueue_.length; i < len; i++) {\n this.processSignalingMessage_(this.messageQueue_[i]);\n }\n this.messageQueue_ = [];\n }", "run () {\n\n this.readAndUpdate();\n this.start(this._state);\n this.doAction(\"PADDLE\", this._current_action);\n this.sendAction();\n\n while (true) {\n\n this.readAndUpdate();\n\n if (!this._next_command)\n return;\n\n if (this._promise_succeeded) {\n this._next_command.resolve(this._state);\n } else {\n this._next_command.reject(this._promise_failure_reason);\n }\n\n this.doAction(\"PADDLE\", this._current_action);\n this.sendAction();\n\n // reset current action\n this._current_action = [0, 0, false];\n\n // reset promise results\n this._promise_succeeded = undefined;\n this._promise_failure_reason = undefined;\n }\n }", "@on('qps')\n queueProcessStart(ticks)\n {\n for (const p of this.players.filter(x => x.client)) {\n p.client.send('qps', ticks);\n }\n }", "function processQueue() {\n\n // If we have a message in the message queue, removed it from the queue and send it to telegram\n if (messages.length > 0) {\n sendTelegram(bufferMessage());\n }\n\n // If there are over conf.queue_max messages in the queue, send the suppression message if it has not been sent and delete all the messages in the queue after this amount (default: 100)\n if (messages.length > conf.queue_max) {\n if (!suppressed.isSuppressed) {\n suppressed.isSuppressed = true;\n suppressed.date = new Date().getTime();\n sendTelegram({\n name: 'pm2-telegram-notify',\n event: 'suppressed',\n description: 'Messages are being suppressed due to rate limiting.'\n });\n }\n messages.splice(conf.queue_max, messages.length);\n }\n\n // If the suppression message has been sent over 1 minute ago, we need to reset it back to false\n if (suppressed.isSuppressed && suppressed.date < (new Date().getTime() - 60000)) {\n suppressed.isSuppressed = false;\n }\n\n // Wait 10 seconds and then process the next message in the queue\n setTimeout(function() {\n processQueue();\n }, 10000);\n}", "function startQueue() {\n if(running)\n return;\n running = true;\n setTimeout(doNext,queue[0].delay);\n\n function doNext() {\n queue[0].fn();\n removeItem(queue,0);\n if(queue.length>0) {\n setTimeout(doNext,queue[0].delay);\n } else\n running = false;\n }\n }", "run() {\n if (!this.isRunning) return;\n\n if (this._dialingQueues.size < this.switch.dialer.MAX_PARALLEL_DIALS) {\n let nextQueue = {\n done: true // Check the queue first and fall back to the cold call queue\n\n };\n\n if (this._queue.size > 0) {\n nextQueue = this._queue.values().next();\n\n this._queue.delete(nextQueue.value);\n } else if (this._coldCallQueue.size > 0) {\n nextQueue = this._coldCallQueue.values().next();\n\n this._coldCallQueue.delete(nextQueue.value);\n }\n\n if (nextQueue.done) {\n return;\n }\n\n let targetQueue = this._queues[nextQueue.value];\n\n if (!targetQueue) {\n log('missing queue %s, maybe it was aborted?', nextQueue.value);\n return;\n }\n\n this._dialingQueues.add(targetQueue.id);\n\n targetQueue.start();\n }\n }", "flush() {\n const len = this.commandQueue.length;\n const endTime = this.msNow() + 250;\n for (let i = 0; i < len; i++) {\n if (this.paused) {\n break;\n }\n else if (this.msNow() > endTime) {\n this.pause();\n setTimeout(() => {\n this.resume();\n }, 0);\n break;\n }\n else {\n const _item = this.commandQueue.shift();\n\n try {\n if (this.isFunction(_item)) {\n _item.call();\n }\n else if (this.isArray(_item)) {\n const [_function, _arguments] = _item;\n _function.apply(this, _arguments);\n }\n }\n catch (e) {\n this.clientException(e, _item);\n }\n }\n }\n }", "processQueue_() {\n if (!this.queue_.length) return;\n const [size, callback] = this.queue_[0];\n\n if (this.getBufferSize_() < size) return;\n\n const chunk = this.consumeBuffer_(size);\n this.queue_.shift();\n callback(chunk);\n this.processQueue_();\n }", "function _processQueues()\n {\n var file = false;\n var transfer = false;\n _log(\"processing queues\")\n while( _loader.hasBandwidth() && (file = _getFile({'isQueued':true}))){\n file.install();\n }\n while( _loader.hasBandwidth() &&\n ( (transfer = _getTransfer( {'isTransfering':true, 'hasUnsentPackets':true, 'hasAvailableElements':true} )) ||\n (transfer = _getTransfer({'isQueued':true})) ) )\n {\n if (transfer.isQueued())\n transfer.start();\n if (transfer.isTransfering())\n transfer.proceed();\n }\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "start() {\n\t\t\tif (this._running) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._scheduler = new Scheduler();\n\t\t\tthis._running = true;\n\n\t\t\tprocessBuffer.call(this);\n\t\t}", "function next(i) {\n\t // pretend we are doing some work\n\t controlSocket.processNewChat(job.data, function (err) {\n\t done();\n\t });\n\t }", "function handleQueue() {\n if (this._is_connected && this._queue.length && !this._emptying_queue) {\n this._emptying_queue = true;\n sendQueueEntry.call(this);\n }\n}", "async processGatewayQueue() {\n if (this.gatewayLoginQueue.length) {\n if (this.gatewayLoginQueue[0].resumable) {\n const gateway = this.gatewayLoginQueue.shift();\n await gateway.login();\n } else if (\n this.startingGateway === null\n && new Date().getTime() > this.safeGatewayIdentifyTimestamp\n ) {\n const gateway = this.gatewayLoginQueue.shift();\n this.safeGatewayIdentifyTimestamp = 10 * SECOND_IN_MILLISECONDS; // arbitrary buffer\n\n /* eslint-disable-next-line prefer-destructuring */\n this.startingGateway = gateway;\n try {\n await gateway.login();\n } catch (err) {\n this.log('FATAL', err.message, gateway);\n this.startingGateway = null;\n }\n }\n }\n }", "start() {\n this.commands = CommandHandler.loadCommands.bind(this)();\n let listenerFunction = this.commandListener;\n this.loggingObject.on('chatMessage', listenerFunction);\n }", "function startQueueProcessor() {\n\n if ( typeof( processInfo ) === 'undefined' ) processInfo = 'Process ' + processFromStatus + ' to ' + processToStatus\n if ( typeof( pollInterval ) === 'undefined' ) pollInterval = 2000\n\n log.i( '' );\n log.i( '----- DLINK JDE PDF Queue Processor Started - ' + processInfo ); \n log.i( '' ); \n log.i( 'JDE Environment : ' + jdeEnv );\n log.i( 'JDE Database : ' + jdeEnvDb );\n log.i( '' ); \n log.i( 'Polling Interval : ' + pollInterval);\n log.i( '' ); \n log.i( 'Pick up Queued PDF files at status ' + processFromStatus + ' - process then - move to status ' + processToStatus ); \n log.i( '' );\n\n // Handle process exit from DOCKER STOP, system interrupts, uncaughtexceptions or CTRL-C \n ondeath( endMonitorProcess );\n\n // First need to establish an oracle DB connection pool to work with\n establishPool();\n\n}", "async started () {\n\t\tthis.tortoise\n\t\t\t.on(Tortoise.EVENTS.CONNECTIONCLOSED, () => {\n\t\t\t\tthis.logger.error('Tortoise connection is closed');\n\t\t\t})\n\t\t\t.on(Tortoise.EVENTS.CONNECTIONDISCONNECTED, (error) => {\n\t\t\t\tthis.logger.error('Tortoise connection is disconnected', error);\n\t\t\t})\n\t\t\t.on(Tortoise.EVENTS.CONNECTIONERROR, (error) => {\n\t\t\t\tthis.logger.error('Tortoise connection is error', error);\n\t\t\t});\n\n\t\tawait Promise.all(this.settings.jobs.map((job) => {\n\t\t\treturn this.tortoise\n\t\t\t\t.queue(job.name, { durable: true })\n\t\t\t\t.exchange(this.settings.amqp.exchange, 'direct', job.route, { durable: true })\n\t\t\t\t.prefetch(1)\n\t\t\t\t.subscribe(async (msg, ack, nack) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.broker.call(`${this.name}.${job.method}`, { msg, ack, nack });\n\t\t\t\t\t\tack();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthis.logger.error('Job processing has error', error);\n\t\t\t\t\t\tnack(true);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}), this);\n\t}", "function Process_Sendq() {\n\tif (!this.empty) {\n\t\tthis.send(this.socket);\n\t}\n}", "async triggerOutgoingHandler(buffer) {\n const bufferLength = buffer.size;\n this.executingOutgoingHandlers++;\n this.offset += bufferLength;\n try {\n await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength);\n }\n catch (err) {\n this.emitter.emit(\"error\", err);\n return;\n }\n this.executingOutgoingHandlers--;\n this.reuseBuffer(buffer);\n this.emitter.emit(\"checkEnd\");\n }", "async triggerOutgoingHandler(buffer) {\n const bufferLength = buffer.size;\n this.executingOutgoingHandlers++;\n this.offset += bufferLength;\n try {\n await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength);\n }\n catch (err) {\n this.emitter.emit(\"error\", err);\n return;\n }\n this.executingOutgoingHandlers--;\n this.reuseBuffer(buffer);\n this.emitter.emit(\"checkEnd\");\n }", "function executeQueuedCommands() {\n console.log('executing queued commands');\n\n _commandPhase.forEach(function(playerKey) {\n var playerPhase = _gamePhase[playerKey];\n var parsedCmd = playerPhase.commandQueue.shift();\n\n if (parsedCmd !== undefined) {\n var commandFunction = commandObj[parsedCmd.command];\n commandFunction(playerPhase.character, parsedCmd.command, parsedCmd.argument, playerPhase.socket)\n }\n });\n }", "initQueue() {\n this.updateConfig();\n this.removeAllListeners();\n this.flush();\n this.on('traceQueued', function traceQueued() {\n if (this.byteSizeLimitReached()) {\n utils.debugLog(`[QUEUE] Queue Byte size reached ${this.currentByteSize} Bytes, releasing batch...`);\n this.emit('releaseRequest', Math.max(this.currentSize - 1, 1));\n } else if (this.batchSizeReached()) {\n utils.debugLog(`[QUEUE] Queue size reached ${this.currentSize}, releasing batch... `);\n this.emit('releaseRequest');\n }\n return this;\n });\n\n this.on('releaseRequest', function releaseRequest(count = this.batchSize) {\n try {\n const batch = this.queue.splice(0, count);\n utils.debugLog('[QUEUE] Releasing batch...');\n this.subtractFromCurrentByteSize(batch);\n this.emit('batchReleased', batch);\n } catch (err) {\n utils.debugLog('[QUEUE] Failed releasing batch!');\n utils.debugLog(`[QUEUE] ${err}`);\n }\n return this;\n });\n\n this.on('batchReleased', async function batchReleased(batch) {\n utils.debugLog('[QUEUE] Sending batch...');\n const batchJSON = batch.map(trace => trace.json);\n this.batchSender(batchJSON);\n });\n process.on('exit', function releaseAndClearQueue() {\n this.emit('releaseRequest');\n this.removeAllListeners();\n });\n }", "async function processQueueNow() {\n if (isQueueProcessing) {\n console.debug('Asked to process queue, but already processing')\n return\n }\n try {\n isQueueProcessing = true\n let entry\n // eslint-disable-next-line no-cond-assign\n while ((entry = await queue.shiftRequest())) {\n const uuid = entry.request.headers.get(cc.xWowUuidHeader)\n const inatId = entry.request.headers.get(cc.xWowInatIdHeader)\n try {\n const theType = computeTaskType(entry)\n console.debug(`SW queue sending req for ${uuid}/${inatId}`)\n const resp = await fetch(entry.request.clone())\n if (resp.status > 299) {\n handleQueueHttpError(uuid)\n continue\n }\n const bodyJson = await resp.json()\n sendMessageToAllClients({\n msgId: cc.queueItemProcessed,\n taskDetails: {\n uuid,\n inatId,\n statusUrl: bodyJson.statusUrl,\n type: theType,\n },\n })\n } catch (error) {\n console.debug(`SW queue failed to send req for ${uuid}/${inatId}`)\n await queue.unshiftRequest(entry)\n // must throw so browser knows to trigger us again later\n throw new Error('queue-replay-failed')\n }\n }\n } finally {\n isQueueProcessing = false\n }\n}", "function queueSetup() {\n console.log(\"q setup done\");\n}", "commandsQueue(commandObj) {\n\t\tlet self=this;\n\t\tfor(let command in commandObj) {\n\t\t\t/*\n\t\t\t * DEFINE.COMMAND_INSTANT, basically a queue item we need to get running\n\t\t\t */\n\t\t\tif(commandObj[command].options.queueRun===self.DEFINE.COMMAND_INSTANT) {\n\t\t\t\tself.queue.push(self.deepCopy(commandObj[command]));\n\t\t\t}\n\t\t\t/*\n\t\t\t * Is the a prepare queue that will be triggered at some later stage\n\t\t\t */\n\t\t\tif(commandObj[command].options.queuePrepare!== undefined) {\n\t\t\t\tself.prepare[commandObj[command].options.queuePrepare]=self.deepCopy(commandObj[command]);\n\t\t\t\tconsole.log('Added Prepared Queue ['+commandObj[command].options.queuePrepare+']');\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * Trigger a queue process\n\t\t */\n\t\tself.queueProcess();\n\t}", "function dxProcessRequestQueue() {\n\tif (dx_processing_queue) {return;}\n\tif (!navigator.onLine) {\n\t\tsetItemInLocalStorage(\"dx_queue\",JSON.stringify(dx_queue),2);\n\t\tshowAlert(presentOfflineRequestQueuedMessage(),\"info\",\"OK\",false);\n\t\treturn;\n\t}\n\tif (dx_queue.length > 0) {\n\t\tlet next_post = dx_queue.shift();\n\t\tdxRequestInternalQueued(next_post.url,next_post.parameters,next_post.on_success,next_post.on_fail,next_post.trigger_element_id);\n\t} else {\n\t\tdx_processing_queue = false;\n\t}\n}", "function queueCommands() {\n app\n .command('queue <cmd>')\n .description('Interract with the queue')\n .action(queueActions)\n}", "function processQueue(cb){\n\n}", "playQueue() {\n // must set delay property to false!!! otherwise the message\n // will be delayed continually...\n this.queue.forEach( m => { m.data.delay = false; this.handleMessage( m ) } )\n this.queue.length = 0\n }", "run(){\n //Determining right strategy for getting messages from topic\n let getter = this.lastId ? new MessageGetterBeforeLastIDStrategy(this.topic, this.lastId, this.howMany):\n new MessageGetterLastStrategy(this.topic, this.howMany)\n\n //Getting messages\n let messages = getter.get()\n\n //updating remaining messages count\n this.howMany -= messages.length;\n\n //if there are any messages at all\n if(messages.length > 0){\n //Giving them to writer\n let writer = this.outWriterFactory.make()\n\n let response = {\n pkfp: this.topic.pkfp,\n messages: messages,\n before: this.lastId,\n topic: this.topic\n }\n\n writer.output(response)\n\n //Updating last written message id\n this.lastId = messages[messages.length-1].header.id;\n }\n\n //Checking whether request is fulfilled\n if(new FulfilledCondition(this.topic, this.howMany).isFulfilled()){\n //If request fulfilled - unsubscribing from bus and terminating\n console.log(\"Request fulfilled!\");\n this.uxBus.off(this);\n }\n }", "async _sendFrames() {\n const frames = this._frameQueue;\n\n while (frames.length) {\n const frame = frames.shift();\n\n await new Promise((resolve, reject) => {\n this._process.stdin.write(frame, err => {\n err ? reject(err) : resolve();\n });\n });\n }\n }", "function requestqueue() {\n\t\t// If the queue is already running, abort.\n\t\tif(requesting) return;\n\t\trequesting = true;\n\t\tlink.request({\n\t\t\turl: \"api/events\",\n\t\t\tmethod: \"POST\",\n\t\t\tparams: {\n\t\t\t\tsid: gSessionID\n\t\t\t},\n\t\t\tcallback: queuecallback\n\t\t});\n\t}", "function start(){\n\tdate = new Date(Date.now()).toLocaleString()\n let message = { 'Message' : i, 'Date' : date}\n\tswitch(process.argv[3]){\t\t\t\t\t\t\t\t//Getting the mode of the stream (Public:1, Private:2, Restricted: 3)\n\t\tcase '1': MAM_public.attach(message);break; \n\t\tcase '2': MAM_private.attach(message);break;\n\t\tcase '3': MAM_restricted.attach(message);break;\n\t\tdefault: MAM_public.attach(message)\n\t}\n\tconsole.log('Start sending data to Tangle...')\n\tlet messageS = JSON.stringify(message)\n\tconsole.log('Message: %s',messageS)\n\tconsole.log('Message in trytes: ' + iota.utils.toTrytes(messageS))\n\tconsole.log('--------------------------------------------------------------------------------------------------------------------')\n\ti++\n}", "function processQueue() {\n if(taskQueue.length === 0) {\n return;\n }\n\t// pull first task off the queue and run it.\n let task = taskQueue.shift();\t\n console.log('Running task. runId: ' + task.runId + ' - cluster: '+ task.CLUSTER_NAME);\n\tcurrentTasks.unshift(task);\n\ttaskExecute(task);\n}", "function startRabbitMQ() {\n\tapp.rMQconnection = amqp.createConnection({host : 'localhost', port : 5672, login : 'cplsyx', password : 'cplsyx'});\n\tapp.rMQconnection.on('ready', function() {\n\t\t//app.exchange = connection.exchange('');\n\t\tapp.webQueue = app.rMQconnection.queue('updateWeb', {durable : true, autoDelete: false});\n\t\tapp.webQueue.bind('#'); //# means all messages on the queue\n\t\tapp.webQueue.subscribe(function (message) {\n\t\t\t/*io.emit('send:message', {\n\t\t\t\tuser: \"Rabbit\",\n\t\t\t\ttext: message.data.toString('utf8')\n\t\t\t});*/\n\t\t\t//app.rMQconnection.publish('updateDevice', message.data.toString('utf8')); //This works but leaving it here results in a send/receive loop!\n\t\t\tconsole.log(message.data.toString('utf8'));\n\t\t});\n\t\n\n\t});\nconsole.log(\"...\");\n}", "function process_queue() {\n finish_last_action_msg();\n\n if (!queue.length) {\n if (!next_action()) {\n window.location.href = app_page_url;\n return;\n }\n }\n\n var request = queue.pop();\n if (!request) {\n process_queue();\n return;\n }\n\n add_action_msg(request.msg);\n if (request.type === 'file') {\n $.ajax({\n 'url': '',\n 'data': request.data,\n 'cache': false,\n 'contentType': false,\n 'processData': false,\n 'type': 'POST',\n 'success': process_queue\n });\n } else {\n $.post('', request.data, process_queue);\n }\n }", "function startWorker() {\n amqpConn.createChannel(function(err, ch) {\n if (closeOnErr(err)) return;\n ch.on(\"error\", function(err) {\n console.error(\"[AMQP] channel error\", err.message);\n });\n ch.on(\"close\", function() {\n console.log(\"[AMQP] channel closed\");\n });\n\n ch.prefetch(10);\n ch.assertQueue(\"jobs\", { durable: true }, function(err, _ok) {\n if (closeOnErr(err)) return;\n ch.consume(\"jobs\", processMsg, { noAck: false });\n console.log(\"Worker is started\");\n });\n \n function processMsg(msg) {\n work(msg, function(ok) {\n try {\n if (ok)\n ch.ack(msg);\n else\n ch.reject(msg, true);\n } catch (e) {\n closeOnErr(e);\n }\n });\n }\n \n });\n}", "async run() { \n\t//loop read from the input channel \n\twhile(true ) {\n\n\t this.feedback(\"continue\")\n\n\t let text = await this.get_input() \n\t if (text == undefined || text == \"finished\") { break }\n\t this.chunks.push(text) \n\t}\n\t//input channel has been closed \n\tthis.finish({payload : { result : this.chunks.join(this.args.joiner || \"\\n\")} }) \n }", "_emptyQueue () {\n // create the queue if it doesn't exist\n if (!this.queue) {\n this.queue = []\n return\n }\n if (this.queue.length === 0) return\n if (!this.isConnected()) return\n\n log('Emptying queue (size : %d)', this.queue.length)\n\n // re-send all of the data\n while (this.queue.length > 0) {\n if (!this.isConnected()) return\n let packet = this.queue[0]\n this.send(packet.channel, packet.data)\n this.queue.shift()\n }\n }", "_setupQueue() {\n // Create a queue that wil be used to send batches to the throttler.\n this.queue = queue(ensureAsync(this._worker));\n\n // When the last batch is removed from the queue, add any incomplete batches.\n this.queue.empty = () => {\n if (!this.pendingItems.length) {\n return;\n }\n\n debug('adding %s items from deferrd queue for processing', this.pendingItems.length);\n\n const batch = this.pendingItems.splice(0);\n this._pushToQueue(batch);\n };\n\n // Emit an event when the queue is drained.\n this.queue.drain = () => {\n this.emit('drain');\n };\n }", "function handleBcastQueue() {\n if (this._is_connected && this._bcast_queue.length && !this._emptying_bcast_queue) {\n this._emptying_bcast_queue = true;\n sendBcastQueueEntry.call(this);\n }\n}", "fill() {\n // Note:\n // - queue.running(): number of items that are currently running\n // - queue.length(): the number of items that are waiting to be run\n while (this.queue.running() + this.queue.length() < this.concurrency && this.path.peersToQuery.length > 0) {\n this.queue.push(this.path.peersToQuery.dequeue());\n }\n }", "queue(action){\n Mediator.queue.push(action);\n }", "processQueue() {\n if (this.ratelimit.remaining === 0) return;\n if (this.ratelimit.queue.length === 0) return;\n if (this.ratelimit.remaining === this.ratelimit.total) {\n this.ratelimit.resetTimer = this.client.setTimeout(() => {\n this.ratelimit.remaining = this.ratelimit.total;\n this.processQueue();\n }, this.ratelimit.time);\n }\n while (this.ratelimit.remaining > 0) {\n const item = this.ratelimit.queue.shift();\n if (!item) return;\n this._send(item);\n this.ratelimit.remaining--;\n }\n }", "function startWorker() {\r\n amqpConn.createChannel(function (err, ch) {\r\n if (closeOnErr(err)) return;\r\n ch.on(\"error\", function (err) {\r\n console.error(\"[AMQP] channel error\", err.message);\r\n });\r\n ch.on(\"close\", function () {\r\n console.log(\"[AMQP] channel closed\");\r\n });\r\n ch.prefetch(10);\r\n ch.assertQueue(\"jobs\", {\r\n durable: true\r\n }, function (err, _ok) {\r\n if (closeOnErr(err)) return;\r\n ch.consume(\"jobs\", processMsg, {\r\n noAck: false\r\n });\r\n console.log(\"Worker is started\");\r\n });\r\n\r\n function processMsg(msg) {\r\n work(msg, function (ok) {\r\n try {\r\n if (ok)\r\n ch.ack(msg);\r\n else\r\n ch.reject(msg, true);\r\n } catch (e) {\r\n closeOnErr(e);\r\n }\r\n });\r\n }\r\n });\r\n}", "async startPinging()\n\t{\n\t\tlogger.debug('startPinging()');\n\n\t\tthis._destinations.forEach((destination) =>\n\t\t{\n\t\t\tif (!destination.closed)\n\t\t\t\tdestination.startPinging();\n\t\t});\n\t}", "static async _startPdReceive() {\n return new Promise((resolve, reject) => {\n this.pdreceive = spawn(path.join(this.binFolder, 'pdreceive'), [`${this.pdreceivePort}`]);\n\n this.pdreceive.stdout.on('data', (data) => {\n if (`${data}` === 'initialized;\\n') {\n resolve();\n } else {\n this._routeMessage(data);\n }\n });\n\n this.pdreceive.stderr.on('data', async (data) => {\n console.log(`pdreceive stderr : ${data}`);\n reject();\n });\n\n this._startPd();\n });\n }", "function LaunchQueue(){\n\tthis._queue = [];\n}", "@on('qpc')\n queueProcessComplete(ticks)\n {\n for (const p of this.players.filter(x => x.client)) {\n p.client.send('qpc', ticks);\n }\n\n //find actions the client can take that could be filtered on the server side\n let possibleActions = this.possibleActions.findPossibleActions();\n const currentTurnPlayer = this.players.find(x => x.id === this.turnState.currentPlayerId && x.client);\n if(currentTurnPlayer){\n currentTurnPlayer.client.send('possibleActions', possibleActions);\n }\n\n //check for game win condition\n let loser = null;\n for (const p of this.players) {\n const hero = this.pieceState.hero(p.id);\n if(!hero){\n loser = p.id;\n break;\n }\n }\n\n //TODO: actually shut down the game\n if(loser !== null){\n this.log.info('player %s LOSES', loser);\n for (const p of this.players.filter(x => x.client)) {\n p.client.send('game:finished',\n {\n id: 99999,\n winnerId: this.players.find(w => w.id != loser).id,\n loserId: loser\n }\n );\n }\n }\n }", "onStart() {\n this.requestQueueLength++;\n if (this.requestQueueLength > 1 || !this.callbacks.onStart) {\n return;\n }\n this.callbacks.onStart(this.requestQueueLength);\n }", "function executeQueue() {\n\t\t\tif (outQueue.length < 1) {\n\t\t\t\texecutingQueue = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar nextRequest,\n\t\t\t\tcollectorUrl,\n\t\t\t\ti;\n\n\t\t\texecutingQueue = true;\n\n\t\t\tfor (i in outQueue) {\n\n\t\t\t\tif (outQueue[i] && outQueue.hasOwnProperty(i)) {\n\n\t\t\t\t\tnextRequest = outQueue[i];\n\n\t\t\t\t\t// Let's check that we have a Url to ping\n\t\t\t\t\tif (!lodash.isString(configCollectorUrl)) {\n\t\t\t\t\t\tthrow \"No Snowplow collector configured, cannot track\";\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Send image request to the Snowplow Collector using GET.\n\t\t\t\t\t * The Collector serves a transparent, single pixel (1x1) GIF\n\t\t\t\t\t * Use IIFE to close over i because i may change between setting image.onload and the image loading.\n\t\t\t\t\t */\n\t\t\t\t\t(function(queueIndex) {\n\t\t\t\t\t\tvar image = new Image(1,1);\n\n\t\t\t\t\t\timage.onload = function() {\n\n\t\t\t\t\t\t\t// We succeeded, let's remove this request from the queue\n\t\t\t\t\t\t\tdelete outQueue[queueIndex];\n\t\t\t\t\t\t\tif (localStorageAccessible) {\n\t\t\t\t\t\t\t\tlocalStorage.setItem(queueName, json2.stringify(outQueue));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\texecuteQueue();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\timage.onerror = function() {}\n\n\t\t\t\t\t\timage.src = configCollectorUrl + nextRequest;\n\n\t\t\t\t\t}(i));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texecutingQueue = false;\n\n\t\t\t// If every request has been sent, set the queue to []\n\t\t\tif (lodash.compact(outQueue).length === 0) {\n\t\t\t\toutQueue = [];\n\t\t\t}\n\t\t}", "processQueue() {\n jobs.forEach(job => {\n const { bee, handle } = this.queues[job.key];\n bee.on('failed', this.hadleFailure).process(handle);\n });\n }", "function startReader() {\n amqpConn.createChannel(function(err, ch) {\n if (closeOnErr(err)) return\n ch.on(\"error\", function(err) {\n console.error(\"[AMQP] channel error\", err.message)\n });\n ch.on(\"close\", function() {\n console.log(\"[AMQP] channel closed\")\n });\n ch.prefetch(10)\n ch.assertQueue(\"Checked\", { durable: true }, function(err, _ok) {\n if (closeOnErr(err)) return\n ch.consume(\"Checked\", processMsg, { noAck: false })\n console.log(\"Check worker has started\")\n });\n\n function processMsg(msg) {\n console.log(\"received message from pi:\", msg.content.toString())\n try {\n if (msg !== \"\")\n ch.ack(msg)\n else\n ch.reject(msg, true)\n } catch (e) {\n closeOnErr(e)\n }\n }\n });\n\n amqpConn.createChannel(function(err, ch) {\n if (closeOnErr(err)) return\n ch.on(\"error\", function(err) {\n console.error(\"[AMQP] channel error\", err.message)\n });\n ch.on(\"close\", function() {\n console.log(\"[AMQP] channel closed\")\n });\n ch.prefetch(10)\n ch.assertQueue(\"measurement\", { durable: true }, function(err, _ok) {\n if (closeOnErr(err)) return\n ch.consume(\"measurement\", processMsg2, { noAck: false })\n console.log(\"Pi worker has started\")\n });\n\n function processMsg2(msg) {\n sendDB(msg, function(ok) {\n try {\n if (ok)\n ch.ack(msg)\n else\n ch.reject(msg, true)\n } catch (e) {\n closeOnErr(e)\n }\n });\n }\n });\n}", "handleBusMessages() {\n const bus = this.runtime.bus();\n\n Object.values(REQUESTS).forEach((msgType) => {\n bus.on(msgType, (msgData) => {\n this.sendCommMessage(msgType, msgData);\n });\n });\n }", "function startWorker() {\n amqpConn.createChannel(function(err, ch) {\n if (closeOnErr(err)) return;\n ch.on(\"error\", function(err) {\n winston.error(\"[AMQP] channel error\", err);\n });\n ch.on(\"close\", function() {\n winston.info(\"[AMQP] channel closed\");\n });\n ch.prefetch(10);//leggila da env\n ch.assertExchange(exchange, 'topic', {\n durable: durable\n // durable: true\n });\n\n ch.assertQueue(queueName, { durable: durable }, function(err, _ok) {\n // ch.assertQueue(\"jobs\", { durable: true }, function(err, _ok) {\n if (closeOnErr(err)) return;\n ch.bindQueue(_ok.queue, exchange, \"request_create\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: request_create\");\n winston.info(\"Data queue\", oka)\n });\n ch.bindQueue(_ok.queue, exchange, \"request_update_preflight\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: request_update_preflight\");\n winston.info(\"Data queue\", oka)\n });\n ch.bindQueue(_ok.queue, exchange, \"request_participants_update\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: request_participants_update\");\n winston.info(\"Data queue\", oka)\n });\n\n ch.bindQueue(_ok.queue, exchange, \"request_update\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: request_update\");\n winston.info(\"Data queue\", oka)\n });\n\n ch.bindQueue(_ok.queue, exchange, \"request_close\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: request_close\");\n winston.info(\"Data queue\", oka)\n });\n\n ch.bindQueue(_ok.queue, exchange, \"request_close_extended\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: request_close_extended\");\n winston.info(\"Data queue\", oka)\n });\n\n ch.bindQueue(_ok.queue, exchange, \"message_create\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: message_create\");\n winston.info(\"Data queue\", oka)\n });\n ch.bindQueue(_ok.queue, exchange, \"project_user_update\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: project_user_update\");\n winston.info(\"Data queue\", oka)\n });\n\n ch.bindQueue(_ok.queue, exchange, \"faqbot_update\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: faqbot_update\");\n winston.info(\"Data queue\", oka)\n });\n\n ch.bindQueue(_ok.queue, exchange, \"lead_create\", {}, function(err3, oka) {\n winston.info(\"Queue bind: \"+_ok.queue+ \" err: \"+err3+ \" key: lead_create\");\n winston.info(\"Data queue\", oka)\n });\n\n\n\n ch.consume(queueName, processMsg, { noAck: false });\n winston.info(\"Worker is started\");\n });\n \n\n function processMsg(msg) {\n work(msg, function(ok) {\n try {\n if (ok)\n ch.ack(msg);\n else\n ch.reject(msg, true);\n } catch (e) {\n closeOnErr(e);\n }\n });\n }\n });\n}", "run() {\n\n\t\tif (this.sequence.number == this.settings.sequences) {\n\n\t\t\t//If we reached the maximum amount of icmp_echo_request stop the interval\n\t\t\tthis.stop()\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t//Create the ping message\n\t\tlet ping = {\n\n\t\t\tservice : 'ping',\n\t\t\tdata : {\n\t\t\t\ttype: 'ping-request',\n\t\t\t\tsequence : this.sequence.number,\n\t\t\t\ttimestamp : new Date()\n\t\t\t}\n\n\t\t}\n\n\t\tthis.sendData(this.host, ping)\n\n\t\t//!!!Remember to increment the sequence number\n\t\tthis.sequence.number++;\n\n\t}", "function processQueue(){queue.forEach(function(func){$mdUtil.nextTick(func);});queue=[];}", "function nextInQueue() {\n if (!processing) {\n processing = true;\n rsmq.popMessage({ qname: name }, function (err, message) {\n if ( err ){\n console.log(err);\n processing = false;\n return\n }\n // Queue finished\n if (!message.id) {\n processing = false;\n return\n }\n // List how many remaining\n rsmq.getQueueAttributes({ qname: name }, function (err, resp) {\n if ( err ) {\n return;\n }\n\n console.log('Queue msgs remaining: ' + resp.msgs);\n });\n // Post it\n postToElastic(message);\n });\n }\n}", "function onQueueReady(exchange){\n\tconsole.log(\"queue binding done...........................\");\n}", "__sendNext() {\n var msgs = this._remainingMsgs[this.caller.clientId];\n if (msgs && msgs.length) {\n var msg = msgs.shift();\n\n while (msgs.length && msg.dstId !== this.socket.roleId) {\n msg = msgs.shift();\n }\n\n // check that the socket is still at the role receiving the messages\n if (msg && msg.dstId === this.socket.roleId) {\n this._logger.trace('sending msg to', this.caller.clientId, this.socket.roleId);\n this.socket.sendMessage(msg.msgType, msg.content);\n }\n\n if (msgs.length) {\n setTimeout(this.__sendNext.bind(this), MSG_SENDING_DELAY);\n } else {\n delete this._remainingMsgs[this.caller.clientId];\n }\n } else {\n delete this._remainingMsgs[this.caller.clientId];\n }\n }", "pointQueueIdleDispatch(publisher, sqsInstance, pointQueue)\n {\n\n if(pointQueue.length > 0)\n {\n var point = pointQueue.shift();\n\n var params = publisher.getMessageParameters(point);\n\n sqsInstance.sendMessage(params, function(err, data)\n {\n if(err)\n {\n console.log(err, err.stack); // an error occurred\n }\n else\n {\n // queue up next point dispatch call\n window.setTimeout(publisher.pointQueueIdleDispatch,\n 1,\n publisher,\n sqsInstance,\n pointQueue);\n\n publisher.statistics.MessagesConfirmed++;\n publisher.BroadcastStatistics();\n\n }\n });\n }\n }", "processNextCommand() {\n var nextCmd = this._script.commands.shift();\n if (! nextCmd) {\n return;\n }\n\n // Process the next command when the current\n // command resolves.\n $.when(this.commandHandler.handle(nextCmd)).then(() => {\n this.processNextCommand();\n });\n }", "function processqueue(queue) {\n\t\t// Bail out if it's not an array.\n\t\tif(!queue.each) return;\n\t\t// For each message in the queue, call any applicable callbacks,\n\t\t// after checking that the callback really is a function.\n\t\t// In addition, some processing for network-oriented events is\n\t\t// done here.\n\t\t\n\t\t// This is where the vast majority of failures in AjaxLife surface - \n\t\t// after an uncaught exception reaches this level, it should be caught and an \n\t\t// (unhelpful) error displayed. If it isn't, the message queue crashes, and no\n\t\t// more incoming messages can be received without reloading the page.\n\t\tqueue.each(function(item) {\n\t\t\tvar handled = false;\n\t\t\tif(callbacks[item.MessageType])\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tcallbacks[item.MessageType].each(function(callback) {\n\t\t\t\t\t\tif(callback && typeof callback == 'function')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcallback(item);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(typeof callback != 'boolean')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAjaxLife.Widgets.Ext.msg(\"Error\",\"Typeof callback = \"+(typeof callback)+\". MessageType = \"+item.MessageType);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\thandled = true;\n\t\t\t\t}\n\t\t\t\tcatch(e)\n\t\t\t\t{\n\t\t\t\t\tAjaxLife.Widgets.Ext.msg(\"Error in processqueue\",e.name+\" - \"+e.message);\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t// If the message is indicating disconnection, it's handled here.\n\t\t\t// If the disconnection was involuntary, a message is displayed.\n\t\t\tif(item.MessageType == 'Disconnected')\n\t\t\t{\n\t\t\t\tif(item.Reason != AjaxLife.Constants.NetworkManager.DisconnectType.ClientInitiated)\n\t\t\t\t{\n\t\t\t\t\tAjaxLife.Network.logout(true);\n\t\t\t\t\t// We should probably fire off some event here so we can disable bits of UI.\n\t\t\t\t\t// This used to be an unclosable message. Following feature requests, it can be closed,\n\t\t\t\t\t// but no actions can be performed other than viewing logs.\n\t\t\t\t\tAjaxLife.Widgets.Modal.alert(_(\"Network.Disconnected\"),_(\"Network.LogoutForced\", {reason: item.Message}));\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an unhandled message is received, complain about it.\n\t\t\telse if(!handled)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar parsed = '';\n\t\t\t\t\tfor(var i in item)\n\t\t\t\t\t{\n\t\t\t\t\t\tparsed += i+': '+item[i]+'\\n';\n\t\t\t\t\t}\n\t\t\t\t\tAjaxLife.Debug(\"Unhandled message: \"+parsed);\n\t\t\t\t}\n\t\t\t\tcatch(e)\n\t\t\t\t{\n\t\t\t\t\t// This should never happen. The number of things going wrong you'd have to have to get here is\n\t\t\t\t\t// high enough that we can just ignore this - especially since no useful information can be gleaned anyway.\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function continueListeningForMessages(){\n\n //go back and listen for more message for the duration of this task\n var currentDate = new Date();\n var currentSeconds = currentDate.getTime() / 1000;\n\n console.log('currentSeconds ' + currentSeconds);\n console.log('startSeconds ' + startSeconds);\n\n //compute the seconds between when we started this scheduled task and now.\n //this is the time that we will long-poll the service bus.\n var newTimeout = Math.round((c_Timeout - (currentSeconds - startSeconds)));\n if(newTimeout > 0){\n //note: the recieveQueueMessage function takes ints no decimals!!\n listenForMessages(newTimeout);\n }\n\n }", "function startWorker() {\n amqpConn.createChannel(function(err, ch) {\n if (closeOnErr(err)) return;\n ch.on(\"error\", function(err) {\n console.error(\"[AMQP] channel error\", err.message);\n });\n ch.on(\"close\", function() {\n console.log(\"[AMQP] channel closed\");\n });\n ch.prefetch(10);\n ch.assertQueue(\"jobs\", { durable: true }, function(err, _ok) {\n if (closeOnErr(err)) return;\n ch.consume(\"jobs\", processMsg, { noAck: false });\n console.log(\"Worker is started\");\n });\n\n function processMsg(msg) {\n work(msg, function(ok) {\n try {\n if (ok)\n ch.ack(msg);\n else\n ch.reject(msg, true);\n } catch (e) {\n closeOnErr(e);\n }\n });\n }\n });\n}" ]
[ "0.6690176", "0.65911025", "0.65269446", "0.646472", "0.646472", "0.6434937", "0.6386433", "0.63230884", "0.62309504", "0.6191447", "0.6107536", "0.6092459", "0.6061203", "0.6061203", "0.6061203", "0.60519135", "0.601904", "0.6006691", "0.60041785", "0.59957856", "0.59957856", "0.5987773", "0.5979748", "0.5949903", "0.59435356", "0.5921853", "0.58900464", "0.5858856", "0.58369833", "0.58369833", "0.58369833", "0.5832108", "0.5826939", "0.581872", "0.58123434", "0.58097637", "0.5808749", "0.5756736", "0.57499737", "0.57355434", "0.57309955", "0.57271576", "0.57271576", "0.57271576", "0.57271576", "0.572652", "0.5718801", "0.5680902", "0.5667065", "0.56156474", "0.56122243", "0.5595182", "0.5594053", "0.5593341", "0.5593341", "0.55931437", "0.5564122", "0.55605286", "0.55574054", "0.554868", "0.5542845", "0.55404174", "0.5538941", "0.55282986", "0.55176353", "0.5504194", "0.5469984", "0.5452054", "0.5440856", "0.5430555", "0.5428651", "0.5418956", "0.5413979", "0.54068565", "0.5403983", "0.5401756", "0.5394268", "0.5386967", "0.53791213", "0.53738534", "0.5372901", "0.53653795", "0.53604203", "0.53396255", "0.5336444", "0.5334508", "0.5332705", "0.5332467", "0.53291386", "0.5324984", "0.532387", "0.53224564", "0.53162867", "0.53160626", "0.53035665", "0.5300143", "0.52983975", "0.5291999", "0.52913797", "0.52899003" ]
0.5795733
37
The main spotify client class!
constructor(token = 'NO TOKEN', options = {}) { this.token = token; this.onReady = options.ready || (() => { }); delete options.ready; this.cacheOptions = options; this.cache = { users: new Collection_1.default(), playlists: new Collection_1.default(), episodes: new Collection_1.default(), shows: new Collection_1.default(), categories: new Collection_1.default(), tracks: new Collection_1.default(), albums: new Collection_1.default(), artists: new Collection_1.default() }; Object.defineProperty(this, 'util', { value: new Util_1.default(this.token), writable: true }); Object.defineProperty(this, 'auth', { value: new AuthManager_1.default(this.token), writable: true }); Object.defineProperty(this, 'users', { value: new UserManager_1.default(this) }); Object.defineProperty(this, 'playlists', { value: new PlaylistManager_1.default(this) }); Object.defineProperty(this, 'episodes', { value: new EpisodeManager_1.default(this) }); Object.defineProperty(this, 'shows', { value: new ShowManager_1.default(this) }); Object.defineProperty(this, 'browse', { value: new BrowseManager_1.default(this) }); Object.defineProperty(this, 'tracks', { value: new TrackManager_1.default(this) }); Object.defineProperty(this, 'albums', { value: new AlbumManager_1.default(this) }); Object.defineProperty(this, 'artists', { value: new ArtistManager_1.default(this) }); Object.defineProperty(this, 'search', { value: SearchManager_1.default(this) }); Object.defineProperty(this, 'user', { value: new UserClient_1.default(this) }); if (this.token != 'NO TOKEN') { if (this.cacheOptions.cacheCurrentUser) this.user.info().then(x => this.onReady()); else this.onReady(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.authorizeURI = 'https://accounts.spotify.com/authorize';\n this. tokenURI = 'https://accounts.spotify.com/api/token';\n this.clientID = config.SPOTIFY_CLIENTID;\n this.redirectURI = config.SPOTIFY_REDIRECT_URI;\n this.clientSecret = config.SPOTIFY_SECRET;\n }", "function mySpotify() {\n console.log(\"Here's The Song Info!\")\n\n\n var searchTrack = '';\n\n var spotify = new Spotify({\n id: 'c4f36b57f5e74a6b858c77acfaf184e5',\n secret: '81b5017ea23848bd85953b8ab0f8e612'\n })\n // if the secondCommand input is not recognized, will automatically search \"The Sign\"\n console.log(spotify);\n if (secondCommand === undefined) {\n searchTrack = \"The Sign\";\n } else {\n searchTrack = secondCommand;\n }\n // searches spotify for requested song\n spotify.search({ type: 'track', query: searchTrack }, function(err, data) {\n if (err) {\n return console.log(\"Error Occurred: \" + err);\n } else {\n\n \t// Dot chain within the object to retrive the desired information\n // console.log(data.tracks.items[0].url);\n console.log(\"Artist: \" + data.tracks.items[0].artists[0].name);\n console.log(\"Song: \" + data.tracks.items[0].name);\n console.log(\"Preview: \" + data.tracks.items[0].preview_url);\n console.log(\"Album: \" + data.tracks.items[0].album.name);\n }\n });\n\n //end of mySpotify\t\n}", "function spotify(){\n //Spotifiy API keys\n var spot = keys.spotifyKeys;\n //Argument for song query\n var song = process.argv[3];\n //Spotify Node Construct\n var spotify = require('spotify');\n\n //Spotify search NPM\n spotify.search({type:'track', query: song}, function(err, data){\n if(!error){\n var artist = data.tracks.items[0].artists[0].name;\n var title = data.tracks.items[0].name;\n var album = data.tracks.items[0].album.name;\n console.log(' ');\n console.log('================ Spotify This ================');\n console.log(\"Artist: \" + artist);\n console.log(\"Song: \" + title);\n console.log(\"Album: \" + album);\n console.log('===========================================');\n console.log(' ');\n }else{console.log(\"Spotify Error or No Track Found\")}\n })\n}", "constructor(key) {\n let Spotify = require('node-spotify-api');\n this.api = new Spotify(key);\n }", "function callSpotify() {\n //Requires the .env file where the API Key and Secret are hidden.\n require(\"dotenv\").config();\n //Requires Loads Spotify API module and Spotify API Key.\n var keys = require(\"./keys.js\");\n var Spotify = require('node-spotify-api');\n var spotify = new Spotify(keys.spotify);\n var spotifyNodeArgs = process.argv;\n var songTitle = \"\";\n //If the user does not enter a search term it will search for \"The Sign\" by Ace of Bass as default.\n if (spotifyNodeArgs.length === 3){\n songTitle = \"The Sign US Remastered\";\n };\n //For Loop that checks the entire process.argv for the users term and combines the terms into \"songTitle\" variable.\n for (var i = 3; i < spotifyNodeArgs.length; i++) {\n if (i > 3 && i < spotifyNodeArgs.length) {\n songTitle = songTitle + \"+\" + spotifyNodeArgs[i];\n }\n else {\n songTitle += spotifyNodeArgs[i];\n }\n };\n //Spotify API call. Uses the \"songTitle\" variable to search for a song. The Artist, song, album, and a preview are logged to the terminal.\n spotify.search({ type: 'track', query: songTitle }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n console.log(\"\\nArtist: \" + data.tracks.items[0].album.artists[0].name, \"\\nSong: \" + data.tracks.items[0].name, \"\\nPreview: \" + data.tracks.items[0].preview_url, \"\\nAlbum: \" + data.tracks.items[0].album.name);\n });\n}", "function spotifyAPI(){\n\tvar Spotify = require(\"node-spotify-api\");\n\n\tvar spotify = new Spotify(keys.spotify);\n\n\tif (argument){\n\t\tspotify.search({ \n\t\t\ttype: 'track', \n\t\t\tquery: argument \n\t\t}, function(error, data) {\n \t\t\tif (!error) {\n \t\t\t\tconsole.log(\"----------------\");\n \t\t\t\tconsole.log(\"Artist Name: \" + data.tracks.artists.name); \n \t\t\t\tconsole.log(\"Song Name: \" + data.tracks.name);\n \t\t\t\tconsole.log(\"Album Name: \" + data.tracks.album.name);\n \t\t\t\tconsole.log(\"Song Preview Link :\" + data.body.tracks.external_urls);\n \t\t}\n \t});\t\n\t}\n else {\n \tspotify.search({ \n\t\t\ttype: 'track', \n\t\t\tquery: 'The Sign' \n\t\t}, function(error, data) {\n \t\t\tif (!error) {\n \t\t\t\tconsole.log(\"----------------\");\n \t\t\t\tconsole.log(\"Artist Name: \" + data.tracks.artists.name); \n \t\t\t\tconsole.log(\"Song Name: \" + data.tracks.name);\n \t\t\t\tconsole.log(\"Album Name: \" + data.tracks.album.name);\n \t\t\t\tconsole.log(\"Song Preview Link :\" + data.body.tracks.external_urls);\n \t\t}\n \t});\t\t\n }\t\n}", "function spot() {\n\tvar Spotify = require('node-spotify-api');\n\n\tvar spotify = new Spotify(keys.spotifyKeys);\n\n\tif (process.argv[3] === undefined) {\n\t\tprocess.argv[3] = 'The Sign Ace of Base'\n\t};\n\n\tspotify.search({ type: 'track', query: process.argv[3] }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n\tvar artistName = data.tracks.items[0].artists[0].name;\n\tvar songName = data.tracks.items[0].name;\n\tvar link = data.tracks.items[0].href;\n\tvar album = data.tracks.items[0].album.name;\n\t \n\tconsole.log(\"Artist Name:\", artistName); \n\tconsole.log(\"Song Name:\", songName);\n\tconsole.log(\"Song Link:\", link);\n\tconsole.log(\"Album Name:\", album);\n});\n\n}", "function callSpotify() {\n var spotify = new Spotify(keys.spotify);\n spotify.search({ type: 'track', query: searchParams }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n console.log(` -============= Song Results =========================-\n Artist(s): ${data.tracks.items[0].artists[0].name}\n Song Name: ${data.tracks.items[0].name}\n Spotify Preview Link: ${data.tracks.items[0].artists[0].external_urls.spotify}\n Album: ${data.tracks.items[0].album.name}\n -=====================================================-`);\n });\n}", "function spotifyAPI(userFavorites){\r\n const spotifyID = {\r\n id: \"520a7273452546879b3b85f62e8b9939\",\r\n secret: \"2d59e1d6dd5a40b3a291fe29a18aaa3c\"\r\n };\r\n\r\n let spotify = new spotify(spotifyID);\r\n\r\n spotify.search( {type: \"artist\", query: userFavorites,} ).then(function(response){\r\n console.log(response);\r\n });\r\n}", "function doSay() {\n //Variables to require file reading and the requirements to use the hidden Spotify API Key & Secret.\n var fs = require('fs');\n require(\"dotenv\").config();\n var keys = require(\"./keys.js\");\n var Spotify = require('node-spotify-api');\n var spotify = new Spotify(keys.spotify);\n //When the function is run, it reads \"random.txt\" to determine search parameters for the spotify API.\n fs.readFile(\"random.txt\", \"utf8\", function (error, data) {\n //Logs an error to the terminal if the function fails to run.\n if (error) {\n console.log(error);\n }\n //Creates an array containing the data found in \"random.txt\". Another variable is created to hold the song name.\n var randomArray = data.split(\",\");\n var songTitle = randomArray[1];\n //Spotify API is called once again using the query term we read from \"random.text\". The result is printed in the terminal.\n spotify.search({ type: 'track', query: songTitle }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n console.log(\"\\nArtist: \" + data.tracks.items[0].album.artists[0].name, \"\\nSong: \" + data.tracks.items[0].name, \"\\nPreview: \" + data.tracks.items[0].preview_url, \"\\nAlbum: \" + data.tracks.items[0].album.name);\n });\n\n });\n}", "function spot(b) {\n console.log(\"*******SPOTIFY*********\");\n\n var spotify = new Spotify({\n id: spotID,\n secret: spotSecret\n });\n\n var song = \"\";\n if (b == \"\") {\n // default song\n if (term.length == 3)\n song = \"All The Small Things\";\n else {\n // get console song input\n for (var i = 2; i < term.length; i++) {\n if (i > 2 && i < term.length)\n song = song + \"+\" + term[i];\n }\n }\n } else\n song = b;\n // api call\n spotify.search({ type: 'track', query: song }).then(function(response) {\n //array containing show info\n var showme = [];\n //console.log(response);\n var find = response.tracks.items[0];\n //console.log(find);\n //artist\n showme.push(find.album.artists[0].name);\n //name of song\n showme.push(find.name);\n //preview link \n showme.push(find.external_urls.spotify);\n //album name\n showme.push(find.album.name);\n\n //display information\n console.log(\"Artist: \" + showme[0]);\n console.log(\"Song Name: \" + showme[1]);\n console.log(\"Link: \" + showme[2]);\n console.log(\"Album Name: \" + showme[3]);\n console.log(\"******END SPOTIFY******\");\n }).catch(function(err) {\n console.log(err);\n });\n\n} //end spot", "getSpotifyPlayer() {\n if (window.Spotify !== null) {\n // Clear first\n clearInterval(this.getPlayerInterval);\n\n // Create a new player with the auth token\n this.player = new window.Spotify.Player({\n name: 'My Artists',\n getOAuthToken: (cb) => {\n cb(this.state.aToken);\n },\n });\n\n // Handle changes in state (i.e., pause, play) as well as errors\n this.createPlayerEventHandlers();\n\n // Connect the player to the SDK server!\n this.player.connect();\n }\n }", "function spotify(){\n spotify = new Spotify({\n id: spotifyKeys.id,\n secret: spotifyKeys.secret,\n });\n //console.log(spotSearch);\n if(spotSearch !== \"\"){\n spotify.search({\n type:'track',\n query: spotSearch,\n }, function(err, data){\n if (!err){\n var trackInfo = data.tracks.items[0];\n //console.log(data);\n //console.log(spotSearch);\n console.log('Title: ' + trackInfo.name + '\\nAlbum: ' + trackInfo.album.name + '\\nArtists: ');\n for (i = 0; i < trackInfo.album.artists.length; i++){\n console.log(trackInfo.artists[i].name)\n }\n console.log('Preview Link: ' + trackInfo.href)\n }\n })\n }\n else {\n spotify.search({type:'track', query:'The Sign Ace of Base'}, function(err, data){\n if (!err){\n var trackInfo = data.tracks.item[0];\n cconsole.log(\"Title: \" + trackInfo.name + '\\nAlbum: ' + trackInfo.album.name + '\\nArtists: ');\n for (i = 0; i < trackInfo.album.artists.length; i++){\n console.log(trackInfo.artists[i].name)\n }\n console.log('Preview Link: ' + trackInfo.href)\n }\n })\n }\n // spotify.search({type:'artist', query: spotSearch}, function(err, data){\n // if (err){\n // return console.log('Error occured: ' + err);\n // }\n // console.log(data);\n}", "function createSpotify () {\n // Load token.\n // Token is relative from root directory, as bot is designed to run from root.\n const token = fs.readFileSync(\".access.token\", \"utf8\").trim()\n // Create Spotify API object.\n const spotify = new Spotify()\n spotify.setAccessToken(token)\n return spotify\n}", "function main() {\n\n var clientLib = namespace.lookup('com.pageforest.client');\n\n // Client library for Pageforest\n ns.client = new clientLib.Client(ns);\n\n // Use the standard Pageforest UI widget.\n //ns.client.addAppBar();\n\n // This app demonstrates auto-loading - will reload the doc if\n // it is changed by another user.\n ns.client.autoLoad = true;\n\n // Quick call to poll - don't wait a whole second to try loading\n // the doc and logging in the user.\n ns.client.poll();\n\n // Expose appid\n items.appid = ns.client.appid;\n }", "function ShopifyConnector() {\n\n this.rootUrl = \"http://shopify-connector.appspot.com\";\n //this.rootUrl = \"http://localhost:8000\";\n this.productUrl = this.rootUrl + '/product/';\n this.collectionUrl = this.rootUrl + '/collection/';\n this.utils = {};\n this.cachedContext = {};\n\n this.config = {\n defaultLimit: 20\n };\n }", "function spotifyCall() {\n\nvar spotifyQuestion = [\n {\n type: 'input',\n name: 'spotifyInput',\n message: \"Input the Spotify song you'd like information on.\"\n }\n]\n\nfunction displaySpotify() {\n\n inquirer.prompt(spotifyQuestion).then(function(answers) {\n\n var spotifyApi = new spotify( {\n clientId: spotifyKeys.client_id,\n clientSecret: spotifyKeys.client_secret,\n })\n\n // Retrieve an access token.\n spotifyApi.clientCredentialsGrant().then(function(data) {\n console.log('The access token expires in ' + data.body['expires_in']);\n console.log('The access token is ' + data.body['access_token']);\n //console.log(params)\n // Save the access token so that it's used in future calls\n spotifyApi.setAccessToken(data.body['access_token']);\n\n var spotifySong = answers.spotifyInput;\n params = spotifySong;\n console.log(params);\n\n spotifyApi.searchTracks(params).then(function(data) {\n console.log('Results for tracks titled ' + params,(JSON.stringify(data.body, null, 2)));\n }, function(err) {\n console.log(err);\n })\n\n\n }, function(err) {\n console.log(spotifyApi);\n console.log('Something went wrong when retrieving an access token', err);\n });\n })\n }\n\ndisplaySpotify()\n}", "spotifyThisSong() {\n const spotify = new SpotifyAPI(KEYS.spotify);\n let songName = \"The Sign Ace of Base\";\n\n if (this.cmdArgs.length > 0) {\n songName = this.cmdArgs.join(\" \");\n }\n spotify.searchSong(songName);\n }", "function spotifyCommand() {\n var trackName;\n // If the user does not type a search value, default to ace of base - the sign.\n if (process.argv[3] === undefined && randomSearch === undefined) {\n trackName = \"ace the sign\"\n } else if (randomSearch !== undefined) {\n trackName = randomSearch\n } else {\n trackName = process.argv[3];\n };\n\n var params = { type: 'track', query: trackName }\n spotify.search(params, function (err, data) {\n if (err) {\n return console.log(\"Error occurred: \" + err);\n }\n console.log(\"Your search is complete! Let's take a look...\"+\n \"\\nArtist: \" + data.tracks.items[0].artists[0].name +\n \"\\nSong Name: \" + data.tracks.items[0].name +\n \"\\nPreview Link: \" + data.tracks.items[0].href +\n \"\\nAlbum: \" + data.tracks.items[0].album.name);\n log(\"spotify-this-song was run and returned the following informtion: \"+\n \"\\nArtist: \" + data.tracks.items[0].artists[0].name +\n \"\\nSong Name: \" + data.tracks.items[0].name +\n \"\\nPreview Link: \" + data.tracks.items[0].href +\n \"\\nAlbum: \" + data.tracks.items[0].album.name +\n \"\\n------------------------------------------------------------\"\n )\n });\n}", "function spotify() {\n\n var track = name;\n //If a track is not specified at argv[3], search parameters default to The Sign by Ace of Base\n if (name === undefined) {\n track = \"the+sign\";\n var artist = \"ace+of+base\";\n } else {\n var artist = \"\";\n }\n\n //The object that tells Spotify what track to return information for\n var options = {\n url: 'https://api.spotify.com/v1/search?q=track:' + track + '%20artist:' + artist + '&type=track&limit=1',\n method: 'GET'\n };\n\n //Sending request to Spotify and storing subsequent callback data\n request(options, function(err, res, body) {\n var json = JSON.parse(body);\n // console.log(body);\n //Filtering specific callback data into variables\n var artist = 'Artist: ' + json.tracks.items[0].artists[0].name;\n var track = 'Track: ' + json.tracks.items[0].name;\n var preview = 'Preview: ' + json.tracks.items[0].external_urls.spotify;\n var album = 'Album: ' + json.tracks.items[0].album.name;\n\n //Calling varibles in terminal\n console.log(artist, track, preview, album);\n\n //Appending data to log.txt\n fs.appendFile('log.txt', '\\n' + line + '\\n' + artist + '\\n' + track + '\\n' + preview + '\\n' + album + '\\n' + line + '\\n', function(error) {\n if (error) {\n console.error(error);\n } else {\n console.log(\"Success!\");\n }\n });\n })\n}", "function spotifySearch() {\n\n console.log(\"initializing funciton\");\n var spotify = new Spotify(keys.spotify);\n\n if(!value) {\n value = \"The Sign by Ace of Base\";\n }\n\n \n\n spotify.search({ type: 'track', query: value }, function(error, data, response) {\n if (error) {\n\n console.log('Error occurred: ' + error);\n return;\n }\n var songInfo = data.tracks.items[0];\n var songData =\n \"\\r\\n Artist: \" + songInfo.artists[0].name +\n \"\\r\\n Song Title: \" + songInfo.name +\n \"\\r\\n Song Preview: \" + songInfo.preview_url ;\n\n console.log(songData);\n }); \n \n }", "function spotifyThisSong() {\n // To include the spotify-api\n var Spotify = require('node-spotify-api');\n var spotify = new Spotify(liriKeys.spotify);\n\n // To search for the song name entered by user\n spotify.search({ type: 'track', query: songName, limit: 1 }, function (error, data) {\n if (!error) {\n // For loop to go through all the data items\n for (var i = 0; i < data.tracks.items.length; i++) {\n var songData = data.tracks.items[i];\n // To log all the information required for the assignment\n console.log(\"* Artist: \" + songData.artists[0].name);\n console.log(\"* Song: \" + songData.name);\n console.log(\"* Preview URL: \" + songData.preview_url);\n console.log(\"* Album: \" + songData.album.name);\n console.log(\"-----------------------\");\n }\n }\n else {\n // To log an error message if error occurs\n console.log(\"Error occurred\" + error);\n }\n });\n}", "function spotify(){\n\n\tvar spotify = require('spotify');\n\n\tvar nodeArgs = process.argv;\n\n\tvar songName = \"\";\n\n\tfor (var i=3; i<nodeArgs.length; i++){\n\n\tif (i>3 && i < nodeArgs.length){\n\n\t\tsongName = songName + \" \" + nodeArgs[i];\n\t}\n\n\telse{\n\n\t\tsongName = songName + nodeArgs[i];\n\t}\n\t\n}\n\n\tspotify.search({ type: 'track', query: songName }, function(err, data) {\n \t\n \tif ( err ) {\n console.log('Error occurred: ' + err);\n return;\n \t}else {\n \t\t//console.log(JSON.stringify(data, null, 2));\n \t\tconsole.log( \"Artist: \")\n \t\tconsole.log( data.tracks.items[0].artists[0].name);\n \t\tconsole.log( \"URL: \")\n \t\tconsole.log( data.tracks.items[0].artists[0].uri);\n \t}\n\t});\n}", "function spotifythissong(name) {\n var spotify = require('node-spotify-api');\n var spotify = new spotify({\n id: keys.spotify.id,\n secret: keys.spotify.secret\n });\n\n spotify.search({ type: 'track', query: 'All the small things', artists: \"artist\" }, function (err, data) {\n if (err) {\n\n return console.log('there is an error' + err);\n }\n console.log(data.tracks.items[0]);\n\n\n });//End of the spotify function\n}", "function authenticateWithSpotify(){\n\n // Load config\n var url = AUTH_URI;\n\n // Generate a state key\n // var state = generateRandomString(32);\n\n // Make authentication request\n url += '?response_type=token';\n url += '&client_id=' + encodeURIComponent(CLIENT_ID);\n url += '&scope=' + encodeURIComponent(SCOPE);\n url += '&redirect_uri=' + encodeURIComponent(REDIRECT_URI);\n url += '&state=' + encodeURIComponent(SCOPE);\n url += '&show_dialog=' + encodeURIComponent(true);\n window.location = url;\n}", "function spotifyThis() {\n\n // Gets user input if available\n if (process.argv.length > 3) {\n songName = \"\";\n for (var i = 3; i < process.argv.length; i++){\n songName += process.argv[i] + \" \";\n }\n }\n spotify.search({ type: 'track', query: songName, limit: 10 }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n console.log(\"Song Name: \" + songName +\"\\n\");\n console.log(\"Versions:\\n\");\n\n // Loop to display all songs\n for (var i = 0; i < data.tracks.items.length; i++) {\n console.log((i+1) + \".\\n\" + \"Band: \" + data.tracks.items[i].album.artists[0].name);\n console.log(\"Album: \" + data.tracks.items[i].album.name);\n console.log(\"Preview URL: \" + data.tracks.items[i].external_urls.spotify + \"\\n\");\n }\n fs.appendFile(\"./log.txt\", \"\\n\" + new Date().toISOString().replace('T', ' ').substr(0, 19) + \" ==> looked up '\" + songName + \"' on Spotify\\n--------------------------------------------------------------------\", function(err){\n if(err){\n throw err;\n }\n });\n });\n}", "function spotify_this(){\n // console.log(\"spotify_this works\")\n //make sure keys are accessible\n // console.log(spotify)\n\n //spotify search track\n spotify.search({ \n type: 'track', \n query: `${input}` }, \n function(err, data) {\n \n if (err) {\n return console.log('Error occurred: ' + err);\n }\n // console.log(data.tracks.items[0]); \n console.log(\"__________________________\")\n console.log(`Artist Name: ${data.tracks.items[0].artists[0].name}`);\n console.log(`Track Name: ${data.tracks.items[0].name}`);\n console.log(`Preview URL: ${data.tracks.items[0].preview_url}`);\n console.log(`Album Title: ${data.tracks.items[0].album.name}`)\n console.log(\"__________________________\")\n });\n}", "function ApiClient() {\n\n}", "function mySpotify(functionParameters) {\n\tvar spotify = new Spotify({\n \t\tid: \"0888876dd4e746b69a275d3c58cd021c\",\n \t\tsecret: \"4afc6e98cbf6417996aa4beb038144c3\"\n});\n \tif(functionParameters < 1) {\n \t\tfunctionParameters = \"The Sign Ace of Base\";\n \t}\nspotify.search({ type: 'track', query: functionParameters }, function(err, data) {\n if (err) {\n \tconsole.log('Error occurred: ' + err);\n return;\n } else {\n \tvar songData = data.tracks.items[0];\n \tvar songResult = console.log(songData.artists[0].name)\n \t\tconsole.log(songData.name)\n \t\tconsole.log(songData.preview_url)\n \t\tconsole.log(songData.album.name)\n \t}\n \n// console.log(data); \n});\n}", "function spotify(song) {\n\n//this song is a default if user did not request the song\nsong = \"The Sign by Ace of Base\"\nif (parameter ==\"\"){\n parameter = song;\n}\n\n//send request to spotify queryURL\nvar spotify = require ('spotify');\n\n//run the request to spotify with specific song the user entered\nspotify.search({ type: 'track', query: parameter }, function(err, data) {\n if ( err ) {\n //console.log('Error occurred: ' + err);\n return;\n }\n\n\n //loop through all the data requested\n //for (var i=0; i<11; i++) {\n\n //console.log(JSON.stringify(data, null, 2));\n //log all necessary information of the song user requested\n ////console.log(\"----------------------------------------------------------------\");\n ////console.log(\"Artist: \" + data.tracks.items[i].artists[0].name);\n ////console.log(\"Song Name: \" + data.tracks.items[i].name);\n ////console.log(\"Spotify Link: \" + data.tracks.items[i].external_urls.spotify);\n ////console.log(\"Album Name: \" + data.tracks.items[i].album.name);\n ////console.log(\"----------------------------------------------------------------\");\n // };\n });\n}", "function displaySpotify() {\n if (process.argv[3]) {\n spotifySong = process.argv[3];\n }\n spotify\n .search({ type: 'track', query: spotifySong })\n .then(function (response) {\n\n dataOutPut = \"\\n\" + commandRequest + \"\\n---------------------------------------------------------------------------------------------------------------------------------\" +\n \"\\nArtist(s): \" + response.tracks.items[0].artists[0].name + \"\\n\" +\n \"\\nSong: \" + response.tracks.items[0].name + \"\\n\" +\n \"\\nPreview: \" + response.tracks.items[0].preview_url + \"\\n\" +\n \"\\nAlbum: \" + response.tracks.items[0].album.name + \"\\n\" +\n \"---------------------------------------------------------------------------------------------------------------------------------\";\n logOutPut();\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function spotifyThisSong(){\n var spotify = new Spotify({\n id: keyz.spotifyKeys.clientId,\n secret: keyz.spotifyKeys.clientSecret\n });\nvar userinput = process.argv.slice(3);\n//console.log(userinput);\n if(userinput.length === 0){\n var userQuery = \"ace of base\";\n }else{\n var userQuery = userinput.join(\" \");\n }\n//console.log(userinput);\n//console.log(userQuery);\n\n spotify.search({ type: 'track', query: userQuery}, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n } \n console.log(\"artist: \" + data.tracks.items[0].artists[0].name);\n console.log(\"song's name: \" + data.tracks.items[0].name); \n console.log(\"preview link: \" + data.tracks.items[0].external_urls.spotify);\n console.log(\"album name: \" + data.tracks.items[0].album.name); \n \n });\n \n }", "function spotifyThisSong() {\n var spotify = new Spotify(keys.spotify);\n // If no track is entered, it will default to 'The Sign' by Ace of Base\n if (!liriSearchTerm) {\n var songTitle = \"The Sign, Ace of Base\";\n }\n else {\n var songTitle = liriSearchTerm;\n }\n // search: function({ type: 'artist OR album OR track', query: 'My search query', limit: 20 }, callback);\n spotify.search({ type: 'track', query: songTitle }, function (err, response) {\n // Create a variable to store the first song in the response\n var spotifyData = response.tracks.items[0];\n // console.log (spotifyData);\n\n // Create an array to store the information about the song, that will be written to the log.txt\n var spotifyData = [\n \"Artist: \" + spotifyData.artists[0].name,\n \"Song Link: \" + spotifyData.name,\n \"Song Preview: \" + spotifyData.preview_url,\n \"Album: \" + spotifyData.album.name,\n ].join(\"\\n\");\n\n // Write the data from the response to the terminal window\n console.log(spotifyData);\n // Write the data to log.txt\n updateLogFile(spotifyData);\n })\n}", "playSong(){\n spotifyApi.play({});\n }", "function spotifyThis (song) {\n //variable for spotify key\n var spotify = new Spotify(keys.spotify);\n \n // default variable if no user input\nif (song == \"\") {\n song = \"The Sign by Ace of Base\";\n }\n// searching spotify\n spotify.search({ type: 'track', query: song }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n \n console.log(\"The artist for \" + song + \" is \" + data.tracks.items[0].artists[0].name + \". \"); \n console.log(\"Here is a preview: \" + data.tracks.items[0].preview_url)\n console.log(\"The name of the album that \" + song + \" is from: \" + data.tracks.items[0].album.name + \". \");\n });\n\n }", "function spotifySong(song) {\n\t// Initialize spotify API keys\n\tvar client = new Spotify (keys.spotifyKeys);\n\t// If a song has been passed into the function\n\t// then set parameters to the specified song. \n\t// Otherwise set it to The Sign by Ace of Base\n\tif (typeof(song) != \"undefined\") {\n\t\t// Specify parameters for API call\n\t\tvar params = {\n\t\t\ttype: 'track',\n\t\t\tquery: song,\n\t\t\tlimit: 1\n\t\t};\n\t\t// Append the command (argument 1 and 2) to the log file log.txt\n\t\tfs.appendFile(\"log.txt\",';'+argument1 + ';' + argument2 , function(err){\n\t\t//If the code experiences any errors it will log the error to the console.\n\t\t if (err) {\n\t\t return console.log(err);\n\t\t };\n\t\t});\n\t} else {\n\t\t// Specify alternate parameters for API call\n\t\tvar params = {\n\t\t\ttype: 'track',\n\t\t\tquery: \"The Sign Ace of Base\",\n\t\t\tlimit: 1\n\t\t};\n\t\t// Append the command (argument 1 only) to the log file log.txt\n\t\tfs.appendFile(\"log.txt\",';' + argument1, function(err){\n\t\t//If the code experiences any errors it will log the error to the console.\n\t\t if (err) {\n\t\t return console.log(err);\n\t\t };\n\t\t});\n\t};\n\t// Execute API call\n\tclient.search(params, function(err, data) {\n\t\tif (err) {\n\t\t\treturn console.log('Error occurred: ' + err);\n\t\t};\n\t\t// Display the artists by looping through length or artist array\n\t\tfor (var i =0; i < data.tracks.items[0].album.artists.length; i++) {\n\t\t\tconsole.log(\"Artists: \" + data.tracks.items[0].album.artists[i].name);\n\t\t};\n\t\t// Display the song name\n\t\tconsole.log(\"Song: \" + data.tracks.items[0].name);\n\t\t// Display the preview link\n\t\tconsole.log(\"Preview link: \" + data.tracks.items[0].preview_url);\n\t\t// Display the album that the song is from\n\t\tconsole.log(\"Album: \" + data.tracks.items[0].album.name);\n\t\t// Append the results to the log file log.txt\n\t\tfs.appendFile(\"log.txt\",';'+ \"Song: \" + data.tracks.items[0].name + ';' + \n\t\t\t\t\t\t\"Preview link: \" + data.tracks.items[0].preview_url + ';' +\n\t\t\t\t\t\t\"Album: \" + data.tracks.items[0].album.name , function(err){\n\t\t\t//If the code experiences any errors it will log the error to the console.\n\t\t \tif (err) {\n\t\t return console.log(err);\n\t\t };\n\t\t});\n\t}); \n}", "function spotify(song) {\nvar spotify = new Spotify({\n id: \"569b986909fb40db838262de1380d393\",\n secret: \"f5b7b55801464dd3bc672665bd685f57\"\n });\n // console.log(\"TEXT TEXT TEXT TEXT\",text);\n var nodeArgsSong = process.argv;\n var songName = song;\n // if(argumentInput == \"spotify-this-song\"){\n for (var i = 3; i < nodeArgsSong.length; i++){\n if(i > 3 && i < nodeArgsSong.length){\n songName = songName + \"+\" + nodeArgsSong[i];\n } \n else{\n songName += nodeArgsSong[i];\n }\n }\n\n if (songName === \"\") {\n songName = 'ace+of+base+sign';\n };\n\n spotify.search({ type: 'track', query: songName, limit: 1 }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n if (!err) {\n var spotifyData = data.tracks.items;\n // for (var i = 0; i < spotifyData.length; i++){\n \n console.log(spotifyData[0].album.name); \n console.log(spotifyData[0].artists[0].name); \n console.log(spotifyData[0].name); \n console.log(spotifyData[0].external_urls);\n // };\n }\n });\n}", "function getSpotify(song='The Sign', artist='Ace of Base') {\n\t// console.log(\"Spotify function ran\");\n\t// console.log(\"spotifyClient: \", spotifyClient);\n\n\tspotifyClient.search({type: 'track', query: song, artist: artist, limit: 1})\n\t\t.then(function(data) {\n\t\t\tvar firstItem=data.tracks.items[0];\n\t\t console.log(\"\\n\\n\" + \"SPOTIFY SONG RESULTS\".black.bgMagenta);\t\t\t\n\t\t\t// console.log (JSON.stringify(firstItem, null, 2));\n\t\t\tconsole.log(`Artist ${firstItem.album.artists[0].name.underline} | Song name ${firstItem.name} | Album name is ${firstItem.album.name}`);\n\t\t\tconsole.log(`Preview url ${firstItem.preview_url}`.white);\n\n\t\t}, function(err) {\n\t\t\tconsole.log('Sorry, I had a problem. ', err);\n\t\t});\n}", "function mySpotify(receivedSong) {\n\n\t// first save the name of the song\n\t// if it is provided from command line then use that otherwise\n\t// set it to 'The Sign' by Ace of Base\n\t// using ternary function seems to be the easiest way to do this\n\t// basically, if receivedSong exists then set it to that otherwise 'The Sign'\n\tvar mySong = receivedSong ? receivedSong : 'The Sign Ace of Base';\n\n\t// run a search on the Spotify API by track name for mySong\n\tSpotify.search({ type: 'track', query: mySong }, function(err, data) {\n\n\t\t// if an error is caught in the call, display that and exit the function\n\t\tif (err) return console.log('Spotify Error: ' + err);\n\n\t\t// if the song is not found in the Spotify database, log that and exit the function\n\t\tif (data.tracks.items.length == 0) return (console.log('No such song found!'));\n\n\t\t// log the command issued to the log.txt file\n\t\tlogCommand();\n\n\t\t// log out the song details, but go with the 0th item returned as API can return\n\t\t// multiple hits - basicaly go with the best match\n\t\tlogThis('Artist Name: ' + data.tracks.items[0].artists[0].name);\n\t\tlogThis('Song Name: ' + data.tracks.items[0].name);\n\t\tlogThis('Preview Link: ' + data.tracks.items[0].preview_url);\n\t\tlogThis('Album Title: ' + data.tracks.items[0].album.name);\n\n\t// end the search function\n\t});\n\n// end the mySpotify function\n}", "function main() {\n console.log(\"Contacting \" + HOST + \":\" + PORT);\n\n // Set access token and user id for example requests\n var accessToken = '';\n var userId = '';\n \n // Create template callback\n callback = function(err, resp) {\n if (err) console.log(\"Call did not succeed: \" + err);\n else console.log(\"Call succeeded: \" + JSON.stringify(resp));\n };\n\n /*\n * Example usage of getSeedTracks()\n *\n * exports.getSeedTracks(accessToken, userId, callback);\n */\n}", "function spotifyThis() {\n // console.log(searchQuery);\n if (!searchQuery) {\n searchQuery = \"The Sign by Ace of Base\"\n // console.log(searchQuery);\n }\n spotify.search({\n type: 'track',\n query: searchQuery\n }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n // console.log(JSON.stringify(data.tracks))\n console.log(\"Artist: \" + data.tracks.items[0].album.artists[0].name);\n console.log(\"Song Title: \" + data.tracks.items[0].name);\n console.log(\"Album Name: \" + data.tracks.items[0].album.name);\n console.log(\"Spotify Preview link: \" + data.tracks.items[0].preview_url);\n\n\n\n });\n}", "function getSpotify(b){\n\n // Test to see if Spotify works\n // console.log(\"Spotify works!\");\n\n // Paste the sample code from npm\n spotify.search({ type: 'track', query: b }, function(err, data) {\n\n if ( err ) {\n \n console.log('Error occurred: ' + err);\n \n return;\n \n }\n\n // console.log(\"The raw data: \" + JSON.stringify(data, null, 3));\n \n for(var i = 0; i < data.tracks.items.length; i++) {\n\n // Do something with 'data' \n console.log(\"=================================================================\");\n\n console.log(\"Potential Song Origin ~ \" + i);\n \n for(var j = 0; j < data.tracks.items[i].artists.length; j++) {\n\n console.log(\"Artist involved: \" + data.tracks.items[i].artists[j].name);\n \n }\n\n console.log(\"Album Name: \" + data.tracks.items[i].album.name);\n\n console.log(\"Song Name: \" + value);\n\n console.log(\"=================================================================\");\n\n console.log(\"\");\n\n console.log(\"\");\n\n }\n\n checkConfirm();\n \n });\n\n}", "function getSpotify(){\t\n\t\n\tvar params = {\n\t\ttype: 'track',\n\t\tquery: userInput,\n\t\tlimit: 1\n\t}\n\n// If no song is provided then your program will default to \"The Sign\" by Ace of Base\n\tif (userInput === undefined){\n\t\tparams.query = \"Ace of Base The Sign\";\n\t}\n\n\tspotify.search(params, function(error, data) {\n\t\tif (error) {\n\t \t\treturn console.log('Error occurred: ' + err);\n\t\t}\n\t \tvar track = data.tracks.items[0]\n\t\tconsole.log(\"Artist name(s): \" + track.artists[0].name); \n\t\tconsole.log(\"Song name: \" + track.name); \n\t\tconsole.log(\"Preview link: \" + track.preview_url); \n\t\tconsole.log(\"Album name: \" + track.album.name); \n\t});\n}", "function doSpotify(song) {\n\n\tif(song === \"\") {\n\n\t\tsong = \"the sign\";\t\n\n\t}\n\n\n\n\t// console.log(\"song title: \"+song)\n\n\n\n\tvar spotify = new Spotify(keys.spotify);\t\n\n\tspotify.search({ type: 'track', query: song }, function(err, data) {\n\n\t \tif (err) {\n\n\t \treturn console.log('Error occurred: ' + err);\n\n\t \t}\n\n\t \tconsole.log(\"title: \" + data.tracks.items[0].name);\n\n\t \tconsole.log(\"artist: \" + data.tracks.items[0].artists[0].name);\n\n\t \tconsole.log(\"album: \" + data.tracks.items[0].album.name);\n\n\t \tif(data.tracks.items[0].preview_url != null) {\n\n\t \t\tconsole.log(\"previewLink: \" + data.tracks.items[0].preview_url);\n\n\t \t} else{\n\n\t \t\tconsole.log(\"no url\");\n\n\t \t}\n\n\t});\n\n}", "function spotifyIt(song) {\n // set up new spotify object for node-spotify-api\n var spotify = new Spotify({\n id: keys.spotify.id,\n secret: keys.spotify.secret\n });\n\n // search spotify using the api\n spotify.search({ type: 'track', query: song }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n } else if (data.tracks.items[0] != undefined) {\n // console loge out the results from the first item in the array\n console.log(`Artist: ${data.tracks.items[0].artists[0].name}`);\n console.log(`Title: ${data.tracks.items[0].name}`);\n console.log(`Album: ${data.tracks.items[0].album.name}`);\n console.log(`Preview: ${data.tracks.items[0].preview_url}`);\n } else {\n console.log(`Track: '${song}' not found`)\n\n }\n });\n}", "function getSpotify(){\n\n\tlet searchTerm;\n\tif(userParameters === undefined){\n searchTerm = \"The Sign Ace of Base\";\n console.log(\"no search term was detected, searching for The Sign by Ace of Base\");\n\t}else{\n // if there are search terms, use the userParameter that was formatted by our for loop\n\t\tsearchTerm = userParameters;\n\t}\n\t//execute the spotify search using the searchTerm\n\tspot.search({type:'track', query:searchTerm}, function(error,data){\n\t if(error){\n\t console.log(`The call to Spotify encountered an error: ${error}`);\n\t return;\n\t }else{\n // if no error was encountered, print the return data: \n\t \t\tconsole.log(\"Artist Name: \" + data.tracks.items[0].artists[0].name);\n console.log(\"Song Name: \" + data.tracks.items[0].name);\n\n // check to see if the preview URL returned is null. Spotify returns null for preview URL \n // when you query a song that is not available to stream in your region. If it is null, return \n // some information to that effect. If it's not null, return the preview URL\n if (data.tracks.items[0].preview_url == null){\n console.log(\"Preview URL is not available - song is not available to stream in your region\")\n }\n else{\n console.log(\"Preview URL: \" + data.tracks.items[0].preview_url);\n };\n console.log(\"Album Name: \" + data.tracks.items[0].album.name);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW SONG SEARCH EVENT:\\nArtist Name: ${data.tracks.items[0].artists[0].name}\\nSong Name: ${data.tracks.items[0].name}\\nPreview URL: ${data.tracks.items[0].preview_url}\\nAlbum Name:${data.tracks.items[0].album.name}\\n------\\n`,function(err) {\n });\n\t }\n\t});\n}", "function runSpotify(query) {\n spotify.search({\n type: 'track',\n query: query,\n }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n // loging resuts\n console.log(\"Artist: \", data.tracks.items[0].album.artists[0].name);\n console.log(\"Song Name: \", data.tracks.items[0].name);\n console.log(\"link to song: \", data.tracks.items[0].preview_url)\n console.log(\"This song is from: \", data.tracks.items[0].album.name)\n\n // end spotify\n });\n}", "function runSpotify(songTitle) {\n //check for user input\n if (songTitle === null || typeof songTitle === 'undefined' || songTitle === undefined) {\n songTitle = \"The+Sign\";\n }\n\n console.log(\"spotify this \" + songTitle);\n console.log(\"==========================\");\n\n spotify.search({ type: 'track', query: songTitle }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n for (i = 0; i < data.tracks.items.length; i++) {\n console.log(\"---------------------------------------------\")\n console.log(data.tracks.items[i].album.artists[0].name);\n console.log(data.tracks.items[i].album.name);\n console.log(data.tracks.items[i].external_urls.spotify);\n };\n });\n}", "function onSpotifyPlayerAPIReady() {\r\n \r\n let player = new Spotify.Player({\r\n name: 'User',\r\n getOAuthToken: function(cb) {\r\n cb(_token)\r\n },\r\n volume: 0.8\r\n });\r\n\r\n player.on('ready', function(data) {\r\n deviceId = data.device_id;\r\n localStorage.setItem('browserDeviceID', data.device_id);\r\n });\r\n\r\n player.on('player_state_changed', function(data) {\r\n if(data) {\r\n let currentTrack = data.track_window.current_track.uri;\r\n updateCurrentlyPlaying(currentTrack);\r\n } \r\n });\r\n\r\n player.connect();\r\n}", "function MovieClient(apiKey) {\n this.apiKey = apiKey;\n}", "function spotifyThisSong(){\n\n var spotify = new spotify({\n \tid: keys.spotify.id,\n \tsecret: keys.spotify.secret\n });\n\n\tvar searchSong;\n\tif(userInput2 === undefined){\n\t\tsearchSong = \"What's My Age Again?\";\n\t}else{\n\t\tsearchSong = userInput2;\n\t}\n\n\tspotify.search({type:'track', query:searchSong}, function(err,data){\n\t if(err){\n\t console.log('Error: ' + err);\n\t return;\n\t }else{\n\t \n\t \t\tconsole.log(\"Artist: \" + data.tracks.items[0].artists[0].name);\n\t console.log(\"Song: \" + data.tracks.items[0].name);\n\t console.log(\"Album: \" + data.tracks.items[0].album.name);\n\t console.log(\"Preview: \" + data.tracks.items[0].preview_url);\n\t }\n\t});\n}", "function songIt(song) {\n //sets up the key\n var spotify = new Spotify(keys.spotify);\n //if there is are other arguments in the terminal line, it searches for that given string\n if (song != \"\") {\n spotify.search({ type: 'track', query: song }, function (error, data) {\n if (!error) {\n console.log(divider);\n //prints artist, song name, preview url, and album name\n for (var i = 0; i < data.tracks.items.length; i++) {\n var songData = data.tracks.items[i];\n console.log(\"Artist: \" + songData.artists[0].name + \"\\nSong: \" + songData.name + \"\\nURL: \" + songData.preview_url + \"\\nAlbum: \" + songData.album.name);\n console.log(divider);\n }\n }\n else {\n console.log(\"You have issues.\");\n }\n });\n }\n //default to given song\n else {\n var special = { type: 'track', id: '3DYVWvPh3kGwPasp7yjahc' };\n spotify.lookup(special, function (error, data) {\n if (!error) {\n console.log(divider);\n for (var i = 0; i < data.tracks.items.length; i++) {\n var songData = data.tracks.items[i];\n console.log(\"Artist: \" + songData.artists[0].name + \"\\nSong: \" + songData.name + \"\\nURL: \" + songData.preview_url + \"\\nAlbum: \" + songData.album.name);\n console.log(divider);\n }\n }\n else {\n console.log(\"You have issues.\");\n }\n });\n }\n}", "function doSpotify(name) {\n\n if (name == null) {\n name = 'The Sign';\n }\n // Search tracks\n spotify.search({\n type: 'track',\n query: name\n }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n } else {\n for (i = 0; i < data.tracks.items.length && i < 5; i++) {\n\n var song = data.tracks.items[i];\n\n //Artist(s)\n console.log(\"\\nArtist: \" + song.artists[0].name +\n //The song's name\n \"\\nSong Name: \" + song.name +\n //A preview link of the song\n \"\\nLink to Song: \" + song.preview_url +\n //The album that the song is from\n \"\\nAlbum Name: \" + song.album.name);\n\n appendFile(\"\\nArtist: \" + song.artists[0].name +\n //The song's name\n \"\\nSong Name: \" + song.name +\n //A preview link of the song\n \"\\nLink to Song: \" + song.preview_url +\n //The album that the song is from\n \"\\nAlbum Name: \" + song.album.name);\n }\n };\n\n\n });\n\n}", "function showSpotifyInfo(userInputs) {\n // If no song is provided then your program will default to \"The Sign\" by Ace of Base.\n if (userInputs === \"\") {\n userInputs = \"The Sign Ace of Base\"\n }\n\n //search spotify-node API for artist/music input\n spotify.search({ type: \"track\", query: userInputs }, function (err, data) {\n if (err) {\n console.log('Error occurred: ' + err);\n return;\n }\n // console.log(data.tracks.items[0]); to gather data\n //printing spotify info to the console\n console.log(\n \"Artist: \" + data.tracks.items[0].album.artists[0].name + \"\\n\",\n \"Song: \" + data.tracks.items[0].name + \"\\n\",\n \"Preview: \" + data.tracks.items[0].album.external_urls.spotify + \"\\n\",\n \"Album: \" + data.tracks.items[0].album.name + \"\\n\",\n )\n })\n}", "function spotifyNow(){\n console.log(\"Now time for some music!\");\n\n var searchMusic;\n if(search === undefined){\n console.log(\"Please try again\"); //Cannot find user input\n }\n else{\n searchMusic = search; //Finds user input\n }\n\n spotify.search({type: \"track\", query: searchMusic}, function(err , data){\n if(err){\n console.log(\"Error occurred: \" + err);\n return;\n } else if (data.error) {\n console.log(\"Error occurred: \" + data);\n return;\n }\n\n else{\n console.dir(data);\n // console.log(\"Artist: \" + data.tracks.items[0].artists[0].name);\n // console.log(\"Song: \" + data.tracks.items[0].name);\n // console.log(\"Album: \" + data.tracks.items[0].album.name);\n // console.log(\"Preview here: \" + data.tracks.items[0].preview_url);\n }\n\n })\n\n}", "function spotifySong() {\n\n\t// it will execute user input of argv[3] or it will execute the sign if there is no argv[3]\n\tvar songData = process.argv[3] || \"The Sign Ace of Base\";\n\n\tspotify.search({ type: 'track', query: songData }, function(err, data) {\n \tif (err) {\n \tconsole.log('Error occurred: ' + err);\n \t// return;\n \t}\n \t// console.log(data);\n \t// console.log(data.tracks.items);\n\n \tfor (var i = 0; i < 1; i++){\n\n \t\t// artist's name\n \t\tconsole.log(\"\");\n \t\tconsole.log('Artists\\' Name:');\n \t\tdata.tracks.items[i].artists.forEach(function(el){\n \t\t\tconsole.log(el.name);\n \t\t});\n\n \t\t// song name\n \t\tconsole.log(\"\");\n \t\tconsole.log('Song Name:');\n \t\tconsole.log(data.tracks.items[i].name);\n\n \t\t// this is name of album\n \t\tconsole.log(\"\");\n \t\tconsole.log('Album Name: ' + data.tracks.items[i].album.name);\n\n \t\t// track 30 seconds preview url\n \t\tconsole.log(\"\");\n \t\tconsole.log('Preview of the song:');\n \t\tconsole.log(data.tracks.items[i].preview_url);\n\n \t\t// album image url\n \t\tconsole.log(\"\");\n \t\tconsole.log('Album URL:');\n \t\tconsole.log(data.tracks.items[i].album.external_urls.spotify);\n\n\n \t}\n\n });\n}", "function searchSpotify() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"query\",\n message: \"Search Spotify:\"\n }\n ]).then(function(input) {\n var query = input.query;\n if (input.query == \"\") {\n query = \"The Sign Ace of Base\"\n }\n var spotify = new Spotify({\n id: spotifyKeys.id,\n secret: spotifyKeys.secret\n });\n spotify.search({ type: \"track\", query: query }, function (error, data) {\n if(error) {\n console.log(error)\n } else {\n var title = data.tracks.items[0].name;\n var artist = data.tracks.items[0].artists[0].name;\n var album = data.tracks.items[0].album.name;\n var previewLink = data.tracks.items[0].preview_url;\n if(!previewLink) {\n previewLink = \"No preview available :(\"\n }\n console.log(\"~Siri~ Here is some information about \" + title + \".\")\n console.log(\"...\");\n console.log(\"Title: \" + title);\n console.log(\"Artist: \" + artist);\n console.log(\"Album: \" + album);\n console.log(\"Preview: \" + previewLink); \n console.log(\"...\");\n logData(\"Searched Spotify for \" + title + \" by \" + artist);\n }\n })\n \n })\n}", "function getMeSpotify(song) {\n\n \tvar spotify = new Spotify({\n id: \"da24436a031e43bca509698c3c3d38d3\",\n secret: \"1001de50019440c682a5433acaa45969\",\n\t});\n \tspotify.search({type: 'track', query: song}, function(error, data) {\n \t\tif(!error) {\n \t\t\tfor (var i = 0; i < data.tracks.items.length; i++) {\n \t\t\t\tvar songData = data.tracks.items[i];\n \t\t\t\t// artist\n \t\t\t\tconsole.log(\"Artist: \" + songData.artists[0].name);\n \t\t\t\t// song name\n \t\t\t\tconsole.log(\"Song: \" + songData.name);\n \t\t\t\t// spotify preview link\n \t\t\t\tconsole.log(\"Preview URL: \" + songData.preview_url);\n \t\t\t\t// name of the album\n \t\t\t\tconsole.log(\"Album: \" + songData.album.name);\n \t\t\t\tconsole.log(\"--------------------\");\n\n \t\t\t\t// adds text to log.txt\n \t\t\tfs.appendFile('log.txt', songData.artists[0].name);\n \t\t\tfs.appendFile('log.txt', songData.name);\n \t\t\tfs.appendFile('log.txt', songData.preview_url);\n \t\t\tfs.appendFile('log.txt', songData.album.name);\n \t\t\tfs.appendFile('log.txt', \"---------------------\");\n \t\t\t}\n \t\t}\telse {\n \t\t\tconsole.log(\"Error occured.There is no music!\");\n \t\t}\t\n \t });\n \t}", "function doThis(){\n fs.readFile(\"random.txt\", \"utf8\", function(error, data){\n if (!error) {\n var doThisResults = data.split(',');\n var spotSearch = doThisResults[1];\n\n console.log(doThisResults);\n spotify = new Spotify({\n id: spotifyKeys.id,\n secret: spotifyKeys.secret,\n });\n //console.log(spotSearch);\n if(spotSearch !== \"\"){\n spotify.search({\n type:'track',\n query: spotSearch,\n }, function(err, data){\n if (!err){\n var trackInfo = data.tracks.items[0];\n //console.log(data);\n //console.log(spotSearch);\n console.log('Title: ' + trackInfo.name + '\\nAlbum: ' + trackInfo.album.name + '\\nArtists: ');\n for (i = 0; i < trackInfo.album.artists.length; i++){\n console.log(trackInfo.artists[i].name)\n }\n console.log('Preview Link: ' + trackInfo.href)\n }\n })\n }\n else {\n spotify.search({type:'track', query:'The Sign Ace of Base'}, function(err, data){\n if (!err){\n var trackInfo = data.tracks.item[0];\n cconsole.log(\"Title: \" + trackInfo.name + '\\nAlbum: ' + trackInfo.album.name + '\\nArtists: ');\n for (i = 0; i < trackInfo.album.artists.length; i++){\n console.log(trackInfo.artists[i].name)\n }\n console.log('Preview Link: ' + trackInfo.href)\n }\n })\n }\n };\n })\n}", "function spotifySearch() {\n // console.log(\"This is the spotify search\");\n if(process.argv.length === 3){\n searchTerm = \"The Sign\";\n }\n spotify.search({\n type: \"track\",\n query: searchTerm,\n limit: 10,\n }, function(err,data) {\n if(err) {\n return console.log(\"Error occurred: \" + err);\n }\n for (var i = 0; i < data.tracks.items.length; i++) {\n \n console.log(`Artist: ${data.tracks.items[i].artists[0].name}\\nSong Name: ${data.tracks.items[i].name}\\nSpotify Preview Link: ${data.tracks.items[i].preview_url}\\nAlbum: ${data.tracks.items[i].album.name}\\n\\n`);\n }\n })\n trackInfo(action, searchTerm);\n }", "function spotifySearch() {\n spotify.search({ type: 'track', query: searchName }, function(err, data) {\n\tif ( err ) {\n console.log('Error occurred: ' + err);\n return;\n\t} else {\n\t console.log(JSON.stringify(data.tracks.items[0].artists, null, 2));\n\t //artists\n\t console.log(\"Artitst(s): \" + data.tracks.items[0].artists[0].name);\n\t // song name\n\t console.log(\"Song Name: \" + data.tracks.items[0].name);\n\t // spotify link\n\t console.log(\"Spotify Link: \" + data.tracks.items[0].href);\n\t // album\n\t console.log(\"Album: \" + data.tracks.items[0].album.name);\n\t}\n });\n} // close spotify function", "function doWhatItSays() {\n\n \n fs.readFile(\"random.txt\", \"utf8\", function(error, data) { \n var dataArr = data.split(',');\n if(dataArr[0] === \"Spotify-This-Song\"){\n\n // require spotify npm\n var Spotify = require('node-spotify-api');\n // adding id and secret\n var spotify = new Spotify({\n id: \"15327b32486a4fda88a3e9ec70fa7c1e\",\n secret: \"5cbd33ae0f4e4083bd14097df393323a\"\n });\n spotify.search({ type: 'track', query:dataArr[1], limit:1 }, function(err, data) {\n var songs = data.tracks.items;\n // for loop to get song's info\n for (var i = 0; i < songs.length; i++) {\n //for loop to get artist's name\n for(var j =0; j < songs[i].artists.length; j++){\n //printing Artist name\n console.log(\"---------------------------------------------------\");\n console.log('Artist(s): '.bold + songs[i].artists[j].name.red.bold);\n }//artist name for loop ends here\n // printing out song info\n console.log(\"---------------------------------------------------\");\n console.log('Song Name: '.bold + songs[i].name.red.bold);\n console.log(\"---------------------------------------------------\");\n //added a line so users can copy the url easier from one line\n console.log('Preview Song:\\n '.bold + songs[i].preview_url.blue);\n console.log(\"---------------------------------------------------\");\n console.log('Album: '.bold + songs[i].album.name.red.bold);\n console.log(\"---------------------------------------------------\");\n };//end of for loop\n promptUser(); \n });//end of spotify search function\n }//end of if statement \n });//end of readFile call back function\n }", "function spotifyThis() {\n //default input if there is no input from user\n if (!input) {\n input = \"the sign ace of base\"\n };\n\n //searching spotify with the user input for 1 track\n spotify.search({type: 'track', query: input, limit: 1}, function(error, data) {\n //error catch and console.log\n if (error) {\n console.log('Error occurred: ' + error);\n }\n\n //console.log results\n var songSearched = data.tracks.items;\n console.log(\"========================\");\n console.log(\"Artist: \" + songSearched[0].artists[0].name);\n console.log(\"Song Title: \" + songSearched[0].name);\n console.log(\"Link to Song: \" + songSearched[0].preview_url);\n console.log(\"Album: \" + songSearched[0].album.name);\n console.log(\"========================\");\n });\n}", "function getSong() {\n //import the spotify package\n var Spotify = require('node-spotify-api');\n var spotify = new Spotify(keys.spotify);\n // set up call to Spotify\n if (process.argv[3]=== undefined) {\n spotify.search({ type: 'track', query: 'Ace of Base' }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n // output the Artist(s), song name, preview link, and album.\n console.log(\"Artist: \"+ data.tracks.items[0].artists[0].name);\n console.log(\"Song Name: \" + data.tracks.items[0].name);\n console.log(\"Preview: \"+ data.tracks.items[0].preview_url);\n console.log(\"Album: \"+ data.tracks.items[0].album.name);\n });\n } else {\n // Store all of the arguments in an array\n var nodeSongArgs = process.argv;\n // Create an empty variable for holding the song name\n var songName = \"\";\n // Loop through all the words in the node argument\n for (var i = 3; i < nodeSongArgs.length; i++) {\n if (i > 3 && i < nodeSongArgs.length) {\n songName = songName + \"+\" + nodeSongArgs[i];\n }\n else {\n songName += nodeSongArgs[i];\n }\n }\n spotify.search({ type: 'track', query: songName }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n // output the Artist(s), song name, preview link, and album.\n console.log(\"Artist: \"+ data.tracks.items[0].artists[0].name);\n console.log(\"Song Name: \" + data.tracks.items[0].name);\n console.log(\"Preview: \"+ data.tracks.items[0].preview_url);\n console.log(\"Album: \"+ data.tracks.items[0].album.name);\n });\n }\n}", "function spotifyThisSong() {\n\n\tvar spotifyInput = process.argv[3];\n\n\t// If there is no input provided by the user,\n\tif (spotifyInput === undefined) {\n\n\t\t// Return information for \"The Sign\" by Ace of Base! :)\n\t\t// Got specific song reference, as searching for \"The Sign\" gave way different results than the \n\t\t// song asked for\n\t\tspotify.lookup({type: \"track\", id: \"3DYVWvPh3kGwPasp7yjahc\"}, function(err, data) {\n\n\t\t\t// If there's an error..\n\t\t\tif (err) {\n\t\t\t\tconsole.log('Error occurred: ' + err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If no error..\n\t\t\telse {\n\n\t \t\t\t// Console log header\n\t \t\t\tconsole.log(\"--------------------------------------------------------------------\");\n\n\t\t\t\t// Artist(s) Name\n\t\t \t\tconsole.log(\"Artist(s) Name(s): \" + data.album.artists[0].name);\n\n\t\t\t\t// Song Name\n\t\t\t\tconsole.log(\"Song Name: \" + data.name);\n\n\t\t\t\t// Preview Link to the song on Spotify\n\t\t\t\tconsole.log(\"Preview Link: \" + data.preview_url);\n\n\t\t\t\t// Album Name\n\t\t\t\tconsole.log(\"Album Name: \" + data.album.name);\n\n\t\t\t\t// Console log footer\n\t\t\t\tconsole.log(\"--------------------------------------------------------------------\");\n\n\t \t\t}\n\t\t});\n\t}\n\n\t// If Spotify input is defined/has a value\n\telse if (spotifyInput !== undefined) {\n\n\t// Search for a track with input search term\n\tspotify.search({type: \"track\", query: spotifyInput}, function(err, data) {\n\n\t\t// If there's an error..\n\t if (err) {\n\t console.log('Error occurred: ' + err);\n\t return;\n\t }\n\n\t // If no error..\n\t \telse {\n\n\t\t\t// Console log header\n\t\t\tconsole.log(\"----- Top 3 Results ---------------------------------------------------------------\");\n\n\t \t\t// Display top three song results\n\t \t\tfor (var i = 0; i < 3; i++) {\n\n\t \t\t\t// Create/empty blank array\n\t\t\t\tvar multArtists = [];\n\n\t\t\t\t\t// Display all artists for track (some have one, some have multiple)\n\t\t \t\t\tfor (var j = 0; j < data.tracks.items[j].artists.length; j++) {\n\n\t\t \t\t\t\t// Push all artists on track to blank array\n\t\t \t\t\t\tmultArtists.push(data.tracks.items[i].artists[j].name);\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t// Artist(s) Name(s)\n\t\t\t\tconsole.log(\"Artist(s) Name(s): \" + multArtists.join(\", \"));\n\n\t\t\t\t// Song Name\n\t\t\t\tconsole.log(\"Song Name: \" + data.tracks.items[i].name);\n\n\t\t\t\t// Preview Link to the song on Spotify\n\t\t\t\tconsole.log(\"Preview Link: \" + data.tracks.items[i].preview_url);\n\n\t\t\t\t// Album Name\n\t\t\t\tconsole.log(\"Album Name: \" + data.tracks.items[i].album.name);\n\n\t\t\t\t// Line break between songs\n\t\t\t\tconsole.log(\"-----\");\n\n\t\t\t}\n\n\t\t\t// Console log footer\n\t\t\tconsole.log(\"--------------------------------------------------------------------\");\n\t \t}\n\t});\n\t}\n}", "function spotifyThisSong() {\n const spotify = new Spotify(keys.spotify);\n if (!userInput) {\n userInput = 'The Sign, Ace of Base';\n spotifyThisSong();\n }\n else {\n spotify.search({ type: 'track', query: userInput })\n .then(function (songResponse) {\n console.group('Song Name: ' + songResponse.tracks.items[0].name);\n console.log('Artist Name: ' + songResponse.tracks.items[0].artists[0].name)\n console.log('Album Name: ' + songResponse.tracks.items[0].album.name);\n console.log('Preview Link: ' + songResponse.tracks.items[0].artists[0].external_urls.spotify)\n });\n };\n}", "function spotifyRequest() {\n\n var spotify = new Spotify(keys.spotify);\n\n spotify.search({ type: 'track', query: song }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n console.log(\"*************this is parse**********\")\n // console.log(JSON.parse(data));\n console.log(\"*************this is stringify**********\")\n // console.log(JSON.stringify(data, null, 2));\n data.tracks.items.forEach(function (element) {\n console.log(\"*************Song's Name**********\")\n console.log(element.name);\n\n console.log(\"*************Artists Name**********\")\n element.artists.forEach(function (element) {\n console.log(element.name + \" \")\n\n })\n\n console.log(\"*************Song's URL**********\")\n console.log(element.external_urls.spotify + \"\\n----------\");\n\n })\n\n });\n}", "function start() {\n // console.log(typeof String(getKey('google')))\n // 2. Initialize the JavaScript client library.\n gapi.client.init({\n 'apiKey': \"AIzaSyABljrxKqX_RRid-9DZMq9aHGm65tuXSSk\"\n }).then(function () {\n // 3. Initialize and make the API request.\n gapi.client.request({\n 'path': `${defineRequest()}`,\n })\n }).then(function (response) {\n }, function (reason) {\n console.log(reason);\n console.log('Error: ' + reason.result.error.message);\n });\n }", "function spotifyAPI(songName) {\n // Begin If statement in case a song is not entered after command\n if (songName) {\n // Use node-spotify-api docs to set up searches\n spotify.search({type: \"track\", query: songName}, function(error, data) {\n if (error) {\n return console.log(\"Error occurred: \" + error);\n };\n\n // Put data.tracks.items object into variable to shorten code\n var songs = data.tracks.items;\n //console.log(data.tracks.items[0]); \n\n // Loop through songs variable and console.log all required song information\n for (var i = 0; i < songs.length; i++){\n console.log(\"Artist(s): \" + songs[i].artists.map(artistNames));\n console.log(\"Song Name: \" + songs[i].name);\n console.log(\"Preview song: \" + songs[i].preview_url);\n console.log(\"Album: \" + songs[i].album.name);\n console.log(\"==============================================================================\");\n }; \n });\n } \n // Else statement in case a song is not entered after command, alert user of Error and suggest Ace of Base's \"The Sign\"\n else {\n console.log(\"Error: A song was not entered\");\n console.log(\"==============================================================================\");\n console.log(\"Suggestion:\");\n console.log(\"Artist: Ace of Base\");\n console.log(\"Song Name: The Sign\");\n console.log(\"Preview song: <https://p.scdn.co/mp3-preview/4c463359f67dd3546db7294d236dd0ae991882ff?cid=fc5f31bbde1e400687ad0b26c4f50951>\");\n console.log(\"Album: The Sign (US Album) [Remastered]\");\n console.log(\"==============================================================================\");\n };\n}", "function requestSpotifyToken() { //function to request a Spotify authentication token\n if(window.XMLHttpRequest) {\n authenticationXHTTP = new XMLHttpRequest(); //create an XMLHttpRequest for all modern browsers\n }\n else {\n authenticationXHTTP = new ActiveXObject(Microsoft.XMLHTTP); //create an XMLHttpRequest for IE5, IE6\n }\n authenticationXHTTP.onreadystatechange = function() { //create a function triggered when the 'readyState' of the XMLHttpRequest changes\n if (this.readyState == 4 && this.status == 200) { //if the Spotify server has responded in the expected manner...\n spotifyTokenJSON = this.responseText; //set the 'spotifyTokenJSON' variable equal to the JSON response of the Spotify server\n spotifyTokenObj = JSON.parse(spotifyTokenJSON); //set the 'spotifyTokenObj' variable equal to the JSON.parsed Spotify server response\n spotifyToken = spotifyTokenObj.access_token; //set the 'spotifyToken' variable equal to the 'access_token' returned by the Spotify server\n spotifyArtistRequest(); //invoke the 'spotifyArtistRequest()' function\n }\n else if(this.readyState == 4) { //otherwise, if the Spotify server has not responded in the expected manner...\n communicationError.innerHTML = \"An error occurred during communication with the Spotify server. Please try again later.\"; //basic communication error handling\n }\n };\n authenticationXHTTP.open(\"POST\", \"https://accounts.spotify.com/api/token\", true); //open the XMLHttpRequest, specifying the communication method, endpoint, and asynchronicity\n authenticationXHTTP.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\"); //set the necessary 'Content-type' request header, as specified in the Spotify Web API documentation\n authenticationXHTTP.setRequestHeader(\"Authorization\", \"Basic \" + base64authorization); //set the necessary 'Authorization' request header, as specified in the Spotify Web API documentation\n authenticationXHTTP.send(\"grant_type=client_credentials\"); //send the XMLHttpRequest to the Spotify Web API server, detailing the body of the request in the manner specified in the Spotify Web API documentation\n}", "function spotifyCommand(inputSong) {\n\tvar inputSong = process.argv[3];\n\tvar spotify = new Spotify({\n\t id: spotkey.spotifyKeys.id,\n\t secret: spotkey.spotifyKeys.secret\n\t });\n\tif(!inputSong) {\n\t\tinputSong = \"Billie Jean\"; //default song INPUT\n\t};\n\n\tspotify.search({type: 'track', query: inputSong}, function(err, data) {\n if (!err) {\n\t \t var spotifyInfo =\n \"\\r\\n\" +\n \"Artist: \" + data.tracks.items[0].artists[0].name + \"\\r\\n\" + \n \"Song: \" + data.tracks.items[0].name + \"\\r\\n\" +\n \"Preview Link: \" + data.tracks.items[0].preview_url + \"\\r\\n\" +\n \"Album: \" + data.tracks.items[0].album.name + \"\\r\\n\"; \n console.log(spotifyInfo);\n log(spotifyInfo);\n } \n else { \n \tconsole.log('Error occurred: ' + err);\n \treturn;\n }\t\n })\n}", "function spotifyThis(term) {\n console.log(\"Running spotify-this-song...\");\n \n if (process.argv[3]) { \n var songName = process.argv.slice(3).join(\" \");\n }\n else if (term) {\n var songName = term;\n }\n else {\n var songName = \"The Sign, Ace of Base\";\n }\n\n spotify.search({ type: 'track', query: songName }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n console.log(\"\\n\" + \"Track: \" + data.tracks.items[0].name); \n console.log(\"Artist: \" + data.tracks.items[0].artists[0].name); \n console.log(\"Album: \" + data.tracks.items[0].album.name); \n console.log(\"Preview: \" + data.tracks.items[0].preview_url + \"\\n\"); \n\n });\n}", "init(info) {\n return __awaiter(this, void 0, void 0, function* () {\n // Return url to get authorization code with\n const authUrl = `https://accounts.spotify.com/authorize?response_type=code&client_id=${this.settings.client_id}&scope=${encodeURIComponent(this.settings.scopes.join(' '))}&redirect_uri=${encodeURIComponent(info.redirect_url)}&state=${encodeURIComponent(info.state)}`;\n return authUrl;\n });\n }", "function spotify() {\n\n var title = \"\";\n\n var Spotify = require('node-spotify-api');\n \n var spotify = new Spotify({\n id: process.env.SPOTIFY_ID,\n secret: process.env.SPOTIFY_SECRET\n });\n\n //This block of code will only run if a song is given as a parameter...else the results will defualt to something else.\n if(nodeArgs[3]) {\n //if parameter is given store it in title\n title = nodeArgs[3];\n // Capture all the words in the title (again ignoring the first three Node arguments)\n for (var i = 4; i < nodeArgs.length; i++) {\n \n // Build a string with the title.\n title = title + \" \" + nodeArgs[i]; \n }\n \n spotify.search({ type: 'track', query: title }, function(err, data) {\n\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n fs.readFile(\"log.txt\", \"utf8\", function(err, data) {\n //if the code experiences any errors it will lof the error and return it to terminate the program. \n if(err){\n return console.log(err);\n }\n //checks if the file is empty to make sure the file doesn't begin with a comma\n if(data.length < 1) {\n //logs the latest command and song into the log.txt file.\n fs.appendFile(\"log.txt\", 'spotify-this-song,' + title, function(err) {\n //if the code experiences any errors it will log the error and return it to terminate the program. \n if(err){\n return console.log(err);\n } \n //lets user know there was no errors and the file has been updated. \n console.log(\"log.txt was updated\"); \n });\n }\n //If something is in the file then write the comma seperator.\n else {\n //logs the latest command and song into the log.txt file.\n fs.appendFile(\"log.txt\", '\\n,spotify-this-song,' + title, function(err) {\n //if the code experiences any errors it will lof the error and return it to terminate the program. \n if(err){\n return console.log(err);\n } \n //lets user know there was no errors and the file has been updated. \n console.log(\"log.txt was updated\");\n \n });\n \n }\n });\n\n //Formatting\n console.log(\"\\n***************************************************\");\n console.log(\"***************************************************\");\n console.log(\"***************** SPOTIFY RESULTS *****************\");\n console.log(\"***************************************************\");\n console.log(\"***************************************************\");\n console.log(\"\\n* Song: \" + data.tracks.items[0].name);\n console.log(\"* Artist: \" + data.tracks.items[0].artists[0].name); \n console.log(\"* Album: \" + data.tracks.items[0].album.name);\n console.log(\"* URL: \" + data.tracks.items[0].href); \n console.log(\"\\n***************************************************\\n\");\n });\n }\n //Else statement used if no song name is given...Defualts the results to The Sign by Ace of Base.\n else {\n //Appends the liri command and the defualt song name to the file.\n fs.appendFile(\"log.txt\", '\\n,spotify-this-song, The Sign', function(err) {\n //if the code experiences any errors it will lof the error and return it to terminate the program. \n if(err){\n return console.log(err);\n }\n console.log(\"log.txt was updated\"); \n }); \n spotify\n //makes a request to the track id of 'The Sign'.\n .request('https://api.spotify.com/v1/tracks/0hrBpAOgrt8RXigk83LLNE')\n .then(function(data) {\n //Formatting\n console.log(\"\\n***************************************************\");\n console.log(\"***************************************************\");\n console.log(\"***************** SPOTIFY RESULTS *****************\");\n console.log(\"***************************************************\");\n console.log(\"***************************************************\");\n\n console.log(\"\\n* Song: \" + data.name);\n console.log(\"* Album: \" + data.album.name); \n console.log(\"* Artist: \" + data.artists[0].name); \n console.log(\"* URL: \" + data.href); \n\n console.log(\"\\n***************************************************\\n\"); \n })\n //Catches and displays an error if there is one.\n .catch(function(err) {\n console.error('Error occurred: ' + err); \n return;\n });\n }\n\n}", "constructor() {\n this.client = new Client({\n auth: process.env.NOTION_TOKEN,\n });\n }", "function SpotifyThis(Song) {\n if (DebugON) console.log (\"** in SpotifyThis() \" + Song);\n\n\tif (!Song) {\n\t\tSong = \"The Sign:Ace of Base\";\n\t}\n\n\tspotify.search({\n\t\ttype: 'artist,track',\n\t\tquery: Song\n\n\t}, function (err, response) {\n\t\tif (err) {\n\t\t\treturn console.log(\"Spotify Query Error occurred: \" + err);\n\t\t}\n\n\t\tvar SongResults = \n \"--------------------------------------------------------------------\" +\n \"\\n S P O T I F Y - T H I S\" +\n \"\\n--------------------------------------------------------------------\" +\n \"\\nArtist(s): \" + response.tracks.items[0].artists[0].name +\n\t\t\t\"\\nSong Name: \" + response.tracks.items[0].name +\n\t\t\t\"\\nAlbum Name: \" + response.tracks.items[0].album.name +\n\t\t\t\"\\nPreview Link: \" + response.tracks.items[0].external_urls.spotify +\n\t\t\t\"\\n--------------------------------------------------------------------\";\n\t\tconsole.log(SongResults);\n\n\t}); // spotify.search()\n\n} // SpotifyThis()", "async function clientCredentialsGrant () {\n console.debug('Getting Spotify client token');\n return spotifyApi.clientCredentialsGrant().then(\n (data) => {\n console.debug(`The access token is: ${data.body['access_token']}`);\n spotifyApi.setAccessToken(data.body['access_token']);\n },\n (error) => { console.error(`SpotifyWebApi error: ${error}`) },\n );\n}", "function spotifySong() {\n\n let spotify = new Spotify({\n id: \"0b69126503894401b9000caef1c6e58b\",\n secret: \"f282337b81514df4ac49a20cb6d4fbb2\",\n });\n\n let songName = userINPUT;\n let space = \"\\n\" + \"\\n\" + \"\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\";\n if (!songName) {\n songName = \"What's my age again\";\n }\n\n params = songName;\n spotify.search({ type: 'track', query: params }, function (err, data) {\n if (err) {\n console.log('Error occurred: ' + err);\n return;\n }\n else {\n output = \"**********************************************************************\" +\n space + \"Song Name: \" + \"'\" + songName.toUpperCase() + \"'\" +\n space + \"Album Name: \" + data.tracks.items[0].album.name +\n space + \"Artist Name: \" + data.tracks.items[0].album.artists[0].name +\n space + \"URL: \" + data.tracks.items[0].album.external_urls.spotify + \"\\n\\n\"\n + \"**********************************************************************\";\n console.log(output);\n\n fs.appendFile(\"log.txt\", output, function (err) {\n if (err) throw err;\n });\n };\n });\n\n}", "function spotifySong(){\n var songTitle =\"\"; \n if (userInput[3] === undefined){\n songTitle = \"The Sign Ace of Base\"\n } else {\n songTitle = userInput[3];\n }; \n spotify.search({type:'track', query:songTitle, limit:1},\nfunction (err,data){\n \n if(err){\n console.log(\"Oops. Something unexpected happened\" + err);\n return false;\n }\n console.log(\"\\n====== Spotify: '\" + songTitle + \"' ==========\");\n console.log(\"Artist(s): \"+ data.tracks.items[0].album.artists[0].name);\n console.log(\"Song: \"+data.tracks.items[0].name);\n console.log(\"Preview URL: \"+data.tracks.items[0].preview_url);\n console.log(\"Album: \"+data.tracks.items[0].album.name);\n console.log(\"\\n\" );\n })\n }", "function spofityPlay() {\n spotify\n .search({ type: 'track', query: \"\\\" \" + input + \"\\\" \" })\n .then(function (data) {\n console.log(\n \"\\n ========== Spotify Search ==========\\n\"\n )\n\n // console.log(data);\n // The song's name\n // A preview link of the song from Spotify\n // The album that the song is from\n //Artist(s)\n // console.log(data.tracks.items[1])\n var song = data.tracks.items[1];\n console.log(\"Song Search: \" + song.album.name);\n console.log(\"Want a quick listen, click here: \" + song.external_urls.spotify)\n console.log(\"The Song is in Album: \" + song.album.name);\n console.log(\"Artist(s): \" + song.artists[0].name + \"\\n\");\n\n // ARTISTS VS ALBUM\n // ALBUM: given to us as an object allows us to call on it normally\n // ARISTS: looks like an object but its really an array with an object\n // nested inside (sneaky bitch.)\n // for the artist name you have to call the array FIRST then the object\n\n })\n .catch(function (err) {\n console.log('Error occurred: '+ err);\n \n\n });\n\n\n}", "function spotifyThisSong() {\n var songName = \"\";\n\n //move over all of the entered words to \n for (var i = 3; i < input.length; i++) {\n if (i > 3 && i < input.length) {\n songName = songName + \"+\" + input[i];\n } else {\n songName += input[i];\n }\n }\n if (songName === \"\") {\n songName = \"The Sign Ace of Base\";\n }\n\n // console.log(keys.spotify);\n spotify.search({ type: 'track', query: songName }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n // console.log(data);\n var track = data.tracks.items[0];\n console.log(\"Song Name: \" + track.artists[0].name);\n console.log(\"Song Name: \" + track.name);\n console.log(\"External Link: \" + track.external_urls.spotify);\n console.log(\"Album Name: \" + track.album.name);\n });\n}", "function showSpotifySong() {\n\n //variable for search term, test if defined.\n\n\n var searchTrack;\n\n if (secondCommand === undefined) {\n\n searchTrack = \"The Sign\";\n\n } else {\n\n searchTrack = secondCommand;\n\n }\n\n //launch spotify search\n\n spotify.search({ type: 'track', query: searchTrack }, function(err, data) {\n\n if (err) {\n\n console.log('Error occurred: ' + err);\n\n return;\n\n } else {\n\n\n console.log(\"Artist: \" + data.tracks.items[0].artists[0].name);\n\n console.log(\"Song: \" + data.tracks.items[0].name);\n\n console.log(\"Album: \" + data.tracks.items[0].album.name);\n\n\n\n }\n\n });\n\n}", "function spotifySearch() {\n\tsearchTerm = '\"' + process.argv.slice(3).join(\" \") + '\"';\n\tconsole.log(\"Searching for \" + searchTerm + \"...\\n\");\n\tspotify\n .search({ type: 'track', query: searchTerm, limit: 1 })\n .then(function(response) {\n console.log(`\n----------------------------------------------------------------------------------------\n\t\t\tYou searched for the song: ${response.tracks.items[0].name} \n\t\t\tThe Artist is: ${response.tracks.items[0].album.artists[0].name}\n\t\t\tThe Album is: ${response.tracks.items[0].album.name}\n\t\t\tClick here to hear a clip: ${response.tracks.items[0].external_urls.spotify}\n \t`);\n\n })\n .catch(function(err) {\n return console.log('Error occurred: ' + err);\n });\n }", "async function spotifyThisSong(searchFor) {\n\n // console.log(\"Inside spotifyThisSong()\");\n\n //Store artist name taken from file\n let artist = searchFor;\n\n //If 'artist' is null then prompt user for artist/song name\n if (artist === \"\") {\n\n // Prompt to get artist name from user input\n const artistOrBandNameResp = await getArtistName();\n\n //Extract artist/band name from user input\n artist = artistOrBandNameResp.artistOrBandName;\n }\n\n //Spotify API call\n spotify\n .search({\n type: 'track',\n query: artist,\n limit: 10\n })\n .then(function (response) {\n\n // console.log(\"response.tracks.items.length: \" + response.tracks.items.length);\n\n console.log(\"\\n-------------------------------------------------------\");\n\n for (let trackCount = 0; trackCount < response.tracks.items.length; trackCount++) {\n\n console.log(\"\\n\");\n\n //Show Artist(s)\n let getArtists = response.tracks.items[trackCount].artists;\n let artistsName = [];\n for (let j = 0; j < getArtists.length; j++) {\n artistsName += getArtists[j].name + \" \";\n }\n console.log(\"Artist/s: \" + artistsName);\n\n // The song's name\n console.log(\"Song's name: \" + response.tracks.items[trackCount].name);\n\n // A preview link of the song from Spotify\n console.log(\"Preview URL: \" + response.tracks.items[trackCount].preview_url);\n\n // The album that the song is from\n console.log(\"Album name: \" + response.tracks.items[trackCount].album.name);\n\n }\n\n //Call restartApp() to restart the app if user wishes to\n restartApp();\n })\n .catch(function (err) {\n console.log(err);\n });\n\n} //End of spotifyThisSong()", "function lookupSpecificSong() {\n\n//sets spotify equal to the key info to call the spotify API\nvar spotify = new Spotify(SpotifyKeys.spotify);\n\n//searches the spotify API by track name \nspotify\n .request( 'https://api.spotify.com/v1/tracks/3DYVWvPh3kGwPasp7yjahc' )\n .then(function(response) {\n //Console.logs the response from the Spotify API for Artist, Song title, URL, and Album name\n logOutput(\"Command: spotify-this-song \" + response.name);\n logOutput(\"Artist: \" + response.artists[0].name);\n logOutput(\"Song: \" + response.name);\n logOutput(\"Spotify preview URL: \" + response.preview_url);\n logOutput(\"Album name: \" + response.album.name);\n logOutput(\"------------\");\n })\n .catch(function(err) {\n //console.logs any caught errors\n console.log(err);\n logOutput(err);\n });\n}", "render() {\n\n return (\n <div className=\"App\">\n <div>\n <a href='http://54.165.160.136:8888' > Login to Spotify </a>\n </div>\n <label>\n Loaded Tracks:\n <br></br>\n <br></br>\n {this.state.URIs}\n </label>\n <div>\n <label>Click \"Sync\" to start</label>\n <button onClick={this.handleSync}>\n Sync\n </button>\n <div>\n <SpotifyPlayer\n token={localStorage.getItem('token')}\n callback={this.handleCallback}\n uris={this.state.URIs}\n key={this.state.URIs}\n autoPlay={true}\n />\n </div >\n </div>\n </div>\n );\n }", "function getSpotify(songName) {\n\n var spotify = new Spotify(keys.spotify)\n // console.log(\"Spotify Key: \" + spotify);\n\n //HA-HA, I'm sorry. I just couldn't bring myself to put \"The Sign\"\n if(!songName){\n songName =\"Overkill\";\n }\n\n spotify.search({type:'track', query: songName}, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n console.log(\"***************************************************************\")\n //console.log(\"Data.Tracks.items is \" + JSON.stringify(data.tracks.items[0]))\n\n console.log(\"Song Searched For: \" + userSearch+\"\\r\\n\");\n console.log(\"Artist(s): \", data.tracks.items[0].album.artists[0].name + \"\\r\\n\")\n console.log(\"Album Name: \", data.tracks.items[0].album.name + \"\\r\\n\")\n console.log(\"Relase Date: \", data.tracks.items[0].album.release_date +\"\\r\\n\")\n console.log(\"Preview Link: \", data.tracks.items[0].preview_url+ \"\\r\\n\")\n\n //Appends the search results to a text file name \"log\"\n var logSong = (\"***** Spotify Log Entry *****\" + \n \"\\nSong: \" + userSearch +\n \"\\nArtist: - \" + data.tracks.items[0].album.artists[0].name +\n \"\\nAlbum Name: \"+ data.tracks.items[0].album.name +\n \"\\mRelase Date: \"+ data.tracks.items[0].album.release_date+\n \"\\nPreview Link: \" +data.tracks.items[0].preview_url+\"\\n\" +\"\\r\\n\");\n fs.appendFile(\"log.txt\", logSong, function (err){\n if(err) throw err\n });\n\n });\n\n }", "function SharkSpotter(opts) {\n\tmod_assert.object(opts, 'opts');\n\tmod_assert.object(opts.log, 'opts.log');\n\tmod_assert.string(opts.moray, 'opts.moray');\n\tmod_assert.string(opts.shark, 'opts.shark');\n\tmod_assert.string(opts.nameservice, 'opts.nameservice');\n\tmod_assert.optionalNumber(opts.begin, 'opts.begin');\n\tmod_assert.optionalNumber(opts.end, 'opts.end');\n\tmod_assert.number(opts.chunk_size, 'opts.chunk_size');\n\tmod_assert.bool(opts.keep_mpu, 'opts.keep_mpu');\n\n\tvar self = this;\n\n\tthis.sf_log = opts.log;\n\tthis.sf_moray = opts.moray;\n\tthis.sf_shark = opts.shark;\n\tthis.sf_nameservice = opts.nameservice;\n\tthis.sf_chunk_size = opts.chunk_size;\n\tthis.sf_begin_id = opts.begin || 0;\n\tthis.sf_end_id = opts.end;\n\tthis.sf_keep_mpu = opts.keep_mpu;\n\n\tthis.sf_mpu_discarded = 0; /* track number of MPUs ignored */\n\n\t/* open output file in current directory */\n\tthis.sf_outfile = mod_util.format('./%s.%d.out', this.sf_moray,\n\t process.pid);\n\tthis.sf_morayclient = mod_moray.createClient({\n\t\t'log': opts.log.child({'component': 'moray-client-' +\n\t\t this.sf_moray}),\n\t\t'srvDomain': this.sf_moray,\n\t\t'cueballOptions': {\n\t\t\t'resolvers': [ this.sf_nameservice ],\n\t\t\t'defaultPort': 2020\n\t\t}\n\t});\n\n\tthis.sf_write_stream = mod_fs.createWriteStream(this.sf_outfile);\n\tthis.sf_write_stream.on('error', function (err) {\n\t\tself.sf_log.error({\n\t\t\t'error': err\n\t\t}, 'error writing data file');\n\t\tself.emit('error', err);\n\t});\n\n\tthis.sf_log.info({\n\t\t'filename': this.sf_outfile\n\t}, 'opened output file');\n\n\tthis.sf_morayclient.on('connect', function () {\n\t\tself.emit('connect');\n\t});\n\n\tEventEmitter.call(this);\n}", "function spotifyThisSong(songName) {\n\n // Default set as \"The Sign\" by Ace of Base if user doesn't specify a song.\n if (songName == \"\") {\n songName = \"The Sign\";\n };\n // URL for this one is defined inside \"node-spotify-api\". Therefore it only needs arguments as shown below.\n spotify.search({ type: 'track', query: songName, limit: 10 })\n .then(function (response) {\n\n var spotifyResponse = response.tracks\n\n if (songName == \"The Sign\") {\n return (console.log(\"-----------------------------\" + \"\\n\",\n \"Song Title: \" + spotifyResponse.items[8].name + \"\\n\",\n \"Album: \" + spotifyResponse.items[8].album.name + \"\\n\",\n \"Artist/s: \" + spotifyResponse.items[8].artists[0].name + \"\\n\",\n \"Preview URL: \" + spotifyResponse.items[8].external_urls.spotify + \"\\n\",\n \"-----------------------------\"));\n\n }\n for (var i = 0; i < spotifyResponse.items.length; i++) {\n console.log(\"-----------------------------\");\n console.log(\"Song Title: \" + spotifyResponse.items[i].name);\n console.log(\"Album: \" + spotifyResponse.items[i].album.name);\n console.log(\"Artist/s: \" + spotifyResponse.items[i].artists[0].name);\n console.log(\"Preview URL: \" + spotifyResponse.items[i].external_urls.spotify);\n console.log(\"-----------------------------\");\n }\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function Client(){var options=arguments.length <= 0 || arguments[0] === undefined?{}:arguments[0];_classCallCheck(this,Client);_EventEmitter.call(this);this.options = options || {};this.options.compress = options.compress || true;this.options.revive = options.revive || false;this.options.rate_limit_as_error = options.rate_limit_as_error || false;this.internal = new _InternalClient2[\"default\"](this);} // def login", "function main() {\n var client = new protoDefinition.NeoTv('localhost:50051',\n grpc.credentials.createInsecure());\n\n \n app.get('/', (req, res) => res.send('Hello World!'))\n app.get('/neotv', (req, res) => {\n const data = req.query;\n return client.GetNeoTvStatus({username: data.username, password: data.password, carrier: data.carrier}, (err, status) => {\n res.send(status);\n })\n })\n\n app.listen(port, () => console.log(`Example app listening on port ${port}!`))\n app.use(bodyParser.json());\n}", "function spotifyThisSong() {\n\t// takes in user input for song name\n\tvar song = input;\n\n\t// if no song is provded, the program will default to \"or nah\" by ty dolla $ign\n\tif (input === \"\"){\n\t\tsong = \"The Sign\";\n\t}\n\n\t// this takes in the song request and searches for it using spotify\n\tspotify.search({type: \"track\", query: song}, function(err, data) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Error: \" + err);\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tvar songData = \"\";\n\t\t\tvar songReturn = data.tracks.items[0];\n\n\t\t\tvar artist = \"\\n\" + \"Artist: \" + songReturn.artists[0].name + \"\\n\";\n\t\t\tsongData += artist;\n\n\t\t\tvar name = \"\\n\" + \"Song Name: \" + songReturn.name + \"\\n\";\n\t\t\tsongData += name;\n\n\t\t\tvar preview = \"\\n\" + \"Preview Link: \" + songReturn.preview_url + \"\\n\";\n\t\t\tsongData += preview;\n\n\t\t\tvar albumName = \"\\n\" + \"Album: \" + songReturn.album.name + \"\\n\";\n\t\t\tsongData += albumName;\n\n\t\t\tconsole.log(\"\\n\" + \"Spotify:\");\n\t\t\tconsole.log(songData);\n\t\t\tdataLog(songData);\n\t\t}\n\t});\n}", "function init(url, title) {\n\n g.title = title||\"Siren Client\";\n \n if(!url || url==='') {\n alert('*** ERROR:\\n\\nMUST pass starting URL to the library');\n }\n else {\n g.url = url;\n req(g.url,\"get\");\n }\n }", "function song() {\n\n var spotify = new Spotify(keys.spotify);\n var args = process.argv;\n var songName = \"\";\n\n for (i = 3; i < args.length; i++) {\n if (i > 3 && i < args.length) {\n songName = songName + \" \" + args[i];\n } else {\n songName = args[i];\n }\n };\n //console.log(songName);\n if (args.length < 4) {\n songName = \"the sign ace of base\"\n process.argv[3] = songName;\n }\n //console.log(songName);\n spotify.search({\n type: \"track\",\n query: songName,\n limit: 1\n }, function (err, data) {\n if (err) {\n console.log(\"ya' messed up: \" + err);\n return;\n }\n console.log(\"-------------------------------------------------------------------------------------------\");\n console.log(\"Artist: \" + data.tracks.items[0].album.artists[0].name);\n console.log(\"Song: \" + data.tracks.items[0].name);\n console.log(\"Preview link: \" + data.tracks.items[0].external_urls.spotify);\n console.log(\"Album: \" + data.tracks.items[0].album.name);\n console.log(\"-------------------------------------------------------------------------------------------\");\n });\n}", "client(config){ return new Python(config) }", "client(config){ return new Python(config) }", "function spotifyDisplay(songTitle) {\n console.log(`Listen to This: ${songTitle}!`);\n console.log(\"-------------------------------------------------------------\")\n\n\n spotify.search({\n type: \"track\",\n query: songTitle,\n limit: 5\n }, function (err, data) {\n if (err) {\n console.log(\"Error occured: \" + err);\n };\n\n // console.log(Object.prototype.toString.call(data.tracks.items));\n var itemArr = data.tracks.items;\n\n //Check with TA's on exactly how this works... \n for (var eachTrack in itemArr) { //this\n if (itemArr.hasOwnProperty(eachTrack)) { //this\n ;\n var artistArr = itemArr[eachTrack].artists;\n var artistList = \"\";\n\n for (var eachArtist in artistArr) {\n\n if (artistArr.hasOwnProperty(eachArtist)) {\n artistList += (` ${artistArr[eachArtist].name},`);\n }\n\n };\n\n artistList = artistList.slice(0, -1); //Removes comma from end of string\n };\n\n var previewLink = JSON.stringify(itemArr[eachTrack].preview_url);\n\n if (previewLink == \"null\") {//If preview is unavailable, provide a message\n previewLink = \"Spotify preview link is unavailable\"\n\n };\n console.log(`\\nTrack: ${itemArr[eachTrack].name}\\n` + `Artist(s):${artistList}\\n` + `Album: ${itemArr[eachTrack].album.name}\\n` + `Take a Listen: ${previewLink}`);\n console.log(\"-------------------------------------------------------------\")\n\n }\n }\n\n\n )\n}", "function spotifyThisSong() {\n\n\t// if user enters a value - process.argv[3]\n\n\tif (value) {\n\n\t\tvar song = value;\n\n\t} // end of if value = true\n\n\telse {\n\n\t\tvar song = \"what's my age again\";\n\n\t} // end of else value = true\n\n\t// searches spotify API based on process.argv[3]\n\n\tspotify.search({ type: 'track', query: song}, function(err, data) {\n\n\t\t// if there is an error\n\n\t\tif (err) {\n\n\t\t\tconsole.log('Error occurred: ' + err);\n\t\t\treturn;\n\n\t\t} // end of if err\n\n\t\t// else console.dir song information\n\n\t\telse {\n\n\t\t\tconsole.dir('Artist(s): ' + data.tracks.items[0].artists[0].name);\n\t\t\tconsole.dir('Song Name: ' + data.tracks.items[0].name);\n\t\t\tconsole.dir('Preview Link: ' + data.tracks.items[0].preview_url);\n\t\t\tconsole.dir('Album: ' + data.tracks.items[0].album.name);\n\n\t\t\t// store information as a string\n\n\t\t\tlogText = JSON.stringify({\n\t\t\t\tartist: data.tracks.items[0].artists[0].name,\n\t\t\t\tsongName: data.tracks.items[0].name,\n\t\t\t\tpreviewLink: data.tracks.items[0].preview_url,\n\t\t\t\talbum: data.tracks.items[0].album.name\n\t\t\t}); // end of logText stringify\n\n\t\t\t// log information in logText in log.txt\n\n\t\t\tlogInfo();\n\n\t\t} // end else err\n\n\t}); // end of spotify search\n\n} // end of spotifyThisSong function", "function API(){}", "function API(){}", "function initClient() {\n gapi.client.init({\n apiKey: API_KEY,\n discoveryDocs: DISCOVERY_DOCS,\n scope: SCOPES\n }).then(function () {\n getInventory();\n }, function(error) {\n console.error(JSON.stringify(error, null, 2));\n });\n}" ]
[ "0.71909004", "0.6974948", "0.6949669", "0.6932511", "0.6881422", "0.68340707", "0.6737493", "0.6685235", "0.6520384", "0.65165585", "0.6499736", "0.64635646", "0.64505374", "0.64385384", "0.63931155", "0.6347447", "0.6339025", "0.633654", "0.6268117", "0.6257913", "0.6251123", "0.6243443", "0.6230086", "0.6230022", "0.6222576", "0.62169874", "0.6194969", "0.6193857", "0.61800146", "0.61462736", "0.61414397", "0.6138757", "0.61386937", "0.6133975", "0.6131772", "0.6116336", "0.6098363", "0.60975385", "0.6097064", "0.6064744", "0.60577184", "0.6052901", "0.604614", "0.6040425", "0.6028835", "0.60035294", "0.5986361", "0.59835595", "0.59653777", "0.59251267", "0.58946663", "0.5892194", "0.5871544", "0.5852878", "0.58432174", "0.5841302", "0.5839211", "0.58316875", "0.58268803", "0.5816525", "0.58164585", "0.58156365", "0.5813759", "0.5803781", "0.5800754", "0.57969034", "0.579315", "0.5786928", "0.5780591", "0.5780512", "0.577965", "0.57744473", "0.5761814", "0.57531404", "0.575287", "0.57385963", "0.57351094", "0.5727468", "0.5725666", "0.5724882", "0.57099503", "0.570887", "0.5708632", "0.57085145", "0.56950486", "0.56884515", "0.5676157", "0.567141", "0.5663285", "0.5663083", "0.56630135", "0.56467164", "0.56465256", "0.56437737", "0.56354684", "0.56354684", "0.56110996", "0.5602275", "0.55972844", "0.55972844", "0.5592342" ]
0.0
-1
generate map(array of array filled with "W" and with padding) padding is to avoid edge case(corner, edge) when count mines
generateMap(num) { return [...Array(num + 2).keys()].map(i => Array(num + 2).fill("W")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeMap(start, w, h) {\n var ix, jx, data;\n\n for (ix = 0; ix < h; ix++) {\n map[ix] = [];\n mark[ix] = [];\n\n data = input[start + ix].trim().split('');\n\n for (jx = 0; jx < w; jx++) {\n map[ix][jx] = +data[jx];\n mark[ix][jx] = 0;\n }\n }\n}", "function createWalls(map)\n{\n //var n = [];\n for (var y = 0; y < map.length; y++)\n {\n for (var x = 0; x < map[0].length; x++)\n {\n if (map[y][x] === 1 && map[y][x] !== 2)\n {\n if (y > 0 && y < map.length - 1 && x > 0 && x < map[0].length - 1)\n {\n if (map[y][x + 1] === 0 || map[y + 1][x] === 0)\n map[y][x] = 2;\n if (map[y][x - 1] === 0 || map[y - 1][x] === 0)\n map[y][x] = 2;\n }\n if (y === 0) {\n if (map[y + 1][x] === 0)\n map[y][x] = 2;\n }\n if (y === map.length - 1) {\n if (map[y - 1][x] === 0)\n map[y][x] = 2;\n }\n if (x === 0) {\n if (map[y][x + 1] === 0)\n map[y][x] = 2;\n }\n if (x === map[0].length - 1) {\n if (map[y][x - 1] === 0)\n map[y][x] = 2;\n }\n }\n }\n }\n}", "generateBoxes(h,w) {\n\t\tvar bx = new Map();\n\t\tfor(var y = 0; y< h-1 ; y++)\n\t\t{\n\t\t\tfor(var x = 0 ; x< w-1; x++)\n\t\t\t{\n\t\t\t\tvar a =new Dot(x,y);\n\t\t\t\tvar box = new Box(a);\n\t\t\t\tbx.set(a.toString(), box);\n\t\t\t}\n\t\t}\n\t\treturn bx;\n\t}", "get mapWidth() {return ~~(Math.abs(zeach.mapLeft) + zeach.mapRight)}", "mapGenerate() {\n for (let i = 0; i < this.ySize; i++) {\n this.map[i] = [];\n for (let j = 0; j < this.xSize; j++) {\n let mapValue = this.empty;\n this.map[i].push(mapValue);\n }\n }\n }", "padMarkerMap(){\n\t\tvar format = \" \",\n\t\t\twithgp = MarkerData.gp_array.length > 1 ;\n\n\n\t\tfor (var i=0; i < MarkerData.rs_array.length; i++){\n\t\t\tMarkerData.padded[i] = (MarkerData.rs_array[i] + format).slice(0,MarkerData.maxlen_marker);\n\n\t\t\tif (withgp){\n\t\t\t\tMarkerData.padded[i] += \" : \" + (MarkerData.gp_array[i] + format).slice(0,5); // 5 sf\n\t\t\t}\n\t\t}\n\t\tMarkerData.hasGPData = withgp\n\n\t\t// Also set display format\n\t\tHaploBlockFormat.hasGPData(withgp);\n\t}", "function removeBorders() {\n for (let i = 0; i < resultingMap.length; i++) {\n for (let j = 0; j < resultingMap[i].length; j++) {\n if (i <= 5 || j <= 5 || i + 5 >= resultingMap.length || j + 5 >= resultingMap[i].length) {\n resultingMap[i][j] = 1.5;\n continue;\n }\n }\n }\n }", "function initBricksMap () {\n var matrix = new Array(5);\n for (var i = 0;i < 5;i++) {\n matrix[i] = new Array(10);\n for (var j = 0;j < 10;j++) {\n matrix[i][j] = 1;\n }\n }\n return matrix;\n}", "function newMap() {\n\t\t'use strict';\n\n\t\t// resulting map\n\t\tvar map = [];\n\n\t\t// number of rows and columns\n\t\tgameMetrics.x = 16;\n\t\tgameMetrics.y = Math.floor(gameMetrics.x / Config.boardRatio);\n\n\t\t// populate map with -1\n\t\tfor (var i = 0; i < gameMetrics.y; i++) {\n\t\t\tvar row = [];\n\t\t\tfor (var j = 0; j < gameMetrics.x; j++) {\n\t\t\t\trow.push(-1);\n\t\t\t}\n\t\t\tmap.push(row);\n\t\t}\n\t\treturn map;\n\n\t}", "function generateMap() {\n for (let x = 0; x < mapSize; x++) {\n map.push([]);\n for (let y = 0; y < mapSize; y++) {\n map[x].push(new Tile(x, y));\n }\n }\n\n generateOutline();\n}", "function MapSize(levelOfDetail){\n return Math.floor(256 << levelOfDetail);\n}", "function startDisplacement(map, width) {\n\t\t\tvar topRight, topLeft, top, bottomRight, bottomLeft, bottom, \n\t\t\t\tright, left, center;\n\n\t\t\tmap[0][0] = Math.random();\n\t\t\ttopLeft = map[0][0];\n\n\t\t\tmap[0][width] = Math.random();\n\t\t\tbottomLeft = map[0][width];\n\n\t\t\tmap[width][0] = Math.random();\n\t\t\ttopRight = map[width][0];\n\n\t\t\tmap[width][width] = Math.random();\n\t\t\tbottomRight = map[width][width];\n\n\t\t\tmap[width / 2][width / 2] = topLeft + bottomLeft + topRight + bottomRight; \n\t\t\tmap[width / 2][width / 2] = normalize(map[width / 2][width / 2]);\n\t\t\tcenter = map[width / 2][width / 2];\n\t\t\t\n\n\t\t\tmap[width / 2][width] = bottomLeft + bottomRight + center / 4;\n\t\t\tmap[width / 2][0] = topLeft + topRight + center / 4;\n\t\t\tmap[width][width / 2] = topRight + bottomRight + center / 4;\n\t\t\tmap[0][width / 2] = topLeft + bottomLeft + center / 4;\n\n\n\t\t\t// if (wrapping === false) {\n\t\t\t// // non wrapping\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center / 3;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center / 3;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center / 3;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center / 3;\n\t\t\t// }\n\n\t\t\t// else {\n\t\t\t// // wrapping\t\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center + center / 4;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center + center / 4;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center + center / 4;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center + center / 4;\n\t\t\t// }\n\n\t\t\tcenterDisplacement(width);\n\t\t}", "function createChunks() {\n for (let x = 0; x < mapArr.length; x++) {\n for (let y = 0; y < mapArr.length; y++) {\n // Create array of all adjacent terrain in bounds:\n let adjTerrain = [];\n for (let v = 0; v < 8; v++) {\n xo = x + adjVectors[v][0];\n yo = y + adjVectors[v][1];\n if (inBounds(mapArr, xo, yo)) adjTerrain.push(mapArr[xo][yo]);\n }\n // Randomly select adjacent terrain to copy:\n mapArr[x][y] = getRandArrItem(adjTerrain);\n }\n }\n}", "function genMap()\r\n\t{\r\n\t\tvar EDGE = 2;\t\t//defaults to fenceless edge\r\n\t\tvar CORNER = 3;\t\t//defaults to fenceless corner\r\n\r\n\t\tif (Math.random() > 0.5)//random fence\r\n\t\t{\r\n\t\t\tEDGE = 4;\r\n\t\t\tCORNER = 5;\r\n\t\t}\r\n\r\n\t\tfor ( var x = 0; x < tileCountX; x ++ )\r\n\t\t{\r\n\t\t\tvar id = 0;\r\n\t\t\tvar rotation = 0;\r\n\r\n\t\t\tspriteTiles[x] = [];\r\n\t\t\tfor ( var y = 0; y < tileCountY; y ++ )\r\n\t\t\t{\r\n\t\t\t\tid = 0;\r\n\r\n\t\t\t\t//level border in clockwise order from top left\r\n\t\t\t\tif ( y == 0 )\t\t\t\t\t\t\t\t// top side\r\n\t\t\t\t\tid = EDGE;\r\n\t\t\t\tif ( x == tileCountX - 1 )\t\t\t\t\t// right side\r\n\t\t\t\t{\r\n\t\t\t\t\tid = EDGE;\r\n\t\t\t\t\trotation = 1;\r\n\t\t\t\t}\r\n\t\t\t\tif ( y == tileCountY - 1 )\t\t\t\t\t// bottom side\r\n\t\t\t\t{\r\n\t\t\t\t\tid = EDGE;\r\n\t\t\t\t\trotation = 2;\r\n\t\t\t\t}\r\n\t\t\t\tif ( x == 0 )\t\t\t\t\t\t\t\t// left side\r\n\t\t\t\t{\r\n\t\t\t\t\tid = EDGE;\r\n\t\t\t\t\trotation = 3;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//level corner --- draws over border\r\n\t\t\t\tif ( x == 0 && y == 0 )\t{\t\t\t\t\t//NW\r\n\t\t\t\t\tid = CORNER;\r\n\t\t\t\t\trotation = 0;\r\n\t\t\t\t}\r\n\t\t\t\tif ( x == tileCountX - 1 && y == 0 )\t\t\t//NE\r\n\t\t\t\t{\r\n\t\t\t\t\tid = CORNER;\r\n\t\t\t\t\trotation = 1;\r\n\t\t\t\t}\r\n\t\t\t\tif ( x == tileCountX - 1 && y == tileCountY - 1 )\t//SE\r\n\t\t\t\t{\r\n\t\t\t\t\tid = CORNER;\r\n\t\t\t\t\trotation = 2;\r\n\t\t\t\t}\r\n\t\t\t\tif ( x == 0 && y == tileCountY - 1 )\t\t\t//SW\r\n\t\t\t\t{\r\n\t\t\t\t\tid = CORNER;\r\n\t\t\t\t\trotation = 3;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//random rocks 1 space inside border\r\n\t\t\t\tif ( x > 1 && x < (tileCountX - 1) - 1 )\r\n\t\t\t\t\tif ( y > 1 && y < (tileCountY - 1) - 1 )\r\n\t\t\t\t\t\tif ( Math.random() > 0.95 )\r\n\t\t\t\t\t\t\tid = 1;\r\n\r\n\t\t\t\tspriteTiles[x].push(new spriteID(id, rotation));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function initializeMap(height, width) {\r\n // 1, 2, 3, 4, 5, 6, 7, 8: numbers of mine near that tile\r\n // 10: no mine (cannot use 0 as 0 in tilemap represents no tile in map)\r\n // 9: bomb!\r\n var randmine = weightedRand({9:0.2, 10:0.8});\r\n var data = [];\r\n\r\n for (var y = 0; y < height; y++) {\r\n data.push([]);\r\n for (var x = 0; x < width; x++) {\r\n data[y].push(parseInt(randmine()));\r\n // if (x < width-1){\r\n // data += ',';\r\n // }\r\n }\r\n // if (y < height-1){\r\n // data += \"\\n\";\r\n // }\r\n }\r\n //console.log(typeof data[0]);\r\n return data;\r\n}", "function map(x, y) {\n var map = [];\n for(i = 0; i <= size; i++) {\n if(i <= size) {\n return 'X';\n }\n }\n}", "function createMap(size) {\n return new Array(size)\n .fill(0)\n .map(function() {\n return new Array(size).fill(0);\n });\n }", "function createMap() {\n\tctx.fillStyle = 'black';\n\n // Create top and bottom borders.\n for (i = 0; i < width; i += side) {\n ctx.fillRect(i, 0, side, side);\n ctx.fillRect(i, height - side, side, side);\n }\n\n // Create left and right borders.\n for (i = 0; i < height; i += side) {\n ctx.fillRect(0, i, side, side);\n ctx.fillRect(width - side, i, side, side);\n }\n}", "function sanitise_map() \n\t{\n\t\tfor (var e = 0; e < height; ++e) \n\t\t{\n\t\t\tfor (var i = 0; i < width; ++i) \n\t\t\t{\n\t\t\t\tif (heightmap[i][e] < MINHEIGHT)\n\t\t\t\t\theightmap[i][e] = MINHEIGHT;\n\t\t\t\tif (heightmap[i][e] > MAXHEIGHT)\n\t\t\t\t\theightmap[i][e] = MAXHEIGHT;\n\t\t\t}\n\t\t}\n\t}", "constructor()\r\n\t{\r\n\t\tvar mapJ1 = [\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n\t\t[0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,9,0],\r\n\t\t[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[1,0,0,0,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,1,1,1]];\r\n\t\t\r\n\t\tvar mapJ2 = [\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n\t\t[0,0,0,6,0,0,0,0,0,0,0,0,0,0,9,0,0,0],\r\n\t\t[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],\r\n\t\t[1,0,0,0,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,1,1,1]];\r\n\r\n var lvlList = [mapJ1, mapJ2]\r\n\t\tvar listLength = lvlList.length;\r\n\t\tvar lvlListIndex = -1;\r\n\t\tthis.GetLvl = function ()\r\n\t\t{\r\n\t\t\tif(lvlListIndex <= listLength)\r\n\t\t\t{\r\n\t\t\t\tlvlListIndex++;\r\n\t\t\t\treturn lvlList[lvlListIndex];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t};\r\n\t}", "_createHexagonMap () {\n var map = {};\n\n let radius = MAP_RADIUS;\n for (let q = -radius; q <= radius; q++) {\n map[q] = {};\n let r1 = Math.max(-radius, -q - radius);\n let r2 = Math.min(radius, -q + radius);\n for (let r = r1; r <= r2; r++) {\n map[q][r] = { q, r, color: Math.random() * 0xffffff };\n }\n }\n\n return map;\n }", "initArrayMap() {\n for (let j = ((this.width - 1) / 2); j >= (-(this.width - 1) / 2); j--) {\n for (let i = (-(this.height - 1) / 2); i <= ((this.height - 1) / 2); i++) {\n this.arrayMap.push({\n coordX: i,\n coordY: j,\n navigable: true,\n player: {\n active: false\n },\n weapon: {\n active: false\n },\n potion: {\n active: false\n }\n });\n }\n }\n }", "function createFreePointsMap(){\n var index=0;\n for (var i = 0; i < 20; i++){\n for (var j = 0; j < 20; j++){\n /*if((j==0 && i == 1) || (j==0 && i == 18) || (j==1 && i >=1 && i <= 8) || (j==1 && i == 11) || (j==1 && i == 14) || (j==1 && i == 18) || (j>=2 && j<=3 && i == 1) || (j>=2 && j<=3 && i == 11) || (j==3 && i>=9 && i<=10) || (j==5 && i==0) ||\n (i==1 && j>=5 && j<=7) || (j==3 && i>=9 && i<=10) || (j==4 && i>=3 && i<=6)|| (j==5 && i>=10 && i<=14)||\n (j==5 && i>=16 && i<=18) || (j==7 && i>=3 && i<=9)|| (j==7 && i>=10 && i<=18) || (j==9 && i>=5 && i<=9) ||\n (j==9 && i>=11 && i<=12) || (j==11 && i>=11 && i<=18) || (j==14 && i>=1 && i<=3) || (j==13 && i>=11 && i<=14) ||\n (j==15 && i>=11 && i<=14) || (j==3 && i>=9 && i<=10) || (j==16 && i>=1 && i<=5) || (j==16 && i>=7 && i<=9) ||\n (j==18 && i>=1 && i<=10) || (j==18 && i>=12 && i<=18) || (i==14 && j>=2 && j<=4) || (i==16 && j>=2 && j<=4) ||\n (i==5 && j>=5 && j<=6) || (i==8 && j>=5 && j<=6) || (i==3 && j>=8 && j<=10) || (i==15 && j>=8 && j<=10) ||\n (i==18 && j>=8 && j<=9) || (i==18 && j>=12 && j<=17) || (i==1 && j>=11 && j<=13) || (i==5 && j>=10 && j<=15) || (i==7 && j>=11 && j<=15) || (i==9 && j>=10 && j<=15) || (i==3 && j>=12 && j<=13) || (i==12 && j>=16 && j<=17) ||\n (i==16 && j>=14 && j<=15) || (i==1 && j==17) || (i==14 && j==14))*/\n if((j>=1 && j<=2 && i>=1 && i<=3) || (j>=1 && j<=2 && i>=5 && i<=7) || (j>=1 && j<=2 && i>=11 && i<=13) || (j>=1 && j<=2 && i>=15 && i<=18) ||\n (j>=0 && j<=2 && i==9) || (j==4 && i>=1 && i<=3) || (j==4 && i>=15 && i<=18) ||(j>=6 && j<=8 && i>=1 && i<=3) || (j>=6 && j<=8 && i>=15 && i<=18) ||\n (j>=10 && j<=12 && i>=1 && i<=3) || (j>=10 && j<=12 && i>=15 && i<=18) || (j>=8 && j<=10 && i>=7 && i<=11) || (j==18 && i>=1 && i<=7) ||\n (j==18 && i>=11 && i<=13) || (j==18 && i>=15 && i<=18) || (j==16 && i>=0 && i<=1) || (j==16 && i>=7 && i<=11) || (j==16 && i>=17 && i<=18) ||\n (j==14 && i>=1 && i<=3) || (j==14 && i>=5 && i<=7) || (j==14 && i>=11 && i<=13) || (j==14 && i>=15 && i<=18) || (j==12 && i>=7 && i<=11) ||\n (j==4 && i>=7 && i<=11) || (j==6 && i>=6 && i<=7) || (j==6 && i>=11 && i<=12) || (i==3 && j>=15 && j<=16) || (i==15 && j>=15 && j<=16) ||\n (i==5 && j>=16 && j<=17) || (i==5 && j>=10 && j<=12) || (i==5 && j>=4 && j<=8) || (i==9 && j>=5 && j<=6) || (i==9 && j>=13 && j<=14) ||\n (i==9 && j>=17 && j<=18) || (i==13 && j>=4 && j<=8) || (i==13 && j>=10 && j<=12) || (i==13 && j>=16 && j<=17) )\n {\n if(i==9 && j==8){\n\n }\n else if(i==9 && j==10){\n\n }\n else{\n continue;\n }\n\n }\n else{\n freePointsMap.points[index] = j;\n freePointsMap.points[index + 1] = i;\n index+=2;\n }\n }\n }\n}", "map(x, y, w, h, sx, sy) {\n let mapArray = this.mapData[0].layers[0].data;\n let tileSize = this.mapData[0].tileHeight;\n let numberVerticalTiles = this.mapData[0].layers[0].height;\n let numberHorizontalTiles = this.mapData[0].layers[0].width;\n let width = w || numberHorizontalTiles;\n let height = h || numberVerticalTiles;\n this.mapAdjustments.x = x || 0;\n this.mapAdjustments.y = y || 0;\n let x1 = sx || 0;\n let y1 = sy || 0;\n // evaluate runtime errors\n if (this.mapAdjustments.x < 0 || this.mapAdjustments.y < 0) {\n throw new RangeError(\"map(): Starting tile cannot be negative!. \");\n }\n for (let y0 = this.mapAdjustments.y; y0 < height; y0++) {\n for (let x0 = this.mapAdjustments.x; x0 < width; x0++) {\n this.spr(mapArray[y0][x0], x1 + (x0 - this.mapAdjustments.x) * tileSize, y1 + (y0 - this.mapAdjustments.y) * tileSize);\n }\n }\n }", "function buildPatternBase(width, pixelSize, roughness) {\n\n\t\t// have to create a 2D array in order to more easily manipulate shapes\n\t\tfunction create2dArray(w,h) { \n\t\t\tvar newArray = new Array(w);\n\n\t\t\tfor (i=0; i<w; i++) {\n\t\t\t\tnewArray[i] = new Array(h); \n\t\t\t}\n\n\t\t\tfor (i=0; i<w; i++) {\n\t\t\t\tfor (j=0; j<h; j++) {\n\t\t\t\t\tnewArray[i][j] = 0; // set all initial values to 0.\n\t\t\t\t}\t\t\t\t\t\t// these will get assigned random values.\n\t\t\t}\n\n\t\t\treturn newArray;\n\t\t}\n\n\n\t\t// start by seeding first corners\n\t\tfunction startDisplacement(map, width) {\n\t\t\tvar topRight, topLeft, top, bottomRight, bottomLeft, bottom, \n\t\t\t\tright, left, center;\n\n\t\t\tmap[0][0] = Math.random();\n\t\t\ttopLeft = map[0][0];\n\n\t\t\tmap[0][width] = Math.random();\n\t\t\tbottomLeft = map[0][width];\n\n\t\t\tmap[width][0] = Math.random();\n\t\t\ttopRight = map[width][0];\n\n\t\t\tmap[width][width] = Math.random();\n\t\t\tbottomRight = map[width][width];\n\n\t\t\tmap[width / 2][width / 2] = topLeft + bottomLeft + topRight + bottomRight; \n\t\t\tmap[width / 2][width / 2] = normalize(map[width / 2][width / 2]);\n\t\t\tcenter = map[width / 2][width / 2];\n\t\t\t\n\n\t\t\tmap[width / 2][width] = bottomLeft + bottomRight + center / 4;\n\t\t\tmap[width / 2][0] = topLeft + topRight + center / 4;\n\t\t\tmap[width][width / 2] = topRight + bottomRight + center / 4;\n\t\t\tmap[0][width / 2] = topLeft + bottomLeft + center / 4;\n\n\n\t\t\t// if (wrapping === false) {\n\t\t\t// // non wrapping\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center / 3;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center / 3;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center / 3;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center / 3;\n\t\t\t// }\n\n\t\t\t// else {\n\t\t\t// // wrapping\t\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center + center / 4;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center + center / 4;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center + center / 4;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center + center / 4;\n\t\t\t// }\n\n\t\t\tcenterDisplacement(width);\n\t\t}\n\n\t\tfunction centerDisplacement(d) {\n\t\t\tvar newD = d / 2,\n\t\t\t\ttopRight, topLeft, top, bottomRight, bottomLeft, bottom, \n\t\t\t\tright, left, center, i, j;\n\n\t\t\tif (newD > pixelSize) {\n\t\t\t\tfor (i = newD; i <= width; i += newD) {\n\t\t\t\t\tfor (j = newD; j <= width; j+= newD) {\n\t\t\t\t\t\tx = i - (newD / 2);\n\t\t\t\t\t\ty = j - (newD / 2);\n\n\t\t\t\t\t\t// corners \n\t\t\t\t\t\ttopLeft = map[i - newD][j - newD];\n\t\t\t\t\t\ttopRight = map[i][j - newD];\n\t\t\t\t\t\tbottomLeft = map[i - newD][j];\n\t\t\t\t\t\tbottomRight = map[i][j];\n\n\t\t\t\t\t\t// center\n\t\t\t\t\t\tmap[x][y] = (topLeft + topRight + bottomLeft + bottomRight) / 4 + displace(d);\n\t\t\t\t\t\tmap[x][y] = normalize(map[x][y]);\n\t\t\t\t\t\tcenter = map[x][y];\n\t\t\t\t\t\t\n\t\t\t\t\t\t// top\n\t\t\t\t\t\tif (j - (newD * 2) + (newD / 2) > 0) {\n\t\t\t\t\t\t\tmap[x][j - newD] = (topLeft + topRight + center + map[x][j - d + (newD / 2)]) / 4 + displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tmap[x][j - newD] = (topLeft + topRight + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[x][j - newD] = normalize(map[x][j - newD]);\n\n\t\t\t\t\t\t// Bottom\n\t\t\t\t\t\tif (j + (newD / 2) < width){\n\t\t\t\t\t\t\tmap[x][j] = (bottomLeft + bottomRight + center + map[x][j + (newD / 2)]) / 4+ displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmap[x][j] = (bottomLeft + bottomRight + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[x][j] = normalize(map[x][j]);\n\n\n\t\t\t\t\t\t//Right\n\t\t\t\t\t\tif (i + (newD / 2) < width){\n\t\t\t\t\t\t\tmap[i][y] = (topRight + bottomRight + center + map[i + (newD / 2)][y]) / 4+ displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmap[i][y] = (topRight + bottomRight + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[i][y] = normalize(map[i][y]);\n\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif (i - (newD * 2) + (newD / 2) > 0){\n\t\t\t\t\t\t\tmap[i - newD][y] = (topLeft + bottomLeft + center + map[i - d + (newD / 2)][y]) / 4 + displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmap[i - newD][y] = (topLeft + bottomLeft + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[i - newD][y] = normalize(map[i - newD][y]);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcenterDisplacement(newD);\n\t\t\t}\n\t\t}\n\n\t\tfunction normalize(x) { // required in the event a center value exceeds 1\n\t\t\tif (x > 1) {\n\t\t\t\tx = 1;\n\t\t\t}\n\t\t\telse if (x < 0) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t\treturn x;\n\t\t}\n\n\t\t// generates a random value to offset center for subsequent iterations\n\t\tfunction displace(num){\n\t\t\tvar max = num / (width + width) * roughness;\n\t\t\treturn (Math.random(1.0)- 0.5) * max;\n\t\t}\n\n\t\tvar map = create2dArray(width + 1, width + 1);\n\t\tstartDisplacement(map,width);\n\t\treturn map;\n\t}", "function normalizeMap(w, h, map) {\n var max = min = map[0][0];\n for (var i = 0; i < w; i++) {\n for (var j = 0; j < h; j++) {\n var val = map[i][j];\n if (val > max) max = val;\n if (val < min) min = val;\n }\n }\n console.log(\"Max: \" + max);\n var mult = 1.0/max;\n for (var i = 0; i < w; i++) {\n for (var j = 0; j < h; j++) {\n map[i][j] *= mult;\n }\n }\n return map; \n}", "generateIobPips(pin, tile, direction, pad) {\n let kin = [];\n let k = [];\n let o = [];\n let i = [];\n let t = [];\n let kmux = undefined;\n let omux = undefined;\n let tmux = undefined;\n let xoff = 0;\n let yoff = 0;\n this.label = \"\";\n if (direction == \"topleft\" && tile == 'AA') {\n // This corner IOB is a special case.\n this.W = 20;\n this.H = 12;\n xoff = -8;\n yoff = 4;\n kin = [\"|col.?.io3:row.A.local.0\"];\n o = [\"col.?.io3:CLK.AA.O:\" + pad + \".O\" + \":CLK.AA.O\"];\n o.push( \"|col.?.io3:row.A.long.2\", \"|col.?.io3:row.A.local.2\", \"|col.?.io3:row.A.local.4\", \"-col.A.long.3:row.?.local.5\",\n \"-col.A.local.3:row.?.local.5\", \"-col.A.local.1:row.?.local.5\", \"-col.A.long.2:row.?.local.5\");\n i = [\"|col.?.x:row.A.local.1\", \"|col.?.x:row.A.local.3\", \"|col.?.x:row.A.long.3\",\n \"-col.A.io2:row.?.io5\", \"-col.A.long.4:row.?.io5\",\n \"-col.A.local.4:row.?.io5\", \"-col.A.local.2:row.?.io5\",\n \"-col.A.long.2:row.?.io5\" ];\n i.push(\"col.?.clb:row.A.io2:\" + tile + \".A:\" + pad + \".I\"); // special case\n i.push(\"col.A.x:AA.B:\" + tile + \".B:\" + pad + \".I\"); // special case\n t = [ \"|col.?.clbl1:row.A.long.2\", \"|col.?.clbl1:row.A.local.1\", \"|col.?.clbl1:row.A.local.3\", \"|col.?.clbl1:row.A.long.3\"];\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {3: 0, 1: 1, 7: 2, 5: 3}[this.muxt];\n } else if (this.muxt == 4) {\n this.tmode = \"\";\n } else if (this.muxt == 6) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // tree of muxes: bit 16 low selects inputs 0, 7; bit 8 low selects 1, 5; bit 4 low selects 2, 4;\n // bit 2 *high* selects 3, 6. Bit 1 selects one of the pair.\n omux = {12: 0, 20: 1, 25: 2, 30: 3, 24: 4, 21: 5, 31: 6, 13: 7}[this.muxo];\n } else if (direction == \"topleft\") {\n // Left-facing IOB along the top\n this.W = 20;\n this.H = 12;\n xoff = -8;\n yoff = 4;\n kin = [\"|col.?.x:row.A.local.0\"];\n o = [\"|col.?.x:row.A.long.2\", \"|col.?.x:row.A.local.2\", \"|col.?.x:row.A.local.4\",\n \"-col.?.long.1:row.A.io3\", \"-col.?.local.3:row.A.io3\", \"-col.?.local.1:row.A.io3\"];\n i = [\"|col.?.clbl2:row.A.local.1\", \"|col.?.clbl2:row.A.local.3\", \"|col.?.clbl2:row.A.long.3\",\n \"-col.?.long.2:row.A.io4\", \"-col.?.local.5:row.A.io4\", \"-col.?.local.4:row.A.io4\",\n \"-col.?.local.2:row.A.io4\"];\n i.push(\"col.?.clb:row.A.io2:A\" + tile[1] + \".A:\" + pad + \".I\"); // special case\n i.push(\"col.?.x:AH.X:\" + pad + \".I:\" + tile + \".B\");\n t = [ \"|col.?.clbl1:row.A.long.2\", \"|col.?.clbl1:row.A.local.1\", \"|col.?.clbl1:row.A.local.3\", \"|col.?.clbl1:row.A.long.3\"];\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {3: 0, 1: 1, 7: 2, 5: 3}[this.muxt];\n } else if (this.muxt == 4) {\n this.tmode = \"\";\n } else if (this.muxt == 6) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux: 2-bit active high, other bits active low, 1-bit toggles.\n omux = {4: 0, 9: 1, 14: 2, 8: 3, 5: 4, 15: 5}[this.muxo];\n } else if (direction == \"topright\" && tile == \"AI\") {\n // Special-case\n this.W = 20;\n this.H = 12;\n xoff = -3;\n yoff = 4;\n kin = [\"|col.?.clbw1:row.A.local.0\"];\n o = [ \"|col.?.clbw1:row.A.local.1\", \"|col.?.clbw1:row.A.local.3\", \"|col.?.clbw1:row.A.long.3\",\n \"-col.H.clbr3:row.?.io3:AH.X:\" + pad + \".O\",\n \"-col.I.long.1:row.?.io3\", \"-col.I.local.1:row.?.io3\", \"-col.I.local.3:row.?.io3\", \"-col.I.long.3:row.?.io3\",];\n i = [ \"|col.?.clbw2:row.A.long.2\", \"|col.?.clbw2:row.A.local.2\", \"|col.?.clbw2:row.A.local.4\",\n \"-col.I.long.2:row.?.io2\", \"-col.I.local.2:row.?.io2\", \"-col.I.local.4:row.?.io2\", \"-col.I.long.3:row.?.io2\"];\n t = [ \"|col.?.clbw3:row.A.long.2\", \"|col.?.clbw3:row.A.local.1\", \"|col.?.clbw3:row.A.local.3\", \"|col.?.clbw3:row.A.long.3\",];\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {3: 0, 1: 1, 7: 2, 5: 3}[this.muxt];\n } else if (this.muxt == 6) {\n this.tmode = \"\";\n } else if (this.muxt == 4) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n omux = {13: 0, 10: 1, 11: 2, 12: 3, 30: 4, 6: 5, 7: 6, 31: 7}[this.muxo];\n } else if (direction == \"topright\") {\n // Right-facing IOB along the top\n this.W = 20;\n this.H = 12;\n xoff = -3;\n yoff = 4;\n kin = [\"|col.?.clbw1:row.A.local.0\"];\n o = [ \"|col.?.clbw1:row.A.local.1\", \"|col.?.clbw1:row.A.local.3\", \"|col.?.clbw1:row.A.long.3\",\n \"-col.?.clbw3:row.A.io2\", \"-col.?.local.2:row.A.io2\", \"-col.?.local.4:row.A.io2\", \"-col.?.local.5:row.A.io2\",\n \"-col.?.long.2:row.A.io2\"];\n i = [ \"|col.?.clbw2:row.A.long.2\", \"|col.?.clbw2:row.A.local.2\", \"|col.?.clbw2:row.A.local.4\",\n\"-col.?.local.1:row.A.local.5\", \"-col.?.local.3:row.A.local.5\", \"-col.?.long.1:row.A.local.5\",];\n t = [ \"|col.?.clbw3:row.A.long.2\", \"|col.?.clbw3:row.A.local.1\", \"|col.?.clbw3:row.A.local.3\", \"|col.?.clbw3:row.A.long.3\",];\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {3: 0, 1: 1, 7: 2, 5: 3}[this.muxt];\n } else if (this.muxt == 6) {\n this.tmode = \"\";\n } else if (this.muxt == 4) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux with 16-bit active-one, others active-zero, 1-bit the toggle.\n omux = {13: 0, 10: 1, 11: 2, 12: 3, 30: 4, 6: 5, 7: 6, 31: 7}[this.muxo];\n } else if (direction == \"rightlower\") {\n this.W = 12;\n this.H = 26;\n xoff = -16;\n yoff = -12;\n kin = [ \"-col.I.local.5:row.?.io1\"];\n t = [ \"-col.I.long.3:row.?.io1\", \"-col.I.local.4:row.?.io1\", \"-col.I.local.2:row.?.io1\", \"-col.I.long.2:row.?.io1\"];\n i = [ \"-col.I.long.3:row.?.io2\", \"-col.I.local.3:row.?.io2\", \"-col.I.local.1:row.?.io2\", \"-col.I.long.1:row.?.io2\",\n \"|col.I.io1:row.?.local.3\", \"|col.I.io1:row.?.local.5\"];\n o = [ \"-col.I.local.4:row.?.io3\", \"-col.I.local.2:row.?.io3\", \"-col.I.long.2:row.?.io3\",\n\"|col.I.io2:row.?.local.1\", \"|col.I.io2:row.?.local.4\", \"|col.I.io2:row.?.long.1\",];\n // Annoying special case. The X and Y connections are to e.g. AH while everything else is in the BH tile.\n let prevRow = String.fromCharCode(tile.charCodeAt(0) - 1);\n o.push(\"col.I.io2:\" + prevRow + \"H.B:\" + pad + \".O:\" + prevRow + \"H.X\");\n o.push(\"col.I.io2:\" + prevRow + \"H.Y:\" + pad + \".O:\" + prevRow + \"H.Y\");\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {3: 0, 5: 1, 1: 2, 7: 3}[this.muxt];\n } else if (this.muxt == 6) {\n this.tmode = \"\";\n } else if (this.muxt == 4) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux: 2-bit active high, other bits active low, 1-bit toggles.\n omux = {6: 0, 30: 1, 20: 2, 21: 3, 19: 4, 18: 5, 7: 6, 31: 7}[this.muxo];\n } else if (direction == \"rightupper\") {\n this.W = 12;\n this.H = 26;\n xoff = -16;\n yoff = -12\n kin = [ \"-col.I.local.5:row.?.io4\"];\n t = [ \"-col.I.long.3:row.?.io4\", \"-col.I.local.4:row.?.io4\", \"-col.I.local.2:row.?.io4\", \"-col.I.long.2:row.?.io4\",];\n i = [ \"-col.I.local.4:row.?.io5\", \"-col.I.local.2:row.?.io5\", \"-col.I.long.2:row.?.io5\",\n \"|col.I.io3:row.?.long.1\", \"|col.I.io3:row.?.local.4\", \"|col.I.io3:row.?.local.1\",];\n o = [ \"-col.I.long.3:row.?.io6\", \"-col.I.local.3:row.?.io6\", \"-col.I.local.1:row.?.io6\", \"-col.I.long.1:row.?.io6\",\n \"|col.I.local.0:row.?.local.5\", \"|col.I.local.0:row.?.local.3\", \"col.I.local.0:?H.B:|col.I.local.0:?H.X\", \"|col.I.local.0:?H.Y\"]\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {5: 0, 3: 1, 7: 2, 1: 3}[this.muxt];\n } else if (this.muxt == 6) {\n this.tmode = \"\";\n } else if (this.muxt == 4) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux: 2-bit active high, other bits active low, 1-bit toggles.\n omux = {31: 0, 25: 1, 21: 2, 13: 3, 12: 4, 24: 5, 20: 6, 30: 7}[this.muxo];\n } else if (direction == \"bottomright\" && tile == \"II\") { // P43\n this.W = 20;\n this.H = 12;\n xoff = -4;\n yoff = -16\n kin = [ \"|col.?.clbw1:row.I.local.5\"];\n o = [ \"|col.?.clbw1:row.I.clk\", \"|col.?.clbw1:row.I.local.4\", \"|col.?.clbw1:row.I.local.2\", \"|col.?.clbw1:row.I.long.1\",\n \"-col.?.long.2:row.I.io2\", \"-col.?.local.2:row.I.io2\", \"-col.?.local.4:row.I.io2\", \"-col.?.long.3:row.I.io2\",]\n o.push(\"col.?.clbw3:row.I.io2:HH.X:PAD30.O\");\n i = [ \"|col.?.clbw2:row.I.long.2\", \"|col.?.clbw2:row.I.local.3\", \"|col.?.clbw2:row.I.local.1\",\n \"-col.?.io1:row.I.io3:CLK.II.O:PAD30.I\",\n \"-col.?.long.1:row.I.io3\", \"-col.?.local.1:row.I.io3\", \"-col.?.local.3:row.I.io3\", \"-col.?.long.3:row.I.io3\",];\n t = [ \"|col.?.clbw3:row.I.long.2\", \"|col.?.clbw3:row.I.local.4\", \"|col.?.clbw3:row.I.local.2\", \"|col.?.clbw3:row.I.long.1\",];\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {3: 0, 1: 1, 7: 2, 5: 3}[this.muxt];\n } else if (this.muxt == 6) {\n this.tmode = \"\";\n } else if (this.muxt == 4) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux: 2-bit active high, other bits active low, 1-bit toggles.\n omux = {14: 0, 45: 1, 42: 2, 43: 3, 39: 4, 62: 5, 38: 6, 63: 7, 44: 8}[this.muxo];\n } else if (direction == \"bottomright\") {\n this.W = 20;\n this.H = 12;\n xoff = -4;\n yoff = -16\n kin = [ \"|col.?.clbw1:row.I.local.5\"];\n o = [ \"|col.?.clbw1:row.I.local.4\", \"|col.?.clbw1:row.I.local.2\", \"|col.?.clbw1:row.I.long.1\",\n \"-col.?.local.2:row.I.io3\", \"-col.?.local.4:row.I.io3\", \"-col.?.local.5:row.I.io3\", \"-col.?.long.2:row.I.io3\",];\n let prevRow = String.fromCharCode(tile.charCodeAt(0) - 1);\n let prevCol = String.fromCharCode(tile.charCodeAt(1) - 1);\n o.push(\"col.?.clbw3:row.I.io3:\" + prevRow + prevCol + \".X:\" +pad + \".O\"); // Hardwire this tricky case\n\"\",\n i = [ \"|col.?.clbw2:row.I.long.2\", \"|col.?.clbw2:row.I.local.3\", \"|col.?.clbw2:row.I.local.1\",\n \"-col.?.local.1:row.I.io4\", \"-col.?.local.3:row.I.io4\", \"-col.?.long.1:row.I.io4\",];\n\"\",\n t = [ \"|col.?.clbw3:row.I.long.2\", \"|col.?.clbw3:row.I.local.4\", \"|col.?.clbw3:row.I.local.2\", \"|col.?.clbw3:row.I.long.1\",];\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {3: 0, 1: 1, 7: 2, 5: 3}[this.muxt];\n } else if (this.muxt == 6) {\n this.tmode = \"\";\n } else if (this.muxt == 4) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux: 2-bit active high, other bits active low, 1-bit toggles.\n omux = {13: 0, 10: 1, 11: 2, 30: 3, 6: 4, 7: 5, 31: 6, 12: 7}[this.muxo];\n } else if (direction == \"bottomleft\" && tile == \"IA\") { // P27\n this.W = 20;\n this.H = 12;\n xoff = -8;\n yoff = -16\n kin = [ \"|col.?.io3:row.I.local.5\",];\n o = [ \"|col.?.io3:row.I.long.2\", \"|col.?.io3:row.I.local.3\", \"|col.?.io3:row.I.local.1\",\n \"-col.A.long.3:row.?.io2\",\n \"-col.A.local.3:row.?.io2\", \"-col.A.local.1:row.?.io2\", \"-col.A.long.2:row.?.io2\",];\n i = [ \"|col.?.x:row.I.local.4\", \"|col.?.x:row.I.local.2\", \"|col.?.x:row.I.long.1\",\n \"-col.A.long.4:row.?.io1\", \"-col.A.local.4:row.?.io1\", \"-col.A.local.2:row.?.io1\", \"-col.A.long.2:row.?.io1\",];\n i.push(\"col.?.clb:row.I.io2:H\" + tile[1] + \".D:\" + pad + \".I\"); // special case\n i.push(\"col.?.x:HH.C:H\" + tile[1] + \".C:\" + pad + \".I\"); // special case\n // i.push(\"col.?.clb:row.I.io2\"); // special case\n t = [ \"|col.?.clbl1:row.I.long.2\", \"|col.?.clbl1:row.I.local.4\", \"|col.?.clbl1:row.I.local.2\", \"|col.?.clbl1:row.I.long.1\",];\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {3: 0, 1: 1, 7: 2, 5: 3}[this.muxt];\n } else if (this.muxt == 4) {\n this.tmode = \"\";\n } else if (this.muxt == 6) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux: 2-bit active high, other bits active low, 1-bit toggles.\n omux = {20: 0, 25: 1, 30: 2, 24: 3, 21: 4, 31: 5, 12: 6}[this.muxo];\n } else if (direction == \"bottomleft\") {\n this.W = 20;\n this.H = 12;\n xoff = -8;\n yoff = -16\n kin = [ \"|col.?.x:row.I.local.5\",];\n o = [ \"|col.?.x:row.I.long.2\", \"|col.?.x:row.I.local.3\", \"|col.?.x:row.I.local.1\",\n \"-col.?.long.1:row.I.io2\", \"-col.?.local.3:row.I.io2\", \"-col.?.local.1:row.I.io2\",\n ];\n i = [ \"|col.?.clbl2:row.I.local.4\", \"|col.?.clbl2:row.I.local.2\", \"|col.?.clbl2:row.I.long.1\",\n \"-col.?.long.2:row.I.io1\", \"-col.?.local.5:row.I.io1\", \"-col.?.local.4:row.I.io1\", \"-col.?.local.2:row.I.io1\",\n \"-H?.D:row.I.io2\"];\n i.push(\"?H.D:row.I.io2:H\" + tile[1] + \".D:\" + pad + \".I\"); // special case\n i.push(\"col.?.x:HH.C:H\" + tile[1] + \".C:\" + pad + \".I\"); // special case\n t = [ \"|col.?.clbl1:row.I.long.2\", \"|col.?.clbl1:row.I.local.4\", \"|col.?.clbl1:row.I.local.2\", \"|col.?.clbl1:row.I.long.1\",];\n if (this.muxt & 1) {\n this.tmode = \"TRI\";\n tmux = {3: 0, 1: 1, 7: 2, 5: 3}[this.muxt];\n } else if (this.muxt == 4) {\n this.tmode = \"\";\n } else if (this.muxt == 6) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux: 2-bit active high, other bits active low, 1-bit toggles.\n omux = {4: 0, 9: 1, 14: 2, 8: 3, 5: 4, 15: 5}[this.muxo];\n } else if (direction == \"leftupper\") {\n this.W = 12;\n this.H = 26;\n xoff = 4;\n yoff = -12;\n kin = [ \"-col.A.local.0:row.?.io4\",];\n t = [ \"-col.A.long.2:row.?.io4\", \"-col.A.local.1:row.?.io4\", \"-col.A.local.3:row.?.io4\", \"-col.A.long.3:row.?.io4\",];\n i = [ \"-col.A.long.2:row.?.io5\", \"-col.A.local.1:row.?.io5\", \"-col.A.local.3:row.?.io5\", \"-col.A.long.3:row.?.io5\",\n \"|col.A.local.5:row.?.local.5\",];\n o = [ \"-col.A.local.2:row.?.io6\", \"-col.A.local.4:row.?.io6\", \"-col.A.long.4:row.?.io6\",\n \"|col.A.io1:row.?.long.1\", \"|col.A.io1:row.?.local.4\", \"|col.A.io1:row.?.local.1\",];\n if (tile == \"HA\") {\n // P24 special case\n i.push(\"col.A.io3:HA.B:\" + pad + \".I:HA.B\");\n }\n if (!(this.muxt & 1)) {\n this.tmode = \"TRI\";\n tmux = {6: 0, 0: 1, 4: 2, 2: 3}[this.muxt];\n } else if (this.muxt == 5) {\n this.tmode = \"\";\n } else if (this.muxt == 7) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux: 2-bit active high, other bits active low, 1-bit toggles.\n omux = {4: 0, 8: 1, 14: 2, 5: 3, 9: 4, 15: 5}[this.muxo];\n } else if (direction == \"leftlower\") { \n this.W = 12;\n this.H = 26;\n xoff = 4;\n yoff = -12;\n kin = [ \"-col.A.local.0:row.?.io1\",];\n t = [ \"-col.A.long.2:row.?.io1\", \"-col.A.local.1:row.?.io1\", \"-col.A.local.3:row.?.io1\", \"-col.A.long.3:row.?.io1\",];\n i = [ \"-col.A.local.2:row.?.io2\", \"-col.A.local.4:row.?.io2\", \"-col.A.long.4:row.?.io2\", \"-col.A.io2:row.?.io2\",\n \"|col.A.io3:row.?.local.4\", \"|col.A.io3:row.?.long.1\",];\n o = [ \"-col.A.long.2:row.?.io3\", \"-col.A.local.1:row.?.io3\", \"-col.A.local.3:row.?.io3\", \"-col.A.long.3:row.?.io3\",\n \"|col.A.io2:row.?.local.3\", \"|col.A.io2:row.?.local.5\"];\n // Annoying special case to deal with connection to above tile.\n let prevRow = String.fromCharCode(tile.charCodeAt(0) - 1);\n i.push(\"col.A.io3:\" + prevRow + \"A.B:\" + pad + \".I:\" + prevRow + \"A.B\");\n if (!(this.muxt & 1)) {\n this.tmode = \"TRI\";\n tmux = {6: 0, 0: 1, 4: 2, 2: 3}[this.muxt];\n } else if (this.muxt == 5) {\n this.tmode = \"\";\n } else if (this.muxt == 7) {\n this.tmode = \"ON\";\n } else {\n assert(false, \"Unexpected muxt \" + this.muxt);\n }\n // Standard mux: 2-bit active high, other bits active low, 1-bit toggles.\n omux = {5: 0, 3: 1, 15: 2, 4: 3, 2: 4, 14:5}[this.muxo];\n } else { \n return;\n }\n\n // Handle the four clock muxes, one for each side. The pips are in the top right and bottom left.\n if (pin == \"P9\") {\n k = [\"|col.I.local.0:CLK.AA.O\", \"|col.I.local.0:row.A.local.1\", \"|col.I.local.0:row.A.local.2\",\n \"|col.I.local.0:row.A.local.3\", \"|col.I.local.0:row.A.local.4\",\n \"|col.I.local.0:row.A.long.3\" ]; // The clock pips in the upper right, an unexpected location for this IOB.\n kmux = {4: 0, 8: 1, 15: 2, 14: 3, 9: 4, 5: 5}[this.muxk]; // K input selected\n } else if (pin == \"P24\") {\n k = [\"|col.A.local.1:row.I.local.0\", \"|col.A.local.2:row.I.local.0\", \"|col.A.local.3:row.I.local.0\",\n \"|col.A.local.4:row.I.local.0\", \"|col.A.long.3:row.I.local.0\",\n \"|col.A.clk:row.I.local.0\" ];\n kmux = {4: 1, 2: 5, 15: 4, 14: 3, 9: 0, 5: 2}[this.muxk]; // K input selected\n } else if (pin == \"P27\") {\n k = [\"|col.A.local.5:row.I.io4\", \"|col.A.local.5:row.I.long.1\", \"|col.A.local.5:row.I.local.1\",\n \"|col.A.local.5:row.I.local.2\", \"|col.A.local.5:row.I.local.3\",\n \"|col.A.local.5:row.I.local.4\" ];\n kmux = {4: 2, 8: 4, 15: 5, 14: 0, 2: 1, 3: 3}[this.muxk]; // K input selected\n } else if (pin == \"P59\") {\n k = [\"|col.I.io3:row.A.local.5\", \"|col.I.long.2:row.A.local.5\", \"|col.I.local.1:row.A.local.5\",\n \"|col.I.local.2:row.A.local.5\", \"|col.I.local.3:row.A.local.5\",\n \"|col.I.local.4:row.A.local.5\" ];\n kmux = {4: 0, 8: 1, 15: 4, 14: 3, 9: 2, 5: 5}[this.muxk]; // K input selected\n // k = [\"|col.I.io3:row.A.local.5\"]; // The clock pips in the upper right, an unexpected location for this IOB.\n }\n // Convert all the pip configuration data to pips.\n this.kinpips = []; // The input pip for each IOB\n this.kpips = []; // Special corner pip selected by k mux\n this.opips = [];\n this.ipips = [];\n this.tpips = [];\n kin.forEach(p => this.kinpips.push(Iob.processIobPip(p, tile, pad + \".K\")));\n k.forEach(p => this.kpips.push(Iob.processIobPip(p, tile, pad + \".K\")));\n o.forEach(p => this.opips.push(Iob.processIobPip(p, tile, pad + \".O\")));\n i.forEach(p => this.ipips.push(Iob.processIobPip(p, tile, pad + \".I\")));\n t.forEach(p => this.tpips.push(Iob.processIobPip(p, tile, pad + \".T\")));\n\n // Highlight pips that are selected by the mix\n if (tmux != undefined && tmux != null) {\n this.tpips[tmux][4] = true; // Select the appropriate pip\n }\n if (omux != undefined && omux != null) {\n this.opips[omux][4] = true; // Select the appropriate pip\n }\n if (this.kinpips && this.latch ) { // Set the clock input\n this.kinpips[0][4] = true;\n }\n if (kmux != undefined && kmux != null) {\n this.kpips[kmux][4] = true; // Select the appropriate pip\n }\n // Grab the x,y coordinates of the K pip; this is the origin for drawing the box\n this.x0 = this.kinpips[0][1] + xoff;\n this.y0 = this.kinpips[0][2] + yoff;\n }", "fillMap() {\n const layout = this.config.layout || [[]];\n\n // First pass to assign basic walls\n layout.forEach((row, y) => {\n row.forEach((col, x) => {\n if (col === 1) {\n this.groundLayer.putTileAt(TILES.FLOOR.BASIC, x, y);\n return;\n }\n\n const isWall = Object.values(getNeighbors(x, y))\n .reduce((a, pos) => isFloorTile(layout, pos) || a, false);\n\n if (isWall) {\n layout[y][x] = 2;\n }\n });\n });\n\n // Second pass to determine wall orientation\n layout.forEach((row, y) => {\n row.forEach((col, x) => {\n if (col < 2) {\n return;\n }\n\n const neighbors = getNeighbors(x, y);\n\n let wallHash = 0;\n if (isWallTile(layout, neighbors.t)) {\n wallHash |= WALL_FLAGS.TOP;\n }\n if (isWallTile(layout, neighbors.r)) {\n wallHash |= WALL_FLAGS.RIGHT;\n }\n if (isWallTile(layout, neighbors.b)) {\n wallHash |= WALL_FLAGS.BOTTOM;\n }\n if (isWallTile(layout, neighbors.l)) {\n wallHash |= WALL_FLAGS.LEFT;\n }\n\n switch (wallHash) {\n case 1:\n this.groundLayer.putTileAt(TILES.WALL.VERTICAL.CAP_BOTTOM, x, y);\n break;\n case 2:\n this.groundLayer.putTileAt(TILES.WALL.HORIZONTAL.CAP_LEFT, x, y);\n break;\n case 3:\n this.groundLayer.putTileAt(TILES.CORNER.BOTTOM_LEFT, x, y);\n break;\n case 4:\n this.groundLayer.putTileAt(TILES.WALL.VERTICAL.CAP_TOP, x, y);\n break;\n case 5:\n this.groundLayer.putTileAt(TILES.WALL.VERTICAL.OPEN, x, y);\n break;\n case 6:\n this.groundLayer.putTileAt(TILES.CORNER.TOP_LEFT, x, y);\n break;\n case 7:\n this.groundLayer.putTileAt(TILES.T_CORNER.RIGHT, x, y);\n break;\n case 8:\n this.groundLayer.putTileAt(TILES.WALL.HORIZONTAL.CAP_RIGHT, x, y);\n break;\n case 9:\n this.groundLayer.putTileAt(TILES.CORNER.BOTTOM_RIGHT, x, y);\n break;\n case 10:\n this.groundLayer.putTileAt(TILES.WALL.HORIZONTAL.OPEN, x, y);\n break;\n case 11:\n this.groundLayer.putTileAt(TILES.T_CORNER.TOP, x, y);\n break;\n case 12:\n this.groundLayer.putTileAt(TILES.CORNER.TOP_RIGHT, x, y);\n break;\n case 13:\n this.groundLayer.putTileAt(TILES.T_CORNER.LEFT, x, y);\n break;\n case 14:\n this.groundLayer.putTileAt(TILES.T_CORNER.BOTTOM, x, y);\n break;\n case 15:\n this.groundLayer.putTileAt(TILES.T_CORNER.ALL, x, y);\n break;\n default:\n this.groundLayer.putTileAt(TILES.WALL.HORIZONTAL.CAP_BOTH, x, y);\n }\n });\n });\n }", "function createMap(maze) {\n const wallTile = \"\\x1b[32m# \\x1b[0m\";\n const floorTile = \"\\x1b[36m. \\x1b[0m\";\n\n let map = Array.from(Array(maze.length * 2 + 1)).map((line) =>\n Array.from(Array(maze.length * 2 + 1)).fill(\n wallTile,\n 0,\n maze.length * 2 + 1\n )\n );\n\n maze.map((line, lineIndex) => {\n line.map((cell, columnIndex) => {\n if (cell.visited) {\n map[lineIndex * 2 + 1][columnIndex * 2 + 1] = floorTile;\n cell.corridors.map((corridor) => {\n if (corridor.line > cell.line) {\n map[lineIndex * 2 + 2][columnIndex * 2 + 1] = floorTile;\n } else if (corridor.line < cell.line) {\n map[lineIndex * 2][columnIndex * 2 + 1] = floorTile;\n } else if (corridor.column > cell.column) {\n map[lineIndex * 2 + 1][columnIndex * 2 + 2] = floorTile;\n } else if (corridor.column < cell.column) {\n map[lineIndex * 2 + 1][columnIndex * 2] = floorTile;\n }\n });\n }\n });\n });\n\n return map.map((line) => line.join(\"\")).join(\"\\n\");\n}", "function createMap() {\n let accountant = 0;\n while (accountant <= 288) {\n const square = document.createElement(\"div\");\n if (accountant % 2 === 0) {\n square.classList.add(\"lightGreen\");\n } else {\n square.classList.add(\"darkGreen\");\n }\n square.classList.add(\"square\", `${accountant}`);\n map.appendChild(square);\n accountant++;\n }\n squares = document.querySelectorAll(\".square\");\n messageDefeat.style.display = \"none\";\n marginsDefine();\n insertApple();\n printScores();\n printSnake();\n}", "makeBoard() {\r\n const a = new Array(this.m).fill(null).map(()=>new Array(this.n).fill(null));\r\n for (let numS in this.placing) {\r\n let [di, dj] = this.placing[numS].dir;\r\n let [i, j] = this.placing[numS].place;\r\n for (let c of numS) {\r\n if (a[i][j]===null) a[i][j] = [];\r\n a[i][j].push(c);\r\n i += di;\r\n j += dj;\r\n }\r\n }\r\n return a;\r\n }", "function completeMap(mapdata, start_h, end_h, start_w, end_w) {\r\n // divided in to 4 area: A B C D\r\n\r\n if ((end_h-start_h <= 2) || (end_w-start_w <= 2)) {\r\n // stop recursive call \r\n for (var h = start_h; h < end_h; h++) {\r\n for (var w = start_w; w < end_w; w++) {\r\n if (mapdata[h][w] === 9) {\r\n // increment the bombCounter as a mine is detected\r\n bombCounter += 1;\r\n mapdata = fillHint(mapdata, h, w);\r\n }\r\n }\r\n }\r\n\r\n return mapdata;\r\n\r\n } else {\r\n var m = end_h - start_h; // height\r\n var n = end_w - start_w; // width\r\n\r\n // be careful with these divisions!!!!, could it returns 0?\r\n // ...probably not as we stop when one of width or height is 1\r\n // but division could returns 1!!!\r\n var mid_m = Math.floor(m/2);\r\n var mid_n = Math.floor(n/2);\r\n\r\n //console.log(\"mid_m: \"+mid_m+\" mid_n: \"+mid_n);\r\n\r\n // A: [0, 0] [0, mid_n] B: [0, mid_n] [0, n]\r\n // [mid_m, 0] [mid_m, mid_n] [mid_m, mid_n] [mid_m, n]\r\n // C: [mid_m, 0] [mid_m, mid_n] D: [mid_m, mid_n] [mid_m, n]\r\n // [m, 0] [m, mid_n] [m, mid_n] [m, n]\r\n\r\n // b/c it's dynamic scoping, mapdata updates along with the function call, \r\n // thus there's no need to write in the form of:\r\n // mapdata = completeMap(...)\r\n completeMap(mapdata, start_h, start_h+mid_m, start_w, start_w+mid_n);\r\n completeMap(mapdata, start_h, start_h+mid_m, start_w+mid_n, end_w);\r\n completeMap(mapdata, start_h+mid_m, end_h, start_w, start_w+mid_n);\r\n completeMap(mapdata, start_h+mid_m, end_h, start_w+mid_n, end_w);\r\n\r\n return mapdata; \r\n }\r\n}", "function updateCountMapWithCounts(countMap, minesMap, height, width) {\n let count = 0;\n for (let y = 0; y < height; y += 1) {\n for (let x = 0; x < width; x += 1) {\n countMap[y][x] = calculateCellCount(x, y, height - 1, minesMap, count);\n }\n }\n return countMap;\n}", "function trimEdges({top, bottom, left, right}) {\n return {\n top: Math.max(top, 0),\n bottom: Math.min (bottom, map.height),\n left: Math.max (left, 0),\n right: Math.min (right, map.width),\n }\n }", "function getDrumPadsMap(startKey, linearize) {\n map = initArray(-1, 128);\n if (linearize) {\n var remap = [4, 5, 6, 7, 12, 13, 14, 15, 0, 1, 2, 3, 8, 9, 10, 11];\n for (i = LKM_DRUM_PADS_LOW; i <= LKM_DRUM_PADS_HIGH; i++) {\n map[i] = (startKey + remap[i - LKM_DRUM_PADS_LOW]) & 0x7F;\n }\n } else {\n for (i = LKM_DRUM_PADS_LOW; i <= LKM_DRUM_PADS_HIGH; i++) {\n map[i] = (startKey + i - LKM_DRUM_PADS_LOW) & 0x7F;\n }\n }\n\n return map;\n}", "function generateWasteland(mapArray) {\n let randomCoordX, randomCoordY, randomNeightborCoords;\n\n // get one random empty tile to start the wasteland\n randomCoordX = getRandomValue(MAP_WIDTH);\n randomCoordY = getRandomValue(MAP_HEIGHT);\n\n mapArray[randomCoordY][randomCoordX] = {\n type: TILE_TYPES[1] // all spaces are empty by default\n }\n\n // get the rest of the wasteland tiles\n for (let i = 0; i < WASTELAND_LENGTH - 1; i++) {\n randomNeightborCoords = getRandomNeighbor(mapArray);\n mapArray[randomNeightborCoords.x][randomNeightborCoords.y] = {\n type: TILE_TYPES[1]\n }\n }\n\n return mapArray;\n}", "function createMap(name, width, height) {\n mapWidth = width;\n mapHeight = height;\n // pushing the height as row\n for (let i = 0; i < mapHeight; i++) {\n emptyMap.push([]);\n // pushing the width as column\n for (let y = 0; y < mapWidth; y++) {\n emptyMap[i].push(\"\");\n }\n }\n title.textContent = name;\n return emptyMap;\n }", "function MapSpec(w, h, def, blocks) {\n if (blocks === undefined) blocks = [];\n var x, y, matrix;\n\n this.width = w;\n this.height = h;\n this.default = def;\n\n matrix = new Array(h);\n \n for (y = 0; y < h; ++y) {\n matrix[y] = new Array(w);\n for (x = 0; x < w; ++x) {\n matrix[y][x] = blocks[x + y * w] || def;\n }\n }\n\n this.matrix = matrix;\n}", "keyLayoutArray() {\n const layoutRowChars = [\n // Stand ins\n ['\\ud806\\udff7', '\\ud806\\udff8', '\\ud806\\udff9'],\n ['\\ud806\\udff4', '\\ud806\\udff5', '\\ud806\\udff6'],\n ['\\ud806\\udff1', '\\ud806\\udff2', '\\ud806\\udff3'],\n ['\\ud806\\udff0']\n ]; \n return layoutRowChars;\n }", "constructRows(levels){\n let myRows = [];\n let H = new Map();\n let count = 0;\n for (let i = 0; i < levels; i++) {\n var currentRow = [];\n for (let space = 0; space <=i; space++) {\n currentRow.push({color: 'white', move: -1 });\n H.set(count++,createVector(space,i));\n }\n myRows.push(currentRow);\n }\n return {rows: myRows, hash: H};\n }", "function map_generate(params)\n{\n\tvar map = {\n\t\twidth: params[\"width\"],\n\t\theight: params[\"height\"],\n\t\tdiagram: null,\n\t\tpolygons: null,\n\t\toutlines: null\n\t};\n\n\tvar width = params[\"width\"];\n\tvar height = params[\"height\"];\n\tvar offset = params[\"offset\"];\n\n\tparams[\"noise-seed\"] = {\n\t\tx: rand(0, width), // TODO: generate these values from seed\n\t\ty: rand(0, height)\n\t};\n\n\tvar voronoi = new Voronoi();\n\tvar bbox = { xl: 0, xr: width, yt: 0, yb: height };\n\tvar n = (width * height) / (offset * offset);\n\n\tvar sites = [];\n\n\tfor (var i = 0; i < n; i++)\n\t\tsites.push({ x: rand(0, width), y: rand(0, height) }); // TODO: generate these values from seed\n\n\tvar diagram = voronoi.compute(sites, bbox);\n\n\tfor (var i = 0; i < params[\"relaxation\"]; i++)\n\t{\n\t\tsites = voronoi_relax(diagram);\n\t\tdiagram = voronoi.compute(sites, bbox);\n\t}\n\n\t// var polygons = voronoi_polygons(diagram, function(cell) { return cell_solid(cell, params); });\n\n\t// if (params[\"simplification\"] > 0)\n\t// {\n\t// \tfor (var i = 0; i < polygons.length; i++)\n\t// \t\tpolygons[i] = polygon_simplify(polygons[i], params[\"simplification\"]);\n\t// }\n\n\t// var outlines = [];\n\n\t// for (var i = 0; i < polygons.length; i++)\n\t// \toutlines = outlines.concat(polygon_outlines(polygons[i]));\n\n\tmap.diagram = diagram;\n\t// map.polygons = polygons;\n\t// map.outlines = outlines;\n\n\treturn map;\n}", "function addPadding(arr) {\r\n var len = arr[arr.length - 1].length\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i].length < len) {\r\n for (var j = 0; j <= (len - arr[i].length); j++) {\r\n arr[i] = \"0\" + arr[i];\r\n }\r\n }\r\n }\r\n}", "getMapInnerBounds() {\n const mb = this.getMap().getDiv().getBoundingClientRect();\n const mib = {\n top: mb.top + this._opts.edgeOffset.top,\n right: mb.right - this._opts.edgeOffset.right,\n bottom: mb.bottom - this._opts.edgeOffset.bottom,\n left: mb.left + this._opts.edgeOffset.left\n };\n mib.width = mib.right - mib.left;\n mib.height = mib.bottom - mib.top;\n return mib;\n }", "function computeMap(table) {\n if (table.type.spec.tableRole != \"table\") { throw new RangeError(\"Not a table node: \" + table.type.name) }\n var width = findWidth(table), height = table.childCount;\n var map = [], mapPos = 0, problems = null, colWidths = [];\n for (var i = 0, e = width * height; i < e; i++) { map[i] = 0; }\n\n for (var row = 0, pos = 0; row < height; row++) {\n var rowNode = table.child(row);\n pos++;\n for (var i$1 = 0;; i$1++) {\n while (mapPos < map.length && map[mapPos] != 0) { mapPos++; }\n if (i$1 == rowNode.childCount) { break }\n var cellNode = rowNode.child(i$1);\n var ref = cellNode.attrs;\n var colspan = ref.colspan;\n var rowspan = ref.rowspan;\n var colwidth = ref.colwidth;\n for (var h = 0; h < rowspan; h++) {\n if (h + row >= height) {\n (problems || (problems = [])).push({type: \"overlong_rowspan\", pos: pos, n: rowspan - h});\n break\n }\n var start = mapPos + (h * width);\n for (var w = 0; w < colspan; w++) {\n if (map[start + w] == 0)\n { map[start + w] = pos; }\n else\n { (problems || (problems = [])).push({type: \"collision\", row: row, pos: pos, n: colspan - w}); }\n var colW = colwidth && colwidth[w];\n if (colW) {\n var widthIndex = ((start + w) % width) * 2, prev = colWidths[widthIndex];\n if (prev == null || (prev != colW && colWidths[widthIndex + 1] == 1)) {\n colWidths[widthIndex] = colW;\n colWidths[widthIndex + 1] = 1;\n } else if (prev == colW) {\n colWidths[widthIndex + 1]++;\n }\n }\n }\n }\n mapPos += colspan;\n pos += cellNode.nodeSize;\n }\n var expectedPos = (row + 1) * width, missing = 0;\n while (mapPos < expectedPos) { if (map[mapPos++] == 0) { missing++; } }\n if (missing) { (problems || (problems = [])).push({type: \"missing\", row: row, n: missing}); }\n pos++;\n }\n\n var tableMap = new TableMap(width, height, map, problems), badWidths = false;\n\n // For columns that have defined widths, but whose widths disagree\n // between rows, fix up the cells whose width doesn't match the\n // computed one.\n for (var i$2 = 0; !badWidths && i$2 < colWidths.length; i$2 += 2)\n { if (colWidths[i$2] != null && colWidths[i$2 + 1] < height) { badWidths = true; } }\n if (badWidths) { findBadColWidths(tableMap, colWidths, table); }\n\n return tableMap\n}", "function computeMap(table) {\n if (table.type.spec.tableRole != \"table\") throw new RangeError(\"Not a table node: \" + table.type.name)\n let width = findWidth(table), height = table.childCount\n let map = [], mapPos = 0, problems = null, colWidths = []\n for (let i = 0, e = width * height; i < e; i++) map[i] = 0\n\n for (let row = 0, pos = 0; row < height; row++) {\n let rowNode = table.child(row)\n pos++\n for (let i = 0;; i++) {\n while (mapPos < map.length && map[mapPos] != 0) mapPos++\n if (i == rowNode.childCount) break\n let cellNode = rowNode.child(i), {colspan, rowspan, colwidth} = cellNode.attrs\n for (let h = 0; h < rowspan; h++) {\n if (h + row >= height) {\n (problems || (problems = [])).push({type: \"overlong_rowspan\", pos, n: rowspan - h})\n break\n }\n let start = mapPos + (h * width)\n for (let w = 0; w < colspan; w++) {\n if (map[start + w] == 0)\n map[start + w] = pos\n else\n (problems || (problems = [])).push({type: \"collision\", row, pos, n: colspan - w})\n let colW = colwidth && colwidth[w]\n if (colW) {\n let widthIndex = ((start + w) % width) * 2, prev = colWidths[widthIndex]\n if (prev == null || (prev != colW && colWidths[widthIndex + 1] == 1)) {\n colWidths[widthIndex] = colW\n colWidths[widthIndex + 1] = 1\n } else if (prev == colW) {\n colWidths[widthIndex + 1]++\n }\n }\n }\n }\n mapPos += colspan\n pos += cellNode.nodeSize\n }\n let expectedPos = (row + 1) * width, missing = 0\n while (mapPos < expectedPos) if (map[mapPos++] == 0) missing++\n if (missing) (problems || (problems = [])).push({type: \"missing\", row, n: missing})\n pos++\n }\n\n let tableMap = new TableMap(width, height, map, problems), badWidths = false\n\n // For columns that have defined widths, but whose widths disagree\n // between rows, fix up the cells whose width doesn't match the\n // computed one.\n for (let i = 0; !badWidths && i < colWidths.length; i += 2)\n if (colWidths[i] != null && colWidths[i + 1] < height) badWidths = true\n if (badWidths) findBadColWidths(tableMap, colWidths, table)\n\n return tableMap\n}", "function get2x2optscramble(mn) {\n var e = [15, 16, 16, 21, 21, 15, 13, 9, 9, 17, 17, 13, 14, 20, 20, 4, 4, 14, 12, 5, 5, 8, 8, 12, 3, 23, 23, 18, 18, 3, 1, 19, 19, 11, 11, 1, 2, 6, 6, 22, 22, 2, 0, 10, 10, 7, 7, 0], d = [\n [],\n [],\n [],\n [],\n [],\n []\n ], v = [\n [0, 2, 3, 1, 23, 19, 10, 6, 22, 18, 11, 7],\n [4, 6, 7, 5, 12, 20, 2, 10, 14, 22, 0, 8],\n [8, 10, 11, 9, 12, 7, 1, 17, 13, 5, 0, 19],\n [12, 13, 15, 14, 8, 17, 21, 4, 9, 16, 20, 5],\n [16, 17, 19, 18, 15, 9, 1, 23, 13, 11, 3, 21],\n [20, 21, 23, 22, 14, 16, 3, 6, 15, 18, 2, 4]\n ], r = [], a = [], b = [], c = [], f = [], s = [];\n\n function t() {\n s = [1, 1, 1, 1, 2, 2, 2, 2, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 0, 0, 0, 0]\n }\n\n t();\n function mx() {\n t();\n for (var i = 0; i < 500; i++)dm(Math.floor(Math.random() * 3 + 3) + 16 * Math.floor(Math.random() * 3))\n }\n\n function cj() {\n var i, j;\n for (i = 0; i < 6; i++)for (j = 0; j < 6; j++)d[i][j] = 0;\n for (i = 0; i < 48; i += 2)if (s[e[i]] <= 5 && s[e[i + 1]] <= 5)d[s[e[i]]][s[e[i + 1]]]++\n }\n\n function dm(m) {\n var j = 1 + (m >> 4), k = m & 15, i;\n while (j) {\n for (i = 0; i < v[k].length; i += 4)y(s, v[k][i], v[k][i + 3], v[k][i + 2], v[k][i + 1]);\n j--\n }\n }\n\n function sv() {\n cj();\n var h = [], w = [], i = 0, j, k, m;\n for (j = 0; j < 7; j++) {\n m = 0;\n for (k = i; k < i + 6; k += 2) {\n if (s[e[k]] == s[e[42]])m += 4;\n if (s[e[k]] == s[e[44]])m += 1;\n if (s[e[k]] == s[e[46]])m += 2\n }\n h[j] = m;\n if (s[e[i]] == s[e[42]] || s[e[i]] == 5 - s[e[42]])w[j] = 0; else if (s[e[i + 2]] == s[e[42]] || s[e[i + 2]] == 5 - s[e[42]])w[j] = 1; else w[j] = 2;\n i += 6\n }\n m = 0;\n for (i = 0; i < 7; i++) {\n j = 0;\n for (k = 0; k < 7; k++) {\n if (h[k] == i)break;\n if (h[k] > i)j++\n }\n m = m * (7 - i) + j\n }\n j = 0;\n for (i = 5; i >= 0; i--)j = j * 3 + w[i] - 3 * Math.floor(w[i] / 3);\n if (m != 0 || j != 0) {\n r.length = 0;\n for (k = mn; k < 99; k++)if (se(0, m, j, k, -1))break;\n j = \"\";\n for (m = 0; m < r.length; m++)j = \"URF\".charAt(r[m] / 10) + \"\\'2 \".charAt(r[m] % 10) + \" \" + j;\n return j\n }\n }\n\n function se(i, j, k, l, m) {\n if (l != 0) {\n if (a[j] > l || b[k] > l)return false;\n var o, p, q, n;\n for (n = 0; n < 3; n++)if (n != m) {\n o = j;\n p = k;\n for (q = 0; q < 3; q++) {\n o = c[o][n];\n p = f[p][n];\n r[i] = 10 * n + q;\n if (se(i + 1, o, p, l - 1, n))return true\n }\n }\n } else if (j == 0 && k == 0)return true;\n return false\n }\n\n function z() {\n var i, j, k, m, n;\n for (i = 0; i < 5040; i++) {\n a[i] = -1;\n c[i] = [];\n for (j = 0; j < 3; j++)c[i][j] = g(i, j)\n }\n a[0] = 0;\n for (i = 0; i <= 6; i++)for (j = 0; j < 5040; j++)if (a[j] == i)for (k = 0; k < 3; k++) {\n m = j;\n for (n = 0; n < 3; n++) {\n var m = c[m][k];\n if (a[m] == -1)a[m] = i + 1\n }\n }\n for (i = 0; i < 729; i++) {\n b[i] = -1;\n f[i] = [];\n for (j = 0; j < 3; j++)f[i][j] = w(i, j)\n }\n b[0] = 0;\n for (i = 0; i <= 5; i++)for (j = 0; j < 729; j++)if (b[j] == i)for (k = 0; k < 3; k++) {\n m = j;\n for (n = 0; n < 3; n++) {\n var m = f[m][k];\n if (b[m] == -1)b[m] = i + 1\n }\n }\n }\n\n function g(i, j) {\n var k, m, n, o = i, h = [];\n for (k = 1; k <= 7; k++) {\n m = o % k;\n o = (o - m) / k;\n for (n = k - 1; n >= m; n--)h[n + 1] = h[n];\n h[m] = 7 - k\n }\n if (j == 0)y(h, 0, 1, 3, 2); else if (j == 1)y(h, 0, 4, 5, 1); else if (j == 2)y(h, 0, 2, 6, 4);\n o = 0;\n for (k = 0; k < 7; k++) {\n m = 0;\n for (n = 0; n < 7; n++) {\n if (h[n] == k)break;\n if (h[n] > k)m++\n }\n o = o * (7 - k) + m\n }\n return o\n }\n\n function w(i, j) {\n var k, m, n, o = 0, p = i, h = [];\n for (k = 0; k <= 5; k++) {\n n = Math.floor(p / 3);\n m = p - 3 * n;\n p = n;\n h[k] = m;\n o -= m;\n if (o < 0)o += 3\n }\n h[6] = o;\n if (j == 0)y(h, 0, 1, 3, 2); else if (j == 1) {\n y(h, 0, 4, 5, 1);\n h[0] += 2;\n h[1]++;\n h[5] += 2;\n h[4]++\n } else if (j == 2) {\n y(h, 0, 2, 6, 4);\n h[2] += 2;\n h[0]++;\n h[4] += 2;\n h[6]++\n }\n p = 0;\n for (k = 5; k >= 0; k--)p = p * 3 + (h[k] % 3);\n return p\n }\n\n function y(i, j, k, m, n) {\n var o = i[j];\n i[j] = i[k];\n i[k] = i[m];\n i[m] = i[n];\n i[n] = o\n }\n\n z();\n for (var i = 0; i < num; i++) {\n mx();\n ss[i] += sv();\n }\n}", "function fillHint(mapdata, x, y){\r\n // +1 to the blocks around the current block if the number is not 9 \r\n // [x-1, y-1] [x-1, y] [x-1, y+1]\r\n // [x, y-1] [x, y] [x, y+1]\r\n // [x+1, y-1] [x+1, y] [x+1, y+1]\r\n // x-1 not < 0, x+1 not > mapdata.length\r\n // y-1 not < 0, y+1 not > mapdata[0].length\r\n\r\n for (var m = x-1; m <= x+1; m++) {\r\n if (!(m < 0) && !(m >= mapdata.length)) {\r\n for (var n = y-1; n <= y+1; n++) {\r\n if (!(n < 0) && !(n >= mapdata[0].length)) {\r\n //console.log(\"checking: \" + mapdata[m][n]);\r\n if (!(mapdata[m][n] === 9)) {\r\n //console.log(\"runing?\")\r\n // mapdata[m][n] += 1;\r\n if (mapdata[m][n] === 10) {\r\n mapdata[m][n] = 1;\r\n } else {\r\n mapdata[m][n] += 1;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return mapdata;\r\n}", "function initStrokeMap(pattern1, pattern2, distanceMetric) {\n\t var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2);\n\t // larger is now k1 with length n\n\t var map = new Array();\n\t for(var i=0;i<n;i++) {\n\t map[i] = -1;\n\t }\n\t var free = new Array();\n\t for(var i=0;i<n;i++) {\n\t free[i] = true;\n\t }\n\t for(var i=0;i<m;i++) {\n minDist = 10000000;\n\t\t min_j = -1;\n\t\t for(var j=0;j<n;j++) {\n\t\t if(free[j] == true) {\n\t\t\t var d = distanceMetric(k1[j],k2[i]);\n \t\t\t if(d < minDist) {\n\t\t\t\t minDist = d;\n\t\t\t\t\t min_j = j;\n\t\t\t }\n\t\t\t }\n\t\t }\n\t\t free[min_j] = false;\n map[min_j] = i;\n }\t \n\t return map; \n }", "function calculateAdjacencyInfo(map, x, y){\n let number = 0;\n let Sides = [{x:0,y:-1}, {x:-1,y:0}, {x:1,y:0}, {x:0,y:1}];\n let SidesID = [0x10, 0x20, 0x40, 0x80];\n \n let CornerMask = [0x30, 0x50, 0xA0, 0xC0];\n let Corners = [{x:-1,y:-1}, {x:1,y:-1}, {x:-1,y:1}, {x:1,y:1}];\n let CornersID = [0x01, 0x02, 0x04, 0x08];\n //first, get the 4 directly adjacent tiles\n for(let i = 0;i<4;i++){\n if (isWall(map, x+Sides[i].x, y+Sides[i].y)){\n number = number | SidesID[i];\n }\n }\n //then, get the corners, if they are noticable\n for(let i = 0;i<4;i++){\n //console.log((number & CornerMask[i]) == CornerMask[i]);\n if ((number & CornerMask[i]) === CornerMask[i]){\n \n if ( isWall(map, x+Corners[i].x, y+Corners[i].y)){\n number = number | CornersID[i];\n }\n }\n }\n //\n return number;\n}", "function getStarMap ( num ) {\n\t \tvar ones = '', max, binary, starMap, mapper, i, j, l, map;\n\n\t \tif ( !starMaps[ num ] ) {\n\t \t\tstarMap = [];\n\n\t \t\twhile ( ones.length < num ) {\n\t \t\t\tones += 1;\n\t \t\t}\n\n\t \t\tmax = parseInt( ones, 2 );\n\n\t \t\tmapper = function ( digit ) {\n\t \t\t\treturn digit === '1';\n\t \t\t};\n\n\t \t\tfor ( i = 0; i <= max; i += 1 ) {\n\t \t\t\tbinary = i.toString( 2 );\n\t \t\t\twhile ( binary.length < num ) {\n\t \t\t\t\tbinary = '0' + binary;\n\t \t\t\t}\n\n\t \t\t\tmap = [];\n\t \t\t\tl = binary.length;\n\t \t\t\tfor (j = 0; j < l; j++) {\n\t \t\t\t\tmap.push( mapper( binary[j] ) );\n\t \t\t\t}\n\t \t\t\tstarMap[i] = map;\n\t \t\t}\n\n\t \t\tstarMaps[ num ] = starMap;\n\t \t}\n\n\t \treturn starMaps[ num ];\n\t }", "function index(i,j){\n\t\tvar temp = i*_mapW + j;\n\t\treturn temp < 0 ? -1 :\n\t\t\t temp > _mapW * _mapH -1 ? -1 :\n\t\t\t temp ;\n\t}", "function createPadding(width) {\n var result = '';\n var string = ' ';\n var n = width;\n do {\n if (n % 2) {\n result += string;\n }\n n = Math.floor(n / 2);\n string += string;\n } while (n);\n\n return result;\n}", "function createPadding (width) {\n var result = ''\n var string = ' '\n var n = width\n do {\n if (n % 2) {\n result += string;\n }\n n = Math.floor(n / 2);\n string += string;\n } while (n);\n\n return result;\n}", "function fillOutStepMap(map, leftLen, rightLen)\n\t{\n\t\tvar out = [];\n\n\t\t// Step through the map\n\t\tvar left = 0, right = 0;\n\t\tfor (var i = 0; i < map.length; i++)\n\t\t{\n\t\t\tif (map[i][0] === 0 && map[i][1] === 0)\n\t\t\t\tout.push([left++, right++]);\n\t\t\telse if (map[i][0])\n\t\t\t{\n\t\t\t\tfor (var j = 0; j < map[i][0]; j++)\n\t\t\t\t\tout.push([-1, right++]);\n\n\t\t\t\tout.push([left++, right++]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (var j = 0; j < map[i][1]; j++)\n\t\t\t\t\tout.push([left++, -1]);\n\n\t\t\t\tout.push([left++, right++]);\n\t\t\t}\n\t\t}\n\n\t\t// Fill out the remaining portion\n\t\tvar fillLen = Math.max (leftLen, rightLen);\n\t\twhile (out.length < fillLen)\n\t\t{\n\t\t\tvar l = (left < leftLen) ? left++ : -1;\n\t\t\tvar r = (right < rightLen) ? right++ : -1;\n\t\t\tout.push([l, r]);\n\t\t}\n\n\t\treturn out;\n\t}", "function generate_minefield( w, h, m )\n{\n var i, j, k;\n minefield = new Array( w ); // this is global\n for (i = 0; i < w; i++)\n {\n minefield[ i ] = new Array ( h);\n for( j = 0; j < h; j++ ) \n {\n minefield[ i ][ j ] = 0;\n }\n }\n\n /*********************************************\n * Lay Mines\n **********************************************/\n for( k = 0; k < m; k++ )\n {\n // Pick a random coordinate\n i = ( Math.floor( Math.random() * 1000 ) ) % w;\n j = ( Math.floor( Math.random() * 1000 ) ) % h;\n if( minefield[ i ][ j ] != 9 )\n {\n minefield[ i ][ j ] = 9;\n }\n // If there's already a mine here, try again\n else\n {\n k--;\n }\n }\n\n /*********************************************\n * Count Nearby Mines\n **********************************************/\n for( i = 0; i < w; i++ )\n {\n for( j = 0; j < h; j++ )\n {\n for( k = 0; k < 8; k++ )\n {\n // Make sure we're not walking off the array\n // and that this isn't already a mine\n if( i + w_mod[ k ] >= 0 &&\n i + w_mod[ k ] < w &&\n j + h_mod[ k ] >= 0 &&\n j + h_mod[ k ] < h &&\n minefield[ i ][ j ] < 9 )\n {\n if( minefield[ i + w_mod[ k ] ][ j + h_mod[ k ] ] == 9)\n {\n minefield[ i ][ j ] += 1;\n }\n }\n }\n }\n }\n\n /*********************************************\n * Return Minefield\n **********************************************/\n return minefield;\n}", "function writeMiniMap(mapFixedWidth, mapFixedHeight) {\n\t\tvar mm = document.createElement(\"span\");\n\t\tmm.setAttribute(\"id\", MINIMAP);\n\t\tvar mmsp = document.body.appendChild(mm);\n\t\tmmsp.style.position = \"absolute\";\n\t\tmmsp.style.top = mapFixedHeight == null ? document.body.clientHeight - this.side : mapFixedHeight - this.side;\n\t\tmmsp.style.left = mapFixedWidth == null ? document.body.clientWidth - this.side : mapFixedWidth;\n\t\tmmsp.style.width = this.side;\n\t\tmmsp.style.height = this.side;\n\t\tmmsp.style.border = \"medium double \" + this.borderColor;\n\t\tmmsp.style.backgroundColor = this.bgColor;\n\t\tmmsp.style.overflow = \"hidden\";\n\t\tmmsp.style.zIndex = 100;\n\t}", "function createBaseMatrix(clues) {\nlet up = clues.slice(0, 4);\nlet right = clues.slice(4, 8);\nlet down = clues.slice(8, 12).reverse();\nlet left = clues.slice(12, 16).reverse();\n\nlet m = [\n [0, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 0, 0]\n];\n\nup.forEach(\n (h, i) => {\n if (h === 4) {\n m = setArr(m, i, false, [1, 2, 3, 4]);\n }\n if (h === 1) {\n m = setArr(m, i, false, [4, 0, 0, 0]);\n }\n }\n);\n\ndown.forEach(\n (h, i) => {\n if (h === 4) {\n m = setArr(m, i, false, [4, 3, 2, 1]);\n }\n if (h === 1) {\n m = setArr(m, i, false, [0, 0, 0, 4]);\n }\n }\n);\n\nleft.forEach(\n (h, i) => {\n if (h === 4) {\n m = setArr(m, i, true, [1, 2, 3, 4]);\n }\n if (h === 1) {\n m = setArr(m, i, true, [4, 0, 0, 0]);\n }\n }\n);\n\nright.forEach(\n (h, i) => {\n if (h === 4) {\n m = setArr(m, i, true, [4, 3, 2, 1]);\n }\n if (h === 1) {\n m = setArr(m, i, true, [0, 0, 0, 4]);\n }\n }\n);\n\nreturn m;\n}", "function getStarMap(num) {\n \tvar ones = \"\",\n \t max,\n \t binary,\n \t starMap,\n \t mapper,\n \t i,\n \t j,\n \t l,\n \t map;\n\n \tif (!starMaps[num]) {\n \t\tstarMap = [];\n\n \t\twhile (ones.length < num) {\n \t\t\tones += 1;\n \t\t}\n\n \t\tmax = parseInt(ones, 2);\n\n \t\tmapper = function (digit) {\n \t\t\treturn digit === \"1\";\n \t\t};\n\n \t\tfor (i = 0; i <= max; i += 1) {\n \t\t\tbinary = i.toString(2);\n \t\t\twhile (binary.length < num) {\n \t\t\t\tbinary = \"0\" + binary;\n \t\t\t}\n\n \t\t\tmap = [];\n \t\t\tl = binary.length;\n \t\t\tfor (j = 0; j < l; j++) {\n \t\t\t\tmap.push(mapper(binary[j]));\n \t\t\t}\n \t\t\tstarMap[i] = map;\n \t\t}\n\n \t\tstarMaps[num] = starMap;\n \t}\n\n \treturn starMaps[num];\n }", "function writeMiniWindow() {\n\t\tvar mapWidth = document.getElementById(MAP).clientWidth * this.xRate;\n\t\tvar mapHeight = document.getElementById(MAP).clientHeight * this.yRate;\n\t\tvar scl = document.getElementById(MAP).scrollLeft * this.xRate;\n\t\tvar sct = document.getElementById(MAP).scrollTop * this.yRate;\n\t\tvar mw = document.createElement(\"v:rect\");\n\t\tmw.setAttribute(\"id\", MINIWINDOW + \"_up\");\n\t\tvar mwsp = document.getElementById(MINIMAP).appendChild(mw);\n\t\tmwsp.style.position = \"absolute\";\n\t\tmwsp.style.left = 0;\n\t\tmwsp.style.top = 0;\n\t\tmwsp.style.width = this.side;\n\t\tmwsp.style.height = sct;\n\t\tmwsp.fill.type = \"solid\";\n\t\tmwsp.fill.color = \"#003366\";\n\t\tmwsp.fill.opacity = \"20%\";\n\t\tmwsp.stroked = \"false\";\n\t\tmw = document.createElement(\"v:rect\");\n\t\tmw.setAttribute(\"id\", MINIWINDOW + \"_left\");\n\t\tmwsp = document.getElementById(MINIMAP).appendChild(mw);\n\t\tmwsp.style.position = \"absolute\";\n\t\tmwsp.style.left = 0;\n\t\tmwsp.style.top = sct;\n\t\tmwsp.style.width = scl;\n\t\tmwsp.style.height = this.side;\n\t\tmwsp.fill.type = \"solid\";\n\t\tmwsp.fill.color = \"#003366\";\n\t\tmwsp.fill.opacity = \"20%\";\n\t\tmwsp.stroked = \"false\";\n\t\tmw = document.createElement(\"v:rect\");\n\t\tmw.setAttribute(\"id\", MINIWINDOW + \"_right\");\n\t\tmwsp = document.getElementById(MINIMAP).appendChild(mw);\n\t\tmwsp.style.position = \"absolute\";\n\t\tmwsp.style.left = scl + mapWidth;\n\t\tmwsp.style.top = sct;\n\t\tmwsp.style.width = this.side;\n\t\tmwsp.style.height = this.side;\n\t\tmwsp.fill.type = \"solid\";\n\t\tmwsp.fill.color = \"#003366\";\n\t\tmwsp.fill.opacity = \"20%\";\n\t\tmwsp.stroked = \"false\";\n\t\tmw = document.createElement(\"v:rect\");\n\t\tmw.setAttribute(\"id\", MINIWINDOW + \"_bottom\");\n\t\tmwsp = document.getElementById(MINIMAP).appendChild(mw);\n\t\tmwsp.style.position = \"absolute\";\n\t\tmwsp.style.left = scl;\n\t\tmwsp.style.top = sct + mapHeight;\n\t\tmwsp.style.width = mapWidth;\n\t\tmwsp.style.height = this.side;\n\t\tmwsp.fill.type = \"solid\";\n\t\tmwsp.fill.color = \"#003366\";\n\t\tmwsp.fill.opacity = \"20%\";\n\t\tmwsp.stroked = \"false\";\n\t\tmw = document.createElement(\"v:rect\");\n\t\tmw.setAttribute(\"id\", MINIWINDOW);\n\t\tmwsp = document.getElementById(MINIMAP).appendChild(mw);\n\t\tmwsp.style.position = \"absolute\";\n\t\tmwsp.style.left = scl;\n\t\tmwsp.style.top = sct;\n\t\tmwsp.style.cursor = \"move\";\n\t\tvar maxWidth = this.side - 9;\n\t\tmwsp.style.width = mapWidth > maxWidth ? maxWidth : mapWidth;\n\t\tmwsp.style.height = mapHeight > maxWidth ? maxWidth : mapHeight;\n\t\tmwsp.fill.type = \"solid\";\n\t\tmwsp.fill.color = \"#003366\";\n\t\tmwsp.fill.opacity = \"0%\";\n\t\tmwsp.strokeColor = \"#003366\";\n\t}", "function makeBoard(/*columnCount, rowCount*/) {\n // Set \"board\" to empty HEIGHT x WIDTH matrix array\n //This array is used for the logic.\n\n board = [...Array(WIDTH)].map(e => Array(HEIGHT)); \n board.every((row) => row.fill(undefined));\n\n\n/* const map = [];\nfor(let x=0; x<columnCount; x++){\n map[x] = []; //set up inner array\n for(let y = 0; y< rowCount; y++){\n addCell(map, x, y);\n }\n}\nreturn map; */\n\n\n}", "function RectPackingMap(size,margin){if(margin===void 0){margin=0;}var _this=_super.call(this,null,null,BABYLON.Vector2.Zero(),size)||this;_this._margin=margin;_this._root=_this;return _this;}", "function towerBuilder(nFloors) {\n let howManyStartPush = 1\n let result = []\n let lustStars = 1\n let firstSpacesLeftRight = 0\n for (let i = 1; i < nFloors; i++) {\n lustStars += 2\n }\n firstSpacesLeftRight = (lustStars - 1)\n for (let i = 0; i < nFloors; i++) {\n console.log(firstSpacesLeftRight)\n let newStrForPush = []\n for (let j = 1; j <= firstSpacesLeftRight / 2; j++) {\n newStrForPush.push(\" \")\n }\n for (let q = 0; q < howManyStartPush; q++) {\n newStrForPush.push(\"*\")\n }\n for (let j = 1; j <= firstSpacesLeftRight / 2; j++) {\n newStrForPush.push(\" \")\n }\n howManyStartPush += 2\n firstSpacesLeftRight -= 2\n result.push(newStrForPush.join(\"\"))\n }\n console.log(result)\n}", "function generateWindow480(){\r\n\tvar c1 =BEZIER(S0)([[0,0,0],[1.5,0,0],[2,0,0],[1.5,0.5,0],[1.5,trainHeight/3-0.5,0],[1.5,trainHeight/3,0],[2,trainHeight/3,0],\r\n\t\t\t\t\t\t[0,trainHeight/3,0]]);\r\n\tvar c2 =BEZIER(S0)([[0,0,0],[-1.5,0,0],[-2,0,0],[-1.5,0.5,0],[-1.5,trainHeight/3-0.5,0],[-1.5,trainHeight/3,0],[-2,trainHeight/3,0],\r\n\t\t\t\t\t\t[0,trainHeight/3,0]]);\r\n\tvar temp = MAP(BEZIER(S1)([c1,c2]))(dom2D);\r\n\tvar out = COLOR([1.71,2.05,2.55])(STRUCT([T([1])([0.29]),R([1,2])(-PI/30),T([0,1,2])([2,-0.3,-trainHeight/2-0.65]),R([1,2])(PI/2),temp]));\r\n\treturn out;\r\n}", "function withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}", "function withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}", "pad() {\n const paddedGame = Game.duplicate(this);\n\n // add empty rows to top and bottom of grid\n paddedGame.cells[this.origin.y - 1] = {};\n paddedGame.cells[this.origin.y + this.height] = {};\n\n // update Game dimensions\n paddedGame.width += 2;\n paddedGame.height += 2;\n paddedGame.origin.x--;\n paddedGame.origin.y--;\n\n return paddedGame;\n }", "function addCells(width, height) {\n for (var x = 0; x < width; x += boxSize) {\n for (var y = 0; y < height; y += boxSize) {\n\n let tempCoord = new Coord(x + boxSize/2 + padding, y + boxSize/2 + padding);\n let rightCoord = new Coord(x + 3*boxSize/2 + padding, y + boxSize/2 + padding);\n let belowCoord = new Coord(x + boxSize/2 + padding, y + 3*boxSize/2 + padding);\n\n let temp;\n let right;\n let below;\n\n if(!contains(coords, tempCoord)) {\n temp = new Cell(new Coord(x + boxSize/2 + padding, y + boxSize/2 + padding));\n coords.push(temp.getCoord());\n cellMap.set(temp.getCoord(), temp);\n } else {\n tempCoord = find(tempCoord);\n temp = cellMap.get(tempCoord);\n }\n\n if(!contains(coords, rightCoord)) {\n right = new Cell(new Coord(x + 3*boxSize/2 + padding, y + boxSize/2 + padding));\n\n\n if(inBounds(rightCoord)) {\n coords.push(right.getCoord());\n cellMap.set(right.getCoord(), right);\n temp.addNeighbor(right);\n right.addNeighbor(temp);\n }\n\n } else {\n rightCoord = find(rightCoord);\n right = cellMap.get(rightCoord);\n\n if(inBounds(rightCoord)) {\n temp.addNeighbor(right);\n right.addNeighbor(temp);\n }\n }\n\n if(!contains(coords, belowCoord)) {\n\n below = new Cell(new Coord(x + boxSize/2 + padding, y + 3*boxSize/2 + padding));\n\n if(inBounds(belowCoord)) {\n coords.push(below.getCoord());\n cellMap.set(below.getCoord(), below);\n temp.addNeighbor(below);\n below.addNeighbor(temp);\n }\n\n } else {\n belowCoord = find(belowCoord);\n below = cellMap.get(belowCoord);\n\n if(inBounds(belowCoord)) {\n temp.addNeighbor(below);\n below.addNeighbor(temp);\n }\n }\n }\n }\n user.path.push(cellMap.get(coords[0]));\n}", "function pad(img, origRows, origCols) {\n\n var rows = powerOf2(origRows);\n var cols = powerOf2(origCols);\n if (rows > cols) {\n cols = rows;\n } else {\n rows = cols;\n }\n var rowDiff = rows - origRows;\n var colDiff = cols - origCols;\n\n for (var i = 0; i < rows; i++) {\n if (i == origRows) {\n origCols = 0;\n }\n for (var j = origCols; j < cols; j++) {\n if (j == 0) {\n img[i] = [];\n }\n img[i][j] = '0';\n }\n }\n}", "static createNewGrid(width, height, charMap) {\n let whole = [];\n for (let y = 0; y < height; y++) {\n whole.push([]); // Row\n for (let x = 0; x < width; x++) {\n whole[y].push(charMap[randInt(0, charMap.length - 1)]);\n }\n }\n return whole;\n }", "function minNodeEntries () {\n return M/2;\n }", "level1()\r\n {\r\n var map = \r\n [\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n /*\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n */\r\n ]\r\n\r\n /*\r\n Function that creates tiles of the map based on the map 2D array\r\n TODO -> create a separate function, so that we can create multiple different maps that use\r\n the same function\r\n */\r\n for(var x = 0; x < this.cols; x++)\r\n {\r\n var row = [];\r\n for(var y = 0; y < this.rows; y++)\r\n {\r\n var newTile = new Tile(x * 30, y * 30);\r\n if(map[y][x] == 0)\r\n newTile.placable = false;\r\n\r\n row.push(newTile);\r\n }\r\n this.canvas.push(row);\r\n }\r\n }", "function withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n var dilatedFilterShape = filterShape.map(function (s, i) {\n return s + (s - 1) * (dilation[i] - 1);\n });\n var padExtraShape = dilatedFilterShape.map(function (s) { return s - 1; });\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n var padExtraStart = padExtraShape.map(function (s) { return Math.floor(s / 2); });\n var padExtraEnd = padExtraShape.map(function (s, i) { return s - padExtraStart[i]; });\n return padExtraShape.map(function (_, i) {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}", "function gridify(matrix, size) {\n // Default size of 64 per quadrant\n var size = size || 64;\n\n // Minimum size of a quadrant since viewport is 32 wide.\n //if (size < 16) size = 16;\n\n // Maximum size of a quadrant since largest supported viewport is 1,024px x 1,024px\n //else if (size > 64) size = 64;\n\n // Get dimensions of map source\n var width = matrix[0].length;\n var height = matrix.length;\n\n // Calculate how many matrices we will have\n var widthGrids = Math.ceil(width/size);\n var heightGrids = Math.ceil(width/size);\n var grids = [];\n\n // Calculate the areas of the matrix to slice\n for (var i = 0; i < widthGrids; i++) {\n grids[i] = [];\n\n for (var j = 0; j < heightGrids; j++) {\n //grids[i][j] = \"X: \" + j*size + \", Y: \" + i*size + \" => X: \" + (j+1)*size + \", Y: \" + (i+1)*size;\n grids[i][j] = [[j*size, i*size], [(j+1)*size, (i+1)*size]];\n }\n }\n\n // Actually slice using calculations from above loop\n var sections = [];\n for (var i = 0; i < grids.length; i++) {\n sections[i] = [];\n\n for (var j = 0; j < grids[0].length; j++) {\n // Make a quadrant from 0,0 to 4,4\n // map.slice(0, 4).map(function(grid) { return grid.slice(0, 4); });\n sections[i][j] = src.slice(grids[i][j][0][0], grids[i][j][1][0]).map(function(grid) { return grid.slice(grids[i][j][0][1], grids[i][j][1][1]); });\n }\n }\n\n return sections;\n}", "getMapInnerBounds() {\n const mb = this.getMap()\n .getDiv()\n .getBoundingClientRect();\n\n let mib = {\n top: mb.top,\n right: mb.right,\n bottom: mb.bottom,\n left: mb.left\n };\n\n mib.width = mib.right - mib.left;\n mib.height = mib.bottom - mib.top;\n return mib;\n }", "function makeNewViewMask (tiles, n = 0) {\n // console.log(tiles);\n\n const mask = {}\n tiles.forEach((a, id, b) => { mask[id] = n })\n return mask\n}", "function makeMap() {\n var numRooms = randomInt(4, 8);\n var rooms = [];\n for(var i = 0; i < numRooms; ++i) {\n var roomX = randomInt(0, 75);\n var roomY = randomInt(0, 75);\n rooms.push(makeRandomRoom(roomX, roomY)); \n }\n\n // Get the width and height of the map\n var largestX = 0;\n var largestY = 0;\n for(var i = 0; i < rooms.length; ++i) {\n if (rooms[i].x + rooms[i].width > largestX) {\n largestX = rooms[i].x + rooms[i].width;\n }\n if (rooms[i].y + rooms[i].height > largestY) {\n largestY = rooms[i].y + rooms[i].height;\n }\n }\n\n var roomGroups = [];\n for(var i = 0; i < rooms.length; i++) {\n // does this room intersect with any other room?\n // TODO - check if rooms[i] is already in a group\n // so we can just add to that one\n var thisGroup = [];\n for(var j = 0; j < rooms.length; j++) {\n // this will always AT LEAST add itself to a group\n // when i == j\n if(isIntersected(rooms[i], rooms[j])) {\n thisGroup.push(rooms[j]);\n }\n }\n roomGroups.push(thisGroup);\n }\n\n // connect the room groups\n // TODO - this should connect the nearest room, not some random room\n while(roomGroups.length > 1) {\n var indexGroup1 = Math.floor(Math.random() * roomGroups.length);\n var indexGroup2 = Math.floor(Math.random() * roomGroups.length);\n if(indexGroup1 == indexGroup2) continue; // that was a wash...\n var passage = makePassage(roomGroups[indexGroup1][0], roomGroups[indexGroup2][0]);\n rooms.push(passage[0]);\n rooms.push(passage[1]);\n roomGroups.splice(indexGroup2, 1);\n }\n\n // choose a random room as a starting point\n var startingRoom;\n while(true) {\n startingRoom = randomChoice(rooms);\n if(startingRoom.type != \"passage\") break;\n }\n\n // choose a random point within that room to be the starting location\n var startX = randomInt(startingRoom.x, startingRoom.x + startingRoom.width-1);\n var startY = randomInt(startingRoom.y, startingRoom.y + startingRoom.height-1);\n\n // find the room whose x,y is furthest from the starting xy\n var furthestRoom = startingRoom; // prime it so we have some room with distance\n furthestRoom.distance = 0;\n for(var i = 0; i < rooms.length; ++i) {\n if(rooms[i].type == \"room\") {\n // Pythagorean theorem to find distance between starting point\n // and our randomly-chosen room's x,y\n var sideA = startX - rooms[i].x;\n var sideB = startY - rooms[i].y;\n var distance = Math.sqrt(sideA * sideA + sideB * sideB);\n if (distance > furthestRoom.distance) {\n furthestRoom = rooms[i];\n furthestRoom.distance = distance;\n }\n }\n }\n\n // like with starting point, find a random point in this room to be our end point\n var endingX = randomInt(furthestRoom.x, furthestRoom.x + furthestRoom.width - 1);\n var endingY = randomInt(furthestRoom.y, furthestRoom.y + furthestRoom.height - 1);\n\n map.mapArray = makeMapArray(rooms, largestX, largestY);\n map.width = largestX;\n map.height = largestY;\n map.startX = startX;\n map.startY = startY;\n map.endX = endingX;\n map.endY = endingY;\n map.rooms = rooms;\n}", "sizeClassification(){\n let a;\n if(this.streetLength < 1) a=`tiny`;\n else if(this.streetLength < 2 && this.streetLength>1) a =`small`;\n else if(this.streetLength < 4 && this.streetLength>2) a =`normal`;\n else if(this.streetLength < 5 && this.streetLength>4) a =`big`;\n else a =`huge`;\n return a; //why so complicated ? -_-'\n /* let a = nex Map();\n a.set(1, `tiny`);\n a.set(2, `small`);\n a.set(3, `normal`);\n a.set(4, `big`);\n return a;*/\n }", "function generateMap(){\n var canvas = document.getElementById('map');\n var ctx = canvas.getContext('2d');\n var weight = {\"dirt\" : 1,\"grass\" : 1, \"water\" : 1};\n var x, y;\n for (x = 0; x < 1500; x+=75) {\n for (y = 0; y < 1500; y+=75) {\n tile = getRandomTile(weight);\n createTile(ctx,tile,x,y);\n if(tile == \"water\"){\n weight = {\"dirt\" : 0.2,\"grass\" : 2, \"water\" : 0.9};\n }\n else if(tile == \"grass\"){\n weight = {\"dirt\" : 0.9,\"grass\" : 1, \"water\" : 1.2};\n }\n else{\n weight = {\"dirt\" : 1 ,\"grass\" : 1, \"water\" : 1};\n }\n }\n }\n}", "function build() {\n for (var i = 0; i < Object.keys(object).length; i++) {\n var k = Object.keys(object)[i];\n object[k] = {};\n for (var j = 0; j < k.length; j++) {\n var w = k.replaceAt(j, wildcard);\n object[k][w] = new Number();\n for (var l = 0; l < alphabet.length; l++) {\n var nw = w.replaceAt(j, alphabet[l]);\n if (nw != k && trie.find(nw)) {\n pos = (alphabet[l].charCodeAt(0) - 'a'.charCodeAt(0));\n object[k][w] = object[k][w] | (1 << pos);\n }\n }\n }\n }\n}", "function WalleryMap ( unit, width, height ) {\n \n // Sucurity tests\n if ( width <= 0 && height <= 0 && unit <= 0 )\n return false;\n \n // Settings\n this.width = width;\n this.height = height;\n this.unit = unit;\n \n // Get the size of the map\n this.size = this.width * this.height;\n this.freeSpace = this.size;\n this.result = [];\n \n // Map initialisation\n this.table = [];\n \n var newLine, i, j;\n for (i=0; i<this.width; i++) {\n newLine = [];\n for (j=0; j<this.height; j++) {\n newLine.push(false);\n }\n this.table.push(newLine);\n }\n}", "function make_map_grid()\n{\n\t_obj_clear(tileObjects);\n\tvar tileRange = get_tile_range( current_zoom );\n\tvar gap_x = Math.abs( map_pixel_nw.x % tile_size );\n\tif (map_pixel_nw.x >= 0)\n\t\tgap_x = tile_size - gap_x;\n\tvar gap_y = Math.abs( map_pixel_nw.y % tile_size );\n\tif (map_pixel_nw.y >= 0)\n\t\tgap_y = tile_size - gap_y;\n\tfor (var tx = 0 ; tx < map_tile_width ; tx++)\n\t{\n\t\tfor (var ty = 0 ; ty < map_tile_height ; ty++)\n\t\t{\n\t\t\t// Source: Processing coords\n\t\t\tvar sx = ( tx == 0 ? 0 : (gap_x + ((tx-1) * tile_size)) );\n\t\t\tvar sy = ( ty == 0 ? 0 : (gap_y + ((ty-1) * tile_size)) );\n\t\t\t// Dest: tile coords\n\t\t\tvar dx = ( tx == 0 ? (tile_size-gap_x) : 0 );\n\t\t\tvar dy = ( ty == 0 ? (tile_size-gap_y) : 0 );\n\t\t\t// chunk size (not tile size!)\n\t\t\tvar w = ( tx == 0 ? gap_x : ( tx == map_tile_width-1 ? map_width-sx : tile_size ) );\n\t\t\tvar h = ( ty == 0 ? gap_y : ( ty == map_tile_height-1 ? map_height-sy : tile_size ) );\n\t\t\t// maps pixel coords\n\t\t\tvar map_x = (sx + map_pixel_nw.x);\n\t\t\tvar map_y = (sy + map_pixel_nw.y);\n\t\t\t// maps tile\n\t\t\tvar tile = pixel_to_tile( map_x, map_y );\n\t\t\t// make object\n\t\t\tvar o = {\n\t\t\t\tzoom:\t\tcurrent_zoom,\n\t\t\t\ttile_x:\t\ttile.x,\n\t\t\t\ttile_y:\t\ttile.y,\n\t\t\t\tsx:\t\t\tsx,\n\t\t\t\tsy:\t\t\tsy,\n\t\t\t\tdx:\t\t\tdx,\n\t\t\t\tdy:\t\t\tdy,\n\t\t\t\tw:\t\t\tw,\n\t\t\t\th:\t\t\th,\n\t\t\t}\n\t\t\tif (tile.y >= 0 && tile.y < tileRange)\n\t\t\t\t_obj_push(tileObjects, o);\n\t\t\t//alert(\"tx=\"+tx+\" ty=\"+ty+\" sx=\"+o.sx+\" sy=\"+o.sy+\" w=\"+o.w+\" h=\"+o.h);\n\t\t}\n\t}\n}", "function starWars(canvas, margin, pixelsPerCell, busyBorders, wrapBorders) {\n var W = 2*margin + ~~(canvas.width / pixelsPerCell);\n var H = 2*margin + ~~(canvas.height / pixelsPerCell);\n\n var peacefulCell = function (x, y) {\n if (0 <= x && x < W && 0 <= y && y < H) {\n return this.data[y*W+x];\n }\n return 0;\n };\n var wrapCell = function (x, y) {\n x = (x + W) % W;\n y = (y + H) % H;\n return this.data[y*W+x];\n };\n var busyCell = function (x, y) {\n if (0 <= x && x < W && 0 <= y && y < H) {\n return this.data[y*W+x];\n } else if (y < 0) {\n return 0x4 + Math.round(Math.random());\n } else if (y >= H) {\n return 0x8 + Math.round(Math.random());\n }\n return 0;\n };\n\n var result = {\n W: W,\n H: H,\n Margin: margin,\n data: null,\n initial_data: null,\n displayIndices: null,\n randomize: function() {\n var result = Array(W*H);\n for (var i = 0; i < result.length; ++i) {\n result[i] = Math.round(Math.random());\n }\n this.initial_data = result;\n this.reset();\n },\n initializeWithPattern: function (pattern) {\n var result = new Array(W*H).fill(0);\n var PH = pattern.length;\n for (var py = 0; py < PH; ++py) {\n var PW = pattern[py].length;\n for (var px = 0; px < PW; ++px) {\n var x = ((W - PW) >> 1) + px;\n var y = ((H - PH) >> 1) + py;\n result[y*W+x] = pattern[py][px];\n }\n }\n this.initial_data = result;\n this.reset();\n },\n reset: function() {\n this.data = this.initial_data.slice();\n },\n clear: function() {\n this.data = Array(W*H).fill(0);\n },\n cell: busyBorders ? busyCell : wrapBorders ? wrapCell : peacefulCell,\n is_live_cell: function (x, y) {\n return (this.cell(x, y) & 3) == 1;\n },\n live_cell_should_continue_living: function (x, y) {\n var count = (\n this.is_live_cell(x-1, y-1) + this.is_live_cell(x, y-1) + this.is_live_cell(x+1, y-1) +\n this.is_live_cell(x-1, y) + this.is_live_cell(x+1, y) +\n this.is_live_cell(x-1, y+1) + this.is_live_cell(x, y+1) + this.is_live_cell(x+1, y+1)\n );\n return (count == 3 || count == 4 || count == 5);\n },\n faction_of_cell: function (x, y) {\n var c = this.cell(x, y);\n if (c == 0x0 + 1) return 1;\n if (c == 0x4 + 1) return 2;\n if (c == 0x8 + 1) return 3;\n return 0;\n },\n dead_cell_should_start_living: function (x, y) {\n var counts = [0, 0, 0, 0];\n counts[this.faction_of_cell(x-1, y-1)] += 1;\n counts[this.faction_of_cell(x , y-1)] += 1;\n counts[this.faction_of_cell(x+1, y-1)] += 1;\n counts[this.faction_of_cell(x-1, y )] += 1;\n counts[this.faction_of_cell(x+1, y )] += 1;\n counts[this.faction_of_cell(x-1, y+1)] += 1;\n counts[this.faction_of_cell(x , y+1)] += 1;\n counts[this.faction_of_cell(x+1, y+1)] += 1;\n if (counts[1] + counts[2] + counts[3] == 2) {\n if (counts[1] == 2) return 1;\n if (counts[2] == 0) return 3;\n if (counts[3] == 0) return 2;\n return 1;\n }\n return 0;\n },\n tweak_one_random_cell: function () {\n var i = Math.floor(Math.random() * (W*H)) % (W*H);\n this.data[i] = (this.data[i] & ~3) | ((this.data[i] + 1) & 3);\n },\n next_step: function () {\n var result = Array(W*H);\n for (var x = 0; x < W; ++x) {\n for (var y = 0; y < H; ++y) {\n var c = this.cell(x, y);\n if (c == 0) {\n var faction = this.dead_cell_should_start_living(x, y);\n if (faction != 0) {\n result[y*W+x] = 1 + ((faction - 1) << 2);\n } else {\n result[y*W+x] = 0;\n }\n } else if ((c & 3) == 1) {\n if (this.live_cell_should_continue_living(x, y)) {\n result[y*W+x] = c;\n } else {\n result[y*W+x] = c + 1;\n }\n } else if ((c & 3) == 2) {\n result[y*W+x] = c + 1;\n } else {\n result[y*W+x] = 0;\n }\n }\n }\n this.data = result;\n },\n createDisplayIndices: function (canvas) {\n // This function should be called whenever the canvas is resized.\n var datalength = canvas.width * canvas.height;\n this.displayIndices = Array(datalength);\n for (var i = 0; i < datalength; ++i) {\n var cy = ~~(i / canvas.width);\n var cx = i % canvas.width;\n var py = margin + ~~((H - 2*margin) * cy / canvas.height);\n var px = margin + ~~((W - 2*margin) * cx / canvas.width);\n this.displayIndices[i] = py*W+px;\n }\n },\n display: function (canvas) {\n var context = canvas.getContext('2d');\n var imageData = context.getImageData(0, 0, canvas.width, canvas.height);\n var data = imageData.data;\n console.assert(data.length == canvas.width * canvas.height * 4);\n var datalength = canvas.width * canvas.height;\n var indices = this.displayIndices;\n console.assert(datalength == indices.length);\n for (var i = 0; i < datalength; ++i) {\n var color = this.data[indices[i]];\n data[4*i+0] = [32, 255, 192, 128, 32, 255, 255, 255, 32, 0, 0, 0][color];\n data[4*i+1] = [32, 64, 0, 0, 32, 255, 128, 0, 32, 255, 255, 32][color];\n data[4*i+2] = [32, 255, 192, 128, 32, 0, 0, 0, 32, 0, 128, 255][color];\n data[4*i+3] = 255;\n }\n context.putImageData(imageData, 0, 0);\n },\n draw_dragging_through: function (x, y) {\n console.assert(0 <= x && x < W);\n console.assert(0 <= y && y < H);\n this.data[y*W+x] += 1;\n this.data[y*W+x] %= 4;\n },\n };\n result.createDisplayIndices(canvas);\n return result;\n}", "function gridMap() {\n return {\n top_left: { _cx_cy_index: 4, drag_index : [ 2, 3, 4 ] },\n bottom_left: { _cx_cy_index : 3, drag_index : [ 1, 4, 3 ] },\n top_right: { _cx_cy_index : 2, drag_index : [ 4, 1, 2 ] },\n bottom_right: { _cx_cy_index : 1, drag_index : [ 3, 2, 1 ] }\n };\n }", "function generate(width, height) {\n\t\n\t// initialize walls\n\tvar map = [];\n\tfor(var x=0;x<width;x++) {\n\t\tmap[x] = [];\n\t\tfor(var y=0;y<height;y++) {\n\t\t\tmap[x][y] = {visited:false, walls: {left:true,right:true,bottom:true,top:true}};\n\t\t}\n\t}\n\n\t// generate walls\n\tvar x = r.nextRange(0, width), y = r.nextRange(0, height);\n\tvar stack = [];\n\twhile(true) {\n\t\tmap[x][y].visited = true;\n\t\t// select the next room to visit\n\t\tvar nextRoomOptions = [];\n\t\tif(x>0 && map[x-1][y].visited == false)\n\t\t\tnextRoomOptions.push({x:x-1,y:y});\n\t\tif(x<width-1 && map[x+1][y].visited == false)\n\t\t\tnextRoomOptions.push({x:x+1,y:y});\n\t\tif(y>0 && map[x][y-1].visited == false)\n\t\t\tnextRoomOptions.push({x:x,y:y-1});\n\t\tif(y<width-1 && map[x][y+1].visited == false)\n\t\t\tnextRoomOptions.push({x:x,y:y+1});\n\t\tif(nextRoomOptions.length == 0) {\n\t\t\tif(stack.length == 0)\n\t\t\t\tbreak;\n\t\t\tvar spos = stack.pop();\n\t\t\tx = spos.x;\n\t\t\ty = spos.y;\n\t\t\tcontinue;\n\t\t}\n\t\tstack.push({x:x,y:y});\n\t\tvar nextPosition = r.choice(nextRoomOptions);\n\t\t// open up the wall between this and the next room\n\t\tif(nextPosition.x < x && y == nextPosition.y) {\n\t\t\tmap[x][y].walls.left = false;\n\t\t\tmap[nextPosition.x][nextPosition.y].walls.right = false;\n\t\t} else if(nextPosition.x > x && y == nextPosition.y) {\n\t\t\tmap[x][y].walls.right = false;\n\t\t\tmap[nextPosition.x][nextPosition.y].walls.left = false;\n\t\t} else if(nextPosition.x == x && nextPosition.y < y) {\n\t\t\tmap[x][y].walls.top = false;\n\t\t\tmap[nextPosition.x][nextPosition.y].walls.bottom = false;\n\t\t} else if(nextPosition.x == x && nextPosition.y > y) {\n\t\t\tmap[x][y].walls.bottom = false;\n\t\t\tmap[nextPosition.x][nextPosition.y].walls.top = false;\n\t\t}\n\n\t\tx = nextPosition.x;\n\t\ty = nextPosition.y;\n\t}\n\t// initialize blocks\n\tvar blocks = [];\n\tfor(var x=0;x<width*2+1;x++) {\n\t\tblocks[x] = [];\n\t\tfor(var y=0;y<height*2+1;y++) {\n\t\t\tblocks[x][y] = true;\n\t\t}\n\t}\n\t// populate blocks\n\tfor(var x=0;x<width;x++) {\n\t\tfor(var y=0;y<height;y++) {\n\t\t\tvar m = map[x][y];\n\t\t\tif(m.visited === false)\n\t\t\t\tcontinue;\n\t\t\tblocks[x*2+1][y*2+1] = false;\n\t\t\tif(x>0 && m.walls.left == false)\n\t\t\t\tblocks[(x*2)-1+1][y*2+1] = false;\n\t\t\tif(x<width-1 && m.walls.right == false)\n\t\t\t\tblocks[(x*2)+1+1][y*2+1] = false;\n\t\t\tif(y>0 && m.walls.top == false)\n\t\t\t\tblocks[x*2+1][(y*2)-1+1] = false;\n\t\t\tif(y<height-1 && m.walls.bottom == false)\n\t\t\t\tblocks[x*2+1][(y*2)+1+1] = false;\n\t\t}\n\t}\n\t// reduce blocks\n\t// creates more open areas instead of narrow corridors\n\t// removes blocks that has 3 free sides\n\tfor(var i=0;i<10;i++) {\n\t\tfor(var x=0;x<blocks.length;x++) {\n\t\t\tfor(var y=0;y<blocks[x].length;y++) {\n\n\t\t\t\tvar sides = 0;\n\n\t\t\t\tif(x>0 && blocks[x-1][y] == false)\n\t\t\t\t\tsides++;\n\n\t\t\t\tif(y>0 && blocks[x][y-1] == false)\n\t\t\t\t\tsides++;\n\n\t\t\t\tif(x<blocks.length-1 && blocks[x+1][y] == false)\n\t\t\t\t\tsides++;\n\n\t\t\t\tif(y<blocks.length-1 && blocks[x][y+1] == false)\n\t\t\t\t\tsides++;\n\n\t\t\t\tif(sides>=3)\n\t\t\t\t\tblocks[x][y] = false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn blocks;\n}", "function makeN(){\n\tvar mimaps = [{'mi':5,'ma':7,'p':0.7},{'mi':8,'ma':10,'p':0.3}];\n\treturn wRand(mimaps);\n}", "makeBoard() {\n return new Array(this.height)\n .fill()\n .map(() => new Array(this.width).fill(0));\n }", "function minimapfunc(Wv, wM) {\n nmwmn(Wv + (250 * mn), wM);\n if (MvV.m !== 1) {\n MvV = wN.wvv(bordermapbig, MvV);\n return;\n }\n \n var mnmvW = nwMnv * NmM;\n var vNwWN = nwMnv * WWV;\n var nVm = win.Math.min(win.Math.max(0, mnmvW - WWn), vvVMV);\n var nmW = win.Math.min(win.Math.max(0, vNwWN - WWn), vvVMV);\n var WW = WWn * mn;\n Mm.drawImage(MvV, nVm, nmW, mVmWm, mVmWm, Wv, wM, WW, WW);\n \n if (SERVG.Vnn === SERVG.VMnnw) {\n if (SERVG.ME.GHOUL !== 0) vmnWW(-255, wM);\n else MnnvV(Wv + 50, wM, 1);\n }\n \n \n if (SERVG.Vnn === SERVG.VNVWN) {\n var wVvnN = SERVG.ME.Mwwnw[win.Math.floor(WWV / NnWnv)][win.Math.floor(NmM / NnWnv)];\n if (((wVvnN !== 0) && (wVvnN < SERVG.ME.wMwmv)) && (SERVG.ME.wMwmv !== 8)) {\n MvvNN = win.Math.min(1000, MvvNN + mV);\n Mm.globalAlpha = WNW.mWV.wWM(MvvNN / 500);\n wN.WM(WWmMW, nvm, 58, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n } else if (MvvNN > 0) {\n MvvNN = win.Math.max(0, MvvNN - mV);\n Mm.globalAlpha = WNW.mWV.wWM(MvvNN / 500);\n wN.WM(WWmMW, nvm, 58, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n }\n Mm.drawImage(MWNMV.W, nVm / 2, nmW / 2, WWn, WWn, Wv, wM, WW, WW);\n Mm.globalAlpha = (mWWwn > 600) ? WNW.mWV.vvw((1200 - mWWwn) / 600) : WNW.mWV.vvw(mWWwn / 600);\n mWWwn = (mWWwn + mV) % 1200;\n Mm.drawImage(MMvWn.W, nVm / 2, nmW / 2, WWn, WWn, Wv, wM, WW, WW);\n Mm.globalAlpha = 1;\n vmnWW(0, wM);\n MnnvV(Wv, wM, 0);\n } else if (SERVG.ME.GHOUL === 0) {\n if (SERVG.MnW.MWw.vww === 1) {\n WNmVW = win.Math.min(1000, WNmVW + mV);\n Mm.globalAlpha = WNW.mWV.wWM(WNmVW / 500);\n wN.WM(VmWNN, nvm, 58, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n } else if (WNmVW > 0) {\n WNmVW = win.Math.max(0, WNmVW - mV);\n Mm.globalAlpha = WNW.mWV.wWM(WNmVW / 500);\n wN.WM(VmWNN, nvm, 58, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n }\n }\n \n \n \n if (nVm >= vvVMV) mnmvW = win.Math.min(((mnmvW - VnvWV) / 2) + nWWwM, WWn - 8);\n else if (mnmvW < WWn) mnmvW = win.Math.max(15, mnmvW / 2);\n else mnmvW = nWWwM;\n if (nmW >= vvVMV) vNwWN = win.Math.min(((vNwWN - VnvWV) / 2) + nWWwM, WWn - 8);\n else if (vNwWN < WWn) vNwWN = win.Math.max(15, vNwWN / 2);\n else vNwWN = nWWwM;\n var wVw = Wv / mn;\n var VVm = wM / mn;\n \n \n \n if ((SERVG.ME.clan !== -1) || ((SERVG.ME.GHOUL !== 0) && (SERVG.WVw < 6))) {\n var socket = nNM.Wvm[mnW];\n for (var place = 0; place < SERVG.ME.nnnVN; place++) {\n var nmmvN = SERVG.ME.MVmNm[place];\n if (nmmvN.wmWMV < 0) continue;\n var ME = SERVG.socket[nmmvN.id];\n var wW;\n if (MNW === (ME.MNW + 1)) {\n var WMv = socket[ME.nnmnv];\n if (Vwv.MWV(ME.rx, ME.ry, WMv.x, WMv.y) < 1000) {\n ME.rx = WMv.x;\n ME.ry = WMv.y;\n }\n ME.x = WMv.x;\n ME.y = WMv.y;\n wW = WMv.angle;\n } else var wW = ME.x % WNVNM;\n var wwn = wVw + win.Math.max(15, win.Math.min(WWn - 15, (mnmvW - 3) + ((ME.rx - NmM) * nwMnv)));\n var Nmn = VVm + win.Math.max(15, win.Math.min(WWn - 15, (vNwWN - 3) + ((ME.ry - WWV) * nwMnv)));\n wN.WM(arrowiconmap, wwn, Nmn, wW, 0, 0, 1);\n }\n }\n \n \n if (SERVG.ME.VvWnm > 0) {\n var ME = SERVG.socket[SERVG.ME.karmaplayerid];\n if (MNW === (ME.MNW + 1)) {\n var socket = nNM.Wvm[mnW];\n var WMv = socket[ME.nnmnv];\n if (Vwv.MWV(ME.rx, ME.ry, WMv.x, WMv.y) < 1000) {\n ME.rx = WMv.x;\n ME.ry = WMv.y;\n }\n ME.x = WMv.x;\n ME.y = WMv.y;\n }\n wN.WM(karma[ME.VwVVw], wVw + win.Math.max(15, win.Math.min(WWn - 15, (mnmvW - 3) + ((ME.rx - NmM) * nwMnv))), VVm + win.Math.max(15, win.Math.min(WWn - 15, (vNwWN - 3) + ((ME.ry - WWV) * nwMnv))), 0, 0, 0, 1.25);\n }\n \n var wwn = wVw + (mnmvW - 3);\n var Nmn = VVm + (vNwWN - 3);\n wN.WM(arrowiconmap2, wwn, Nmn, myply.angle, 0, 0, 1);\n if ((SERVG.ME.GHOUL === 0) && ((SERVG.ME.MwV > 0) || (wnW.WMw > 0))) {\n var nn = (wnW.nn + mV) % 1000;\n wnW.nn = nn;\n if (wnW.nn < 500) Wv += 260 + (15 * WNW.mWV.vvw(nn / 500));\n else Wv += 260 + (15 * WNW.mWV.vvw((1000 - nn) / 500));\n Mm.globalAlpha = WNW.mWV.wWM(wnW.WMw);\n wN.WM(wnW, Wv, wM + 31, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n if ((SERVG.ME.MwV <= 0) || (windowobjects.MvN() === 1)) wnW.WMw = win.Math.max(0, wnW.WMw - (mV / 500));\n else if (wnW.WMw < 1) wnW.WMw = win.Math.min(1, wnW.WMw + (mV / 500));\n }\n }", "function minesweeper (inputGrid) {\n const outputGrid = [];\n for (let row = 0; row < inputGrid.length; row++) {\n\n let rowArray = [];\n for (let col = 0; col < inputGrid[0].length; col++) {\n\n if (inputGrid[row][col] === 1) {\n rowArray.push(9);\n } else {\n let total = 0;\n let neighboringCoordinates = getNeighboringCoordinates(row,col);\n neighboringCoordinates.forEach(cord => {\n total += inputGrid[cord[0]][cord[1]];\n });\n rowArray.push(total);\n }\n\n }\n outputGrid.push(rowArray);\n }\n return outputGrid;\n}", "function createLayer() {\r\n \r\n /* FUNCTION createLayer\r\n * Creates an empty layer of map size (WIDTH x HEIGHT)\r\n */\r\n \r\n return new Array(this.CONFIGURATION.WIDTH * this.CONFIGURATION.HEIGHT).fill(0);\r\n \r\n }", "function wallMaker() {\n\tvar height = mapArrays.length;\n // Because it's a square we only need to check the length of one line.\n var width = mapArrays[0].length;\n var bottomRowY = mapArrays.length-1;\n var lastColumnX = mapArrays[0].length - 1;\n // A little callback function created inside wallMaker so that we don't have to repeat the same 3 commands.\n function waller(wallThis) {\n wallThis.canMove = false;\n wallThis.description = \"A wall\";\n \twallThis.terrainType = \"wall\";\n wallThis.symbol = \"^\";\n wallThis.color = \"wall\";\n // Or whatever symbol we want to set it to.\n }\n // Walls the top row.\n for(var idx = 0; idx < width; idx++) {\n \tvar toWall = mapArrays[0][idx];\n waller(toWall);\n }\n // Walls the bottom row.\n for(var idx = 0; idx < width; idx++) {\n \tvar toWall = mapArrays[bottomRowY][idx];\n waller(toWall);\n }\n // Walls the sides. Ignores the top and bottom rows since they're already done.\n for(var idx = 1; idx < height-1; idx++) {\n \tvar toWall1 = mapArrays[idx][0];\n var toWall2 = mapArrays[idx][lastColumnX];\n waller(toWall1);\n waller(toWall2);\n }\n}", "createRowMap(colorSlots) {\n let rowMap = {};\n // keys in the row map are rows and values are columns in that rows\n // that are filled\n for (let i = 0; i < colorSlots.length; i++) {\n let slot = colorSlots[i];\n let row = this.getRow(slot);\n\n if (!rowMap[row]) {\n rowMap[row] = [this.getCol(slot)];\n } else {\n rowMap[row].push(this.getCol(slot));\n }\n }\n return rowMap;\n }", "function buildRow(cols, startNum, section, isTopEdge, isBottomEdge) {\n let row = document.createElement(\"div\");\n row.classList.add(\"cellHolder\");\n\n // for (let c = cols; c > 0; c--)\n for (let c = 0; c < cols; c++) {\n let id = c + startNum;\n\n var cellDiv = document.createElement(\"div\"); //make a div to contain each image and letter\n cellDiv.setAttribute(\"id\", \"c\" + id);\n cellDiv.classList.add(\"cellDiv\");\n row.appendChild(cellDiv);\n\n //var svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n let svg = oneHexagon();\n cellDiv.appendChild(svg);\n\n let letter = document.createElement(\"label\");\n letter.setAttribute(\"id\", \"l\" + id);\n\n letter.classList.add(\"cellLetter\");\n cellDiv.appendChild(letter);\n\n //empty array to hold the neighbours\n let n = [];\n\n if (c != 0) {\n // img.setAttribute(\"data-left\",id -1) // wil be ID number ...do we get rid of code that makes it\n n.push(id - 1);\n }\n // we need to push id+1 into the array\n // img.setAttribute(\"data-right\",id +1)\n if (c < cols - 1) {\n n.push(id + 1);\n }\n\n //deal with diagonal neighbours\n\n let isFirstColumn = c == 0;\n let isLastColumn = c == cols - 1;\n\n if (section == \"top\") {\n n.push(id + cols); //Below left\n n.push(id + cols + 1); //below Right\n if (!isFirstColumn && !isTopEdge) {\n n.push(id - cols); //Above left\n }\n if (!isLastColumn && !isTopEdge) {\n n.push(id - cols + 1); //Above right\n }\n } else if (section == \"middle\") {\n if (!isFirstColumn && !isTopEdge) {\n n.push(id - cols); //Above Left\n }\n if (!isLastColumn && !isTopEdge) {\n n.push(id - cols + 1); //Above right\n }\n if (!isFirstColumn && !isTopEdge) {\n n.push(id + cols - 1); //Below Left\n }\n if (!isLastColumn && !isTopEdge) {\n n.push(id + cols); //Below right\n }\n } else if (section == \"bottom\") {\n n.push(id - cols); //Below left\n n.push(id - cols - 1); //below Right\n\n if (!isLastColumn && !isBottomEdge) {\n n.push(id + cols); //Below right\n }\n if (!isFirstColumn && !isBottomEdge) {\n n.push(id + cols - 1); //Above right\n }\n }\n //ADD STRING C TO DATA-NEIGHBOURS\n // option 1\n // for(let i=0;i<n.length;i++){\n // \tn[i]=\"C\"+n[i];\n // }\n //option 2\n // n.forEach(function(element, index) {\n // \tn[index] = 'C' + element;\n // });\n //option 3\n n = n.map((i) => \"c\" + i);\n\n cellDiv.setAttribute(\"data-neighbours\", n.join(\",\"));\n }\n return row;\n}", "function generateTop480(){\r\n\tvar height = 0.9;\r\n\tvar Su0 = BEZIER(S0)([[0,0,0],[trainLength-0.13,0,0]]);\r\n\tvar Su1 = BEZIER(S0)([[0,trainWidth,0],[trainLength-0.13,trainWidth,0]]);\r\n\tvar control2 = [[0,0,0],[0,0,height],[0,trainWidth,height],[0,trainWidth,0]];\r\n\tvar Sv0 = BEZIER(S1)(control2);\r\n\tvar control3 = [[trainLength-0.13,0,0],[trainLength-0.13,0,height],[trainLength-0.13,trainWidth,height],[trainLength-0.13,trainWidth,0]];\r\n\tvar Sv1 = BEZIER(S1)(control3);\r\n\tvar out = MAP(COONS_PATCH([Su0,Su1,Sv0,Sv1]))(dom2D);\r\n\treturn STRUCT([T([0])([0.13]),out]);\r\n}", "function toIndex(x, y) {\n //y * map width and add x \n return ((y * mapW) + x)\n }", "function cellularAutomation(cavernWidth, cavernHeight, cavernArray, cavernSkeleton, iterations){\n if (iterations <= 0){\n return cavernArray;\n } else {\n var weightedArray = new Array();\n var otherWeightedArray = new Array();\n weightedArray = new Array();\n for (var i = 0; i < cavernHeight; i++){\n weightedArray[i]=new Array();\n for (var j = 0; j < cavernWidth; j++){\n weightedArray[i][j] = 0;\n }\n }\n otherWeightedArray = new Array();\n for (var i = 0; i < cavernHeight; i++){\n otherWeightedArray[i]=new Array();\n for (var j = 0; j < cavernWidth; j++){\n otherWeightedArray[i][j] = 0;\n }\n }\n // the good news about having that big border in cavernSkeleton is that we don't have to check edge cases, we can just start from\n // one layer in. TODO: remember this for the future when you start letting caves go off the edge of the map and the level generation\n // gets all weird.\n for (var i = 1; i < cavernHeight-1; i++){\n for (var j = 1; j < cavernWidth-1; j++){\n weightedArray[i][j] = cavernArray[i-1][j-1] + cavernArray[i-1][j] + cavernArray[i-1][j+1] + cavernArray[i][j-1] + cavernArray[i][j] + cavernArray[i][j+1] + cavernArray[i+1][j-1] + cavernArray[i+1][j] + cavernArray[i+1][j+1];\n }\n }\n for (var i = 2; i < cavernHeight-2; i++){\n otherWeightedArray[i] = new Array();\n for (var j = 2; j < cavernWidth-2; j++){\n otherWeightedArray[i][j] = cavernArray[i-2][j-2] + cavernArray[i-2][j-1] +cavernArray[i-2][j] +cavernArray[i-2][j+1] +cavernArray[i-2][j+2] +\n cavernArray[i-1][j-2] + cavernArray[i-1][j-1] + cavernArray[i-1][j] + cavernArray[i-1][j+1] + cavernArray[i-1][j+2] +\n cavernArray[i][j-2] + cavernArray[i][j-1] + cavernArray[i][j] + cavernArray[i][j+1] + cavernArray[i][j+2] +\n cavernArray[i+1][j-2] + cavernArray[i+1][j-1] + cavernArray[i+1][j] + cavernArray[i+1][j+1] + cavernArray[i+1][j+2] + \n cavernArray[i+2][j-2] + cavernArray[i+2][j-1] + cavernArray[i+2][j] + cavernArray[i+2][j+1] + cavernArray[i+2][j+2];\n }\n }\n\n //now update cavernArray so that cells are set to 1 if their weighting is at least 5 or the other weighting is 0;\n // set them to 0 otherwise (unless they're in the skeleton)\n for (var i = 0; i < cavernHeight; i++){\n for (var j = 0; j < cavernWidth; j++){\n if(cavernSkeleton[i][j] ==1){\n cavernArray[i][j] = 1;\n } else if (cavernSkeleton[i][j] == -1){\n cavernArray[i][j] = 0;\n } else {\n // update based on weightedArray and otherWeightedArray\n if(weightedArray[i][j] < 5 && otherWeightedArray[i][j] > 0){\n cavernArray[i][j] = 0;\n } else {\n cavernArray[i][j] = 1;\n }\n }\n }\n } \n iterations--;\n return cellularAutomation(cavernWidth, cavernHeight, cavernArray, cavernSkeleton, iterations);\n }\n}", "function createMatrix(w, h) {\n return [...Array(h).keys()].map(function createNewArray() {\n return new Array(w).fill(0);\n });\n // return [...Array(h).keys()].map(() => new Array(w))\n}", "function getColormap(){\n const map = new Uint8Array(networkSize*3);\n const index = [];\n\n for(let i = 0; i < networkSize; i++){\n index[network[i][3]] = i;\n }\n\n for(let i = 0, k=0; i < networkSize; i++){\n const j = index[i];\n map[k++] = network[j][0];\n map[k++] = network[j][1];\n map[k++] = network[j][2];\n }\n return map;\n }", "function miniMap(data, ctx) {\n\tvar scale = 10;\n\tvar imageData = ctx.createImageData(data[0].length*scale,data.length*scale)\n\tfor(var i = 0; i < data.length; i++) {\n\t\tfor(var j = 0; j < data[i].length; j++) {\n\t\t\tfor(var k = 0; k < scale; k++) {\n\t\t\t\tfor(var l = 0; l < scale; l++) {\n\t\t\t\t\tif (data[i][j].walkable==1) {\n\t\t\t\t\t\tsetPixel(imageData, j*scale+k, i*scale+l, 150, 150, 255, 255);\n\t\t\t\t\t} else if (data[i][j].walkable==2) {\n\t\t\t\t\t\tsetPixel(imageData, j*scale+k, i*scale+l, 100, 225, 100, 255);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetPixel(imageData, j*scale+k, i*scale+l, 150, 100, 100, 255);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tbase: imageData,\n\t\tcurrent: imageData,\n\t\tscale: scale\n\t}\n}", "function generateHeightmap({ width, height, number, scale }) {\n const data = []\n\n const seedPoints = []\n for (let i = 0; i < number; i++) {\n seedPoints.push([Math.random(), Math.random()])\n }\n\n let max = 0\n for (let i = 0; i < width; i++) {\n const row = []\n for (let j = 0; j < height; j++) {\n let min = Infinity\n seedPoints.forEach((p) => {\n const distance2 = (p[0] - i / width) ** 2 + (p[1] - j / height) ** 2\n if (distance2 < min) {\n min = distance2\n }\n })\n const d = Math.sqrt(min)\n if (d > max) {\n max = d\n }\n row.push(d)\n }\n data.push(row)\n }\n\n /* Normalize and scale. */\n for (let i = 0; i < width; i++) {\n for (let j = 0; j < height; j++) {\n data[i][j] *= scale / max\n }\n }\n return data\n}", "function create2D(heightMap, mapSize)\n{\n \n for(i = 0; i < mapSize+1; i++)\n {\n heightMap[i] = new Array();\n for(j = 0; j < mapSize+1; j++)\n {\n \n if((i == 0 && j == 0) ||\n (i == 0 && j == mapSize) ||\n (i == mapSize && j == 0) ||\n (i == mapSize && j == mapSize))\n {\n heightMap[i][j] = Math.random(); //make height \n }\n \n else\n {\n heightMap[i][j] = 0; \n }\n \n } \n }\n console.log(heightMap[0][0]);\n \n}" ]
[ "0.7099747", "0.6300533", "0.6058275", "0.5884678", "0.577169", "0.56844723", "0.56808746", "0.5654168", "0.5615094", "0.5613694", "0.55864066", "0.55722404", "0.55704874", "0.55683094", "0.5555177", "0.5552572", "0.55500966", "0.55494833", "0.5548978", "0.5544212", "0.5519269", "0.5492371", "0.5480938", "0.5477582", "0.5465205", "0.54539347", "0.544341", "0.5410823", "0.5368023", "0.53653705", "0.5319266", "0.53182447", "0.53165746", "0.53124064", "0.5302737", "0.52892214", "0.5271995", "0.5260293", "0.5255551", "0.525546", "0.52515507", "0.5219031", "0.5215142", "0.5208594", "0.520814", "0.52050215", "0.51947993", "0.51944125", "0.5190905", "0.5188652", "0.51873523", "0.5183109", "0.51790696", "0.51780504", "0.51740813", "0.5172915", "0.5146017", "0.5144975", "0.51425976", "0.5140241", "0.5132601", "0.51251143", "0.51231647", "0.5118881", "0.5118881", "0.5118332", "0.51123697", "0.5097857", "0.50911486", "0.50871825", "0.50863165", "0.508261", "0.50818", "0.50746185", "0.50714415", "0.50656587", "0.5063786", "0.50630504", "0.5055406", "0.5048058", "0.50439525", "0.5043098", "0.50332665", "0.503196", "0.50196135", "0.5019107", "0.50145674", "0.50043595", "0.50037473", "0.49953273", "0.49883613", "0.49842745", "0.49838138", "0.49819922", "0.4972414", "0.49707925", "0.4965259", "0.4965224", "0.49644443", "0.49632427" ]
0.6876692
1
Capitalize First Letter of string
function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LetterCapitalize(str) {\n return str.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "function capitalize(str) {}", "function capitalizeFirstLetter(string) {\n string=string.toLowerCase()\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstLetter(string) {\n\treturn string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstLetter(str) {\n\treturn str.charAt(0).toUpperCase() + str.substring(1);\n}", "capitalizeFirstLetter(word) {\n return (word.charAt(0).toUpperCase() + word.substring(1));\n }", "function capitalizeFirstLetter(string) {\n\t\t\t\t\treturn string.charAt(0).toUpperCase() + string.slice(1);\n\t\t\t\t}", "static capitalizeFirstLetter(string){\n return string.charAt(0).toUpperCase() + string.substring(1)\n }", "capitalizeFirstLetter(str) {\n let pattern = /(^|[-\\s])([a-zа-яё])/g;\n let normalizedName = str.toLowerCase();\n\n normalizedName = normalizedName.replace(pattern, function($2){\n \treturn $2.toUpperCase();\n });\n\n return normalizedName;\n }", "function capitaliseFirstLetter(string){\n\t\t\tvar newstring = string.toLowerCase();\n\t\t\treturn newstring.charAt(0).toUpperCase() + newstring.slice(1);\n\t\t}", "function capitalizeFirstLetter(string) {\n\treturn string.charAt(0).toUpperCase() + string.slice(1);\n}", "function fn_CapitalizeFirstChar(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function Capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "function Capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "capitalizeFirstLetter(string) {\n\t\treturn string.charAt(0).toUpperCase() + string.slice(1);\n\t}", "function capitalizeFirstLetter(input) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capFirstLetter(string){\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n }", "function capitalizeFirstLetter(string) {\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n}", "function capitalizeFirstLetter(string)\n{\n\treturn string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(text) {\n if (typeof text !== 'string') {\n return '';\n }\n return text.charAt(0).toUpperCase() + text.slice(1);\n }", "function capitaliseFirstLetter(string) {\n var pieces = string.split(\"\");\n pieces[0] = pieces[0].toUpperCase();\n return pieces.join(\"\");\n}", "function capitalizeFirstLetter (str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function sc_string_capitalize(s) {\n return s.replace(/\\w+/g, function (w) {\n\t return w.charAt(0).toUpperCase() + w.substr(1).toLowerCase();\n });\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0) + string.slice(1).toLowerCase();\n}", "function capitalizeFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "function capitalizeFirstLetter(string) {\n var modified = string.charAt(0).toUpperCase() + string.slice(1);\n return modified;\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitaliseFirstLetter(string) {\n try {\n return string.charAt(0).toUpperCase() + string.slice(1);\n } catch (e) {\n showErrorMsg(e);\n }\n }", "function LetterCapitalize(str) {\n str = str.toLowerCase().split(' ');\n for (let i = 0; i < str.length; i++) {\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n return str.join(' ');\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1)\n}", "function Capitalize(str) {\n \tvar first = str[0];\n\n \tif(isNaN(first))\n return first.toUpperCase() + str.slice(1);\n \telse \n \t return str;\n}", "function capitalizeLetter(str) {\n return str.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "function capitalize(str) {\n const firstLetter = str[0].toUpperCase()\n const rest = str.slice(1)\n return firstLetter + rest\n}", "function LetterCapitalize(str) { \n return str\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}", "function capitalizeFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n}", "function letterCapitalize(str) {\n str = str.split(\" \");\n\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n return str.join(\" \");\n}", "function capitalize(str) {\n const firstLow = firstCharacter(str);\n const rest = str.slice(1);\n const firstUp = firstLow.toUpperCase(str);\n return firstUp + rest;\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function firstLetterCap(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(str) {\n let strS=str.split(\" \");\n let strMap= strS.map((a)=>a.slice(0,1).toUpperCase()+a.slice(1));\n return strMap.join()\n}", "function firstLetterCapital(str){\n str = str.toLowerCase().split(' ');\n\n for (var i = 0; i < str.length; i++) {\n\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n\n return str.join(' ');\n}", "function capitalizeFirstLetter(string) {\n return !string ? '' : string.charAt(0).toUpperCase() + string.slice(1);\n}", "function cap_first(s) {\n return s[0].toUpperCase() + s.substring(1); \n}", "function capitalFirstLetter(name) {\n return name.charAt(0).toUpperCase() + name.slice(1)\n}", "function capitaliseFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstLetter(string) {\n const words = string.split(' ');\n for (let i = 0; i < words.length; i++) {\n words[i] = words[i][0].toUpperCase() + words[i].slice(1);\n };\n\n return words.join(' ');\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n}", "function capitalize(str) {\n if (str === '') return '';\n\n const firstLetter = str[0].toUpperCase();\n const rest = str.slice(1).toLowerCase();\n\n return `${firstLetter}${rest}`;\n}", "function firstLetterCap(string) {\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n}", "function capitalizeFirstLetter(inputString) {\n\n let newString = inputString.charAt(0).toUpperCase() + inputString.slice(1);\n\n return newString;\n \n}", "function uppercaseFirstLetter(str) {\n\treturn str[0].toUpperCase() + str.slice(1);\n\t// Prend la première lettre de la chaine de caractère reçu en param\n\t// La met en majuscule\n\t// concatène le reste de la chaine de caractère (toujours en minuscule) avec cette lettre en maj\n}", "function capitalizeFirstLetter(str)\n{\n var firstLetter = str.charAt(0);\n var otherChars = str.substr(1);\n\n return firstLetter.toUpperCase() + otherChars;\n\n}", "function capitalizeWord(string){\n var firstLetter = string.charAt(0); // takes first letter\n var goodString = firstLetter.toUpperCase() + string.slice(1); //capitalize and reattach\n return goodString;\n}", "function capfirst(str) {\n str = str.toLowerCase().replace(/\\b[a-z]/g, function (letter) {\n return letter.toUpperCase();\n });\n return str;\n}", "static capitalize(string){\n let firstLetter = string.slice(0,1).toUpperCase()\n return firstLetter + string.slice(1)\n }", "static capitalizeFirstLetter(string) {\n if(typeof string !== \"string\" || string === \"\") {\n return string;\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalize(s){\n\t\t\treturn s[0].toUpperCase() + s.slice(1);\n\t\t}", "function LetterCapitalize(str) { \n let words = str.split(' ');\n for (let i = 0; i < words.length; i++) {\n let word = words[i][0].toUpperCase() + words[i].slice(1);\n words[i] = word;\n }\n return words.join(' ');\n}", "function capitalie(str){\n\treturn str.charAt(0).toUpperCase() + str.slice(1);\n\n}", "function capitalize(input) {\n return input.replace(input.charAt(0), input.charAt(0).toUpperCase());\n}", "function capitalizeFirst(string) {\n return string.charAt(0).toUpperCase() + string.slice(1)\n }", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "function firstLetterCaps(string){\n return string[0].toUpperCase() + string.slice(1);\n }", "function capitaliseLetter(str) {\n return str[0].toUpperCase() + str.substring(1);\n}", "function capitalize(str) {\n const firstLetter = str.slice(0, 1);\n const capitalized = firstLetter.toUpperCase();\n return str.replace(firstLetter, capitalized);\n}", "function capitaliseFirstLetters(str) {\r\n var splitStr = str.toLowerCase().split(' ');\r\n for (var i = 0; i < splitStr.length; i++) {\r\n // Assign it back to the array\r\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\r\n }\r\n // Directly return the joined string\r\n return splitStr.join(' ');\r\n}", "function capitalize(str){\n\treturn str.charAt(0).toUpperCase() + str.slice(1);\n}", "function firstWordCapitalize(word){\n let firstCharcter = word[0].toUpperCase();\n return firstCharcter + word.slice(1);\n \n}", "function capitalizeFirst(s) {\n\n return s.substr(0, 1).toUpperCase() + s.substr(1);\n\n}", "function capFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "function LetterCapitalize(str) { \n var result = \"\";\n var lastLetter = \" \";\n \n // loop through each letter\n for (var i = 0; i < str.length; i++) {\n // if first letter or if last letter was a space, add capitalized letter to result\n if (lastLetter === \" \") {\n result += str[i].toUpperCase();\n }\n // else add current letter to result\n else {\n result += str[i];\n }\n \n // set lastLetter to current letter for next loop run\n lastLetter = str[i];\n }\n\n return result; \n}", "function capitalize(s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}", "function firstLetterCap(string){\n return result = string.charAt(0).toUpperCase() + string.slice(1);\n}", "function letterCapitalize(str) {\n const chunks = str.split(' ');\n const output = [];\n for (let i = 0; i < chunks.length; i++) {\n let chunk = chunks[i];\n if (chunk.charAt(0) !== chunk.charAt(0).toUpperCase()) {\n chunk = chunk.charAt(0).toUpperCase() + chunk.substr(1);\n }\n output.push(chunk);\n }\n return output.join(' ');\n}" ]
[ "0.842108", "0.8380864", "0.8375612", "0.83688587", "0.83629566", "0.83428496", "0.8338981", "0.8329437", "0.8315428", "0.83019686", "0.82882404", "0.8286483", "0.8285477", "0.8276344", "0.8276344", "0.82702726", "0.82702726", "0.82702726", "0.8266327", "0.8262205", "0.8257093", "0.82554084", "0.8254144", "0.8252208", "0.82473767", "0.82433295", "0.823375", "0.82323354", "0.8229281", "0.82247716", "0.82245094", "0.8220046", "0.8214656", "0.8204512", "0.8192043", "0.8187251", "0.81754076", "0.8157575", "0.81523615", "0.8149384", "0.8146945", "0.8146708", "0.8142255", "0.8141709", "0.8137324", "0.8137324", "0.8137324", "0.8137324", "0.8137324", "0.8137324", "0.8137324", "0.8132666", "0.8129432", "0.8129432", "0.8129432", "0.8129206", "0.8125848", "0.8119802", "0.8117582", "0.8116144", "0.8111921", "0.8111921", "0.80998397", "0.80894864", "0.8084538", "0.80779755", "0.80759543", "0.80664915", "0.8049171", "0.80488074", "0.8046695", "0.80296", "0.80295736", "0.80149716", "0.80137354", "0.80059856", "0.8003689", "0.79826254", "0.7978853", "0.79751277", "0.7972596", "0.79698753", "0.79590464", "0.79582965", "0.79577005", "0.79402274", "0.79397017", "0.79343295", "0.7931754", "0.7931437", "0.7924088", "0.79238856", "0.7922101" ]
0.81636435
44
Checks for string extension
function checkUrlExtension(url, typeOfExt) { var arr = typeOfExt == "img" ? ["jpeg", "jpg", "gif", "png"] : ["mp3"]; var ext = url.indexOf(".") != -1 ? url.substring(url.lastIndexOf(".") + 1) : ""; if ($.inArray(ext, arr) == -1) { return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function type_validator(_extention){\nif(_extention == undefined){return false;}\nvar index = supported_type.indexOf(String(_extention));\nif(index >= 0){\n return true\n}\nindex = supported_type.indexOf(String(_extention).replace(\".\",\"\"));\nif(index >= 0){\n return true\n}\nreturn false\n}", "function fileExtension(str){\n\n // code goes here\n\n}", "function isExtName(obj, isalert, msgType, showTarget) {\n var value = obj.value;\n var ext = obj.getAttribute(\"ext\");\n var ext_arr = ext.split(\",\");\n var s_num = value.lastIndexOf(\".\");\n var lastname = value.substring(s_num, value.length).toLowerCase();\n if (isalert) {\n if (ext_arr.in_array(lastname)) {\n return true;\n } else {\n if (msgType) {\n tipsAppend(showTarget, lastname + \"的文件格式不正确!\", \"error\", \"red\");\n } else {\n showDialog(lastname + \"的文件格式不正确!\", \"alert\", \"文件格式错误\", \"\", 0);\n }\n return false;\n }\n } else {\n if (ext_arr.in_array(lastname)) {\n return true;\n } else {\n return false;\n }\n }\n }", "hasExtension(fileName) {\n return (new RegExp(`(${this.props.imgExtension.join('|').replace(/\\./g, '\\\\.')})$`)).test(fileName);\n }", "supportedExt(filename) {\n let extensions = [\"doc\", \"docx\", \"odt\", \"pdf\", \"rtf\", \"txt\"];\n return extensions.some(ext => filename.endsWith(ext));\n }", "function stringEndsWithValidExtension(stringToCheck, acceptableExtensionsArray, required) {\n\tif (required == false && stringToCheck.length == 0) { return true; }\n\tfor (var i = 0; i < acceptableExtensionsArray.length; i++) {\n\t\tif (stringToCheck.toLowerCase().endsWith(acceptableExtensionsArray[i].toLowerCase())) { return true; }\n\t}\n\treturn false;\n}", "function isExtension(location, ext){\n\t\t\treturn getExtension(location) === ext;\n\t\t}", "hasExtension(fileName) {\n return (new RegExp('(' + appConstants.actionPicture.extensions.join('|').replace(/\\./ig, '\\\\.') + ')$')).test(fileName) ||\n (new RegExp('(' + appConstants.actionPicture.extensions.join('|').replace(/\\./ig, '\\\\.') + ')$')).test(fileName.toLowerCase());\n }", "function isExtension(value, key) {\n return _.startsWith(key, 'x-');\n}", "function checkDefaultExtension(loader, arg) {\n return loader.defaultJSExtensions && arg.substr(arg.length - 3, 3) != '.js'; \n }", "function checkDefaultExtension(loader, arg) {\n return loader.defaultJSExtensions && arg.substr(arg.length - 3, 3) != '.js'; \n }", "supportedExtExtract(filename) {\n let extensions = [\"csv\", \"doc\", \"docx\", \"eml\", \"epub\", \"gif\", \"htm\", \"html\",\n \"jpeg\", \"jpg\", \"json\", \"log\", \"mp3\", \"msg\", \"odt\", \"ogg\",\n \"pdf\", \"png\", \"pptx\", \"ps\", \"psv\", \"rtf\", \"tff\", \"tif\",\n \"tiff\", \"tsv\", \"txt\", \"wav\", \"xls\", \"xlsx\"];\n return extensions.some(ext => filename.endsWith(ext));\n }", "isSupportedExtension(filename) {\n const ext = path.extname(filename);\n let result = false;\n this.supportedExtensions.forEach((item) => {\n if (item === ext) {\n result = true;\n }\n });\n return result;\n }", "validExtension(value) {\n if (!this.fileExt) {\n return false;\n }\n\n const target = value || this.fieldValue;\n const params = { ext: this.fileExt };\n if (target && rules.fileext.validate(target, params)) {\n return true;\n }\n\n return false;\n }", "function checkExtension()\n{\n // for mac/linux, else assume windows\n var fileTypes = new Array('.ppt','.pptx','.jnt','.rtf','.pps','.pdf','.swf','.doc','.xls','.xlsx','.docx','.ppsx','.flv','.mp3','.wmv','.wav','.wma','.mov','.avi','.mpeg'); // valid filetypes\n var fileName = document.getElementById('fileupload').value; // current value\n var extension = fileName.substr(fileName.lastIndexOf('.'), fileName.length);\n var valid = 0;\n for(var i in fileTypes)\n {\n if(fileTypes[i].toUpperCase() == extension.toUpperCase())\n {\n valid = 1;\n break;\n }\n }\n return valid;\n}", "function extension (expectedExtension, filename) {\n\t verify(low.unemptyString(expectedExtension), 'missing expected extension', expectedExtension);\n\t verify(low.unemptyString(filename), 'missing filename', filename);\n\t var reg = new RegExp('.' + expectedExtension + '$');\n\t return reg.test(filename)\n\t}", "function isValidName(string) {\n\t\tvar test = new RegExp('[a-z]+[.]?[a-z]+', 'i');\n\t\treturn test.test(string);\n\t}", "static extension(url) {\n var name = this.name(url)\n if (!name.match(/\\./)) return undefined\n return name.toLowerCase().replace(/.*\\./,\"\") \n }", "function hasFileExt(url)\n{\n var filename = url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('?'));\n return filename.lastIndexOf('.') >= 0;\n}", "function suffixCheck () {\n const prohibitedTypes = [\n /\\.xml$/,\n /\\.pdf$/,\n ];\n const currentUrl = window.location.pathname;\n for (const type of prohibitedTypes) {\n if (type.test(currentUrl)) {\n return false;\n }\n }\n return true;\n}", "function extensionValida(nombre) {\n\n var nombreSplit = nombre.split('.'); // Nombre del Archivo\n var extension = nombreSplit[nombreSplit.length - 1]; // Extension del Archivo\n\n if (extensionesValidas.indexOf(extension) < 0) {\n return null;\n }\n return extension;\n}", "function domainCheck(string) {\n if (!LetterDot(string)) {\n alert(\"Domain can only contain alphabets or period(.)\");\n document.getElementById(\"email\").value = \"\";\n return;\n }\n let domainExtArr = string.split(\".\"); //still in array\n let domainExtArrLen = domainExtArr.length;\n if (\n domainExtArrLen >= 2 &&\n domainExtArrLen <= 4 && //for 2-4 extensions\n domainExtArr[0].length !== 0\n ) {\n //domain input\n if (\n domainExtArr[domainExtArrLen - 1].length >= 2 && //2-3 char in last extension\n domainExtArr[domainExtArrLen - 1].length <= 3 \n // && domainExtArr[domainExtArrLen - 1] === 'com'\n )\n {\n return true;\n }\n }\n return false;\n }", "function tryExtensions(p, exts, isMain) {\n\t for (var i = 0; i < exts.length; i++) {\n\t const filename = tryFile(p + exts[i]);\n\n\t if (filename) {\n\t return filename;\n\t }\n\t }\n\t return false;\n\t }", "function endsWith(stringA, extension) {\n\t\t\treturn -1 !== stringA.indexOf(extension, stringA.length - extension.length);\n\t\t}", "function getExtension(fn) {\n return fn.split('.').pop();\n}", "function checkString (input, error, extra) {\n const regExName = /^[a-zA-Z '.-]*$/\n if (input.length >= extra && (regExName.test(input))) {\n return true\n }\n error.classList.remove('hidden')\n return false\n}", "function checkAcceptedExtensions (file) \n{\n\tconst type = file.type.split('/').pop()\n\tconst accepted = ['jpeg', 'jpg', 'png', 'gif', 'pdf','webp']\n\tif (accepted.indexOf(type) == -1) {\n\t\treturn false\n\t}\n\treturn true\n}", "function imageNameCheck(string)\n {\n //http://stackoverflow.com/questions/336210/regular-expression-for-alphanumeric-and-underscores\n var res = string.match(/^[a-z0-9._ -]+$/i);\n if(res==null)\n {\n swal(\"Oops...\", \"Only English alphabet, numbers, space, '.', '-' and '_' is allowed for image/video name\", \"error\");\n return false;\n }\n else\n return true;\n }", "function checkDomainExtension(lastOctateVal){\n var ext = \".\" + lastOctateVal;\n for (var i = 0; i <= domainNameExt.length - 1; i++) {\n if (ext == domainNameExt[i]) \n return true;\n }\n return false;\n}", "function checkFileType() {\n var validFileType = false;\n var regexFileType = /(?:\\.([^.]+))?$/; //whats my extention?\n var checkValidFileType = regexFileType.exec(fileName)[1];\n var validFileTypes = [\"jpeg\", \"png\", \"gif\", \"jpg\"]; //which file types are valid?\n\n for(var i = 0; i < validFileTypes.length; i++){\n if(validFileTypes[i] === checkValidFileType){\n validFileType = true;\n }\n }\n\n if(validFileType){\n return true;\n }else{\n return false;\n }\n\n }", "function isValidFileType(fName, fType) {\n\t\treturn extensionLists[fType].indexOf(fName.split('.').pop().toLowerCase()) > -1;\n\t}", "function validateFileExtension(obj){\n\n\tvar allowedFiles = [\".jpeg\", \".jpg\", \".png\", \".JPGE\", \".JPG\", \".PNG\"];\n\n var fileUpload = $(obj); \n\n var regex = new RegExp(\"([a-zA-Z0-9\\s_\\\\.\\-:])+(\" + allowedFiles.join('|') + \")$\");\n\n if (!regex.test(fileUpload.val().toLowerCase())) \n\n return false;\n\n return true;\n\n}", "function getMimeTypeExt(string){\n var compare = string.substring(0,6)\n if (compare.match('image/')){\n return string.substring(6,)\n }\n}", "static isAlphanumericExt(name) {\n return /^[\\sa-zA-Z][\\w\\s\\-]*$/.test(name);\n }", "function isFileName(str) {\r\n var pattern = \"\\\\/:*?\\\"<>|\"; // illegal characters \\ / : * ? \" < > |\r\n\r\n if (str == null || str.length == 0 || str.length > 255) return false;\r\n\r\n var i = 0;\r\n for (i = 0; i < str.length; i++) {\r\n if (pattern.indexOf(str.substr(i, 1)) >= 0) return false;\r\n }\r\n return true;\r\n}", "function checkFormat(filename, extensions) {\n if (extensions)\n return extensions.reduce((prevExt, currExt) => (checkNewExt(filename, prevExt.length, currExt) ? currExt : prevExt), '');\n else\n return '';\n}", "function tryExtensions(p, exts) {\n for (var i = 0, EL = exts.length; i < EL; i++) {\n var filename = tryFile(p + exts[i]);\n\n if (filename) {\n return filename;\n }\n }\n return false;\n}", "function noExt (s) { return s.replace(/\\.[^*]+$/, \"\")}", "function isAllowedFileExtensionWhiteList(ext) {\n\tif (!window.acceptedFileExtensions) {\n\t\twindow.acceptedFileExtensions =\n\t\t{\n\t\t\t'.123':1,'.3g2':1,'.3gp':1,'.3gp2':1,'.7z':1,'.aac':1,'.abw':1,'.abx':1,'.accdb':1,'.accde':1,\n\t\t\t'.accdr':1,'.accdt':1,'.accfl':1,'.ace':1,'.ade':1,'.adp':1,'.aeh':1,'.ai':1,'.aif':1,'.aiff':1,\n\t\t\t'.amr':1,'.apng':1,'.arc':1,'.art':1,'.asc':1,'.asf':1,'.asx':1,'.atom':1,'.au':1,'.avi':1,\n\t\t\t'.awt':1,'.azw':1,'.azw1':1,'.b64':1,'.backup':1,'.bin':1,'.bmp':1,'.bz':1,'.bz2':1,'.bzip':1,\n\t\t\t'.bzip2':1,'.cab':1,'.caf':1,'.cgm':1,'.crtx':1,'.css':1,'.csv':1,'.cwk':1,'.dap':1,'.db':1,\n\t\t\t'.dbf':1,'.dcr':1,'.dds':1,'.dex':1,'.dib':1,'.dif':1,'.diz':1,'.dmg':1,'.doc':1,'.docm':1,\n\t\t\t'.docx':1,'.dot':1,'.dotm':1,'.dotx':1,'.drw':1,'.ds_store':1,'.dv':1,'.dvr-ms':1,'.dwf':1,'.dwg':1,\n\t\t\t'.dxf':1,'.emf':1,'.eml':1,'.emlx':1,'.emz':1,'.eot':1,'.eps':1,'.fbp':1,'.fdp':1,'.fhtml':1,\n\t\t\t'.file':1,'.flac':1,'.flc':1,'.fli':1,'.flp':1,'.flv':1,'.fm':1,'.fm2':1,'.fm3':1,'.fm5':1,\n\t\t\t'.fmp':1,'.fnt':1,'.fon':1,'.fp':1,'.fp3':1,'.fp5':1,'.fp7':1,'.fphtml':1,'.fpt':1,'.fpweb':1,\n\t\t\t'.fpx':1,'.gg':1,'.gif':1,'.gnumeric':1,'.gra':1,'.gsm':1,'.gz':1,'.hdmov':1,'.hdp':1,'.hqx':1,\n\t\t\t'.htm':1,'.html':1,'.ical':1,'.icns':1,'.ico':1,'.ics':1,'.ifo':1,'.indd':1,'.isf':1,'.isu':1,\n\t\t\t'.ivs':1,'.jbf':1,'.jpe':1,'.jpeg':1,'.jpf':1,'.jpg':1,'.jxr':1,'.key':1,'.kml':1,'.kmz':1,\n\t\t\t'.knt':1,'.kth':1,'.lhz':1,'.lit':1,'.log':1,'.lrc':1,'.lrf':1,'.lrx':1,'.lst':1,'.lyr':1,\n\t\t\t'.m4a':1,'.m4b':1,'.m4p':1,'.m4r':1,'.mdb':1,'.mde':1,'.mht':1,'.mhtml':1,'.mid':1,'.midi':1,\n\t\t\t'.mim':1,'.mix':1,'.mng':1,'.mobi':1,'.mod':1,'.moi':1,'.mov':1,'.movie':1,'.mp3':1,'.mp4':1,\n\t\t\t'.mpa':1,'.mpc':1,'.mpe':1,'.mpeg':1,'.mpg':1,'.mpv2':1,'.msg':1,'.mswmm':1,'.mxd':1,'.numbers':1,\n\t\t\t'.odb':1,'.odf':1,'.odg':1,'.ods':1,'.odx':1,'.ofm':1,'.oft':1,'.ogg':1,'.ogm':1,'.ogv':1,\n\t\t\t'.one':1,'.onepkg':1,'.opx':1,'.osis':1,'.ost':1,'.otf':1,'.oth':1,'.p65':1,'.p7b':1,'.pages':1,\n\t\t\t'.pbm':1,'.pcast':1,'.pcf':1,'.pcm':1,'.pct':1,'.pcx':1,'.pdc':1,'.pdd':1,'.pdf':1,'.pdp':1,\n\t\t\t'.pfx':1,'.pgf':1,'.pic':1,'.pict':1,'.pkg':1,'.pmd':1,'.pmf':1,'.png':1,'.pot':1,'.pothtml':1,\n\t\t\t'.potm':1,'.potx':1,'.ppam':1,'.pps':1,'.ppsm':1,'.ppsx':1,'.ppt':1,'.ppthtml':1,'.pptm':1,'.pptx':1,\n\t\t\t'.prc':1,'.ps':1,'.psd':1,'.psp':1,'.pspimage':1,'.pst':1,'.pub':1,'.pubhtml':1,'.pubmhtml':1,'.qbb':1,\n\t\t\t'.qcp':1,'.qt':1,'.qxd':1,'.qxp':1,'.ra':1,'.ram':1,'.ramm':1,'.rar':1,'.raw':1,'.rax':1,\n\t\t\t'.rm':1,'.rmh':1,'.rmi':1,'.rmm':1,'.rmvb':1,'.rmx':1,'.rp':1,'.rss':1,'.rt':1,'.rtf':1,\n\t\t\t'.rts':1,'.rv':1,'.sbx':1,'.sdf':1,'.sea':1,'.shs':1,'.sit':1,'.sitx':1,'.smil':1,'.snapfireshow':1,\n\t\t\t'.snp':1,'.stc':1,'.svg':1,'.svgz':1,'.swf':1,'.sxc':1,'.sxi':1,'.tab':1,'.tar':1,'.tex':1,\n\t\t\t'.tga':1,'.thmx':1,'.tif':1,'.tiff':1,'.tpz':1,'.tr':1,'.trm':1,'.tsv':1,'.ttf':1,'.txt':1,\n\t\t\t'.uue':1,'.vcf':1,'.vob':1,'.vrml':1,'.vsc':1,'.vsd':1,'.wab':1,'.wav':1,'.wax':1,'.wbk':1,\n\t\t\t'.wbmp':1,'.wdp':1,'.webarchive':1,'.webloc':1,'.wk1':1,'.wk3':1,'.wm':1,'.wma':1,'.wmf':1,'.wmmp':1,\n\t\t\t'.wmv':1,'.wmx':1,'.wpd':1,'.wps':1,'.wri':1,'.wvx':1,'.xbm':1,'.xcf':1,'.xg0':1,'.xg1':1,\n\t\t\t'.xg2':1,'.xg3':1,'.xg4':1,'.xht':1,'.xhtm':1,'.xhtml':1,'.xif':1,'.xlam':1,'.xlb':1,'.xlc':1,\n\t\t\t'.xld':1,'.xlk':1,'.xlm':1,'.xls':1,'.xlsb':1,'.xlshtml':1,'.xlsm':1,'.xlsmhtml':1,'.xlsx':1,'.xlt':1,\n\t\t\t'.xlthtml':1,'.xltm':1,'.xltx':1,'.xlv':1,'.xlw':1,'.xml':1,'.xpi':1,'.xps':1,'.xsf':1,'.xsn':1,\n\t\t\t'.xtp':1,'.zabw':1,'.zip':1,'.zipx':1\n\t\t};\n\t}\n\t\n\treturn (window.acceptedFileExtensions[(ext + '').toLowerCase()] === 1);\n}", "function containsDotFile(parts){for(var i=0;i<parts.length;i++){if(parts[i][0]==='.'){return true;}}return false;}", "function file_ext(file) {\n return (/[.]/.exec(file)) ? /[^.]+$/.exec(file.toLowerCase()) : '';\n }", "function isValidLocal(str)\r\n\t{\r\n // REPLACE THIS CODE WITH YOUR isValidLocal() METHOD\r\n var ch = str.charAt(0);\r\n if (ch == \".\" || ch == \"_\") {\r\n return false;\r\n }\r\n for(var i = 1; i < str.length; ++i) {\r\n var ch = str.charAt(i);\r\n var valid = ((ch >= \"A\" && ch <= \"Z\") || (ch >= \"a\" && ch <= \"z\") \r\n || (ch >= \"0\" && ch <= \"9\") || ch == \".\" || ch == \"_\");\r\n if (!valid) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n\t}", "function checkExtension(fileFieldId, allowedExtensions)\n{\t\n\tvar filename = eval(formName + fileFieldId).value;\n\t\n\tfilename = trimText(filename);\n\n\tif(filename.length==0)\n\t\treturn true;\n\n\tif(filename.indexOf(\".\")==-1)\n\t\treturn false;\n\t\n\tvar extension = filename.substr(filename.lastIndexOf(\".\")+1,(filename.length));\n\t\t\t\t\t\n\tif(allowedExtensions.indexOf(\"*.*\")!=-1)\n\t\treturn true;\n\telse\n\t{\t\n\t\tvar extArr = allowedExtensions.split(',');\n\t\tfor(i=0;i<extArr.length;i++)\n\t\t{\n\t\t\tif(extension.toUpperCase()==extArr[i].toUpperCase())\n\t\t\t\treturn true;\n\t\t}\n\t}\n}", "function checkIfNoIllegalCharacters ( name ) {\n return ( name.indexOf(\".\") === -1 ) &&\n ( name.indexOf(\"/\") === -1 ) &&\n ( name.indexOf(\":\") === -1) &&\n ( name.indexOf(\"*\") === -1 );\n }", "function extReg(ext) {\n var parse_ext = /[a-zA-Z0-9\\/]/,\n res;\n if (ext && typeof ext === 'string' && parse_ext.test(ext)) {\n res = new RegExp(\"[\\\\w\\\\-\\\\/]+\\\\.\" + ext, \"g\");\n return res;\n }\n else {\n throw new Error('ERROR : \"' + ext + '\" is not a file extension');\n }\n}", "function isExtglobChar(ch) {\n return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';\n}", "function isExtglobChar(ch) {\n return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';\n}", "function isExtglobChar(ch) {\n return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';\n}", "function isExtglobChar(ch) {\n return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';\n}", "function tryExtensions(p, exts, isMain) {\r\n for (var i = 0; i < exts.length; i++) {\r\n\r\n var filename = tryFile(p + exts[i], isMain);\r\n\r\n if (filename) {\r\n return filename;\r\n }\r\n }\r\n return false;\r\n}", "function checkNewExt(filename, oldExtLen, newExt) {\n return newExt.length > oldExtLen && filename.endsWith(newExt);\n}", "function xStr(s)\n{\n for (var i=0, l=arguments.length; i<l; ++i) {\n if (typeof(arguments[i]) !== 'string')\n return false;\n }\n return true;\n}", "get extension()\t{ return this.match[10] || \"\" }", "function tryExtensions (p, exts) {\n for (let i = 0, EL = exts.length; i < EL; i++) {\n let filename = tryFile(p + exts[i])\n\n if (filename) {\n return filename\n }\n }\n return false\n}", "function checkFileName(fileName, extensionName) {\n\n //File name elements to check against\n var exhibitName = ['albedo', 'sallyride'];\n var pathways = ['engineer', 'biologist', 'climatologist','default'];\n var location = ['top', 'right', 'left', 'bottom', 'middle','background'];\n var extension = [\n 'png',\n 'svg',\n 'jpeg',\n 'jpg',\n 'gif',\n 'bmp',\n 'SVG',\n 'PNG',\n 'JPEG',\n 'JPG',\n 'GIF',\n 'BMP',\n 'mp4',\n 'mov',\n 'avi',\n 'amv',\n 'wmv',\n 'MP4',\n 'MOV',\n 'AVI',\n 'AMV',\n 'WMV'\n ];\n var name = fileName;\n\n var bool = 0; //returns -1 if check is unsuccessful\n console.log(\"The current file name is \" + name);\n\n //check that there exists two '-'\n var parsedName = name.split('-')\n if (parsedName.length != 3) {\n return -1;\n }\n\n //check exhibit exists\n bool = exhibitName.lastIndexOf(parsedName[0]);\n if (bool === -1) {\n console.log(\"parsedName[2] is:\" + parsedName[0]);\n return -1;\n }\n\n //check pathway exists\n bool = pathways.lastIndexOf(parsedName[1]);\n if (bool === -1) {\n console.log(\"parsedName[2] is:\" + parsedName[1]);\n return -1;\n }\n\n //Check location exists\n bool = location.lastIndexOf(parsedName[2]);\n if (bool === -1) {\n console.log(\"parsedName[2] is:\" + parsedName[2]);\n return -1;\n }\n\n //Check if extension is a valid image extension\n bool = extension.lastIndexOf(extensionName);\n if (bool === -1) {\n console.log(\"image extension is:\" + extensionName);\n return -1;\n }\n\n return 0; //Returns 0 if naming scheme is followed correctly\n}", "function _matchingFileExtension(relativePath) {\n\t// check if file has an aceptable extension to process\n\t// toLower() so it's not case sensitive\n\tvar ext = path.extname(relativePath).toLower();\n\treturn acceptableExtensions.indexOf(ext) > -1;\n}", "function isFilenameValid(name) {\n return /^[A-Za-z0-9][A-Za-z0-9\\._\\-]*$/.test(name)\n}", "function getExtension(_filename){\n let extension =_filename.split('.');\n extension=extension[extension.length-1];\n return extension.toLowerCase();\n\n}", "function isImageFileName(filename) {\n var extension = filename.split(\".\")[filename.split(\".\").length - 1];\n var known_extensions = [\"png\", \"jpg\", \"jpeg\", \"gif\", \"tiff\", \"bmp\", \"webp\"];\n return known_extensions.includes(extension.toLowerCase());\n }", "function isImageFileName(filename) {\n var extension = filename.split(\".\")[filename.split(\".\").length - 1];\n var known_extensions = [\"png\", \"jpg\", \"jpeg\", \"gif\", \"tiff\", \"bmp\", \"webp\"];\n return known_extensions.includes(extension.toLowerCase());\n }", "function normalizeExtension(extension) {\n if (extension.length > 0 && extension.indexOf('.') !== 0) {\n extension = `.${extension}`;\n }\n return extension;\n }", "function normalizeExtension(extension) {\n if (extension.length > 0 && extension.indexOf('.') !== 0) {\n extension = \".\" + extension;\n }\n return extension;\n }", "function normalizeExtension(extension) {\n if (extension.length > 0 && extension.indexOf('.') !== 0) {\n extension = \".\" + extension;\n }\n return extension;\n }", "function getExtension(url) {\n var a = url.split('.');\n\n if (a.length === 1 || (a[0] === '' && a.length === 2))\n return '';\n return a.pop();\n }", "function xStr(s)\r\n{\r\n for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}\r\n return true;\r\n}", "function checkExtensionOfUploadFile(type, extension){\n\n\tvar ext = null;\n\tif(type == Poi.CUSTOM_FIELDS.TYPE.IMAGE) {\n\n\t\text = extension === '.png' ? \".png\" : null ||\n\t\t\t\t\textension === '.jpg' ? \".jpg\" : null ||\n\t\t\t\t\textension === '.gif' ? \".gif\" : null;\n\n\t} else if(type == Poi.CUSTOM_FIELDS.TYPE.VIDEO){\n\n\t\text = extension === '.mp4' ? \".mp4\" : null;\n\n\t} else if(type == Poi.CUSTOM_FIELDS.TYPE.AUDIO) {\n\n\t\text = extension === '.mp3' ? \".mp3\" : null ||\n\t\t\t\t\textension === '.ogg' ? \".ogg\" : null;\n\n\t} else if (type == Poi.CUSTOM_FIELDS.TYPE.FILE) {\n\n\t\text = extension ? extension : null;\n\n\t}\n\n\treturn ext;\n\n}", "function LetterDot(string) {\n return /^[a-zA-Z.]+$/.test(string);\n }", "function xStr(s)\n{\n for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}\n return true;\n}", "function getExt(nombre){\n return nombre.split('.').pop();\n}", "function validateFileBeforeUpload (file){\n // file type checking \n var validFormats = ['jpg','jpeg','png'];\n var filename = file.name;\n var ext = filename.substr(filename.lastIndexOf('.')+1);\n var matchExt = false;\n for (var index = 0; index < validFormats.length; index++) {\n if(ext == validFormats[index]){\n matchExt = true; \n }\n \t}\n \t return matchExt; \n\t}", "function CheckFileExtension(fileName, allowedExtensions) {\n\t extensionArray = allowedExtensions.split(\",\");\n\t fileNameArray = fileName.split(\".\");\n\t if(fileNameArray.length != 2) {\n\t\t return false;\n\t }\n\t extCheck = false;\n\t for(extCount = 0; extCount < extensionArray.length; extCount ++) {\n\t\t if(extensionArray[extCount] == fileNameArray[1]) {\n\t\t\t extCheck = true;\n\t\t\t break;\n\t\t }\n\t }\n\t return extCheck;\n}", "getFileExtension1(filename) {\r\n return /[.]/.exec(filename) ? /[^.]+$/.exec(filename)[0] : undefined;\r\n }", "function fileViewerEndsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n }", "function validFileType (file) {\n var extensionPatt = /\\.mp4|mkv|avi$/i\n return extensionPatt.test(file)\n}", "function tryExtractTypeScriptExtension(fileName) {\n return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); });\n }", "function getFileExtension(filename) {\n var pos = filename.lastIndexOf('.');\n if (pos != -1)\n return filename.substring(pos+1);\n else // if '.'' never occurs\n return '';\n }", "function extname(filename) {\n\treturn path.extname(filename).slice(1).toLowerCase();\n}", "function checkFile(strValue, strFileType)\n\t{\n\t\tvar strExtension = strValue.substr((strValue.lastIndexOf(\".\") + 1), strValue.length);\n\t\tvar arrExtension = strFileType.split(\",\");\n\t\tvar bFound = false;\n\t\tfor(var i = 0; i < arrExtension.length;i++)\n\t\t{\n\t\t\tif(strExtension.toLowerCase() == arrExtension[i].toLowerCase())\n\t\t\t{\n\t\t\t\tbFound = true;\n\t\t\t}\n\t\t}\n\t\treturn bFound;\n\t}", "get extname() {\n return typeof this.path === 'string' ? path.extname(this.path) : undefined\n }", "function validateVideoFileExtension(obj){\n\n var allowedFiles = [\".mp4\", \".webm\", \".ogg\"];\n\n var fileUpload = $(obj); \n\n var regex = new RegExp(\"([a-zA-Z0-9\\s_\\\\.\\-:])+(\" + allowedFiles.join('|') + \")$\");\n\n if (!regex.test(fileUpload.val().toLowerCase())) \n\n return false;\n\n return true;\n\n}", "function validateType (fileName){\n //console.log(fileName);\n //let fileType = (fileName).split(\".\");\n let fileType = (fileName.split(\".\"))[1].toLowerCase();\n console.log(fileType);\n if (fileType == \"jpg\" || fileType == \"jpeg\" || fileType == \"gif\" || fileType == \"png\"){\n //if((fileType.find(type => type==\"jpg\" || type==\"jpeg\" ||type==\"gif\" || type==\"png\")) !== undefined){\n return true;\n } else {\n return false;\n }\n }", "function getExtension(filename) {\n return filename.substr(filename.lastIndexOf('.') + 1).toLowerCase();\n}", "function isValidDomain(str){\r\n flag_dot = 0\r\n hiphen = 0\r\n var len = str.length;\r\n if ( len > 0 )\r\n {\r\n \t// Can't start with a dot or an underscore\r\n\t\tif ( str[0]!='.' && str[0]!='_' && str[len-1]!= '.')\r\n\t\t\t{\r\n\t\t\t// Everything else should be alphabet, number or '.' or '_'\r\n\t\t\tvar ctr=0;\r\n\t\t\twhile (ctr < len && ( (str[ctr] >= 'A' && str[ctr] <= 'Z') || (str[ctr] >= 'a' && str[ctr] <= 'z') || ( str[ctr] >= '0' && str[ctr] <= '9') || str[ctr] == '.' || str[ctr] == '-' ))\r\n\t\t\t\t{\r\n if(str[ctr] == '.') flag_dot += 1\r\n if(str[ctr] == '-') hiphen += 1\r\n\t\t\t\tctr++;\r\n\t\t\t\t}\r\n\t\t\tif (ctr==len && flag_dot == 1 && hiphen <= 1)\r\n\t\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\treturn false;\r\n}", "get extname() {\n return typeof this.path === 'string' ? path$1.extname(this.path) : undefined\n }", "function getExtensionFile(filename) {\n return (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename) : undefined;\n}", "function stringFilter(file) {\n var type = mime.lookup(file);\n return type && (mime.charset(file) || checkXML.test(type));\n}", "hasExtension(extensionName) {\n return Boolean(this._extensionsUsed && this._extensionsUsed.indexOf(extensionName) > -1);\n }", "getFileExtension() {\n throw new TypeError(\"Stub.\");\n }", "normalizeExtension(path) {\r\n if (path_1.default.extname(path) == \".js\")\r\n path = path.substring(0, path.length - path_1.default.extname(path).length);\r\n if (path_1.default.extname(path) == \"\")\r\n path += \".json\";\r\n return path;\r\n }", "function _get_extention(filename)\n\t\t{\n\t\t\treturn filename.split('.').pop();\n\t\t}", "function comprobarExtension(campo){\n var exp = /^(jpg|png|jpeg)$/;\n var parts = campo.value.split(\".\");\n var ext = parts[parts.length-1];\n\n if (exp.test(ext) == false ){// se comprueba que la extension tenga el formato adecuado\n document.getElementById(campo.name+\"_error\").style.visibility = \"visible\";\n campo.style.border = \"2px solid red\";\n return false;\n }else {\n document.getElementById(campo.name+\"_error\").style.visibility = \"hidden\";\n campo.style.border = \"2px solid green\";\n return true;\n }\n}", "function validate_uploadfile_format(fileName,filterType)\n {\n \n var allowed_extensions1 = new Array(\"jpeg\",\"jpg\",\"png\",\"gif\");\n var allowed_extensions2 = new Array(\"pdf\",\"doc\",\"docs\");\n var allowed_extensions12 = new Array(\"jpeg\",\"jpg\",\"png\",\"gif\",\"pdf\",\"doc\",\"docx\");\n \n var file_extension = fileName.split('.').pop(); // split function will split the filename by dot(.), and pop function will pop the last element from the array which will give you the extension as well. If there will be no extension then it will return the filename.\n\n if(filterType == 'image'){\n for(var i = 0; i <= allowed_extensions1.length; i++)\n {\n if(allowed_extensions1[i]==file_extension)\n {\n return 'true'; // valid file extension\n }\n }\n }\n if(filterType == 'docs'){\n for(var i = 0; i <= allowed_extensions2.length; i++)\n {\n if(allowed_extensions2[i]==file_extension)\n {\n return 'true'; // valid file extension\n }\n }\n }\n \n if(filterType == 'imgdocs'){\n for(var i = 0; i <= allowed_extensions12.length; i++)\n {\n if(allowed_extensions12[i]==file_extension)\n {\n return 'true'; // valid file extension\n }\n }\n }\n \n \n \n return 'false';\n }", "function getExtensionFromName(fileName) {\n\n try {\n\n var fileExt = \"\";\n var lastDotIndex = -1;\n\n if (typeof fileName != 'undefined' && fileName.length > 0) {\n lastDotIndex = fileName.lastIndexOf(\".\");\n }\n if (lastDotIndex > -1) {\n fileExt = fileName.substr(lastDotIndex + 1, fileName.length - lastDotIndex - 1);\n }\n\n return fileExt.toLowerCase();\n } catch (e) { alertExceptionDetails(e); }\n}", "function getExtension(filename) {\n const dot = filename.lastIndexOf('.');\n if (dot === -1) return '';\n return filename.substring(dot + 1, filename.length);\n }", "function safeString (stringToCheck) {\n return (\n validator.isAscii(stringToCheck) &&\n validator.matches(stringToCheck, /^((\\w)*[-.]?(\\w)*)*$/)\n );\n}", "function getFileExtension(filename){\t\n\treturn filename.substr(filename.lastIndexOf('.')+1);\n}", "function getExtension(filename) {\n return filename.split('.').pop();\n }", "function getExtension(filename) {\n var i = filename.lastIndexOf('.');\n return (i < 0) ? '' : filename.substr(i);\n}", "function string_check(string) {\n if (typeof string !== 'string') {\n error(\"ADsafe string violation.\");\n }\n return string;\n }", "function isAllowedFileExtensionPDF(filename) {\n\t//cut out the path portion\n\twhile (filename.indexOf(\"/\", 0) > 0)\n\t\tfilename = filename.substr(filename.indexOf(\"/\", 0) + 1, filename.length - filename.indexOf(\"/\", 0))\n\twhile (filename.indexOf(\"\\\\\", 0) > 0)\n\t\tfilename = filename.substr(filename.indexOf(\"\\\\\", 0) + 1, filename.length - filename.indexOf(\"\\\\\", 0))\n\n\tvar lastPeriod, i, fileExtension;\n\tlastPeriod = filename.indexOf(\".\", 0);\n\ti = lastPeriod;\n\twhile (lastPeriod > 0) {\n\t\ti = lastPeriod;\n\t\tlastPeriod = filename.indexOf(\".\", i + 1);\n\t}\n\n\tif (i > 0)\n\t\tfileExtension = filename.substr(i + 1, filename.length - i).toUpperCase();\n\telse\n\t\tfileExtension = \"\";\n\n\tswitch (fileExtension) {\n\t\tcase \"GIF\":\n\t\tcase \"JPG\":\n\t\tcase \"JPEG\":\n\t\tcase \"PNG\":\n\t\tcase \"HTM\":\n\t\tcase \"HTML\":\n\t\tcase \"DOC\":\n\t\tcase \"DOCX\":\n\t\tcase \"XLS\":\n\t\tcase \"XLSX\":\n\t\tcase \"TXT\":\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tdefault:\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t}\n}" ]
[ "0.6928145", "0.68992615", "0.67724186", "0.6716921", "0.6670673", "0.6658165", "0.6654943", "0.65865076", "0.6583341", "0.6562029", "0.6562029", "0.6407334", "0.6400999", "0.6357022", "0.633308", "0.6323063", "0.6251263", "0.6238019", "0.622181", "0.618022", "0.6162779", "0.6134006", "0.6101136", "0.608959", "0.6077257", "0.6069367", "0.60622436", "0.60445213", "0.6028481", "0.6001673", "0.5993246", "0.5970885", "0.5967214", "0.59634423", "0.5960833", "0.5954327", "0.59526116", "0.59489375", "0.5932261", "0.5921774", "0.59192556", "0.5917168", "0.590305", "0.58894795", "0.5860733", "0.5858332", "0.5858332", "0.5858332", "0.5858332", "0.58513206", "0.5845248", "0.5824", "0.5819982", "0.58056444", "0.58016074", "0.57921153", "0.57812625", "0.5769423", "0.5768346", "0.5768346", "0.5761783", "0.57556397", "0.57556397", "0.5746343", "0.57451946", "0.57373106", "0.5731523", "0.5729633", "0.5721925", "0.5704423", "0.57023656", "0.568735", "0.56841636", "0.56828755", "0.5680203", "0.567317", "0.5653237", "0.5652671", "0.5626882", "0.56176895", "0.56148595", "0.5600537", "0.55995", "0.5595568", "0.55945075", "0.55882925", "0.55842954", "0.5575464", "0.556487", "0.55605274", "0.5556953", "0.55453694", "0.55452645", "0.5535726", "0.55110145", "0.55080503", "0.55046177", "0.5504392", "0.54909337", "0.54908997" ]
0.6489098
11
Merge options onto `app.options`. Use `app.option()` method if one exists.
function mergeOptions(app, options) { if (typeof app.option === 'function') { app.option(options); } else { var opts = utils.merge({}, app.options, options); utils.merge(options, opts); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mergeOptions (options, notMerge, lazyUpdate) {\n this.delegateMethod('setOption', options, notMerge, lazyUpdate)\n }", "mergeOptions() {\n\t\tthis.config = _.defaultsDeep(this.configFile, ServiceBroker.defaultOptions);\n\n\t\tthis.config = this.overwriteFromEnv(this.config);\n\n\t\tif (this.flags.silent) this.config.logger = false;\n\n\t\tif (this.flags.hot) this.config.hotReload = true;\n\n\t\t// console.log(\"Merged configuration\", this.config);\n\t}", "function config(opt) {\n options = Object.assign({}, options, opt);\n }", "setOptions(options) {\n this.options = deepExtend({}, this.defaultOptions, options);\n }", "setOptions(options) {\n Object.assign(this.options, options || {});\n return this.options;\n }", "get options() {}", "function setup (options) {\n App.config = _.deepExtend(defaults, options);\n }", "setOptions(options) {\n if (typeof options !== 'undefined') {\n for (let key in options) {\n this.options[key] = options[key];\n }\n }\n }", "function fix(options) {\n if (app === null) {\n app = Object.create(appProto);\n }\n if (typeof options === 'object') {\n $.extend(app, options);\n }\n return app;\n }", "set options(value) {}", "set options(options) {\n const {\n debug = false,\n clientId,\n endpoint = 'https://stream.bionic-app.com/flags',\n } = options;\n this._options = {\n debug,\n clientId,\n endpoint,\n };\n }", "setOptions (options) {\n for(let [i, val] of Object.entries(this.opt)) {\n if(options.hasOwnProperty(i)) {\n this.opt[i] = options[i];\n }\n }\n }", "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 }", "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 }", "function setGlobalOptions(options) {\n if (typeof options !== 'object') {\n throw new TypeError('\"options\" argument needs to be an object!');\n }\n logSettings_1.logger.info('\"setGlobalOptions\" got called with', options);\n for (const key of Object.keys(options)) {\n data_1.globalOptions[key] = Object.assign({}, data_1.globalOptions[key], options[key]);\n }\n}", "updateOptions(options, ...args) { return args; }", "function updateOptions(options)\n\t{\n\t\t_options = jQuery.extend(true, {}, _options, options);\n\t}", "function ExtraOptions() {}", "function ExtraOptions() {}", "setOptions(options) {\n this._options = options || {};\n }", "function ExtraOptions(){}", "function ExtraOptions() { }", "function ExtraOptions() { }", "function getOptions(options){\n // TODO: move to argv module that provides documentation\n var argv = require('minimist')(process.argv.slice(2));\n var _ = require('underscore');\n\n if (options === undefined) options = {};\n\n // Handle common runtime overrides\n var cliOptions = {\n port: argv.p,\n appName: argv.n,\n collectStats: argv['collect-stats'],\n maxListeners: argv['max-listeners']\n };\n\n // Handle environment variables\n var environmentOptions = {\n port: process.env.PORT,\n appName: process.env.APP_NAME,\n collectStats: process.env.COLLECT_STATS,\n maxListeners: process.env.MAX_LISTENERS\n };\n\n // Make sure necessary options are in place\n var defaultOptions = {\n port: 3000,\n collectStats: false\n };\n\n _.defaults(options, cliOptions, environmentOptions, defaultOptions);\n\n // Make sure types are valid\n options.port = Number(options.port);\n\n return options;\n}", "function mergeDefaultOptions(options) {\n Object.keys(examiner.defaultOptions).forEach(function(name) {\n if (options[name] == null) {\n options[name] = examiner.defaultOptions[name];\n }\n });\n}", "constructor(options) {\n\t\tthis.options = Object.assign({}, defaultOptions, options)\n\t}", "setOptions(options) {\n for (var name in options) {\n if (options.hasOwnProperty(name)) {\n this.setOption(name, options[name])\n }\n }\n return this\n }", "function generateBuildOptions(metadata, options) {\n const results = Object.assign({}, command_1.filterOptionsByIntent(metadata, options), command_1.filterOptionsByIntent(metadata, options, 'app-scripts'));\n // Serve specific options not related to the actual run or emulate code\n return Object.assign({}, results, { externalAddressRequired: true, iscordovaserve: true, nobrowser: true, target: 'cordova' });\n}", "optionsUpdateHook() { }", "injectRootOptions(file, options) {\n const _options =\n this.installer.rootOptions[file] ||\n (this.installer.rootOptions[file] = new Set());\n (Array.isArray(options) ? options : [options]).forEach(opt => {\n _options.add(opt);\n });\n }", "setOptions(options) {\n\n // save for later use\n this.options = Object.assign(DEFAULT_OPTIONS, options);\n\n if(this.options.Binding) {\n SerialPort.Binding = this.options.Binding;\n }\n }", "setOptions(options) {\n this.options = options;\n }", "get options() {\n return this.__options;\n }", "get options() {\n return this._options;\n }", "function setOptions(new_options) {\n options = jQuery.extend({}, defaults, options, new_options);\n }", "function setOptions(new_options) {\n options = jQuery.extend({}, defaults, options, new_options);\n }", "combineOptions(options) {\n let defaults = {\n fitPosition: 'center center',\n addContainer: true\n };\n\n this.options = {\n ...defaults,\n ...options\n };\n }", "function mergeOptions(optionObjs) {\n return mergeProps(optionObjs, complexOptions);\n } // TODO: move this stuff to a \"plugin\"-related file...", "function configure(user_options) {\n options = inherit(options, user_options);\n}", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function mergeOptions(options, type) {\n return _extends({}, options, {\n type: type,\n toastId: getToastId(options)\n });\n}", "function mergeOptions(options, type) {\n return _extends({}, options, {\n type: type,\n toastId: getToastId(options)\n });\n}", "static _normalizeOptions (options) {\n return options\n }", "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "async function onOptionsUpdated() {\n globalOptions = await getNewOptions(null);\n}", "get options() {\n Observable.track(this, \"options\");\n return this._options;\n }", "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "function configure(user_options) {\n options = inherit$1(options, user_options);\n }", "get options() {\n Observable.track(this, \"options\");\n return this._options;\n }", "function mergeOptions(options, type) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({}, options, {\n type: type,\n toastId: getToastId(options)\n });\n}", "function extend(settings, opt) {\n for (var attr in opt) {\n settings[attr] = opt[attr];\n }\n}", "setGlobalLogOptions(options) {\n jitsi_meet_logger__WEBPACK_IMPORTED_MODULE_21___default.a.setGlobalOptions(options);\n }", "function setOptions(options) {\n for(var optionKey in options) {\n if(optionKey in _options) {\n _options[optionKey] = options[optionKey];\n }\n }\n }", "function setup(opt) {\n\t\tObject.extend(lang, opt.lang || {});\n\t\tdelete opt.lang;\n\t\tObject.extend(options, opt || {});\n\t}", "options () {\n return Object.assign({}, defaultConfig, this.chartOptions)\n }", "function mergeOptions(options, type) {\n return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, options, {\n type: type,\n toastId: getToastId(options)\n });\n}", "function mergeOptions(options, type) {\n return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, options, {\n type: type,\n toastId: getToastId(options)\n });\n}", "function mergeOptions(options, type) {\n return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, options, {\n type: type,\n toastId: getToastId(options)\n });\n}", "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}", "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}", "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}", "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}", "function mergeOptions(optionObjs){return util_1.mergeProps(optionObjs,complexOptions);}", "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);\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}", "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;\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}", "constructor(app, configKey = 'authentication', options = {}) {\n if (!app || typeof app.use !== 'function') {\n throw new Error('An application instance has to be passed to the authentication service');\n }\n this.app = app;\n this.strategies = {};\n this.configKey = configKey;\n app.set('defaultAuthentication', app.get('defaultAuthentication') || configKey);\n app.set(configKey, merge_1.default({}, app.get(configKey), options));\n }" ]
[ "0.6586097", "0.6392027", "0.6390061", "0.62914187", "0.6240641", "0.6217867", "0.61463195", "0.6084719", "0.60140634", "0.59662414", "0.592318", "0.59116346", "0.5908685", "0.58994037", "0.5808822", "0.579319", "0.57713825", "0.57581747", "0.57581747", "0.575082", "0.57170624", "0.5716246", "0.5716246", "0.5707199", "0.5705663", "0.5634778", "0.55855656", "0.5566963", "0.5554206", "0.5550103", "0.5549161", "0.55485815", "0.5540321", "0.55155057", "0.551335", "0.551335", "0.55106765", "0.5507267", "0.54760414", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.54439783", "0.5436682", "0.5424821", "0.5424821", "0.54071075", "0.5402071", "0.5402071", "0.5402071", "0.5402071", "0.5402071", "0.5402071", "0.5402071", "0.5402071", "0.5398598", "0.5398598", "0.53970903", "0.5390537", "0.5388359", "0.5388359", "0.5388359", "0.5388359", "0.5388359", "0.53767663", "0.5375868", "0.5348034", "0.53434813", "0.5342666", "0.53308344", "0.5308634", "0.53013265", "0.52899104", "0.52899104", "0.52899104", "0.5287869", "0.5287869", "0.5287869", "0.5287869", "0.52814275", "0.52810264", "0.52729243", "0.52629507" ]
0.82860786
0
This will add the listInput into the List of Tasks, assigning it a random number of points
function addToList(){ listInput = $('#category').val()+": "+$('#task').val(); points = (Math.floor(Math.random()*10)+1); liString = listInput+" | "+points+" "; if(listInput != '') { $.post('/addTask', { 'category': $('#category').val(), 'description': $('#task').val(), 'points': points },function(result) { alert(result); $('#taskList').append("<li id='"+currentTasks+"'> "+liString+ "<button onclick='specialComplete(\""+listInput+ "\","+points+","+currentTasks+")'> Finished Task </button>"+"</li>"); $('#task').val(''); $('#category').val(''); currentTasks += 1; }) } else { alert('Nothing entered into Input'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTask() {\n 'use strict';\n var task = document.getElementById('task');\n var output = document.getElementById('output');\n var message = [];\n\n if (task.value) {\n tasks.push(task.value);\n task.value = '';\n rNum = Math.floor(Math.random() * tasks.length);\n message = ['<h2>To-Do</h2><ol>'];\n for (var i = 0, count = tasks.length; i < count; i++) {\n message = ['<li>' + tasks[rNum] + '</li>'];\n }\n message = ['</ol>'];\n output.innerHTML = message.join();\n } // End of task.value IF.\n\n // Return false to prevent submission:\n return false;\n\n} // End of addTask() function.", "function addTask(list) {\n console.log(task);\n createList(task).then((data) => {\n if (data.error) {\n console.log(data.error);\n } else {\n console.log(data.data);\n setItems((prevValues) => {\n return [...prevValues, data.data];\n });\n setTask('');\n }\n });\n }", "function insertNewTask() {\n let newTask = document.getElementById(\"input_new_task\").value;\n let obj = {};\n obj['id'] = taskCount;\n obj['task'] = newTask;\n obj['complete'] = false;\n tasksList.push(obj);\n taskCount += 1;\n const finalData = generateTasksList();\n document.getElementById(\"divTasksList\").innerHTML = finalData;\n document.getElementById(\"input_new_task\").value = '';\n}", "function createRandomTasks() {\n\t\t// creaun arreglo con 50 posiciones vacias y contruye la tarea\n\t\t// con datos variables\n\t\tconst randomTasks = [...Array(50)].map((task, index) => ({\n\t\t\ttitle: `Tarea ${index + 1}`,\n\t\t\tdescription: `Esta es la tarea aleatoria ${index + 1}`,\n\t\t\tduration: 1500 + index,\n\t\t\ttimerType: 1,\n\t\t\tisCompleted: true,\n\t\t\tcreatedAt: dayjs().subtract(index, 'hour'),\n\t\t\tcompletedTime: Math.floor(((1500 + index) * getRandomInt()) / 100)\n\t\t}));\n\t\t// hace las peticiones para guardar las tareas\n\t\trandomTasks.forEach((task, index) => {\n\t\t\tif(index === 49) {\n\t\t\t\tSwal.fire('Tareas aleatorias', 'Tareas creadas con éxito', 'success');\n\t\t\t}\n\n\t\t\tdispatch(requestAddTask(task))\n\t\t});\n\t\n\t}", "async addTask(input = { tasklistId: '0' }) {\n\n return await this.request({\n name: 'task.add',\n args: [input.tasklistId],\n params: {\n 'todo-item': input['todo-item']\n }\n });\n\n }", "function createTask(event) {\n event.preventDefault();\n document.getElementById(\"currentCount\").innerHTML = \"0 \";\n const taskList = JSON.parse(localStorage.getItem('task')) || [];\n const taskName = document.querySelector(\"[name='taskName']\").value;\n const taskDescription = document.querySelector(\"[name='taskDescription']\").value;\n const taskIcon = document.getElementById(\"pickedIcon\").src;\n const taskDeadlineInput = document.querySelector(\"[name='taskDeadlineInput']\").value;\n const taskMembers = [];\n const taskChecklistUl = document.getElementsByClassName(\"checkListLi\");\n var taskCheckListArray = [];\n const taskHeight = \"230px\";\n\n if(taskName == \"\") {\n console.log(\"missing taskname\");\n document.getElementById(\"missingInputName\").style.visibility = \"visible\";\n setTimeout(\"document.getElementById('missingInputName').style.visibility = 'hidden'\", 5000);\n return false;\n }\n\n for(var i = 0; i < taskChecklistUl.length; i++) {\n var taskChecklist = {\n checkPointName : taskChecklistUl[i].innerHTML,\n checked : false\n };\n taskCheckListArray.push(taskChecklist);\n\n }\n console.log(taskChecklistUl)\n \n let taskId = Math.floor(Math.random() * 1000);\n const task = { taskId, taskName, taskDescription, taskIcon, taskCheckListArray, taskMembers, taskDeadlineInput, taskHeight};\n taskList.push(task);\n window.localStorage.setItem('task', JSON.stringify(taskList));\n\n event.target.reset();\n hideSection(addTaskSection);\n renderTaskList();\n}", "async addTasklist(input = { projectId: '0' }) {\n\n return await this.request({\n name: 'tasklist.add',\n args: [input.projectId],\n params: {\n 'todo-item': input['todo-item']\n }\n });\n\n }", "function addTask() \n{\n //Create a Variable to hold the Input Value\n var task = document.getElementById(\"inputValue\").value;\n //Clear off the Input Value after saving it in the task variable\n document.getElementById(\"inputValue\").value = \"\";\n //Add the task into our Array\n taskList.push(task);\n \n //Display the latest list of tasks\n displayList();\n}", "function addTask(input) {\n var listItem = createTask(input.value); // create the list item\n var taskList = $(input).siblings(\".taskList\").first(); // ul (taskList)\n\n // if there is no ul\n if (taskList.length > 0)\n taskList.append(listItem);\n else { // else create ul and add listText to it\n var ul = document.createElement(\"ul\");\n $(ul).addClass(\"taskList\");\n $(ul).append(listItem);\n $(ul).insertAfter(input);\n }\n bindTaskEvents(listItem);\n input.value = \"\";\n }", "function addTaskToList(task, list){\r\n //What is the task? @parameter task\r\n //Where is the task going? @List Parameter\r\n //What order / priority? lowest on the bottom(push)\r\n return list.push({\r\n text: task, completed: false\r\n });\r\n}", "function addTask() {\n // Create task\n let newTask;\n \n // Get task name from form\n taskName = $(\"#task-input\").val()\n\n // Add caracteristics to newTask\n newTask = new Task(taskName, false, tasks.length);\n\n // Add task to list of tasks\n tasks.push(newTask);\n\n // Reset value of field\n $(\"#task-input\").val(\"\")\n updateUI();\n\n}", "function createTasks(evt){\n var setA = [\"1a\", \"2a\", \"4a\"];\n var setB = [\"1b\", \"2b\", \"4b\"];\n var randomSet = [];\n\n setA.sort(function() { return 0.5 - Math.random() });\n setB.sort(function() { return 0.5 - Math.random() });\n\n for(var i = 0; i <= 4; i++){\n var choseSet = Math.floor((Math.random() * 2) + 1);\n\n if(choseSet == 1){\n randomSet[i] = \"task_\" + setA[i];\n randomSet[i + 5] = \"task_\" + setB[i];\n }else if(choseSet == 2){\n randomSet[i] = \"task_\" + setA[i];\n randomSet[i + 5] = \"task_\" + setB[i];\n }\n }\n console.log(randomSet);\n\n window.setTimeout(function(){\n loadTasks(randomSet);\n }, 100);\n window.setTimeout(function(){\n $('#nextSession').show();\n }, 1000);\n}", "function add(random){\n namelist.push(random);\n}", "function addListAfterClick() {\n if (inputlength() > 0) {\n addTask();\n }\n}", "function createNewTask(taskInput) {\n var newTask = document.createElement('li');\n var newTaskHeader = document.createElement('h1');\n var newTaskButtonDelete = document.createElement('button');\n var newTaskButtonComplete = document.createElement('button');\n\n newTaskButtonDelete.innerText = 'Delete';\n newTaskButtonDelete.classList.add('deleteTaskButton');\n newTaskButtonComplete.innerText = 'Complete';\n newTaskButtonComplete.classList.add('completeTaskButton');\n newTaskHeader.innerText = taskInput.value;\n newTask.appendChild(newTaskHeader);\n newTask.appendChild(newTaskButtonDelete);\n newTask.appendChild(newTaskButtonComplete);\n\n //cross out complete tasks on click of 'Complete' button\n newTaskButtonComplete.addEventListener('click',function(event) {\n\n //if it is not completed\n var taskText = this.parentElement.querySelector('h1');\n if (this.parentElement.className.indexOf('done') == -1) {\n taskText.style.textDecoration = 'line-through';\n taskText.style.color = 'grey';\n this.parentElement.classList.add('done');\n subtractCount();\n } else {\n taskText.style.textDecoration = 'none';\n taskText.style.color = 'initial';\n this.parentElement.classList.remove('done');\n addCount();\n }\n });\n\n //remove list item on click of 'Delete' button\n newTaskButtonDelete.addEventListener('click',function(event) {\n this.parentElement.parentElement.removeChild(this.parentElement);\n subtractCount();\n });\n\n addCount();\n\n return newTask;\n }", "function createTask(event){\nconst li = document.createElement('li');\nconst inputBox = document.getElementById('new-task-description');\nconst list = document.getElementById('tasks');\nli.innerHTML = inputBox.value;\nlist.appendChild(li);\nevent.target.reset()\n}", "addTask(task) {\n this.listTask = [...this.listTask, task];\n }", "function addItem(){\n // Check to see if there is a value in the input textbox.\n if (inputText.value == \"\"){\n // If so, exit the function.\n return;\n }\n\n // If there is an input, add it to the list.\n // Create a date object.\n let timeStamp = new Date();\n\n // Make a new task object.\n let newTask = {id: timeStamp, content: inputText.value, completed: false};\n\n // Append the object to the array.\n list.push(newTask);\n\n // Print the list again.\n printList();\n\n // Remove the text from the textbox.\n inputText.value = \"\";\n\n // Save the list to local storage.\n saveList(list);\n}", "function startRoulette(){\n if($('#currentTask').text()=='') {\n allTasks = $('#taskList').children('li');\n taskToDoIndex = Math.floor(Math.random()*allTasks.length);\n currentTaskPosition = taskToDoIndex;\n task = $('#taskList li').get(taskToDoIndex).innerHTML;\n task = task.split('|');\n task[1] = parseInt(task[1]);\n $('#currentTask').text('The Roulette Assigned Task Is : ' + task[0]);\n $('#pointsAvailable').text('The Number of Points Up For Grabs are : '+task[1]);\n $('#completed').show();\n }\n else {\n alert(\"Haven't Finished the current task yet!\");\n }\n}", "function addTask() {\n //criou um elemento item\n const tarefa = document.createElement('li')\n //adicionou o conteudo do input ao item\n tarefa.innerText = input.value\n //adicionou o item à div listaTarefas\n listaTarefas.appendChild(tarefa)\n }", "function placeTasks(){\n let app = $(\"#current-tasks\");\n let taskList = document.createElement('ul');\n app.append(taskList);\n loadTasks().then((tasks)=>{\n tasks.forEach(task=>{\n newTask(task.name, task.id);\n });\n });\n }", "addTask(task) {\n const taskList = this.state.taskList;\n\n // might want to arrange this as a dictionary later on\n let newTask = {\n // generate unique id\n id: crypto.randomBytes(16).toString(\"hex\"),\n name: task[0],\n date: task[1],\n type: task[2],\n isFinished: task[3],\n notes: task[4]\n }\n\n // add the new task into the state\n this.setState({\n taskList: taskList.concat(newTask),\n taskListLength: taskList.length,\n })\n\n // API call to insert into DB \n this.createNewTask(newTask);\n }", "push(task){\n task.id = this.list.length;\n this.list.push(task); \n }", "function randomNumber() {\n pick = Math.floor(Math.random() * parkList.length);\n}", "function addTasks() {\n const text =\n document.getElementById('enter-task').value;\n if (text) {\n tasks.push(new Task(text)); // somehow connect the tasks to the list they are in (optional-ish)\n showTasks();\n }\n // window.localStorage.setItem(lists, JSON.stringify(text));\n }", "function addTask(input_todo) {\n let todo_list = document.getElementById(\"todo_list\");\n \n addButton(\"check\", todo_list);\n \n let li = addListItem(todo_list);\n \n // Assign the value to the new item\n li.innerHTML = input_todo;\n\n // Store the task in localStorage\n localStorage.setItem(\"index\", index++);\n localStorage.setItem(\"task\" + index, li);\n\n addButton(\"delete_item\", todo_list);\n}", "function addItem(){\n const item = document.createElement(\"li\");\n item.innerText = input.value;\n taskList.append(item);\n\n clearInput();\n \n}", "function addTask() {\n 'use strict';\n\n // Get the task:\n var task = document.getElementById('task');\n\n // Reference to where the output goes:\n var output = document.getElementById('output');\n\n \n // For the output:\n var message = '';\n\n if (task.value) {\n \n // Add the item to the array:\n tasks.push(task.value);\n \n // Update the page:\n message = '<h2>To-Do</h2><ol>';\n for (var i = 0, count = tasks.length; i < count; i++) {\n message += '<li>' + tasks[i] + '</li>';\n }\n message += '</ol>';\n output.innerHTML = message;\n \n } // End of task.value IF.\n\n \n\n // Return false to prevent submission:\n return false;\n \n} // End of addTask() function.", "generateList(number) {\n let tmpNode = new Node(0, Math.random());\n this.list = new ListItem(tmpNode);\n let p1 = this.list;\n for (let i = 1; i < number; i++) {\n tmpNode = new Node(i, Math.random());\n p1.next = new ListItem(tmpNode);\n p1 = p1.next;\n p1.key = tmpNode;\n }\n }", "function appendToDo () {\n userInput = $('#userInput').val();\n if (userInput) {\n taskId += 1;\n $('#todoList').append(\"<li class='task' id=\" + taskId + \">\" + userInput + \"</li>\");\n $('#userInput').val('');\n }\n else {\n console.log(\"ERROR - NO INPUT\");\n }\n}", "function add() {\n rl.question(`\\nWhat?\\n>`, (answer) => {\n list.push({\n task: answer,\n done: false\n })\n menu();\n });\n}", "addToList(e){\n e.preventDefault();\n let tempList = this.state.list.slice();\n tempList.push({\n task: document.getElementById(\"taskInput\").value,\n done: false,\n id: this.state.maxId});\n this.setState({list: tempList});\n this.setState({maxId: this.state.maxId + 1})\n }", "function createListTasks(tasks) {\n const listTasks = document.getElementById(\"list-tasks\");\n for (const task of tasks) {\n const taskNode = createTaskNode(task);\n listTasks.appendChild(taskNode);\n }\n}", "function makeStartingList(){\n for(var i = 0; i<1; i++){\n addListItem( {task: \"Make the list\"});\n addListItem( {task: \"Test the list\"});\n addListItem( {task: \"Pretend to do the list\"});\n }\n}", "function addToList() {\n if ($(\"#js--project1-input\").val() != \"\") {\n var taskDescription = $(\"#js--project1-input\").val();\n $(\"#list\").append(taskItem(taskDescription));\n $(\"#js--project1-input\").val(\"\");\n } else {\n alert (\"you need to write something!\");\n }\n }", "function addListTask(data) {\n listTask.push(data)\n saveData()\n openModal()\n}", "function addToDo() {\n let tasks = document.getElementById('tasks')\n let newTask = document.createElement('li')\n let lastTask = tasks.appendChild(newTask)\n lastTask.innerHTML = document.getElementById('new-task-description').value;\n }", "function getTask(){\n // Clear UL of all task before adding new one...\n document.getElementById(\"taskList\").innerHTML = \"\";\n // Input value\n let getTask = document.getElementById(\"task\").value;\n \n if(getTask === null || getTask === \"\" || getTask === undefined) return false;\n // Timeduration for new task\n let timeDuration = document.getElementsByName(\"timeDuration\");\n \n let pickedTime;\n for(let i = 0; i < timeDuration.length; i++){\n if(timeDuration[i].checked){\n pickedTime = timeDuration[i].value;\n }\n }\n // Creating timestamp\n let getTimeStamp = (new Date().getTime() + Number(pickedTime*1000));\n // Object for task\n let objTask = {\n task: getTask,\n time: getTimeStamp,\n classState: \"list-group-item mb-1\"\n };\n \n allObjTask.push(objTask);\n \n // Set LS\n localStorage.setItem('items', JSON.stringify(allObjTask));\n // Restarting Input field\n document.getElementById(\"task\").value = \"\";\n // Printing new task in UI\n printUI();\n}", "function addTask()\n{\n //The month scales from 0-11 so we need to add one.\n var tempMonth = new Date().getMonth() + 1;\n\n var td = new Date().getFullYear() + \"-\" + tempMonth + \"-\" + new Date().getDate() + \"|\" + new Date().getHours() + \":\" + new Date().getMinutes() + \":\" + new Date().getSeconds();\n var taskDate = td.toString();\n\n var md = new Date();\n var mDate = md.getTime();\n\n //Adding the input values to the array\n taskArr.push({Name: taskTitle.value, Description: taskDetails.value, Date: taskDate, MDate: mDate});\n console.log(taskArr);\n\n //calling the for loop to create the elements.\n floop();\n\n //Adding the listed items to the incompleteTaskList.\n incompletetaskList.appendChild(listItem);\n\n //Calls the BindTaskEvents and passes in the buttons' function.\n bindTaskEvents(listItem);\n\n //Resets the values of the input field.\n taskTitle.value = \"\";\n taskDetails.value = \"\";\n}", "function createNewList(name) {\n return {\n id: Date.now().toString(),\n name: name,\n tasks: [],\n };\n}", "function addTask(event) {\n event.preventDefault();\n const taskDiv = document.createElement(\"div\");\n taskDiv.classList.add(\"task\");\n\n //List - append\n const newTask = document.createElement(\"li\");\n newTask.innerText = inpTask.value;\n newTask.classList.add(\"task-item\");\n taskDiv.appendChild(newTask);\n\n //Legg til i liste lokalt på pc\n\n saveLocalTasks(inpTask.value);\n\n\n //Done-button\n const doneBtn = document.createElement(\"button\");\n doneBtn.innerHTML = \"Done\";\n doneBtn.classList.add(\"done-btn\");\n taskDiv.appendChild(doneBtn);\n\n //Delete-button\n const deleteBtn = document.createElement(\"button\");\n deleteBtn.innerHTML = \"Delete\";\n deleteBtn.classList.add(\"del-btn\");\n taskDiv.appendChild(deleteBtn);\n\n //Add div to list\n taskList.appendChild(taskDiv);\n\n //Remove inp value\n inpTask.value = \"\";\n\n}", "function appendTaskClick() {\n\tvar value = document.getElementById(\"inputTask\").value; \n\tif (value) {\n\t\tdata.openTasks.push(value); //store in array \n\t \tdataObjectUpdated(); //update data storage \n\t \tcreateListElement(value); //display in DOM \n\t \ttask.value = \"\"; //clear input field \n\t}\n}", "function addTask(task){\n var txt = document.createTextNode(task);\n var li = document.createElement(\"LI\");\n li.appendChild(txt);\n li.id=counter;\n counter++;\n myTaskList.incomplete.push(li);\n addCloseButton(li);\n addChecked(li);\n updateTaskList();\n}", "function appendListItem(task) {\n const list = document.querySelector('ul');\n const template = document.querySelector('#template-task');\n const domFragment = template.content.cloneNode(true);\n\n domFragment.querySelector('li p').textContent = task;\n list.appendChild(domFragment);\n\n domUpdate();\n}", "function addTask(task) {\n return toDoList.push(task);\n}", "function addTaskFunc(inputValue)\n {\n var task=document.createElement('li');\n var taskDiv=document.createElement('div');\n taskDiv.innerText=inputValue;\n taskDiv.classList.add('taskDivClass')\n \n \n var buttonsCont = document.createElement('div');\n buttonsCont.classList.add('buttonContClass');\n \n var completed = document.createElement('button');\n completed.classList.add('completedButton')\n \n var edit = document.createElement('button');\n edit.classList.add('editButton')\n \n var deleteIt = document.createElement('button');\n deleteIt.classList.add('deleteButton')\n \n deleteIt.innerHTML=\"&#10006\";\n completed.innerHTML=\"&#10004\" ;\n edit.innerHTML=\"&#9998\";\n \n buttonsCont.appendChild(taskDiv);\n buttonsCont.appendChild(deleteIt);\n buttonsCont.appendChild(completed);\n buttonsCont.appendChild(edit);\n task.appendChild(buttonsCont);\n \n var list = document.getElementById(\"taskList\");\n list.insertBefore(task,list.childNodes[0]);\n document.getElementById(\"userInput\").focus();\n \n //eventlisteners for buttons\n deleteIt.addEventListener('click', deleteTask);\n completed.addEventListener('click', completeTask);\n edit.addEventListener('click', editTask);\n }", "function addTask() {\n var task = $('#task').val(); // Traer el valor del elemento con id=\"task\" (input de las tareas).\n if (!task) return; // Si en la caja no dice nada, terminar.\n var li =$(`<li class=\"no-edit\" id='task-${count}'>\n <input type='checkbox' class='checkbox'></input>\n <span class=\"task\">${task}</span><input class=\"edit-input\" type=\"text\"></input>\n <button class='editBtn'> <i class=\"fas fa-edit\"></i> </button>\n <button class='save'> <i class=\"fas fa-save\"></i> </button>\n <button data-task='task-${count}' class='delete'> <i class=\"fas fa-times-circle\"></i> </button>\n </li>`); // Crear etiquetas HTML. Las comillas ` ` permiten concatenar código sin usar +, con ${ }.\n $('#list').append(li); // Agregar el tag creado como hijo del elemento con id=\"list\" (<ul>).\n $('#task').val(\"\"); // Limpia el campo del input\n count++; // Aumenta el contador en 1.\n}", "function renderList(new_list = '') {\n let renderTasks = new_list || list;\n taskList.innerHTML = '';\n renderTasks = sortTasks(renderTasks);\n renderTasks.forEach((element) => {\n createElement(element.id, element.title, element.description, element.priority, element.done);\n });\n}", "function addTask() {\n\n // TODO: look javascript with the dom(document || javascript with html)\n let taskInput = document.getElementById(\"taskinput\");\n\n // TODO: look up conditionals if else\n if (taskInput.value === \"\") {\n alert(\"Invalid Value\")\n } else {\n taskList.push(taskInput.value)\n\n taskinput.value = \"\";\n }\n\n listTasks();\n\n // returns false for form so it doesn't reload\n return false;\n}", "function addTask(){\n var userInput = document.getElementById('input-task').value\n var parentEl = document.getElementById('parent-el')\n\n // creating li element\n var liEl = elementGenerator('li' , userInput)\n\n // Creating Span element\n var spanEl = document.createElement('span')\n\n // Creating Delete Button Element\n var deleteBtnEl = elementGenerator('button' , 'Delete')\n deleteBtnEl.setAttribute('class' , 'deleteBtn')\n deleteBtnEl.setAttribute('onClick' , 'deleteLi(this)')\n\n // Creating Edit Button Element\n var editBtnEl = elementGenerator('button' , \"Edit\")\n editBtnEl.setAttribute('class' , 'editBtn')\n editBtnEl.setAttribute('onClick' , 'editTodo(this)')\n\n \n // Appending Buttons into SPAN\n spanEl.appendChild(deleteBtnEl)\n spanEl.appendChild(editBtnEl) \n\n // Appending Span el into LI\n liEl.appendChild(spanEl)\n\n // Appending LI el onto DOM\n parentEl.appendChild(liEl)\n}", "constructor( name, taskslist) {\n this.name = name\n this.taskslist = taskslist\n }", "function addTask() {\n console.log('addTask called')\n if (!!taskInputValue) { // makes sure that taskInputValue is not blank\n setToDoArray(toDoArray.concat(taskInputValue))\n setTaskInputValue('')\n }\n }", "function updateTaskList(list) {\n list.forEach(function(user) {\n addItemTask(user);\n });\n}", "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "function tasks()\r\n{\r\n let getLocalStorage = localStorage.getItem(\"New Todo\"); //getting local storage\r\n if(getLocalStorage == null) //if local storage is null\r\n {\r\n listArray = []; //create blank array\r\n }\r\n else\r\n {\r\n listArray = JSON.parse(getLocalStorage); //transforming json string into js object\r\n }\r\n const num_tasks = document.querySelector(\".num_tasks\");\r\n num_tasks.textContent = listArray.length; // passing length value of array to num_tasks \r\n let newLiID = '';\r\n // if array length is greater than 0 -> active deleteTasks button\r\n if(listArray.length > 0)\r\n {\r\n deleteTasksButton.classList.add(\"active\");\r\n }\r\n else\r\n {\r\n deleteTasksButton.classList.remove(\"active\");\r\n }\r\n listArray.forEach((element, index) => {\r\n newLiID += `<li> ${element} <span onclick = \"deleteTask(${index})\"; ><i class=\"fas fa-trash\"></i></span></li>`;\r\n \r\n });\r\n todolist.innerHTML = newLiID; // adding new li id inside ul\r\n inputBox.value = \"\"; //once task added -> leave input field blank \r\n}", "function createTaskElement(taskInput, taskDate){\n // Create li element\n const li = document.createElement('li');\n\n const vBolt = document.createElement('b');\n vBolt.innerText = 'Task: ';\n li.appendChild(vBolt);\n\n // add class\n li.className = 'collection-item orange darken-3 z-depth-5';\n // create text node and append to li\n li.appendChild(document.createTextNode(taskInput)); \n \n // ******** X button **********\n // create new link element\n const link = document.createElement('a');\n // add class\n link.className = 'delete-item secondary-content';\n // add icon html\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // ****************************\n\n // ******** Line *************\n const vLine = document.createElement('hr');\n vLine.style.color = 'orange';\n // ****************************\n\n // ******** Date **************\n // create new Date element\n const newDate = document.createElement('p');\n newDate.className = 'newDate';\n var dDate = new Date(taskDate);\n newDate.innerText = 'Task deadline: ' + dDate.getUTCDate() + '/' + (dDate.getUTCMonth() + 1) + '/' + dDate.getUTCFullYear();\n // ****************************\n\n // ******** Date **************\n // create new Date element\n const newReDate = document.createElement('p');\n newReDate.className = 'remainingDays';\n var daysR = daysRemaining(taskDate, Date.now());\n newReDate.innerText = `Remaining days to complete this task: ${daysR}`;\n // ****************************\n\n // ******** Preloader **************\n // create new Date element\n const newPreloader = document.createElement('div');\n newPreloader.className = 'progress';\n const newDeterminate = document.createElement('div'); \n newDeterminate.className = 'determinate grey';\n var daysRPorcent = 100 - daysR;\n newDeterminate.style.width = daysRPorcent + '%';\n newPreloader.appendChild(newDeterminate)\n // ****************************\n\n // append the link to li\n li.appendChild(link);\n li.appendChild(vLine);\n // append Date\n li.appendChild(newDate);\n li.appendChild(newReDate);\n li.appendChild(newPreloader);\n // append li to ul\n taskList.appendChild(li);\n}", "function AddTask() {\r\n\r\n // adding listitem in list\r\n let li = document.createElement(\"li\");\r\n mainList.prepend(li);\r\n\r\n // creating and adding requied attributes and listeners\r\n\r\n let input = document.createElement('input');\r\n input.setAttribute('type', 'checkbox');\r\n input.addEventListener('click', Complete);\r\n li.append(input);\r\n\r\n let p = document.createElement(\"p\");\r\n p.textContent = document.getElementById(\"input\").value;\r\n li.append(p);\r\n\r\n let button = document.createElement('button');\r\n button.textContent = 'Delete Task';\r\n button.addEventListener('click', Delete);\r\n li.append(button);\r\n\r\n\r\n // function to complete and uncomplete a task\r\n function Complete(ev) {\r\n if (ev.target.checked) {\r\n\r\n let selectedIndex = ev.target.parentNode;\r\n selectedIndex.querySelector('p').style.textDecoration = 'line-through';\r\n mainList.append(selectedIndex);\r\n } else {\r\n\r\n let selectedIndex = ev.target.parentNode;\r\n selectedIndex.querySelector('p').style.textDecoration = 'none';\r\n mainList.prepend(selectedIndex);\r\n }\r\n }\r\n // function to remove a task\r\n function Delete(ev) {\r\n mainList.remove(ev.target.parentNode);\r\n }\r\n}", "addTask() {\n // You need to change this.state using this.setState({your new state}) otherwhise React doesn´t track your changes, \n // in other words it doesn't re-render the task list\n //console.log(this.state.tasks)\n // let tasks = { tasks: [...this.state.tasks, {name: this.state.input}] };\n //console.log(this.state.tasks)\n this.setState({ tasks: [...this.state.tasks, {name: this.state.input}] });\n console.log(this.state.tasks)\n }", "function render(typeOflist, typeOfArray) {\n postTandD.style.display = \"none\"\n removeTasks()\n let index = 0;\n let order = 0;\n\n typeOfArray.forEach(t => {\n let list = document.createElement(\"li\");\n list.className = 'list';\n list.setAttribute('data-index', order++);\n list.style.backgroundColor = `${t.color}`;\n let nameAndTrash = document.createElement(\"div\");\n nameAndTrash.className = 'nameAndTrash';\n\n let desc = document.createElement(\"p\");\n desc.setAttribute('onclick', \"updateTask(this)\");\n desc.className = 'desc';\n desc.appendChild(document.createTextNode(`${t.desc}`));\n\n let labelsAndCheck = document.createElement(\"div\");\n labelsAndCheck.className = 'labelsAndCheck';\n\n let nameOfTask = document.createElement(\"h1\");\n nameOfTask.className = 'nameOfTask';\n nameOfTask.appendChild(document.createTextNode(`${t.title}`));\n\n let trash = document.createElement(\"img\");\n trash.className = 'trash';\n trash.setAttribute(\"src\", \"../assets/trash.svg\");\n trash.setAttribute('data-index', index++);\n trash.addEventListener('click', deleteTask);\n\n nameAndTrash.appendChild(nameOfTask);\n nameAndTrash.appendChild(trash);\n\n let labels = document.createElement(\"div\");\n labels.className = 'labels';\n\n let checkbox = document.createElement(\"input\");\n checkbox.className = 'checkbox';\n checkbox.setAttribute(\"type\", \"checkbox\");\n checkbox.addEventListener('click', moveCheckedTask)\n if (typeOflist.getAttribute(\"id\") == \"listOfChecked\") {\n checkbox.setAttribute(\"checked\", \"\")\n checkbox.style.pointerEvents = \"none\"\n }\n\n labelsAndCheck.appendChild(labels);\n labelsAndCheck.appendChild(checkbox);\n\n let timeAndDate = document.createElement(\"div\");\n timeAndDate.className = 'label';\n\n let wordLabel = document.createElement(\"div\");\n wordLabel.className = 'label';\n\n labels.appendChild(timeAndDate);\n labels.appendChild(wordLabel);\n\n let alarm = document.createElement(\"img\");\n alarm.className = 'alarm';\n alarm.setAttribute(\"src\", \"../assets/alarmclock.svg\");\n\n let dataAndTime = document.createElement(\"span\");\n dataAndTime.className = 'dataAndTime';\n dataAndTime.className = 'word';\n dataAndTime.appendChild(document.createTextNode(`${t.date}` + ', ' + `${t.time}`));\n\n timeAndDate.appendChild(alarm);\n timeAndDate.appendChild(dataAndTime);\n\n let labelSpan = document.createElement(\"span\");\n labelSpan.className = 'labelSpan';\n labelSpan.className = 'word';\n labelSpan.appendChild(document.createTextNode(`${t.label}`));\n wordLabel.appendChild(labelSpan);\n\n list.appendChild(nameAndTrash);\n list.appendChild(desc);\n list.appendChild(labelsAndCheck);\n\n typeOflist.insertBefore(list, typeOflist.childNodes[0]);\n });\n\n let dark = Array.from(document.querySelectorAll(\".list , .label , .borderDark , input[checkbox] , .lineBelow , .below\"));\n let currentTheme = document.documentElement.getAttribute(\"data-theme\");\n if (currentTheme === \"dark\") {\n dark.forEach(el => {\n if (!el.classList.contains(\"noborder\"))\n el.classList.add(\"noborder\");\n })\n }\n\n if (Array.isArray(typeOfArray) && typeOfArray.length) {} else {\n createNoTasks()\n }\n}", "function createTask($scope, params, list) {\n if (!list.todo) { return; }\n $http.post('/todos', {\n task: list.todo,\n todoColor: list.color,\n list: list,\n isCompleted: false,\n isEditing: false\n }).success(response => {\n getLists($scope);\n $scope.createTaskInput = '';\n });\n params.createHasInput = false;\n $scope.createTaskInput = '';\n }", "addNewTask() {\n let task = new Task(this.newTaskName);\n task.id = new Date().getMilliseconds();\n this.tasks.push(task);\n }", "function createTask(event) {\r\n event.preventDefault(); //prevents the form from submitting\r\n\r\n /* For every element in the array of tasks we need to add this, html code\r\n <li> \r\n <div class=\"tasks\">\r\n <div class=\"wrap\">\r\n <div id='mark-completed-button></div>\r\n \r\n <b>Add JavaScript to the Website!</b>\r\n </div>\r\n <i class=\"fas fa-trash\"></i>\r\n </div>\r\n </li>\r\n */\r\n\r\n pendingTasks++; //since new task is created pending task is increased by 1\r\n incompleteItem.innerText = 'Pending Tasks : ' + pendingTasks; //rendering the new value\r\n\r\n let listItem = document.createElement('li'); //creates the li tag\r\n let item = document.createElement('div'); //creates the outer div\r\n item.classList.add('tasks'); //adding tasks class to the div\r\n let subItem = document.createElement('div'); //creates the inner div\r\n subItem.classList.add('wrap'); //adding the wrap class to inner div\r\n let markCompletedBtn = document.createElement('div'); //creates the checkbox \r\n markCompletedBtn.classList.add('mark-completed-button'); //adds the radio button to the form\r\n let desc = document.createElement('b'); //creates the b tag\r\n desc.innerText = inputForm.value; //adds the description of the task to the b tag\r\n subItem.appendChild(markCompletedBtn); //appending form to inner div\r\n subItem.appendChild(desc); //appending b tag to inner div\r\n item.appendChild(subItem); //appending inner div to outer div\r\n let trash = document.createElement('i'); //creating an a tag\r\n trash.classList.add('fas'); //adding relevant class to the fa icon\r\n trash.classList.add('fa-trash'); //adding relevant class to the fa icon\r\n item.appendChild(trash); //appending the delete button to the outer div\r\n listItem.appendChild(item); //appending the outer div to li tag\r\n document.getElementById('tasks-list').appendChild(listItem); //appending li tag to the ul tag\r\n inputForm.value = \"\"; //setting the entered text of the form to empty after adding it\r\n}", "function addPilots() {\n let pilotsContainer = document.querySelector('#pilots')\n for (let i = 0; i < 5; i++) {\n let input = createInput(indexPilots)\n indexPilots++\n pilotsContainer.appendChild(input)\n }\n }", "function addTask(){\n //update localstorage\n todos.push({\n item: $newTaskInput.val(),\n done: false\n })\n localStorage.setItem('todos', JSON.stringify(todos))\n //add to ui\n renderList()\n $newTaskInput.val('')\n $newTaskInput.toggleClass('hidden')\n $addTask.toggleClass('hidden')\n $addBtn.toggleClass('hidden')\n}", "function addTask(event) {\n event.preventDefault();\n\n let text = document.getElementById('to-do').value; \n let date = document.getElementById('deadline').value;\n let imp = document.getElementById('importance').value;\n var tasksList = document.getElementById('task-list');\n \n //Checking if sth was written\n if (text === '' || text.trim() === '') {\n alert('You need to write down Your task');\n } else if (Date.parse(date) < Date.parse(`${yyyy}-${mm}-${dd}`)) {\n alert('Your deadline is in past!');\n } else {\n \n //Creates a task\n const task = {\n text,\n date,\n imp,\n id: listOfTasks.length,\n checked: false\n }\n\n //Adds task to the list\n listOfTasks.push(task);\n\n //Prints the list\n console.log(listOfTasks); \n\n //Makes input blank again\n document.getElementById('to-do').value = '';\n document.getElementById('deadline').value = '';\n document.getElementById('importance').value = 'Normal';\n\n //Saving values in local storage\n localStorage.setItem('tasks', JSON.stringify(listOfTasks));\n }\n}", "function handAddTask(event) {\n\t\tif (event.keyCode == 13 && task !== \"\") {\n\t\t\t//&& task !== \"\" que no suceda cuando este vacio\n\t\t\tsetListarray([...listarray, task]);\n\t\t\tsetTask(\"\"); //esto sirve para evitar que agrege cosas en blanco\n\t\t}\n\t\t//keycode es para asignar una letra al keyup, 13 es codigo del enter\n\t\t//es agregar todo lo que ya tenia mas la nueva, list tiene toda la lista de tarea\n\t}", "function addlist() {\r\n if (currentInput !== null && currentInput !== undefined && currentInput !== '') {\r\n newListItem = newListelement();\r\n list.appendChild(newListItem);\r\n input.value = '';\r\n currentInput = '';\r\n } else {\r\n alert('Please enter your task')\r\n }\r\n}", "function addTask(newTask) {\n //create list element and set its class\n const newTaskItem = document.createElement('li');\n newTaskItem.setAttribute('class', 'task_item');\n\n // create checkbox element and set its type and class\n const newCheckBtn = document.createElement('div');\n newCheckBtn.setAttribute('class', 'task_check_btn');\n\n // create span element and set its class and add new task input\n const newTaskBio = document.createElement('span');\n newTaskBio.setAttribute('class', 'task_bio');\n\n // add input value to li\n newTaskBio.innerText = newTask;\n\n // insert li tag inside the ul tag\n taskList.appendChild(newTaskItem);\n\n // insert checkbox to li\n newTaskItem.appendChild(newCheckBtn);\n\n // insert newTask into li\n newTaskItem.appendChild(newTaskBio);\n\n // run Function when task is completed and checkbox is check.\n onTaskComplete(newCheckBtn);\n}", "function createListElement(text, doneTasks) { \n\tvar list = (doneTasks) ? document.getElementById(\"doneTasks\") : document.getElementById(\"openTasks\") //identifies which tasklist to add new item to \n\n\tvar item = document.createElement(\"li\"); // Create new list element \n\titem.innerText = text; //set input value to the innertext of the element \n\t\t\n\t//create remove and complete buttons \n\tvar buttons = document.createElement(\"div\"); //div for both buttons \n\tbuttons.classList.add('buttonsDiv');\n\n\tvar remove = document.createElement('button');\n\tremove.classList.add('remove');\n\tremove.innerHTML = removeSVG; \n\tremove.addEventListener('click', removeItem); // add click event for removing item\n\n\tvar complete = document.createElement('button');\n\tcomplete.classList.add('complete');\n\tcomplete.innerHTML = completeSVG; \n\tcomplete.addEventListener('click', completeItem); //add click event for completing item \n\n\t//add buttons to buttons div and list element and append list element to top of tasklist \n\tbuttons.appendChild(remove);\n\tbuttons.appendChild(complete);\n\titem.appendChild(buttons);\n\tlist.insertBefore(item, list.childNodes[0]);\n }", "function addNewTask() {\r\n let textInput = document.querySelector(\"#taskInput\");\r\n let allTasksFromMemory = JSON.parse(localStorage.getItem(\"tasks\"));\r\n\r\n if (textInput.value == \"\") {\r\n return;\r\n }\r\n\r\n // dio za kreiranje novog taska:\r\n let newLi = document.createElement(\"li\");\r\n let textNode = document.createTextNode(\"\");\r\n newLi.appendChild(textNode);\r\n newLi.classList.add(\"task\", \"unfinished\");\r\n\r\n //dole je novo\r\n newLi.innerHTML =\r\n '<img class=\"emptyCircle\" src=\"SVG/empty-circle.svg\" onclick=\"completeTask(this)\"/><img class=\"tickedCircle\" src=\"SVG/ticked-circle.svg\"/><div class=\"textPartofTask\"><p class=\"taskText\">' +\r\n textInput.value +\r\n '</p><p class=\"taskDate\"></p></div><div class=\"right-task-buttons\"><img src=\"SVG/edit-circle.svg\" class=\"right-hidden-button editCircle\" onclick=\"footerVisibilitySwitch(\\'edit\\',this)\"/><img src=\"SVG/thrash-circle.svg\" class=\"right-hidden-button thrashCircle\" onclick=\"deleteTask(this)\"/><img src=\"SVG/date-circle.svg\" class=\"right-hidden-button dateCircle\" onclick=\"showCalendar(this)\"/><img src=\"SVG/options-circle.svg\" class=\"optionsCircle\" onclick=\"expandRightButton(this)\"/></div>';\r\n\r\n newLi.setAttribute(\"id\", taskCounter);\r\n document.querySelector(\".allTasksUl\").appendChild(newLi);\r\n\r\n let attrib;\r\n if (allTasksFromMemory) {\r\n attrib = {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n };\r\n } else {\r\n attrib = [\r\n {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n },\r\n ];\r\n }\r\n\r\n if (allTasksFromMemory) {\r\n allTasksFromMemory.push(attrib);\r\n localStorage.setItem(\"tasks\", JSON.stringify(allTasksFromMemory));\r\n } else {\r\n localStorage.setItem(\"tasks\", JSON.stringify(attrib));\r\n }\r\n\r\n //skrivanje footera i clear-anje input forme\r\n taskCounter++;\r\n localStorage.setItem(\"taskCounter\", taskCounter);\r\n textInput.value = \"\";\r\n footerVisibilitySwitch(\"default\");\r\n}", "function addItem() {\n var contents = document.getElementById('newTask').value;\n var item = new listItem(Date.now(), contents, false);\n masterList.push(item);\n showList(masterList);\n saveList();\n}", "function addTask() {\n\t\t\tvm.totalTime = 0;\n\t\t\ttaskDo.service.addTask(vm).then(function (response) {\n\t\t\t\tvm.sample=\"vamsi\";\n\t\t\t});\n\t\t}", "function addNewTask(inputParam) {\n\n\tvar newTask = inputParam.val(),\n\n\t\tperson = inputParam.closest('.column_info_container').find('input[name=person]:checked').val();\n\n\tif (newTask.length > 0) {\n\t\t\n\t\tvar currentColumn = inputParam.closest('.column_info_container').find('.columns-ul');\n\t\t\n\t\tif (person != undefined) {\n\t\t\tcurrentColumn.append(\n\t\t\t\t\t\t\"<li>\" + \n\t\t\t\t\t\t\t\"<a href='#' class='task_link'>\" + newTask + \"</a>\" +\n\t\t\t\t\t\t\t\"<span class='pic_span'><img src=images/\"+person+\".png></span>\" + \n\t\t\t\t\t\t\"</li>\"\n\t\t\t);\n\t\t} else {\n\t\t\tcurrentColumn.append(\n\t\t\t\t\"<li>\" + \n\t\t\t\t\t\"<a href='#' class='task_link'>\" + newTask + \"</a>\" +\n\t\t\t\t\t\"<span class='pic_span'><img src=images/not_asigned.png></span>\" + \n\t\t\t\t\"</li>\"\n\t\t\t);\n\t\t}\n\n\t\tinputParam.val(\"\");\n\t}\t\t\n}", "function addTask(){\n\t\tif (item.value.length >= 1) {\n\t\t\tincompleteUl.append('<li>' + '<p>' + item.value + '</p>' + complete + remove + '</li>');\n\t\t\ttoDoList.push(item.value);\n\t\t}else {\n\t\t\talert(\"Please add a task\");\n\t\t}\n\n\t\ttoDoCount();\n\t\tnotToDoCount();\n\t\tcompleteTask();\n\t\tremoveTask();\n\t\taddClear();\n\t\titem.value = \"\";\n\t}", "function createList() {\n //spread operator makes a copy of the array\n [...richestPeople]\n .map((a) => ({ value: a, sort: Math.random() }))\n .sort((a, b) => a.sort - b.sort)\n .map((a) => a.value)\n .forEach((person, index) => {\n const listItem = document.createElement(\"li\");\n //Experiment with adding new classes for each action\n // listItem.classList.add('over');\n\n listItem.setAttribute(\"data-index\", index);\n listItem.innerHTML = `\n <span class=\"number\"> ${index + 1} </span>\n <div class = \"draggable\" draggable=\"true\">\n <p class = \"person-name\">${person} </p>\n <i class =\" fas fa-arrows-alt-v\"></i></div>\n `;\n listItems.push(listItem);\n draggable_list.appendChild(listItem);\n });\n\n addEventListeners();\n}", "function createList() {\n [...richestPeople]\n .map(a => ({ value: a, sort: Math.random() }))\n .sort((a, b) => a.sort - b.sort)\n .map(i => i.value)\n .forEach((person, index) => {\n const listItem = document.createElement('li')\n \n listItem.setAttribute('data-index', index)\n listItem.innerHTML = `\n <span class=\"number\">${index + 1}</span>\n <div class=\"draggable\" draggable=\"true\">\n <p class=\"person\">${person}</p>\n <i class=\"fas fa-grip-lines\"></i>\n </div>\n `\n listItems.push(listItem)\n draggableList.appendChild(listItem)\n })\n\n addEventListners()\n}", "function appendList(event) {\n event.preventDefault();\n // Get the input from the user\n const input = document.forms[0].addTo.value;\n\n if (toDos === null)\n toDos = [];\n // Form validation to alert the user to enter a task\n // within 50 chars.\n if(input === '')\n alert('Cannot create a blank task');\n else if(input.length > 50)\n alert('Entry is to big');\n else {\n // Using the input we create an object to store it\n const add = {id: Date.now(), content: input, completed: false};\n\n // Add it to the top of the list and then update local storage\n toDos.unshift(add);\n ls.setJSON(key, JSON.stringify(toDos));\n\n // Update the list displayed to the user\n displayList();\n }\n\n}", "function addTask() {\r\n\r\n var taskId = \"task_\" + taskCount++;\r\n\r\n var task = createTask(taskId, \"\", \"\");\r\n taskList[taskId] = task;\r\n\r\n var domElement = createNewTaskDOMElement(task);\r\n taskListDOMElements[taskId] = domElement;\r\n\r\n showTaskDetail(task);\r\n}", "function drawTask(i){\n \n var taskList = arguments[1];\n var container = document.getElementById('taskContainer');\n //console.log(arguments[1]);\n var task = document.createElement('div');\n task.classList.add('form-group', 'row');\n container.appendChild(task);\n\n var col1 = document.createElement('div');\n col1.classList.add('col-xs-10', 'col-sm-11');\n task.appendChild(col1);\n\n var inpGroup = document.createElement('div');\n inpGroup.classList.add('input-group', 'input-group-lg');\n col1.appendChild(inpGroup);\n\n var span1 = document.createElement('span');\n span1.classList.add('input-group-addon');\n span1.id = \"sizing-addon1\";\n inpGroup.appendChild(span1);\n \n var touchKey = false;\n \n //-------- drag & drop event listeners\n span1.addEventListener('mousedown', function(event){\n dragDrop(event, container, taskList, touchKey);\n });\n span1.addEventListener('touchstart', function(event){\n event.preventDefault();\n touchKey = true;\n dragDrop(event, container, taskList, touchKey);\n });\n\n //-------- creation of input-field and binding it to the model\n var inputField = document.createElement(\"input\");\n gapi.drive.realtime.databinding.bindString(doc.getModel().getRoot().get('coll_list').get(i), inputField);\n \n inputField.type = \"text\";\n inputField.placeholder = 'Empty task';\n inputField.classList.add('form-control');\n inputField.ariaDescribedby = 'sizing-addon1';\n inpGroup.appendChild(inputField);\n\n var col2 = document.createElement('div');\n col2.classList.add('col-xs-2', 'col-sm-1');\n task.appendChild(col2);\n\n var delButton = document.createElement(\"button\");\n delButton.type = 'submit';\n delButton.classList.add('btn', 'btn-default', 'btn-lg');\n delButton.dataset.listIndex = i;\n \n //-------- removing item from list:\n delButton.addEventListener('click', function(){\n var delInd = delButton.dataset.listIndex;\n taskList.remove(+delInd);\n });\n\n col2.appendChild(delButton);\n\n var spanBtn = document.createElement('span');\n spanBtn.classList.add('glyphicon');\n delButton.appendChild(spanBtn);\n}", "function addResourceToTask(input, li) {\n var id = jQuery(li).find(\".complete_value\").text();\n jQuery(input).val(\"\");\n\n jQuery.get(\"/tasks/resource/\", { resource_id : id }, function(data) {\n jQuery(\"#task_resources\").append(data);\n });\n}", "function addToTasks() {\n\n //get value of the task and the description...\n var task = document.getElementById('task').value;\n var description = document.getElementById('description').value;\n\n var li = document.createElement(\"li\");\n var inputValue = \" Task: \" + task + \"\\nDescription: \" + description;//\n // console.log(f);\n var t = document.createTextNode(inputValue);\n li.appendChild(t);\n if (inputValue === '') {\n alert(\"Please type in a task!\");\n } else {\n document.getElementById(\"mytasks\").appendChild(li);\n }\n \n document.getElementById(\"task\").value = \"\";\n document.getElementById(\"description\").value = \"\";\n\n //add task and description to the added tasks section\n \n \n //console.log(task,description);\n // var x = document.getElementById(\"taskinfo\").firstChild;\n // console.log(x);\n // x.remove();\n\n // var y = document.getElementById(\"doneButton\").firstChild;\n // console.log(y);\n // y.remove();\n\n}", "function addTask(task){\n if(input.value === \"\") {\n return;\n } else {\n const text = input.value;\n const item = `<li><input type=\"checkbox\" class=\"complete_task\">${text}<label><input type=\"radio\" name=\"incomplete_task\"> </label>\n </li>`;\n const position = \"beforeend\";\n list.insertAdjacentHTML(position,item);\n id++;\n form.reset(); \n }\n}", "function addResourceToTask(input, li) {\n var id = jQuery(li).find(\".complete_value\").text();\n jQuery(input).val(\"\");\n\n jQuery.get(\"/tasks/resource/\", { resource_id : id }, function(data) {\n\tjQuery(\"#task_resources\").append(data);\n });\n}", "function addTasks(e) {\n\t\n\t//Condition to check the user input, if not an empty string add the task\n\tif(inputElem.value !== '') {\n\t\t\n\t\t//addTaskTitle();\n\t\t\n\t\t//focusing the input for guiding the user to add next task\n\t\tinputElem.focus();\n\t\t\n\t\t//Creating new div and li element and append it to output div\n\t\tconst div = document.createElement('div');\n\t\t\t\t\n\t\tconst newTask = document.createElement('li');\n\t\tnewTask.appendChild(document.createTextNode(inputElem.value));\n\t\t\t\t\t\n\t\tconst checkBox = document.createElement('input');\n\t\tcheckBox.type = 'checkbox';\n\t\tcheckBox.className = 'done';\n\t\t\t\t\t\n\t\tdiv.appendChild(checkBox);\n\t\tdiv.appendChild(newTask);\n\t\t\t\t\t\n\t\tconst listOfTask = document.querySelector('.output');\n\t\tlistOfTask.appendChild(div);\n\t\t\n\t\t//Making the input value to empty string\n\t\tinputElem.value = '';\n\t\t\n\t\t\n\t\t//edit and remove button added to the end\n\t\tconst editButton = document.createElement('button');\n\t\teditButton.className = 'edit-button';\n\t\teditButton.appendChild(document.createTextNode('Edit'));\n\t\t\n\t\tdiv.appendChild(editButton);\n\t\t\n\t\t//adding event listener to edit button\n\t\teditButton.addEventListener('click', editTasks);\n\t\t\n\t\tconst removeButton = document.createElement('button');\n\t\tremoveButton.className = 'remove-button';\n\t\tremoveButton.appendChild(document.createTextNode('Remove'));\n\t\t\n\t\tdiv.appendChild(removeButton);\n\t\t\n\t\t//adding event listener to remove button\n\t\tremoveButton.addEventListener('click', removeTask);\n\t\t\n\t\t//adding eventlistener to checkBox\n\t\tcheckBox.addEventListener('change', strikeTask);\n\t}\n\t\n\telse {\n\t\terror();\n\t}\n\t\n\t\n\t//Prevent default behaviour of form element\n\te.preventDefault();\n}", "function addToLocalStorage(listTask) {\n localStorage.setItem('listTask', JSON.stringify(listTask));\n renderTask(listTask);\n}", "@action\n addTaskToExistingDate(task, date) {\n this.content[date].push({\n task: task,\n id: Math.floor(Math.random() * 1000000000).toString(),\n notes: \"\"\n });\n }", "function renderTasks(){\n todoList.innerHTML = ''\n\n tasks.forEach( task => {\n todoList.appendChild(generateTask(task))\n })\n}", "function addTaskToToDoList() {\n if (task.value.length > 0) {\n var newTask = document.createElement(\"li\");\n var finalTask = document.createElement(\"label\");\n var taskToBeAdded = void 0;\n if (isCat(task.value)) {\n taskToBeAdded = new CatTask(task.value, \"https://breakbrunch.com/wp-content/uploads/2019/06/cute-cat-with-big-eyes-041619-1.jpg\");\n var img = document.createElement(\"img\");\n img.src = taskToBeAdded.url;\n img.height = 30;\n img.width = 30;\n newTask.appendChild(img);\n }\n else {\n taskToBeAdded = new NormalTask(task.value, false);\n var checkbox = document.createElement(\"input\");\n checkbox.type = \"checkbox\";\n checkbox.className = \"todo-check\";\n checkbox.addEventListener(\"click\", tickDoneOnToDoList);\n newTask.appendChild(checkbox);\n }\n finalTask.appendChild(document.createTextNode(taskToBeAdded.text));\n finalTask.className = \"todo\";\n newTask.appendChild(finalTask);\n var newDeleteButton = document.createElement(\"button\");\n newDeleteButton.appendChild(document.createTextNode(\"delete\"));\n newDeleteButton.className = \"btn btn-outline-warning\";\n newDeleteButton.setAttribute(\"id\", \"delete\");\n newDeleteButton.addEventListener(\"click\", deleteTaskFromToDoList);\n newTask.appendChild(newDeleteButton);\n newTask.appendChild(document.createElement(\"BR\"));\n newTask.appendChild(document.createElement(\"BR\"));\n todoList.appendChild(newTask);\n task.value = \"\";\n }\n}", "function addTask() {\n var inputValue = document.getElementById(\"input_text\").value;\n var li = document.createElement(\"li\");\n var text = document.createTextNode(inputValue);\n li.appendChild(text);\n if (inputValue === '') {\n alert(\"You need to declare a new task!:)\");\n } else {\n document.getElementById(\"task_list\").appendChild(li);\n document.getElementById(\"input_text\").value = '';\n }\n\n\n}", "function setAnswer(list) {\n const res = list[Math.floor(Math.random() * list.length)];\n return res;\n}", "function floop () \n{\n for(var i = 0; i < taskArr.length; i++)\n {\n listItem = createNewTaskElement(taskArr[i], i);\n }\n}", "function addItemToDOM(task, listName) {\n let list = document.getElementById(listName);\n\n // <li>\n let listItem = document.createElement('li');\n listItem.textContent = task.description;\n listItem.setAttribute('id', task.id);\n\n // <div class=\"buttons\">\n let buttons = document.createElement('div');\n buttons.classList.add('buttons');\n\n // <button class=\"remove\">\n let remove = document.createElement('button');\n remove.classList.add('remove');\n remove.innerHTML = removeSVG;\n\n // Add click event for removing item\n remove.addEventListener('click', removeItem);\n\n // <button class=\"complete\">\n let complete = document.createElement('button');\n complete.classList.add('complete');\n complete.innerHTML = completeSVG;\n\n // Add click event for completing list items\n complete.addEventListener('click', completeItem);\n\n // relate variables with each other\n list.insertBefore(listItem, list.childNodes[0]);\n listItem.appendChild(buttons);\n buttons.appendChild(remove);\n buttons.appendChild(complete);\n dataObjectUpdated();\n}", "function addTask(taskName) {\n // Use templateList.content.querySelector to select the component of the template.\n const taskElement = document.importNode(templateList.content.querySelector('.taskItem'), true);\n // Assign the class name\n taskElement.className = 'activeItem';\n // Select the components from the list.\n const activeItem = taskElement.querySelector('input');\n const activeIcon = taskElement.querySelector('label');\n // Change the icon and text.\n activeIcon.innerHTML = '&#10065';\n activeItem.value = taskName;\n // Append to ul\n taskList.appendChild(taskElement);\n}", "saveEditTask(li, input) {\n let index = [...li.parentElement.children].indexOf(li);\n if (li.classList.contains(\"todo-list__item--done\")) {\n this.doneTaskArr.splice(index - 1, 1, input.value);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n } else {\n this.undoneTaskArr.splice(index - 1, 1, input.value);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n }\n input.disabled = true;\n input.classList.remove(\"todo-list__value--editable\");\n }", "@action getManyDataItems() { // go ask for a bunch of random numbers\n this.numberList.replace(); // empty the list\n for (var ctr = 0; ctr < this.listSize; ctr++){ // count to goal \n this.numberList.push(-1); // make the array the right size\n setTimeout( this.getRandomForIndex.bind(this,ctr) , // call a service\n 200+Math.random()*3000 ); // after a random wait\n } \n }", "function createNewTaskElement(textInput, isDone){\n\tvar listItem=document.createElement(\"li\");\n //creating delete button\n var deleteButton=document.createElement(\"button\");\n\tdeleteButton.innerText=\"x\";\n\tdeleteButton.className=\"delete\";\n deleteButton.addEventListener(\"click\", deleteTask);\n //type of if else to mark tasks done or todo\n listItem.addEventListener(\"click\", isDone ? markTodo : markDone);\n\tlistItem.appendChild(deleteButton);\n //creating added text that user wrote to the input and returns it as listitem\n var textAdded = document.createElement('span');\n textAdded.textContent = textInput; \n listItem.appendChild(textAdded);\n listItem.dataset.text=textInput;\n\treturn listItem;\n}", "function addNewTask() {\n buttonAdd.onclick = function () {\n if (!newText.value || !newText.value.trim()) return alert('Please, input your text')\n newContainer.classList.add(hiddenClass)\n let id = listTask.length ? listTask[listTask.length - 1].id + 1 : 0\n let date = new Date().toJSON()\n const task = {\n id,\n text: newText.value.trim(),\n date,\n completed: false\n }\n listTask.push(task)\n addTaskToDom(task, listBlock)\n newText.value = ''\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n }", "addNewItem() {\n\t \tlet task = this.state.task;\n\t \tlet updated_list = this.props.data;\n\t \t\n\t \tupdated_list = updated_list.concat(task);\n\t \tthis.props.onItemAdd(updated_list);\n\t \tthis.setState({task : ''});\n \t\n \t}", "function addNewTask(e) {\n e.preventDefault();\n\n if (taskInput.value === '') {\n taskInput.style.borderColor = 'red';\n return;\n }\n\n const li = document.createElement('li');\n\n li.className = 'collection-item';\n\n li.appendChild(document.createTextNode(taskInput.value));\n\n const link = document.createElement('a');\n\n link.className = 'delete-item secondary-content';\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n\n li.appendChild(link);\n taskList.appendChild(li);\n taskInput.value = '';\n}", "function random(list) {\n\n var randNum = Math.random() * list.length;\n randNum = Math.floor(randNum);\n console.log(randNum);\n name = list[randNum];\n list.splice(randNum, 1);\n\n chooseOption(name, randNum);\n}" ]
[ "0.67296064", "0.6531027", "0.6404672", "0.6335312", "0.6308852", "0.6294946", "0.62653375", "0.6238996", "0.6194537", "0.61409956", "0.6122929", "0.60137355", "0.6004269", "0.59975904", "0.5996972", "0.5974074", "0.59650195", "0.5961351", "0.59525305", "0.5950603", "0.59196097", "0.59057295", "0.58971167", "0.58908105", "0.5889294", "0.5861328", "0.5859931", "0.58325815", "0.58129656", "0.5785578", "0.57647353", "0.5763447", "0.57524174", "0.5748207", "0.5723546", "0.5696262", "0.5690692", "0.56823933", "0.5680551", "0.56682676", "0.5659667", "0.5653085", "0.5649568", "0.56481117", "0.56468666", "0.5637892", "0.5621968", "0.5618064", "0.5610884", "0.56054425", "0.5600418", "0.55970675", "0.5596708", "0.5593538", "0.55878466", "0.55844384", "0.55820775", "0.55813247", "0.5577718", "0.5568452", "0.5562907", "0.5560993", "0.55607885", "0.55555874", "0.5553471", "0.5535848", "0.5532124", "0.55265164", "0.55157125", "0.54983294", "0.5484414", "0.54735106", "0.5471589", "0.54703134", "0.5470089", "0.54694134", "0.5464094", "0.54594344", "0.54574317", "0.5457002", "0.54444724", "0.5442899", "0.5442014", "0.5440531", "0.54242444", "0.5411514", "0.5411077", "0.5410922", "0.5408683", "0.5408639", "0.5400063", "0.53949827", "0.5394715", "0.5390028", "0.5388613", "0.5381175", "0.53800356", "0.5375675", "0.5372815", "0.5368324" ]
0.6747056
0
This will delete a task from the list TO DO : Currently not being used
function deleteFromList(element){ if(confirm('Would you like to delete this item?') == 1){ $(element).parent().remove(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteTask(task) {\n var position = toDoList.indexOf(task);\n if (position > -1) {\n return toDoList.splice(position, 1);\n }\n else {\n console.log(\"task is not in our list!\");\n }\n}", "function deleteTask (e){\n for (var i = 0 ; i< loginUser.tasks.length; i ++){\n if(parseInt(loginUser.tasks[i].id) === parseInt(e.target.getAttribute('data-id'))){\n if(loginUser.tasks[i].status === false){\n taskToDo--;\n $('#countOfTask').text('').text('Task to do: '+ taskToDo);\n }\n loginUser.tasks.splice(i, 1);\n $('#task' + e.target.getAttribute('data-id')).remove();\n collectionOfUser.update(\n {\n id : loginUser.id,\n tasks : loginUser.tasks\n },\n function(user){\n loginUser = user;\n },\n error \n );\n }\n }\n }", "deleteTask(id) {\n var index = this.list.map(i => i.id).indexOf(id);\n this.list.splice(index, 1);\n ls.deleteItem(id);\n }", "deleteTask(taskId) {\n\t\tconst todos = this.getAndParse('tasks');\n\t\tconst filteredTodos = todos.filter(task => task.id !== taskId);\n\t\tthis.stringifyAndSet(filteredTodos, 'tasks');\n\t}", "removeTask () {\n\t\tthis.deleter.addEventListener('click', (e) => {\n\t\t\tfetch('/items/'+e.target.parentNode.parentNode.parentNode.childNodes[0].getAttribute('data-task'), {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\t\n\t\t\t})\n\t\t\t.then(res => res.text()) \n\t\t\t.then(res => console.log(res))\n\t\t\t.catch(error => console.error(error));\n\t\t\te.target.parentNode.parentNode.parentNode.remove();\n\t\t\tupdateProgess(numberOfCompletedTasks());\n\t\t});\n\n\t\t// We need to also remove tasks from the backend\n\t}", "function deleteTask()\n {\n var child = this.parentNode.parentNode;\n var parent = child.parentNode;\n parent.removeChild(child);\n var id= parent.id;\n var value = child.innerText;\n if (id == \"taskList\")\n {\n obj.taskListArr.splice(obj.taskListArr.indexOf(value), 1);\n }\n else \n {\n obj.taskCompletedArr.splice(obj.taskCompletedArr.indexOf(value), 1);\n } \n dataStorageUpdt();\n }", "function deleteTask() {\n const buttonDelete = document.querySelectorAll('.button-delete')\n buttonDelete.forEach(button => {\n button.onclick = function (event) {\n event.path.forEach(el => {\n if (el.classList?.contains(listItemClass)) {\n let id = +el.id\n listTask = listTask.filter(task => {\n if (task.id === id) {\n el.remove()\n return false\n }\n return true\n })\n showInfoNoTask()\n }\n })\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n })\n }", "function deleteTask(currentTask) {\n console.log(\"Delete task\");\n console.log(\"---task to be deleted: \" + currentTask.task);\n\n setTasks(\n tasks.filter((task) => {\n // console.log(\"\")\n return task.id !== currentTask.id;\n })\n );\n }", "function deleteTask(taskListIndex) {\n\n taskList.splice(taskListIndex, 1);\n\n\n listTasks()\n}", "function deleteTask(e) {\n let index = this.dataset.index;\n let tyList = this.parentElement.parentElement.parentElement;\n if (tyList.getAttribute(\"id\") == \"lists\") {\n tasks.splice(index, 1);\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n render(lists, tasks);\n }\n if (tyList.getAttribute(\"id\") == \"listOfChecked\") {\n tasksChecked.splice(index, 1);\n localStorage.setItem(\"tasksChecked\", JSON.stringify(tasksChecked));\n render(listOfChecked, tasksChecked);\n }\n}", "function removeTask(){\n\t\t$(\".remove\").unbind(\"click\").click(function(){\n\t\t\tvar single = $(this).closest(\"li\");\n\t\t\t\n\t\t\ttoDoList.splice(single.index(), 1);\n\t\t\tsingle.remove();\n\t\t\ttoDoCount();\n\t\t\tnotToDoCount();\n\t\t\taddClear();\n\t\t});\n\t}", "function deleteTask() {\n this.parentNode.parentNode.removeChild(this.parentNode);\n }", "deleteTask(taskId) {\n const newTasks = [];\n this.tasks.forEach((item) => {\n if (item.Id !== taskId) {\n newTasks.push(item);\n }\n });\n this.tasks = newTasks;\n }", "function deleteTask(event)\n{\n //gets button id\n let id = event.target.id;\n\n //gets task position from button id\n let taskPosition = id.replace(/\\D/g,'');\n\n //removes task from task array\n taskArr.splice(taskPosition - 1, 1); \n\n //loop through task array to adjust position\n for(let i = 0; i < taskArr.length; i++)\n {\n taskArr[i].position = i + 1;\n };\n\n //rewrites task list\n rewritesList();\n}", "deleteTask(taskId) {\n let newTasks = [];\n this.tasks.forEach(task => {\n if (task.id !== taskId) {\n newTasks.push(task);\n }\n });\n this.tasks = newTasks;\n }", "function deleteTask($scope, todoToDelete) {\n $http.delete(`/todos/${todoToDelete._id}`).success(response => {\n getLists($scope);\n });\n }", "function deleteTask(id){\n API.deleteTask(id)\n .then(()=>{\n getTasks();\n }).catch();\n }", "function deleteTask(event) {\n\n let idDelete = event.target.getAttribute('data-id')\n\n let keyId = listTask.findIndex(element => {\n if (element.id == idDelete) {\n return element\n }\n })\n\n if (keyId != -1) {\n listTask.splice(keyId, 1)\n saveData()\n }\n\n openModalDel()\n}", "function deleteTask(task) {\n const params = new URLSearchParams();\n params.append('id', task.id);\n fetch('/delete-task', {method: 'POST', body: params});\n}", "function removeTask(event){\n // Get the index of the task to be removed\n let index = findIndexById(event.target.parentElement.id);\n\n // Confirm if the user wants to remove said task\n if(confirm(`Do you want to remove this task? \"${toDos[index].content}\"`)){\n // Use splice to delete the task object and reorder the array then update local storage\n toDos.splice(index, 1);\n ls.setJSON(key, JSON.stringify(toDos));\n\n // Update the list displayed to the user\n displayList();\n }\n}", "function deleteTask(event) {\n const taskListItem = this.parentNode.parentNode;\n const keyValue = taskListItem.querySelector('input').dataset.key\n taskListItem.parentNode.removeChild(taskListItem);\n\n\n manageTasksAjax(event, '', keyValue, 'delete')\n}", "function deleteTaskFromToDoList(event) {\n event.target.parentElement.remove();\n}", "function delete_task(task_id) {\n fetch(`delete/${task_id}`, {\n method: 'DELETE'\n })\n var task = document.getElementById(`${task_id}`);\n task.remove();\n }", "function deleteTask(e){\n const taskID = document.getElementById('id').value;\n http\n .delete(`http://localhost:3000/Tasks/${taskID}`)\n .then(task=>{\n //clearing field\n ui.clearFiled();\n //showing message\n ui.showAlertMessage('Task deleted','alert alert-warning');\n //getting task\n getTasks();\n })\n}", "removeTask(target) {\n if (!target.classList.contains(\"todo-list__btn-remove\")) return;\n let li = target.parentElement;\n if (li.classList.contains(\"todo-list__item--done\")) {\n let index = [...li.parentElement.children].indexOf(li);\n this.doneTaskArr.splice(index - 1, 1);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n li.remove();\n } else {\n let index = [...li.parentElement.children].indexOf(li);\n this.undoneTaskArr.splice(index - 1, 1);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n li.remove();\n }\n }", "deleteTask(task) {\n const deleteItem = task.key;\n const deleteRef = firebase.database().ref(`${this.props.userId}/${deleteItem}`);\n deleteRef.remove();\n }", "function deleteTask(id) {\n listTask = listTask.filter(function(item) {\n return item.id != id;\n });\n\n addToLocalStorage(listTask);\n}", "function deleteTask(id){\r\n // Remove from DOM\r\n let item = document.getElementById(id);\r\n item.remove();\r\n\r\n // Remove from backend\r\n let dataSend = \"deleteTask=exec&id=\" + id;\r\n return apiReq(dataSend, 3);\r\n}", "function deleteTask(tasks, uuid)\n {\n var i = 0;\n console.error('tasks', tasks);\n\n for (; i < tasks.length; i++)\n {\n if (uuid == tasks[i].uuid)\n {\n tasks.splice(i, 1);\n i--;\n }\n }\n return tasks;\n }", "function removeTask(elem) {\n elem.parentNode.parentNode.removeChild(elem.parentNode);\n LIST[elem.id].trash = true;\n}", "function deleteTask(req,res){\n\tconsole.log(req.query);\n\n\tconsole.log('***id**= ',req.query.id);\n\tTodoList.findByIdAndDelete(req.query.id, function(err){\n\t\tif(err){\n\t\t\tconsole.log(\"Error in deleting task\");\n\t\t\treturn\n\t\t}\n\t\treturn res.redirect('back');\n\t})\n}", "function taskDeletor(idel) {\n\t\tconst currentTask = tasks.find( el => el.id == idel);\n\t\tlet taskIndex = tasks.indexOf(currentTask);\n\t\ttasks.splice(taskIndex, 1);;\n\t}", "removeTask(e) {\n const index = e.target.parentNode.dataset.key;\n this.tasks.removeTask(index);\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\n }", "deleteTask(taskId) {\n // Create an empty array and store it in a new variable, newTasks\n const newTasks = [];\n\n // Loop over the tasks\n for (let i = 0; i < this.tasks.length; i++) {\n // Get the current task in the loop\n const task = this.tasks[i];\n\n // Check if the task id is not the task id passed in as a parameter\n if (task.id !== taskId) {\n // Push the task to the newTasks array\n newTasks.push(task);\n }\n }\n\n // Set this.tasks to newTasks\n this.tasks = newTasks;\n }", "function delete_task(e) {\n console.log('delete task btn pressed...');\n e.target.parentElement.remove();\n\n }", "function deleteTask(id) {\r\n let Note = document.getElementById(id); \r\n //removes note from page\r\n document.getElementById(\"shoeNotesFromLS\").removeChild(Note); \r\n let indexOfTaskToRemove = tasks.findIndex(task => task.id === id);\r\n //removes from array of tasks\r\n tasks.splice(indexOfTaskToRemove, 1);\r\n //removes from array in local storage\r\n if (tasks.length != 0) {\r\n localStorage.tasks = JSON.stringify(tasks);\r\n }\r\n else {\r\n localStorage.removeItem(\"tasks\");\r\n }\r\n \r\n}", "function removeTask(e) {\n // Clicking on the delete button causes the removal of that list item\n if (e.target.parentElement.classList.contains('delete-item')){\n e.target.parentElement.parentElement.remove();\n removeLocalStorage(e.target.parentElement.parentElement.textContent);\n // Refresh the list to mirror local storage contents as all duplicates are removed\n getTasks(e);\n }\n e.preventDefault();\n}", "function deleteTask(id) {\n // Delete it in DB\n todoListService\n .deleteTask(id)\n .then((response) => console.log(response))\n .catch((error) => console.error(error));\n\n // Filter out the remaining Tasks based on the task Id\n const remainingTasks = tasks.filter((task) => id !== task.id);\n // Update the state\n setTasks(remainingTasks);\n }", "deleteTask(givenID){\n var index = this.list.findIndex(function (item) { return item.id === givenID;})\n var deletedTask = theTaskList.list.splice(index,1);\n if (deletedTask.length === 0){\n return -1;\n }\n else{\n return deletedTask[0];\n }\n }", "function deleteTask(event) {\n //confirm action from used with confirmation alert\n var doDelete = confirm (\"Do you really want to remove selected task?\")\n //if user clicks \"ok\" this returns true and task is removed from the list\n if (doDelete === true) {\n this.parentElement.parentElement.removeChild(this.parentElement);\n } \n //Both done and todo are possible to be removed from list\n this.parentElement.removeEventListener(\"click\", markDone)\n this.parentElement.removeEventListener(\"click\", markTodo)\n //saved into local storage and taskCount is updated\n updateLocalStorage();\n taskCount();\n}", "function deleteTask(del){\n\t$.delete(\"http:localhost:8080/deleteTask\",\n\t\tdel,\n\t\tfunction(data, status){\n\t\t});\n}", "function deleteTask() {\n this.parentNode.parentNode.removeChild(this.parentNode);\n}", "function deleteTask(taskId) {\n console.log('in deleteTask');\n\n $.ajax({\n method: 'DELETE',\n url: `/todo/${taskId}`\n }).then( response => {\n console.log('deleted task', taskId);\n }).catch( error => {\n console.log('delete error', error);\n }); \n\n getTasks();\n}", "function removeTask(e){\n // get the parent list item to remove\n var taskItem = e.target.parentElement;\n taskList.removeChild(taskItem);\n}", "function deleteTasks() {\n const mutateCursor = getCursorToMutate();\n if (mutateCursor) {\n clickTaskMenu(mutateCursor, 'task-overflow-menu-delete', false);\n } else {\n withUnique(\n openMoreMenu(),\n 'li[data-action-hint=\"multi-select-toolbar-overflow-menu-delete\"]',\n click,\n );\n }\n }", "static removeTask(project, task) {\n const qSelector = `#delete-project${project.id}-task${task.id}`\n console.log(qSelector)\n const taskDeleteBtn = document.querySelector(qSelector)\n taskDeleteBtn.addEventListener('click', () => {\n project.removeTask(task);\n DomOutput.loadTaskList(project);\n })\n }", "function del(number) {\n if (number >= list.length) {\n console.log(`\\nInvalid Number\\n`);\n menu()\n } else {\n let task = list[number].task\n list.splice(number, 1);\n console.log(`\\nDeleted ${task}\\n`);\n view();\n }\n}", "function deleteTask(projectid, taskid) {\n data.projects[projectid].tasks.splice(taskid, 1);\n }", "function deleteTask (taskId, callback) {\n var taskKey = datastore.key([\n 'Task',\n taskId\n ]);\n\n datastore.delete(taskKey, function (err) {\n if (err) {\n return callback(err);\n }\n\n console.log('Task %d deleted successfully.', taskId);\n return callback(null);\n });\n}", "'tasks.remove'(taskId) {\n check(taskId, String);\n\n const task = Tasks.findOne(taskId);\n if (task.private && task.owner !== this.userId) {\n // If the task is private, make sure only the owner can delete it\n throw new Meteor.Error('not-authorized');\n }\n\n Tasks.remove(taskId);\n }", "function deleteTask(id) {\n const updatedTasks = tasks.filter((task) => task.taskId !== id);\n setTasks(updatedTasks);\n }", "deleteTask(task) {\n let containerCard = this.get('taskCard');\n let parentFunc = this.get('deleteTask');\n return parentFunc(task, containerCard);\n }", "deleteFromList(taskID) {\n let deleted = this.taskArr.find(task => task.id == taskID)\n this.taskArr = this.taskArr.filter(value => value != deleted)\n return this.taskArr\n }", "function deleteTask(a,b) {\r\n taskList.splice(a,3)\r\n return taskList;\r\n\r\n }", "function deleteTask(task) {\n var index;\n index = myTaskArray.indexOf(task);\n if (index > -1) {\n myTaskArray.splice(index, 1);\n console.log(\"Item \" + task + \" has been deleted from the array\");\n }\n else {\n console.log(\"Item \" + task + \" is not in the array\");\n }\n return myTaskArray.length;\n}", "deleteByTaskId(id, callback) {\n try {\n id = new ObjectID(id)\n } catch (err) {\n callback(null)\n }\n collection.deleteMany({task: id}, callback)\n }", "function deleteToDo(itemDataKey) {\n var cleanDataKey = parseInt(itemDataKey)\n for (var i = 0; i < newToDoList.length; i++) {\n if (newToDoList[i].taskId === cleanDataKey) {\n newToDoList.splice(i, 1);\n break;\n }\n }\n}", "async handleDeleteTask(task) {\n let removeIndex = this.state.tasks.findIndex((t) => (task.id === t.id));\n\n let oldTasks = Array.from(this.state.tasks);\n let newTasks = this.state.tasks.concat();\n newTasks.splice(removeIndex, 1);\n\n // provisional update of state to reflect deletion before request has been sent\n await this.setState({\n tasks: newTasks,\n undoContent: oldTasks,\n undoType: 'deleted'\n });\n\n // if undo button has been pressed, don't send deletion request and revert state instead\n let undoTimer = setTimeout(async () => {\n if (this.state.confirmDelete) {\n await Helpers.fetch(`/api/tasks/${task.id}`, {\n method: 'DELETE'\n });\n } else {\n await this.setState({\n tasks: this.state.undoContent,\n });\n }\n\n await this.setState({\n undoContent: null,\n undoType: null,\n confirmDelete: true\n });\n }, 3000);\n\n this.setState({\n undoTimer: undoTimer\n });\n }", "function deleteTask(task) {\n var index = myArray.indexOf[task];\n myArray.splice(index, 1);\n return myArray.length;\n}", "function deleteTask(id,deleteIds) {\n const path = location.pathname+\"/\"+deleteIds;\n axios.delete(path)\n .then(res => {\n setTasks(prevNotes => {\n return prevNotes.filter((noteItem, index) => {\n return index !== id;\n });\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "function deleteTasks(taskId){\n $.ajax({\n url: '/tasks/' + taskId,\n type: 'DELETE',\n success: function(response){\n console.log(response);\n getTasks();\n } // end success\n }); //end ajax\n}", "function deleteTodoTask(key) {\n const index = todoListArray.findIndex(item => item.id === Number(key));\n const delTodo = {\n deleted: true,\n ...todoListArray[index]\n }\n\n delTodo.deleted = true\n todoListArray = todoListArray.filter(item => item.id !== Number(key));\n showTodoList(delTodo);\n}", "function removeTask(e) {\r\n let li = e.target.parentElement.parentElement;\r\n let a = e.target.parentElement;\r\n if (a.classList.contains('delete-item')) {\r\n if (confirm('Are You Sure ?')) {\r\n li.remove();\r\n removeFromLS(li);\r\n }\r\n }\r\n}", "function removeTodoById(id, li) {\n connection.remove({\n from: 'tasks',\n where: {\n id: id\n }\n }).then(() => {\n li.remove()\n // alert('Todo removed')\n })\n}", "function removeTask(e) {\n\tif (e.target.parentElement.classList.contains('delete-item')) {\n\t\tif (confirm('Are You Sure?')) {\n\t\t\te.target.parentElement.parentElement.remove();\n\t\t\t/*Ako parentElement ima klasu delete-item onda hocu da...*/\n\n\t\t\t//-Remove from LS-//\n\t\t\tremoveTasksFromLocalStorage(e.target.parentElement.parentElement);//Funkcija za brisanje iz LS\n\t\t}\n\t}\n}", "function deleteTask(taskId) {\n return TaskModel.remove({_id: taskId});\n }", "removeTask(taskId) {\n const dbRef = firebase.database().ref();\n dbRef.child(taskId).remove();\n }", "function removeTask(e) {\n\n const elementValue = e.target.parentNode.getElementsByTagName(\"p\")[0].innerHTML;\n \n const tasksArray = Array.from(getLocalStorageTasks());\n\n tasksArray.forEach(task => {\n if (task == elementValue) {\n const filteredArray = tasksArray.filter(item => item != elementValue);\n \n setLocalStorage(filteredArray);\n\n // we need to fetch done tasks from local storage\n // then copy the elements + add the completed one\n // set new array to localStorage complete tasks\n //setCompleteTasksLocalStorage()\n refreshTasks();\n }\n })\n}", "deleteSubtask(event) {\n\n let idToDelete = event.target.name;\n let subtasks = this.subtasks;\n let subtaskIndex;\n let recordIdToDelete;\n\n this.processing = true;\n\n for (let i = 0; i < subtasks.length; i++) {\n if (idToDelete === subtasks[i].id) {\n subtaskIndex = i;\n }\n }\n\n recordIdToDelete = subtasks[subtaskIndex].recordId;\n\n deleteSubtask({recordId: recordIdToDelete})\n .then(result => {\n if (result) {\n subtasks.splice(subtaskIndex, 1);\n } else {\n }\n })\n .catch(error => console.log(error))\n .finally(() => this.processing = false);\n this.subtasks = event.target.querySelector(refreshSubtaskList);\n }", "function deleteTask(e) {\n e.preventDefault();\n if (e.target.className === 'delete-task') {\n e.target.parentElement.remove();\n deleteTaskLocalStorage(e.target.parentElement.textContent);\n\n //alert('Tweet eliminado')\n }\n\n}", "static async removeTask(id) {\n let result = await Task.findOneAndDelete({id}).exec()\n return result\n }", "function removeTask(e) {\n\tupdateSidebar(e);\n\t\n\t//updating task description\n\tupdateTaskDescription(e);\n\t\n\te.target.parentElement.parentNode.removeChild(e.target.parentElement);\n}", "delete(id, item) {\n this.tasks = this.tasks.filter(task => task.id !== id);\n\n localStorage.setItem(this.storageList, JSON.stringify(this.tasks));\n item.remove();\n }", "function deleteLS(delItem){\n console.log(\"delete activated\");\n let task;\n if(localStorage.getItem('task') === null)\n {\n task=[];\n }\n else\n {\n task=JSON.parse(localStorage.getItem('task'));\n\n\n }\n\n \n task.forEach(function(tasks,index){\n \n if(delItem.innerHTML === tasks){\n \n\n \n \n task.splice(index,1);\n }\n })\n localStorage.setItem('task',JSON.stringify(task));\n}", "function deleteTask(el) {\n\tel.parentNode.remove();\n}", "function deleteTask(deleteButton) {\n var task = deleteButton.closest(\"task\");\n var tasks = document.getElementsByTagName(\"task\");\n for (i = 0; i < tasks.length; i++) {\n var currentTask = tasks[i];\n if (currentTask === task) {\n localStorage.removeItem(i);\n task.parentNode.removeChild(task);\n }\n }\n }", "deleteTask(taskId) {\n // Create an empty array and store it in a new variable, newTasks\n const newTasks = [];\n console.log( `taskId: ${taskId}` );\n\n // Loop over the tasks\n for (let i = 0; i < this.tasks.length; i++) {\n // Get the current task in the loop\n const task = this.tasks[i];\n\n // Check if the task id is not the task id passed in as a parameter\n if (task.id !== taskId) {\n // Push the task to the newTasks array\n newTasks.push(task);\n }\n }\n\n // Set this.tasks to newTasks\n this.tasks = newTasks;\n console.log(this.tasks);\n }", "function CompleteTask() \n{ \n var listItem = this.parentNode;\n var ul = listItem.parentNode;\n var tarInd = listItem.querySelector(\"p\");\n\n ul.removeChild(listItem);\n\n taskArr.splice([tarInd.value],1);\n\n console.log(taskArr);\n}", "function removeTask(lnk) {\n\tvar id = lnk.href.match(/task=(\\d+)\\&?/)[1];\n\n\tvar index = findId(id);\n\tif(index != -1) {\n\t\thideCurrentTask();\n\t\t\n\t\tvar new_tasks = [];\n\t\tfor(var i=0; i<tasks.length; i++) {\n\t\t\tif(i != index)//Delete the index'th item\n\t\t\t\tnew_tasks.push(tasks[i]);\n\t\t}\n\t\ttasks = new_tasks;\n\t\t\n\t\tif(!tasks.length) {\n\t\t\t$(\"controls\").innerHTML = t(\"There are no more tasks left\");\n\t\t\t\n\t\t} else {\n\t\t\tvar id = tasks[current_task];\n\t\t\tif(id) $(\"task-\"+id).className = \"active\";\n\t\t}\n\t}\n}", "function deleteTask(itemId) {\n console.log(itemId);\n // DELETE /api/items/{ID}\n return $http({\n method: \"DELETE\",\n url: \"/tasks/\" + itemId\n });\n }", "doTaskUndone(target) {\n let index = [...target.parentElement.children].indexOf(target);\n this.doneTaskArr.splice(index - 1, 1);\n this.undoneTaskArr.push(target.children[0].value);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n const task = new Task(target.children[0].value);\n this.taskListUnDone.appendChild(task.createUndoneTask());\n target.remove();\n }", "function deleteTask(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/task/\"+id\n })\n .then(function() {\n viewData();\n });\n }", "function removeTask(e) {\n if (e.target.parentElement.classList.contains('delete-item')) {\n if (confirm('Are you sure?')) {\n e.target.parentElement.parentElement.remove();\n\n removeTaskFromLocalStorage(Number(e.target.parentElement.parentElement.id.substring(5)))\n }\n }\n}", "function delTask(index) {\n let getLocalStorage = localStorage.getItem(\"New Todo\"); // Getting the localstorage\n listArr = JSON.parse(getLocalStorage);\n listArr.splice(index, 1);\n\n localStorage.setItem(\"New Todo\", JSON.stringify(listArr));\n showTasks();\n}", "function deleteTask(self){\n clearInterval(timeVar);\n var neededId = getNeededId(self);\n $.ajax({\n url: $SCRIPT_ROOT + '/delete',\n data: {'id': neededId},\n type: 'POST',\n success: function(response){ returnToBeginning(neededId); },\n error: function(response){ handleResponseFromServer(response); }\n });\n}", "function removeTaskFromList(req, res, next) {\n var generateResponse = Api_Response(req, res, next);\n var taskId = req.params.task_id;\n var listId = req.params.list_id;\n List\n .remove_task(taskId, listId)\n .then(function (list) {\n var activity = new Activity({\n action: 'activityFeed.removeTaskFromList',\n project: list.board.project,\n user: req.user._id,\n node: taskId,\n board: list.board._id,\n boardName: list.board.name,\n list: list._id,\n listName: list.name\n });\n activity.save(function (error) {});\n\n // Send socket.io message.\n socket.removeTaskFromList(taskId, list, req.user._id);\n\n generateResponse(null, list);\n })\n .catch(generateResponse);\n}", "function removeTask() {\n var result = confirm('Permanently delete this task?');\n if (result) {\n var values = {};\n values.id = $(this).data('id');\n console.log($(this).data('id'));\n\n $.ajax({\n type: 'POST',\n url: 'task/remove',\n data: values,\n success: function () {\n updateTaskList();\n }\n });\n }\n}", "deleteTask(taskId, callback) {\n\n var result, response;\n\n this.db.deleteItem({ TableName: this.tableName, Key: { taskId: taskId } }, function (err, data) {\n if (err) {\n callback(err, null);\n } else {\n response = {\n statusCode: 200,\n body: JSON.stringify({\n message: \"task \" + taskId + \" has been deleted.\"\n }),\n };\n callback(null, response);\n }\n });\n }", "function removeDOMTask(event, list = inbox) {\n \n if (event.target.tagName === 'A') {\n // remover tarea de la lista, (se necesita el índice)\n list.removeTask(getTaskIndex(event), tasksContainerElement); \n }\n}", "function deleteDone(doneUl, doneLi, json) {\n\tconst configObj = {\n\t\tmethod: \"DELETE\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\"Accept\": \"application/json\"\n\t\t}\n\t}\n\n\tfetch(`http://localhost:3000/tasks/${json.id}`, configObj)\n\n\tdoneUl.removeChild(doneLi);\n}", "function deleteNewTask(e){\r\n const item = e.target;\r\n \r\n if(item.classList[0] === 'btnDelete'){\r\n const todo = item.parentElement;\r\n todo.remove();\r\n }\r\n if(item.classList[0] === 'imp-task'){\r\n \r\n item.classList.toggle('fas');\r\n }\r\n}", "function removeTask(event) {\n\n let id = event.target.dataset.id;\n let tareaEliminar = event.target.parentNode;\n console.log(tareaEliminar);\n\n tareaEliminar.parentNode.removeChild(tareaEliminar)\n\n //buscar en el array la posicion\n let posicionBorrar = tasks.findIndex(task => {\n return task.titulo == id\n })\n\n console.log(posicionBorrar);\n tasks.splice(posicionBorrar, 1)\n}", "function deleteTask(){\n var result = confirm('Are you sure you want to delete?');\n if (result){\n var deleteID = $( this ).data( 'id' );\n var delTask = {\n \"id\": deleteID\n };\n $.ajax({\n type: 'POST',\n url: '/postDelete',\n data: delTask\n });\n getTasks();\n }else{\n return false;\n }\n }", "function deleteTask(clickedId) {\n $.ajax({\n method: 'DELETE',\n url: `/tasks/${clickedId}`,\n }).then(function(response) {\n getTasks();\n }).catch(function(error) {\n console.log('error in DELETE:', error);\n });\n}", "handleDeleteTask (id) {\n this.model.deleteTask(id);\n }", "function removeTask(task, taskList) {\n newArr = [];\n for (var i = 0; i < taskList.length; ++i) {\n if (task.eID === taskList[i].eID) {\n newArr = taskList.slice(i, i + 1);\n return newArr;\n }\n }\n}", "function delTask(e) {\n e.parentNode.remove()\n}", "function deleteTask(key,element) {\n firebase.database().ref('todoList').child(key).remove();\n element.parentElement.parentElement.remove();\n}", "function deleteTask(index) {\n\tlet getLocalStorage = localStorage.getItem(\"New Todo\"); //getting localStorage\n listArr = JSON.parse(getLocalStorage);\n listArr.splice(index, 1)//remove or delete the particuler indexed li\n //after remove li again update localStorage\n localStorage.setItem(\"New Todo\", JSON.stringify(listArr)); // transforming js objcet into a json string\n\tshowTasks();\n}", "function removeDOMTask (e, list = inbox) {\n\t// Se comprueba que se pulso el enlace (nombre de la etiqueta en mayuscula)\n\tif (e.target.tagName === 'A') {\n\t\t// Remover tarea de la lista (se necesita el indice)\n\t\tlist.removeTask(getTaskIndex(e), taskContainerElement);\n\t}\n\n\t// console.log('remove');\n}", "deleteAllTasks () {\r\n this.eliminatedTask.splice(0, this.eliminatedTask.length);\r\n }" ]
[ "0.8193291", "0.81615853", "0.8121757", "0.808274", "0.8004172", "0.7977931", "0.7931227", "0.79140383", "0.78764004", "0.7874437", "0.7833239", "0.7693", "0.76769716", "0.7676726", "0.7653592", "0.7650218", "0.7645165", "0.7638648", "0.76268345", "0.7599988", "0.759349", "0.7554636", "0.7542396", "0.75357544", "0.7535194", "0.7518346", "0.75113195", "0.75004226", "0.74889845", "0.746521", "0.7452472", "0.7447104", "0.74412614", "0.7435023", "0.74277925", "0.74221146", "0.7386608", "0.7383527", "0.73797923", "0.73778784", "0.7369016", "0.736573", "0.73646003", "0.7328547", "0.7324825", "0.7319997", "0.72929937", "0.72898215", "0.7284686", "0.72830135", "0.7258559", "0.7253725", "0.7231522", "0.7222096", "0.7197628", "0.7191247", "0.7179121", "0.7174059", "0.7168707", "0.71682084", "0.715468", "0.71534485", "0.7142982", "0.7135601", "0.71347684", "0.7128019", "0.71182287", "0.7115276", "0.7090951", "0.70896155", "0.7083472", "0.708339", "0.70664185", "0.70660126", "0.7063592", "0.7062923", "0.7054494", "0.704735", "0.7046932", "0.7045888", "0.7032281", "0.70282567", "0.7021348", "0.7019734", "0.7017539", "0.7012633", "0.7010854", "0.7009328", "0.70017964", "0.7000738", "0.699413", "0.6992034", "0.6980253", "0.6974121", "0.6948114", "0.6942678", "0.6940487", "0.6940376", "0.6938002", "0.693767", "0.6930344" ]
0.0
-1
This will begin the roulette
function startRoulette(){ if($('#currentTask').text()=='') { allTasks = $('#taskList').children('li'); taskToDoIndex = Math.floor(Math.random()*allTasks.length); currentTaskPosition = taskToDoIndex; task = $('#taskList li').get(taskToDoIndex).innerHTML; task = task.split('|'); task[1] = parseInt(task[1]); $('#currentTask').text('The Roulette Assigned Task Is : ' + task[0]); $('#pointsAvailable').text('The Number of Points Up For Grabs are : '+task[1]); $('#completed').show(); } else { alert("Haven't Finished the current task yet!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roulette() {\n var tmp = 0;\n for(var l = arguments.length - 1; l > 0; l--) {\n roulette.two(arguments[l + tmp++], arguments[l-1]);\n }\n}", "rouletteWheel() \n {\n //To look at a car's progress, iterate through this.population[i] with each\n //of them being indviduals\n \n //totalProgress represents the accumulated progress that all of the progress had made \n var totalProgress = 0;\n //console.log(\"1: totalProgress\"+ totalProgress);\n for(let i = 0; i < this.popSize; i++) \n {\n let individual = this.population[i];\n let carGeno = this.population[i].returnGenotype();\n let carFit = this.population[i].returnFitness();\n //console.log(\"1: carFit(\" + i + \") - \" + carFit);\n //console.log(\"2: carGeno - \" + carGeno);\n totalProgress = totalProgress + individual.returnFitness();\n //console.log(\"2: \" + totalProgress);\n //console.log(\"3: \"+ this.population[i].fitness); //Don't use the way to get the fitness\n }\n //console.log(\"160: rouletteWheel() totalProgress: \" + totalProgress);\n //Determine the percentage chance of choosing each of the \n for(let j = 0; j < this.popSize; j++) \n {\n this.population[j].fitness /= totalProgress;\n //console.log(\"165: rouletteWheel() this.population[j].fitness: \" + this.population[j].fitness);\n }\n\n //Here all the fitnesses sum up to 1\n let choice = random();\n let fitnessSoFar = 0;\n\n //Go through the fitness until we reach the value of choice\n for(let k = 0; k < this.popSize; k++) \n {\n fitnessSoFar += this.population[k].fitness;\n\n if(choice < fitnessSoFar) \n {\n return this.population[k];\n }\n }\n\n return this.population[this.population.length - 1];\n }", "function Roulette( startingBankroll ) {\n this.balance = startingBankroll;\n\n this.spin = function( bet, input ) {\n\n if ( bet <= this.balance ) {\n var result = Math.floor( Math.random() * 37 + 1 );\n\n if ( typeof( input ) === \"number\" ) {\n var multiplier = this.checkNumber( input, result );\n } else {\n var multiplier = this.checkString( input.toLowerCase(), result );\n }\n\n if ( result === 37 ) {\n result = \"00\"\n }\n\n if ( multiplier !== 0 ) {\n winnings = bet * multiplier;\n this.balance += winnings;\n var message = \"You win \" + winnings + \", the spin was \" + result + \"!!!\";\n } else {\n this.balance -= bet;\n var message = \"You lose! The spin was \" + result;\n }\n\n message += \"\\nYou now have \" + this.balance;\n console.log( message );\n } else {\n console.log( \"You can't bet more than you have!\" );\n }\n\n return result;\n };\n\n this.bankroll = function() {\n console.log( this.balance );\n return this.balance;\n };\n\n this.buyIn = function( amount ) {\n this.balance += amount;\n return this.balance;\n }\n\n this.checkNumber = function(input, result) {\n var multiplier = 0;\n if ( input === result ) {\n multiplier = 35;\n }\n return multiplier;\n };\n\n this.checkString = function(input, result) {\n var multiplier = 0;\n\n switch(input) {\n case '00':\n if (result === 37) {\n multiplier = 35;\n }\n break;\n case 'even':\n if (result % 2 === 0 && result !== 0 ) {\n multiplier = 1;\n }\n break;\n case 'odd':\n if (result % 1 === 1 && result !== 37) {\n multiplier = 1;\n }\n break;\n case '1 to 18':\n if (result >= 1 && result <= 18) {\n multiplier = 1;\n }\n break;\n case '19 to 36':\n if (result >= 19 && result <= 36) {\n multiplier = 1;\n }\n break;\n case '1st 12':\n if (result >= 1 && result <= 12) {\n multiplier = 2;\n }\n break;\n case '2nd 12':\n if (result >= 13 && result <= 24) {\n multiplier = 2;\n }\n break;\n case '3rd 12':\n if (result >= 25 && result <= 36) {\n multiplier = 2;\n }\n break;\n }\n return multiplier;\n };\n\n}", "function rouletteBlackRed() {\n return Math.floor(Math.random() * 100)<47;\n}", "init() {\n roulette.data = utils.loadData();\n }", "function singleSpin() {\n if((bet_i>cash_i) || (bet_i===0)){\n bet.className=\"error\";\n stoploop_i = true;\n return stoploop_i;\n }\n\n spin_i++;\n if (rouletteBlackRed()){\n cash_i+=bet_i;\n win_i++;\n\n if(onwin_i===0) {\n stoploop_i = true;\n }\n else {\n bet_i = Math.floor(bet_i * onwin_i);\n }\n }\n else {\n cash_i-=bet_i;\n lose_i++;\n\n if(onlose_i===0) {\n stoploop_i = true;\n }\n else {\n bet_i = Math.floor(bet_i * onlose_i);\n }\n }\n return stoploop_i;\n }", "function makeRope()\n\t\t\t{\n\t\t\t\tbranchBank -= 5;\n\t\t\t\tleafBank -= 5;\n\t\t\t\tropeBank++;\n\t\t\t\taction(1,1,1);\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "function roulette_wheel(population, fitnesses) {\n sum_fitness = fitnesses.reduce((total, current) => total + current, 0)\n select_id = -1\n random = (Math.random() * (sum_fitness)) + 0\n fitnesses.some((item, i) => {\n // console.log(random + \" + \" + item)\n if (random <= 0) {\n select_id = i; \n return true\n }\n random -= item; \n return false\n })\n select_id == -1 ? roulette_wheel(population, fitnesses) : select_id\n return population[select_id]\n // return select_id\n}", "drawRouletteWheel() {\r\n const { baseSize } = this.props;\r\n let { startAngle, arc } = this.state;\r\n let ctx;\r\n const canvas = this.refs.canvas;\r\n if (canvas.getContext) {\r\n const outsideRadius = baseSize - 205;\r\n const textRadius = baseSize - 45;\r\n const insideRadius = baseSize - 55;\r\n ctx = canvas.getContext('2d');\r\n ctx.clearRect(0,0,600,600);\r\n ctx.strokeStyle = 'white';\r\n ctx.lineWidth = 2;\r\n ctx.font = '14px Helvetica, Arial';\r\n\r\n //The section below controls the creation of the RouletteWheel\r\n for(let i = 0; i < this.state.cuisineArr.length; i++) {\r\n const angle = startAngle + i * arc;\r\n ctx.fillStyle = this.getColor(i, this.state.cuisineArr.length);\r\n ctx.beginPath();\r\n ctx.arc(baseSize, baseSize, outsideRadius, angle, angle + arc, false);\r\n ctx.arc(baseSize, baseSize, insideRadius, angle + arc, angle, true);\r\n ctx.fill();\r\n ctx.save();\r\n ctx.fillStyle = 'white';\r\n ctx.translate(baseSize + Math.cos(angle + arc / 2) * textRadius,\r\n baseSize + Math.sin(angle + arc / 2) * textRadius);\r\n ctx.rotate(angle + arc / 2 + Math.PI / 2);\r\n const text = this.state.cuisineArr[i];\r\n ctx.fillText(text, -ctx.measureText(text).width / 2, 0);\r\n ctx.restore();\r\n }\r\n \r\n //The section below controls the creation and styling for the RouletteWheel arrow symbol.\r\n ctx.fillStyle = 'red';\r\n ctx.beginPath();\r\n ctx.lineTo(baseSize + 10, baseSize - (insideRadius + 5));\r\n ctx.lineTo(baseSize + 0, baseSize - (insideRadius - 20));\r\n ctx.lineTo(baseSize - 10, baseSize - (insideRadius + 5));\r\n ctx.fill();\r\n ctx.stroke();\r\n }\r\n }", "spinWheel() {\n\n if (!_extra && (_rb + _gb < 10000)) {\n swal({\n title: \"Số dư không đủ\",\n text: \"Bạn có muốn nạp tiền ngay?\",\n type: \"warning\",\n showCancelButton: !0,\n confirmButtonText: \"Nạp ngay\",\n cancelButtonText: \"Hủy\"\n }).then(function (e) {\n e.value && (window.location.href = Utils.UrlRoot + 'user/cashin')\n });\n return;\n }\n\n // can we spin the wheel?\n if (this.canSpin) {\n this.prizeText.setText(\"\");\n\n // the wheel will spin round from 2 to 4 times. This is just coreography\n var rounds = Phaser.Math.Between(2, 4);\n\n // then will rotate by a random number from 0 to 360 degrees. This is the actual spin\n var degrees = 1;\n var desc;\n\n var cur_gb = _gb;\n var cur_rb = _rb;\n if(!_extra) {\n if (cur_gb >= 10) {\n numberChangeAnimation(cur_gb, cur_gb - 10, 'game_balance');\n cur_gb -= 10;\n } else {\n numberChangeAnimation(cur_rb, cur_rb - 10, 'real_balance');\n }\n }\n\n showLoading();\n $.ajax({\n type: \"POST\",\n url: Utils.UrlRoot + 'user/playWheelGame',\n async: false, \n success: function (data) {\n if (data.ResponseCode >= 0) {\n degrees = data.Position;\n desc = data.Description;\n _rb = data.rb;\n _gb = data.gb;\n if(_extra) _gb += 10;\n _extra = data.Bonus;\n\n } else if (data.ResponseCode === -1) {\n swal({\n title: \"Số dư không đủ\",\n text: \"Bạn có muốn nạp tiền ngay?\",\n type: \"warning\",\n showCancelButton: !0,\n confirmButtonText: \"Nạp ngay\",\n cancelButtonText: \"Hủy\"\n }).then(function (e) {\n e.value && (window.location.href = Utils.UrlRoot + 'user/cashin')\n });\n\n } else {\n swal(\"Thất bại!\", data.Description, \"warning\");\n }\n hideLoading();\n }\n }).fail(function () {\n swal(\"Thất bại!\", 'Hệ thống đang bận, vui lòng thử lại sau!', \"warning\");\n hideLoading();\n });\n // resetting text field\n \n // before the wheel ends spinning, we already know the prize according to \"degrees\" rotation and the number of slices\n// var prize = gameOptions.slices - 1 - Math.floor(degrees / (360 / gameOptions.slices));\n\n // now the wheel cannot spin because it's already spinning\n this.canSpin = false;\n\n // animation tweeen for the spin: duration 3s, will rotate by (360 * rounds + degrees) degrees\n // the quadratic easing will simulate friction\n this.tweens.add({\n\n // adding the wheel to tween targets\n targets: [this.wheel],\n\n // angle destination\n angle: 360 * rounds + degrees,\n\n // tween duration\n duration: gameOptions.rotationTime,\n\n // tween easing\n ease: \"Cubic.easeOut\",\n\n // callback scope\n callbackScope: this,\n\n // function to be executed once the tween has been completed\n onComplete: function (tween) {\n\n // displaying prize text\n this.prizeText.setText(desc);\n\n // Header balance\n numberChangeAnimation(cur_gb, _gb, 'game_balance');\n\n // player can spin again\n this.canSpin = true;\n\n }\n });\n }\n }", "function callPipette(){\n\t// Move the pipette from air into the beaker\n\tif(step_no == 4){\n\t\tstep_no++;\n\t\t$(\"#pipette_arrow\").hide();\n\t\t$(\"#pipette_arrow\").rotate({angle:160});\n\t\t$(\"#pipette_arrow\").css(\"top\",\"415%\");\n\t\t$(\"#pipette_arrow\").css(\"left\",\"37%\");\n\t\t$(\"#pipette_txt\").css(\"top\",\"300%\");\n\t\t$(\"#pipette_txt\").css(\"left\",\"49%\");\n\t\t$(\"#pipette_txt\").hide();\n\t\tsetTimeout(function() {\n\t\t\t$(\"#pipette_txt\").show();\n\t\t\t$(\"#pipette_arrow\").show();\n\t\t\t$(\"#change\").html(\"Click on the pipette to draw 10ml of tri-sodium citrate solution from the beaker...\");\n\t\t}, 1000);\n\t\tmove(\"#pipette\",-310,170,1000);\n\t}\n\t// Reduce the volume of the beaker and move the pipette back to its original position\n\telse if(step_no == 5){\n\t\t$(\"#beaker_water\").velocity({ \n\t\t\theight: \"30%\",\n\t\t\ttranslateY: \"110%\",},\n\t\t\t{ duration: 500});\n\t\tstep_no++;\n\t\t$(\"#pipette_arrow\").hide();\n\t\t$(\"#pipette_txt\").hide();\n\t\t$(\"#pipette_arrow\").rotate({angle:0});\n\t\t$(\"#pipette_arrow\").css(\"top\",\"380%\");\n\t\t$(\"#pipette_arrow\").css(\"left\",\"33%\");\n\t\t$(\"#pipette_txt\").css(\"top\",\"500%\");\n\t\t$(\"#pipette_txt\").css(\"left\",\"30%\");\n\t\tsetTimeout(function() {\n\t\t\tmove(\"#pipette\",5,-10,1000);\n\t\t\tsetTimeout(function() {\n\t\t\t\t$(\"#pipette_txt\").show();\n\t\t\t\t$(\"#pipette_arrow\").show();\n\t\t\t\t$(\"#change\").html(\"Click on the pipette to move it over to the Flask containing boiling AgNO<sub>3</sub> solution..\");\t\n\t\t\t}, 1000);\n\t\t}, 1000);\n\t}\n\t// Move the pipette towards the flask containing the magnet\n\telse if( step_no == 6){\n\t\tstep_no++;\n\t\t$(\"#pipette_arrow\").hide();\n\t\t$(\"#pipette_arrow\").css(\"top\",\"300%\");\n\t\t$(\"#pipette_arrow\").css(\"left\",\"47%\");\n\t\t$(\"#pipette_txt\").hide();\n\t\t$(\"#pipette_txt\").css(\"top\",\"430%\");\n\t\t$(\"#pipette_txt\").css(\"left\",\"44%\");\n\t\tmove(\"#pipette\",348,-55,1000);\n\t\tsetTimeout(function() {\n\t\t\t$(\"#change\").html(\"Click on the pipette to add tri-sodium citrate solution, drop by drop to boiling AgNO<sub>3</sub> solution in the flask...\");\t\n\t\t\t$(\"#drop\").show();\n\t\t\t$(\"#pipette_arrow\").show();\n\t\t\t$(\"#pipette_txt\").show();\n\t\t}, 1000);\n\t}\n\t// Creates the effect of drops of liquid falling into the beaker\n\telse if( step_no == 7){\n\t\t$(\"#pipette_arrow\").hide();\n\t\t$(\"#pipette_txt\").hide();\n\t\tremovePointer(pipette);\n\t\tstep_no++;\n\t\t$(\"#drop\").animate({ top: \"506.7%\"},500);\n\t\tsetTimeout(function() {\n\t\t\t$(\"#drop\").animate({ top: \"385.4%\"},1);\n\t\t\t$(\"#drop\").animate({ top: \"506.7%\"},500);\n\t\t\tsetTimeout(function() {\n\t\t\t\t$(\"#drop\").animate({ top: \"385.4%\"},1);\n\t\t\t\t$(\"#drop\").animate({ top: \"506.7%\"},500);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$(\"#drop\").animate({ top: \"385.4%\"},1);\n\t\t\t\t\t$(\"#drop\").animate({ top: \"506.7%\"},500);\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t$(\"#drop\").animate({ top: \"385.4%\"},1);\n\t\t\t\t\t\t$(\"#drop\").animate({ top: \"506.7%\"},500);\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t$(\"#drop\").animate({ top: \"385.4%\"},1);\n\t\t\t\t\t\t\t$(\"#drop\").animate({ top: \"506.7%\"},500);\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t$(\"#drop\").hide();\n\t\t\t\t\t\t\t\t$(\"#txt\").show();\n\t\t\t\t\t\t\t\t$(\"#change\").html(\"Golden coloured Silver colloid formed....<br> Click on RESET to start the experiment again...\")\n\t\t\t\t\t\t\t\t$(\"#change\").css(\"margin-top\",\"-8px\");\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}, 500);\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t}, 500);\n\t\t\t\t}, 500);\n\t\t\t}, 500);\n\t\t}, 500);\n\t\t$(\"#color\").animate({opacity:0.8},3000);\n\t}\n}", "function rest()\n\t\t\t{\n\t\t\t\tif (randInt(1,2) == 1)\n\t\t\t\t{\n\t\t\t\t\taction(1,0,0);\n\t\t\t\t}\n\t\t\t\tif (randInt (1,2) == 1)\n\t\t\t\t{\n\t\t\t\t\taction(0,1,0);\n\t\t\t\t}\n\t\t\t\tstamina = (stamina * 10 + 10) / 10;\n\t\t\t\tif (stamina > 10)\n\t\t\t\t{\n\t\t\t\t\tstamina = 10;\n\t\t\t\t}\n\t\t\t\tif (thirst < 0)\n\t\t\t\t{\n\t\t\t\t\thealth = ((health * 10) + (thirst * 10)) / 10;\n\t\t\t\t\tthirst = 0;\n\t\t\t\t}\n\t\t\t\thealth = (health * 10 + 1) / 10;\n\t\t\t\tif (health > 10)\n\t\t\t\t{\n\t\t\t\t\thealth = 10;\n\t\t\t\t}\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "function LetThereBeRobberies() {\r\n\t\tvar DoesIHaveStamina = parseInt(document.getElementById('user_stamina').innerHTML);\r\n\t\tvar DoesIHaveEn = parseInt(document.getElementById('user_energy').innerHTML);\r\n\t\tif (!DroneOnOff){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tskillspender();\r\n\t\tif ((DoesIHaveStamina < stamy) && (DoesIHaveEn < howmuchy)) {\r\n\t\t\tif(DoesIHaveEn > 165){\r\n\t\t\t\tsetTimeout(Travelmeepmeep,3500);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (doireallynothaveenorstam < 5){\r\n\t\t\t\tdoireallynothaveenorstam++\r\n\t\t\t\tsetTimeout(FobOrRobTravelr,3500);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (StopOn){\r\n\t\t\t\tsetTimeout(GoTime,(restartref));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\talert('Not enough Energy or Stamina to continue!');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (DoesIHaveStamina < stamy) {\r\n\t\t\tsetTimeout(JobTravelr,3500);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif ((EnAlways == 'checked') && (DoesIHaveEn > howmuchy)) {\r\n\t\t\tsetTimeout(JobTravelr,3500);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tRatio();\r\n\t\tif (weratioing == true && NeededRatio < ratiochan){ \r\n\t\t\tRobOrFoB = 5;\r\n\t\t\tRobOn = false;\r\n\t\t\tstamy = 5;\r\n\t\t\tsetTimeout(FobOrRobTravelr,3500);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (weratioingwitfobs == true && NeededRatio < ratiochan){ \r\n\t\t\tRobOrFoB = false;\r\n\t\t\tRobOn = false;\r\n\t\t\tstamy = 120;\r\n\t\t\tsetTimeout(FobOrRobTravelr,3500);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdoireallynothaveenorstam = 0;\r\n\t\t\tdo_ajax ('', 'remote/html_server.php?xw_controller=robbing&xw_action=rob&xw_city='+WhereAmI+'&slot=0', 1, 0, RobbingController.preRob(0), RobbingController.rob);\r\n\t\t\tsetTimeout(slotone, (robslowdown));\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "function startGame(){\n\tcomputerRandomNumber = Math.floor(Math.random()*(120 - 19 + 1) + 19);\n\tuserTotalScore = 0;\n\trescrambleCrystalValues();\n\tupdateDisplay();\n}", "function h_getRobbed()\n{\n\tvar robberyFactor = h_getRandomInt(10,90); // calculate the percentage player will loose while being robbed\n\n\t// calculate money stolen\n\tvar stolen = Math.round(cash / 100 * robberyFactor);\n\tcash = cash - stolen; \n\t\t\t\t\n\tvar n = noty({text: '<p><i class=\"fa fa-qq\"></i> Robbery</p>You got robbed. Loss '+stolen+' $.'});\n\tlog.info(\"Got robbed - you lost \"+stolen+\" $ (robbery)\");\n\t\n\thealth = health -10;\n\t\n\th_updateAllUIElements();\n}", "function usePaper() {\n let aiChoice = aiTurn();\n let lastRound = comparator(1, aiChoice);\n endRound(aiChoice, lastRound);\n }", "function gameStart() {\n matchNumber = Math.floor((Math.random() * (120 - 19 + 1) + 19));\n $(\".matchNumber\").html(matchNumber);\n \n gem1 = (Math.ceil(Math.random() * 12));\n // console.log('GameStart Gem1: ' + gem1);\n gem2 = (Math.ceil(Math.random() * 12));\n gem3 = (Math.ceil(Math.random() * 12));\n gem4 = (Math.ceil(Math.random() * 12));\n\n Total = 0;\n $(\".guessTotal\").html(Total);\n }", "function randomizer() {\n target = Math.floor(Math.random() * 100) + 19;\n gem1rando = Math.floor(Math.random() * 13) + 2;\n gem2rando = Math.floor(Math.random() * 13) + 2;\n gem3rando = Math.floor(Math.random() * 13) + 2;\n gem4rando = Math.floor(Math.random() * 13) + 2;\n }", "flipCoin() {\n var head = 0, tail = 0;\n\tvar n = readlinesync.questionInt(\"Enter the number of times to Flip Coin....\");\n\tvar r = require('random-number');\n\tfor (var i = 0; i < n; i++) {\n\t\tvar size = r();\n\t console.log(size);\n\t\tif (size < 0.5) {\n\t\t\thead++;\n\t\t}\n\t\telse {\n\t\t tail++;\n\t\t}\n\t}\n\tconsole.log(\"Heads:\" + head);\n\tconsole.log(\"Tails:\" + tail);\n\tvar perhead = (head * 100 / n);\n\tvar pertail = (tail * 100 / n);\n\tconsole.log(\"percentage of Heads vs tail:\" + perhead);\n\tconsole.log(\"percentage of Tails vs head:\" + pertail);\n}", "function makeDecision() {\n clearInterval(slotTimers[currSlot]);\n $(\".slot\").eq(currSlot).attr(\"src\", \"img/\" + images[indexOfCurrImg[currSlot]]);\n slots[currSlot] = indexOfCurrImg[currSlot];\n\n if (currSlot >= 2) {\n clearInterval(decisionTimer);\n computeSpinResult(); // Callback\n }\n currSlot++;\n}", "function russianRoulette(num) {\n let counter = 0;\n\treturn function(){\n counter++;\n if ( counter < num) {\n\t return 'click';\n } else if (counter == num) {\n return 'bang';\n } else {\n return 'reload to play again';\n }\n }\n}", "function run_primer() {\n\t\t\t\tclearInterval(checking)\n\t\t\t\tget_fallback(['orange','banana']) // primer\n\t\t\t\tfunction run_real() {\n\t\t\t\t\tget_fallback(fntList)\n\t\t\t\t\tclearInterval(checking2)\n\t\t\t\t}\n\t\t\t\tlet checking2 = setInterval(run_real, 25)\n\t\t\t}", "function start_opp_timer() {\n\t\ttime--;\n\t\trun_timer(time);\n\n\t\tif(score >= TARGET_POINTS){\n\t\t\t// console.log('WOOOOOHHOOOO!!! your at '+TARGET_POINTS);\n\t\t\tif(t){\n\t\t\t\tclearTimeout(t);\t\n\t\t\t}\n\t\t\troundFinished = true;\n\t\t\top_success();\t\n\t\t}\n\t\telse if(time < 1) {\n\t\t\t// console.log('UHH OHH!!! your at '+TARGET_POINTS);\n\t\t\troundFinished = true;\n\t\t\top_fail();\n\t\t}\n\t\telse {\n\t\t\tt = setTimeout(start_opp_timer, 1000);\n\t\t}\n\t}", "function spin1(){\n\t\ti1++;\n\t\tif (i1>=numeberReel1){\n coin[0].play();\n\t\t\tclearInterval(reel1);\n\t\t\treturn null;\n\t\t}\n\t\treelTile = document.getElementById(\"slot1\");\n\t\tif (reelTile.className==\"s1\"){\n\t\t\treelTile.className = \"s0\";\n }\n let d1 = Math.floor(Math.random() * 5) + 1;\n\t\treelTile.className = \"s\"+ d1\n }", "function freeze() {\n //if any of the playarea grid squares conation the class taken. stop tetrominoe moving down and give the class taken\n if (current.some(index => squares[currentPosition + index + width].classList.contains('taken'))) {\n current.forEach(index => squares[currentPosition + index].classList.add('taken'));\n //start a new tetrominoe by starting the process over again\n random = nextRandom;\n nextRandom = Math.floor(Math.random() * theTetrominoes.length);\n current = theTetrominoes[random][currentRotation];\n currentPosition = 4;\n draw();\n displayShape();\n addScore();\n gameOver();\n };\n }", "init() {\n this.thinking = Math.round(Math.random() * 100 + 1);\n }", "function spinReels() {\n if(coinsPlayed != 0 && coins-coinsPlayed>=0) {\n spinSound.play();\n\n //update users coins\n coins -= coinsPlayed;\n document.getElementById('U_COINS').style.left = 790 - (coins.toString().length*40);\n document.getElementById('U_COINS').innerHTML = coins;\n\n var timeoutValue = 100; //initialize a delay variables\n\n //the random stops for each reel\n stop1 = Math.floor(Math.random() * 12);\n stop2 = Math.floor(Math.random() * 12);\n stop3 = Math.floor(Math.random() * 12);\n\n //jackpot win hardcode\n // stop1 = 5;\n // stop2 = 2;\n // stop3 = 9;\n\n //Medium Win hardcode\n // stop1 = 1;\n // stop2 = 10;\n // stop3 = 5;\n\n //small win hardcode\n // stop1 = 9;\n // stop2 = 8;\n // stop3 = 6;\n\n //goes through every image 8 times to give spinning effect.\n for(var i = 0; i < 108; i++) {\n\n //play reel stopping noise when each reel stops\n if((i == 48 + stop1) || (i == 72 + stop2) || (i == 96 + stop3)) {\n setTimeout(()=> {slotStopSound.play();}, timeoutValue);\n }\n\n //first reel spin. We want it to stop first. Used 48 as it is the 0th element of array after 4 spins.\n if(i < (48 + stop1)) {\n setTimeout(()=> {drawSlot(slotReel[slot1]+\".jpg\", 185, 20); slot1++; if(slot1==12) {slot1=0;}}, timeoutValue);\n }\n\n //second reel spin. We want it to stop second. Used 72 as it is the 0th element of array after 6 spins.\n if(i < (72 + stop2)) {\n setTimeout(()=> {drawSlot(slotReel[slot2]+\".jpg\", 425, 20); slot2++; if(slot2==12) {slot2=0;}}, timeoutValue);\n }\n\n //third reel spin. We want it to stop last. Used 96 as it is the 0th element of array after 8 spins.\n if(i < (96 + stop3)) {\n setTimeout(()=> {drawSlot(slotReel[slot3]+\".jpg\", 660, 20); slot3++; if(slot3==12) {slot3=0;}}, timeoutValue);\n }\n\n timeoutValue += 50;\n\n }\n\n setTimeout(()=> {payOut();}, timeoutValue);\n\n }\n\n}", "Move(probs) {\n // console.log(probs)\n let left = 0;\n let right = 0;\n let up = 0;\n\n if (!this.touchdown) {\n left = probs[0];\n right = probs[1];\n up = probs[2];\n }\n else {\n left = 0;\n right = 0;\n up = 0;\n }\n\n\n if (up > 0.5) {\n this.boosterON += 1;\n //force up\n stroke(100, 10, 0);\n let force = createVector(-100, 0);\n force.normalize();\n force.mult(landerBoosterStrength * (this.body.mass + (this.foot1.mass * 2))); //make it a specific length\n force.rotate(this.L.angle + (Math.PI / 2));\n Matter.Body.applyForce(this.L, this.body.position, { x: force.x, y: force.y });\n //console.log(force);\n //strokeWeight(10);\n line(this.ray_x, this.ray_y, this.ray_x + force.x, this.ray_y + force.y);\n //this.booster = true;\n if (this.alive) {\n fill(255, 165, 0);\n noStroke();\n\n push();\n translate(this.body.position.x, this.body.position.y);\n rotate(this.L.angle);\n triangle(-(landerWidth / 5), (landerWidth / (1.5 * 2)), (landerWidth / 5), (landerWidth / (1.5 * 2)), 0, landerWidth);\n pop();\n }\n\n //x: (landerWidth / 2.5),\n //y: (landerWidth / (1.5 * 2))\n\n }\n\n //console.log(left);\n //console.log(right);\n //console.log(up);\n\n if (left > right && left > 0.5) {\n //rotate counterclockwise\n Matter.Body.rotate(this.L, -landerRotAngle);\n }\n\n if (right > left && right > 0.5) {\n //rotate clockwise\n Matter.Body.rotate(this.L, landerRotAngle);\n }\n\n if (up <= 0.5) this.booster = false;\n //console.log(this.body.position)\n }", "function upgradeShovel()\n\t\t\t{\n\t\t\t\tif (shovelTier == 0)\n\t\t\t\t{\n\t\t\t\t\tsharpStoneBank--;\n\t\t\t\t\tsmoothBranchBank--;\n\t\t\t\t\tropeBank--;\n\t\t\t\t}\n\t\t\t\tshovelTier++;\n\t\t\t\taction(1,1,1);\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "function freeze() {\n //check if any cell in the tetromino block is of class taken the next time it moves down\n if(currentTetromino.some(index => squares[currentPosition + index + width].classList.contains('taken'))) {\n currentTetromino.forEach(index => squares[currentPosition + index].classList.add('taken'));\n //start new tetromino falling\n randomTetromino = nextRandom;\n nextRandom = Math.floor(Math.random() * tetrominoes.length);\n currentTetromino = tetrominoes[randomTetromino][currentOrientation];\n currentPosition = 4;\n draw();\n displayShape(); //display next tetromino in the mini-grid\n addScore(); //updates the score\n gameOver(); //ends game if conditions met\n }\n }", "function startBall(){\r\n\tlet direction = 1;\r\n\ttopPositionOfBall = startTopPositionOfBall;\r\n\tleftPositionOfBall = startLeftPositionOfBall;\r\n\t\r\n\t//50% chance of starting in either direction (right or left)\r\n\tif(Math.random() < 0.5){\r\n\t\tdirection = 1;\r\n\t} else {\r\n\t\tdirection = -1;\r\n\t}//else\r\n\t\t\r\n\ttopSpeedOfBall = Math.random() * speedRange + speedMin; \r\n\t\r\n\tif(checkScore()){\r\n\tspeedMin += 2;\r\n\tlevels++;\r\n\t}//if\r\n\t\r\n\tleftSpeedOfBall = direction * (Math.random() * speedRange + speedMin);\r\n\t\r\n\t\r\n\t\r\n}//startBall", "static train() {\n\t\t// Get random number from 1-5\t\t\n let randNum = Math.ceil(Math.random() * 5);\n let training = 0;\n let trainingMessage = \"\";\n\t\t\n\t\t// Made it so that if the random number is odd you get an ability point and a message for how you did that session. If the number is even you lose an ability point with a message explaining why.\n switch (randNum) {\n case 1:\n training = 1;\n trainingMessage = \"You had a nice steady learning experience\";\n break;\n case 2:\n training = -1;\n trainingMessage = \"You were distracted most of the day and had to refresh what you already know\";\n break;\n case 3:\n training = 2;\n trainingMessage = \"You had a great day you learned more than what you set out to accomplish\";\n break;\n case 4:\n training = -2;\n trainingMessage = \"You had a terrible day and just couldn't figure anything out and started questioning what you already know.\";\n break;\n case 5:\n training = 5;\n trainingMessage = \"You had an amazing day! You feel that you might just be a natural programmer\";\n break;\n default:\n training = 0;\n trainingMessage = \"I don't think it's possible for the code to get here but just in case Good Job you found a bug!\"\n break;\n }\n\n\t\t// I got bored with the simulator myself so I added this part in for a multiplier to your positive training. If you had a bad training session you penalty will not be multiplied.\n let finalScore = 0;\n if (training < 1) {\n finalScore = training;\n } else {\n let multiplierNum = Math.random();\n let multiplier = 1;\n if (multiplierNum < 0.3) {\n multiplier = 1;\n } else if (multiplierNum < 0.5) {\n multiplier = 1.5;\n } else if (multiplierNum < 0.7) {\n multiplier = 2;\n } else if (multiplierNum < .9) {\n multiplier = 2.5;\n } else {\n multiplier = 3; // Yes intentional 1/10th chance for 3x multiplier\n trainingMessage += \" Congrats you got a 3x multiplier too! Super smart looking!\"\n }\n\n\n finalScore = training * multiplier;\n }\n\n return [finalScore, trainingMessage];\n }", "function crystall() {\n return Math.floor(Math.random() * 20 + 5)\n }", "function Gambling () {\n if (global.commons.isSystemEnabled(this) && global.commons.isSystemEnabled('points')) {\n this.current = {\n duel: {\n '_total': 0,\n '_timestamp': null\n }\n }\n\n global.parser.register(this, '!gamble', this.gamble, constants.VIEWERS)\n global.parser.register(this, '!seppuku', this.seppuku, constants.VIEWERS)\n global.parser.register(this, '!roulette', this.roulette, constants.VIEWERS)\n global.parser.register(this, '!duel', this.duel, constants.VIEWERS)\n\n global.configuration.register('seppukuTimeout', 'gambling.seppuku.timeout', 'number', 10)\n global.configuration.register('rouletteTimeout', 'gambling.roulette.timeout', 'number', 10)\n\n const self = this\n setInterval(function () {\n if (_.isNil(self.current.duel._timestamp)) return true\n\n if (new Date().getTime() - self.current.duel._timestamp > 1000 * 60 * 5) {\n let winner = _.random(0, parseInt(self.current.duel._total, 10) - 1, false)\n const total = self.current.duel._total\n\n delete self.current.duel._total\n delete self.current.duel._timestamp\n\n let winnerArray = []\n _.each(self.current.duel, function (v, k) {\n for (let i = 0; i < v; i++) {\n winnerArray.push(k)\n }\n })\n\n const username = winnerArray[winner]\n const tickets = parseInt(self.current.duel[username], 10)\n const probability = tickets / (parseInt(total, 10) / 100)\n\n global.commons.sendMessage(global.translate((_.size(self.current.duel) === 1) ? 'gambling.duel.noContestant' : 'gambling.duel.winner')\n .replace('(pointsName)', global.systems.points.getPointsName(total))\n .replace('(points)', total)\n .replace('(probability)', _.round(probability, 2))\n .replace('(tickets)', tickets)\n .replace('(ticketsName)', global.systems.points.getPointsName(tickets))\n .replace('(winner)', (global.configuration.getValue('atUsername') ? '@' : '') + username), { username: username }, { force: true })\n\n // give user his points\n const user = global.users.get(username)\n user.points = parseInt(_.isNil(user.points) ? 0 : user.points, 10) + parseInt(total, 10)\n global.users.set(username, { points: user.points })\n\n // reset duel\n self.current.duel = {}\n self.current.duel._timestamp = null\n self.current.duel._total = 0\n }\n }, 30000)\n }\n}", "function race() {\n for (let i = 1; i <= 3; i++){\n console.log(\"*\".repeat(i))\n }\n console.log(`${userName}'s car: ${userCar.name}`)\n console.log(\"🚘 \".repeat(userCar.speed))\n console.log(`Computer's car: ${compCar.name}`)\n\n\n if(newCompCar) {\n console.log(\"🚘 \".repeat(newCompCar))\n } else {\n console.log(\"🚘 \".repeat(compCar.speed))\n }\n\n if (userCar.speed > compCar.speed || userCar.speed > newCompCar) {\n console.log(`${userName} Wins! 🏁 🏁 🏁`)\n playAgain()\n } else if (userCar.speed === newCompCar && userCar.speed === compCar.speed){\n console.log(\"Tie!!!🏳️ 🏳️ 🏳️\")\n playAgain()\n } else {\n console.log(\"Computer wins!!🏴‍ ☠️ 🏴‍ ☠️ 🏴‍ ☠️\")\n playAgain()\n }\n}", "function collectBerries()\n\t\t\t{\n\t\t\t\tberryTurns -= 1;\n\t\t\t\tberryBank += 3;\n\t\t\t\tdocument.querySelector(\".eatBerries\").disabled = false;\n\t\t\t\taction(1,1,1);\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "resume() {\n let resume = 0.005;\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n // resumes to its initial speed\n if (this.speed === 0) {\n this.speed = resume;\n }\n }\n }\n }", "function eatBerries()\n\t\t\t{\n\t\t\t\tberryBank -= 1;\n\t\t\t\tif (berryBank == 0)\n\t\t\t\t{\n\t\t\t\t\tdocument.querySelector(\".eatBerries\").disabled = true;\n\t\t\t\t}\n\t\t\t\tstamina = (stamina * 10 + 5) /10;\n\t\t\t\tif (stamina > 10)\n\t\t\t\t{\n\t\t\t\t\tstamina = 10;\n\t\t\t\t}\n\t\t\t\thunger = (hunger * 10 + 5) / 10;\n\t\t\t\tif (hunger > 10)\n\t\t\t\t{\n\t\t\t\t\thunger = 10;\n\t\t\t\t}\n\t\t\t\tthirst = (thirst * 10 - 1 ) / 10;\n\t\t\t\tif (thirst < 0)\n\t\t\t\t{\n\t\t\t\t\thealth = ((health * 10) + (thirst * 10)) / 10;\n\t\t\t\t\tthirst = 0;\n\t\t\t\t}\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "function useRock() {\n let aiChoice = aiTurn();\n let lastRound = comparator(0, aiChoice);\n endRound(aiChoice, lastRound);\n }", "function ranSpin(){\n if (playing)\n {return null;}\n\tplaying = true;\n let numChanges = ran_number(1,4)*5\n\tlet numeberReel1 = numChanges+ran_number(1,5)\n\tlet numeberReel2 = numChanges+2*5+ran_number(1,5)\n\tlet numeberReel3 = numChanges+4*5+ran_number(1,5)\n\tlet i1 = 0;\n\tlet i2 = 0;\n let i3 = 0;\n let sound = 0;\n\tstatus.innerHTML = \"RANDOM SPIN\"\n\treel1 = setInterval(spin1, 200);\n\treel2 = setInterval(spin2, 200);\n reel3 = setInterval(spin3, 200);\n colorChange = setInterval(setColor, 300);\n let allList = document.querySelectorAll('li');\n for (let i = 0; i< allList.length; i++) {\n allList[i].classList.remove('winner');\n }\n \n // finction that controls the reel 1 spinning\n\tfunction spin1(){\n\t\ti1++;\n\t\tif (i1>=numeberReel1){\n coin[0].play();\n\t\t\tclearInterval(reel1);\n\t\t\treturn null;\n\t\t}\n\t\treelTile = document.getElementById(\"slot1\");\n\t\tif (reelTile.className==\"s1\"){\n\t\t\treelTile.className = \"s0\";\n }\n let d1 = Math.floor(Math.random() * 5) + 1;\n\t\treelTile.className = \"s\"+ d1\n }\n // finction that controls the reel 2 spinning\n\tfunction spin2(){\n\t\ti2++;\n\t\tif (i2>=numeberReel2){\n coin[1].play();\n\t\t\tclearInterval(reel2);\n\t\t\treturn null;\n\t\t}\n\t\treelTile = document.getElementById(\"slot2\");\n\t\tif (reelTile.className==\"s1\"){\n\t\t\treelTile.className = \"s0\";\n }\n let d2 = Math.floor(Math.random() * 5) + 1;\n\t\treelTile.className = \"s\"+ d2\n }\n // finction that controls the reel 3 spinning\n\tfunction spin3(){\n\t\ti3++;\n\t\tif (i3>=numeberReel3){\n coin[2].play();\n\t\t\tclearInterval(reel3);\n\t\t\tcheckWin();\n\t\t\treturn null;\n\t\t}\n\t\treelTile = document.getElementById(\"slot3\");\n\t\tif (reelTile.className==\"s1\"){\n\t\t\treelTile.className = \"s0\";\n }\n sound++;\n\t\tif (sound==spin.length){\n\t\t\tsound=0;\n\t\t}\n\t\tspin[sound].play();\n\n let d3 = Math.floor(Math.random() * 5) + 1;\n\t\treelTile.className = \"s\"+ d3\n\t}\n}", "function curveBall(md, plyr) {\n console.log(\"inside curveballs\")\n\n let card = Math.floor(Math.random() * 10) + 1;;\n\n plyr.hitCurveBall = false;\n let tmpPath = plyr.pathHist.slice(0)\n let chance = \"\";\n switch (card) {\n \n ///Heat/////\n case 1:\n if (md == \"Walk\") {\n chance = \"go back 1 steps\";\n curveBallPane.label.text = cb1;\n curveBallPane.show();\n\n tmpPath = tmpPath.reverse().slice(0, 2)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n\n } else if (md == \"Bike\" || md == \"Scooter\") {\n chance = \"go back 2 steps\";\n curveBallPane.label.text = cb1;\n curveBallPane.show();\n\n tmpPath = tmpPath.reverse().slice(0, 3)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n } else {\n playerTurn = updateTurn(playerTurn, numOfPlayers);\n setReady(playerTurn);\n // socket.setProperty(\"playerTurn\", playerTurn)\n\n }\n console.log(chance)\n\n break;\n\n ///Rain///////\n case 2:\n if (md == \"Bike\" || md == \"Scooter\") {\n chance = \"go back 2 steps\";\n curveBallPane.label.text = cb3;\n curveBallPane.show();\n\n\n tmpPath = tmpPath.reverse().slice(0, 3)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n }\n else if (md == \"Bus\") {\n chance = \"go back 1 steps\";\n curveBallPane.label.text = cb3;\n curveBallPane.show();\n\n tmpPath = tmpPath.reverse().slice(0, 2)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n }\n\n else if (md == \"Car\") {\n chance = \"go back 4 steps\";\n curveBallPane.label.text = cb3;\n curveBallPane.show();\n\n tmpPath = tmpPath.reverse().slice(0, 5)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n }\n\n else {\n playerTurn = updateTurn(playerTurn, numOfPlayers);\n setReady(playerTurn);\n // socket.setProperty(\"playerTurn\", playerTurn)\n }\n console.log(chance)\n break;\n\n ///High gas///////\n case 3:\n if (md == \"Car\") {\n chance = \"-$10\";\n curveBallPane.label.text = cb5;\n curveBallPane.show();\n\n plyr.budget = plyr.budget - 10;\n }\n\n if (md == \"Bus\") {\n chance = \"-$1\";\n curveBallPane.label.text = cb5;\n curveBallPane.show();\n\n\n plyr.budget = plyr.budget - 1;\n playerTurn++;\n }\n playerTurn = updateTurn(playerTurn, numOfPlayers);\n setReady(playerTurn);\n // socket.setProperty(\"playerTurn\", playerTurn)\n console.log(\"$\" + plyr.budget);\n break;\n\n ///Late Bus///////\n case 4:\n if (md == \"Bus\") {\n chance = \"go back 4 steps\";\n curveBallPane.label.text = cb8;\n curveBallPane.show();\n\n tmpPath = tmpPath.reverse().slice(0, 5)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n }\n break;\n\n ///Snow////////\n case 5:\n if (md == \"Bus\") {\n tmpPath = tmpPath.reverse().slice(0, 2)\n board.followPath(plyr, tmpPath, null, null,);\n chance = \"go back 1 steps\";\n curveBallPane.label.text = cb2;\n curveBallPane.show();\n plyr.secondturn = true;\n\n } else if (md == \"Bike\" || md == \"Scooter\") {\n chance = \"go back 2 steps\";\n curveBallPane.label.text = cb2;\n curveBallPane.show();\n\n\n tmpPath = tmpPath.reverse().slice(0, 3)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n\n } else if (md == \"Car\") {\n chance = \"go back 4 steps\";\n curveBallPane.label.text = cb2;\n curveBallPane.show();\n\n tmpPath = tmpPath.reverse().slice(0, 5)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n }\n else {\n playerTurn = updateTurn(playerTurn, numOfPlayers);\n setReady(playerTurn);\n // socket.setProperty(\"playerTurn\", playerTurn)\n }\n break;\n\n /// Traffic /////\n case 6:\n if (md == \"Walk\" || md == \"Bike\" || md == \"Scooter\") {\n chance = \"go forward 1 steps\";\n curveBallPane.label.text = cb4;\n curveBallPane.show();\n mode = \"Walk\"\n\n walkBtn.enabled = false;\n walkBtn.enabled = false;\n bikeBtn.enabled = false;\n busBtn.enabled = false;\n scooterBtn.enabled = false;\n carBtn.enabled = false;\n\n plyr.secondturn = true;\n // return mode\n\n } else if (md == \"Bus\") {\n chance = \"go back 2 steps\";\n //alert\n\n curveBallPane.label.text = cb4;\n curveBallPane.show();\n\n\n tmpPath = tmpPath.reverse().slice(0, 3)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n }\n else {\n playerTurn = updateTurn(playerTurn, numOfPlayers);\n setReady(playerTurn);\n // socket.setProperty(\"playerTurn\", playerTurn)\n }\n\n break;\n\n ///Flat Tire ////////\n case 7:\n if (md == \"Car\") {\n chance = \"go back 7 steps\";\n curveBallPane.label.text = cb6;\n curveBallPane.show();\n\n tmpPath = tmpPath.reverse().slice(0, 9)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n\n } else if (md == \"Bus\") {\n chance = \"go back 2 steps\";\n curveBallPane.label.text = cb6;\n curveBallPane.show();\n\n tmpPath = tmpPath.reverse().slice(0, 3)\n board.followPath(plyr, tmpPath, null, null,);\n plyr.secondturn = true;\n\n } else {\n playerTurn = updateTurn(playerTurn, numOfPlayers);\n setReady(playerTurn);\n // socket.setProperty(\"playerTurn\", playerTurn)\n }\n break;\n \n /////Free Scooter/////\n case 8:\n if (md == \"Scooter\") {\n chance = \"Move again with Scooter\";\n curveBallPane.label.text = cb7;\n curveBallPane.show();\n\n mode=\"Scooter\"\n walkBtn.enabled = false;\n bikeBtn.enabled = false;\n busBtn.enabled = false;\n scooterBtn.enabled = false;\n carBtn.enabled = false;\n\n plyr.secondturn = true;\n } else {\n playerTurn = updateTurn(playerTurn, numOfPlayers);\n setReady(playerTurn);\n // socket.setProperty(\"playerTurn\", playerTurn)\n }\n\n break;\n\n ////Sunny Day//// \n case 9:\n chance = \"go forward 5 steps\";\n curveBallPane.label.text = cb9;\n curveBallPane.show();\n mode = \"Scooter\"\n plyr.budget = plyr.budget + 3; \n AI.setAcceptableTiles(tilesLimits[\"Special\"]); \n\n walkBtn.enabled = false;\n bikeBtn.enabled = false;\n busBtn.enabled = false;\n scooterBtn.enabled = false;\n carBtn.enabled = false;\n plyr.secondturn = true;\n break;\n\n ////Great Breakfast//// \n case 10:\n chance = \"go forward 5 steps\";\n curveBallPane.label.text = cb10;\n curveBallPane.show();\n\n mode = \"Car\"\n plyr.budget = plyr.budget + 8;\n\n AI.setAcceptableTiles(tilesLimits[\"Special\"]);\n\n walkBtn.enabled = false;\n walkBtn.enabled = false;\n bikeBtn.enabled = false;\n busBtn.enabled = false;\n scooterBtn.enabled = false;\n carBtn.enabled = false;\n plyr.secondturn = true;\n\n break;\n\n }\n\n // //////Flood /////////\n // case 11:\n // if (board.getColor(plyr.boardTile) == \"#acd241\"\n // ) {\n // chance = \"go back 2 steps\";\n // //alert\n // tmpPath = tmpPath.reverse().slice(0, 3)\n // board.followPath(plyr, tmpPath, null, null,);\n // plyr.secondturn = true;\n // } else {\n // playerTurn = updateTurn(playerTurn, numOfPlayers);\n // setReady(playerTurn);\n // }\n // console.log(chance)\n // break;\n }", "function main() {\n // variabler som endres\n var processCounter = 1;\n var currentBet = newCurrentBet; //TODO herererer -------------------\n console.log(\"CurrentBet: \" + newCurrentBet);\n\n //TODO bruke betMulti til å gjøre opp for ghetto løsning med hvor my man skal bette (den gjør ingen ting nå)\n placeBet();\n\n // Denne kjøres hvert sekund, og sjekker statusen\n setInterval(function () {\n if (processCounter == 1) {\n if (newRoundStart()) {\n console.log(\"NEWROUND\");\n processCounter = 2;\n }\n } else if (processCounter == 2) {\n sjekkIfCT();\n } else if (processCounter == 3) {\n placeBet();\n\n console.log(\"PLACEBET\");\n } else if (\n document.getElementsByClassName(\"text-2xl font-bold font-numeric\")[0]\n .innerText > 11\n ) {\n processCounter = 4;\n } else if (processCounter == 4) {\n if (endOfRound()) {\n console.log(\"ENDOFROUND\");\n document.getElementsByClassName(\"bet-btn\")[0].click(); //Make Bet\n processCounter = 1;\n }\n }\n }, 1000);\n\n function sjekkIfCT() {\n //If win\n if (\n document.getElementsByClassName(\"previous-rolls-item\")[19].children[0]\n .className == \"inline-block w-24 h-24 rounded-full ml-1 coin-ct\"\n ) {\n console.log(\"Ez cash\");\n //TODO DENNE FUNKER; MEN TRYKKER BARE EN GANG PÅ 0.01 (Bare Å LEGGE TIL EN FOR-LØKKE)\n currentBet = document.getElementById(\"setCurrentBet\").value;\n\n for (i = 0; i < currentBet * 100; i++) {\n document.getElementsByClassName(\"bet-input__control\")[1].click(); //Trykker en en gang pr 0.01 currentBet\n }\n\n processCounter = 0;\n }\n //If lose\n else {\n currentBet *= 2;\n processCounter = 3;\n }\n }\n\n function newRoundStart() {\n document.getElementsByClassName(\"bet-input__control\")[0].click();\n if (\n document.getElementsByClassName(\"text-2xl font-bold font-numeric\")[0]\n .innerText > 17\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n function endOfRound() {\n if (\n document.getElementsByClassName(\"text-2xl font-bold font-numeric\")[0]\n .innerText < 10\n ) {\n return true;\n } else {\n return false;\n }\n }\n function numberToArray(number) {\n let array = number.toString().split(\"\"); // Gjør om til streng\n var intedArray = array.map((x) => parseInt(x)); // Mapper til listen til int\n var filteredArray = intedArray.filter(function (value) {\n // Filtrer ut NaN fra listen\n return !Number.isNaN(value);\n });\n return filteredArray.reverse();\n }\n\n function placeBet() {\n // Passer på at man ikke kan bette mer enn man har\n if (\n currentBet >\n document.getElementsByClassName(\"user-action absolute\")[0].innerText\n ) {\n console.log(\"Not enough money to bet\");\n return;\n }\n // Ellers:\n var returnLog = numberToArray(currentBet); // Initsialiserer funksjonen\n console.log(returnLog);\n\n var increment = 1;\n var buttonNumber = 0;\n\n // Valuen som ganges for hver iterasjon av forLøkka\n // Denne skal da klikke på knappen utifra resultat\n for (let index of returnLog) {\n console.log(\n \"Clicked \" +\n parseFloat(increment).toPrecision(1) +\n \" : \" +\n index +\n \" Times\"\n );\n for (i = 0; i < index; i++) {\n console.log(\"Trykket index: \" + index);\n document\n .getElementsByClassName(\"bet-input__control\")\n [buttonNumber + 1].click();\n }\n increment *= 0.1;\n buttonNumber++;\n // OK. Vet helt ærlig ikke helt hvorfor dette funker, men fack it\n }\n\n processCounter = 4;\n\n // hello\n // Below is the code for the visible elements when activation the botasdasd\n }\n }", "function saltItStart ()\n{\n if(saltComingDown > (0-scaledHeight)) {saltComingDown -= 40;}\n} //End of saltItStart", "function heavy (){\n \n \n dam = Math.ceil((Math.random() * 12) * 2); \n\n if (hero.defend === 1){\n hero.defend = 0;\n heroHealth -= (Math.floor(dam / 2));\n document.getElementById('hh').textContent = heroHealth;\n document.getElementById('choose').textContent = '';\n document.getElementById('char').src = char1;\n endCheck();\n }\n else {\n heroHealth -= dam;\n document.getElementById('hh').textContent = heroHealth;\n document.getElementById('choose').textContent = '';\n document.getElementById('char').src = char1;\n endCheck();\n }\n\n }", "function run() {\n var rand = Math.random();\n if (rand < .50) {\n console.log(\"You got away!\");\n //add 1 to turn counter if run away is successful\n turns += 1;\n //reset baddie type\n baddie = {};\n whatToDo();\n } else {\n console.log(\"Your escape is blocked as the enemy attacks you!\");\n //enemy gets free attack if run fails\n enemyAttack();\n }\n}", "function freeze(){\n\n if (current.some(index => squares[currentPosition + index +width].classList.contains('taken'))){\n // reach just lil space bar\n reach=1\n current.forEach(index => squares[currentPosition + index].classList.add('taken'))\n current.forEach(index => squares[currentPosition + index].classList.remove('tetromino'))\n current.forEach(index => squares[currentPosition + index].classList.remove('moving'))\n //wa7id jdid\n random=nextRandom\n nextRandom = rand7()\n currentRotation=Math.floor(Math.random()*4)\n current=current= theTetrominoes[random][currentRotation]\n currentPosition=4\n draw()\n displayShape()\n addScore()\n gameOver()\n if (sessionStorage.getItem(\"SS\") == 0){fall.play()}\n }\n }", "function jouer(){\n\t\tafficheScoreCook();\n\t\tstart('180');\t\n}", "function createRocks()\n{\n\t\tvar direction\n\t\tclock ++;\n\t\tif (clock == 100)\n\t\t{\n\t\t\t\n\t\t\tdirection = random(0,2);\n\t\t\t\n\t\t\tif (direction < 1) direction = 0;\n\t\t\telse direction = height;\n\t\t\t\n\t\t\tboundary = createSprite(Clength,Cheight,1,Cheight*2);\n\t\t\t//boundary.visible = false;\n\t\t\t\n\t\t\trock = createSprite(Clength,direction,75,random(Cheight/2,Cheight));\n\t\t\trock.velocity.x= speed;\n\t\t\trock.immovable = true;\n\t\t\tboundary.velocity.x = speed;\n\t\t\tboundary.visible = false;\n\t\t\trocks.add(rock);\n\t\t\tboundaries.add(boundary);\n\t\t\tclock = 0;\n\t\t}\t\t\t\n}", "function makeBet(){\n\tif($('#betAmount').spinner('value') > wallet)\n\t\t$('#betAmount').val(wallet);\n\n\twallet -= $('#betAmount').spinner('value');\n\tvar betIndex = $('input[name=\"horseSelect\"]:checked').val();\n\traceHorses[betIndex].bet += $('#betAmount').spinner('value');\n\n\t$('#betAmount').val(0);\n\tupdatePlayerTable();\n\tupdateHorseTable();\n\tbettingMenu.dialog('close');\n}", "function aiSpinningBobbing() {\n var spd = 0.025;\n var bobspeed = 350;\n //var bobsize = 100;\n this.aimAngleRadians = this.aimAngleRadians + spd;\n validateRotation.call(this); // stay in 0..360 deg\n // up and down like a doom weapon\n this.bobbingFactor = (Math.floor(((Math.cos(performance.now()/bobspeed)+1)/2) * 15.0))/15;\n //this.renderOffset.y = ((Math.cos(performance.now()/bobspeed)+1)/2)*bobsize;\n}", "function buryTreasure() {\n treasurex = getRndInteger(0, canvas.width);\n treasurey = getRndInteger(0, canvas.height);\n}", "function spin2(){\n\t\ti2++;\n\t\tif (i2>=numeberReel2){\n coin[1].play();\n\t\t\tclearInterval(reel2);\n\t\t\treturn null;\n\t\t}\n\t\treelTile = document.getElementById(\"slot2\");\n\t\tif (reelTile.className==\"s1\"){\n\t\t\treelTile.className = \"s0\";\n }\n let d2 = Math.floor(Math.random() * 5) + 1;\n\t\treelTile.className = \"s\"+ d2\n }", "function turboCharge(){\n\n randomNumRange = 25;\n\n}", "resume() {\n let resume = 0.0008;\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n // resumes to its initial speed\n if (this.speed === 0) {\n this.speed = resume;\n }\n }\n }\n }", "function doRhyme(){\n RhymeBrainSubmit();\n}", "function freeze() {\n if (current.some(index => squares[currentPosition + index + width].classList.contains('taken'))) {\n current.forEach(index => squares[currentPosition + index].classList.add('taken'))\n\n currentPosition = INITIAL_POSITION\n currentRotation = INITIAL_ROTATION\n\n random = nextRandom\n nextRandom = Math.floor(Math.random() * theTetrominoes.length)\n current = theTetrominoes[random][currentRotation]\n\n draw()\n displayShape()\n }\n }", "function run() {\n var numPicked;\n var randNum = Math.floor(Math.random() * 2);\n numPicked = randNum;\n //create conditions that need to be met for player to continue playing\n //deduct a set number of players hp to be subtracted upon choosing to run\n // call beginning function again\n if (numPicked === 2 && player.hp > 0) {\n player.hp -= 20;\n console.log(\"You used up 20 hp running away into the shadows. You have only \" + player.hp + \" hp remaining!!!!!\");\n walking();\n } else {\n //set players hp to 0 and provide GAME OVER message\n player.hp = 0;\n console.log(\"You wern't quick enough and got eaten by the sea monster!Game Over.!!!!!!\");\n }\n }", "function Bounce()\n{\t\n\tshaking = true;\n\tvar startY : float = gameObject.transform.position.y;\n\tfor(var v1=0; v1<5; v1++)\n\t{\n\t\tgameObject.transform.position.y += 0.1;\n\t\tyield WaitForSeconds(0.01);\n\t}\n\tfor(var v2=0; v2<7; v2++)\n\t{\n\t\tgameObject.transform.position.y -= 0.1;\n\t\tyield WaitForSeconds(0.01);\n\t}\n\tfor(var v3=0; v3<2; v3++)\n\t{\n\t\tgameObject.transform.position.y += 0.1;\n\t\tyield WaitForSeconds(0.01);\n\t}\n\tgameObject.transform.position.y = startY;\n\tyield WaitForSeconds(0.2);\n\tshaking = false;\n}", "function rock() {\r\n u = 0;\r\n c = Math.floor(Math.random() * (2 - 0 + 1) + 0);\r\n // Math.floor(Math.random()*(b-a+1)+a)\r\n // where a is lowest limit and b is highest limit\r\n // Both inclusive [a, b]\r\n document.getElementById(\"user-choice\").innerText = choices[u];\r\n document.getElementById(\"comp-choice\").innerText = choices[c];\r\n decision(u, c);\r\n result();\r\n}", "function generate(){\n\n // increase difficulty after it scored over 10 points\n if(variables.score > 10) {\n variables.max = Math.ceil(variables.score / 5) * 5\n }\n if(variables.score > 20){\n variables.min = Math.ceil(variables.score / 10) * 5\n }\n\n variables.leftNumber = getRandomNumber(variables.min, variables.max)\n variables.rightNumber = getRandomNumber(variables.min, variables.max)\n variables.result = getRandomBoolean()\n variables.score++\n refreshNumbers()\n}", "function roundCycle() {\n if (heroHealth > 0) {\n // while villain has health keep playing\n while (villainHealth > 0) {\n console.log(`\\n${currentVillain}`)\n questionQuery()\n option = Number(readlineSync.question(questionFormat(currentQuestion)));\n // if user guess is wrong guess again\n while (!userGuess(option, currentQuestion)) {\n option = Number(readlineSync.question(questionFormat(currentQuestion))); \n }\n } \n } \n}", "function coinFlipStart(){\n\talert(\"We will flip a coin to determine who plays first. Heads, you play first; tails, the computer plays first.\");\n\t$('#coinFlip').css('display', 'none');\n\tcoinFlip = Math.floor(Math.random() * 10) + 1;\n\tif (coinFlip <= 5){\n\t\talert(\"Coin flip was tails! Computer will go first.\");\n\t\tenemyPreviousTotal = 0;\n\t\tenemyTurn(enemyPreviousTotal);\n\t} else {\n\t\talert(\"Coin flip was heads! You get to play first.\");\n\t\tpreviousTotal = 0;\n\t\tplayerTurn(previousTotal);\n\t}\n}", "incrementRotor(){if(this.bias<25){this.bias+=1;}else{this.bias=0;}}", "roll() {\n\n if (this.firstRoll) {\n let skittles = this.generate.randomize(this.remainder);\n this.bowl.currentRoll(skittles);\n this.remainder = 10 - skittles;\n\n // if strike, make sure to reset the roll\n if (skittles !== 10) {\n this.firstRoll = false;\n }\n\n } else {\n let skittles = this.generate.randomize(this.remainder);\n this.bowl.currentRoll(skittles);\n this.firstRoll = true; // lets start over next roll\n this.remainder = 0;\n }\n\n // Output the scores for each frame to view\n this.bowl.score();\n\n /* \n * check if last 2 rolls in last frame doesnt get spare or strike, game over if not\n * if spare or strike, continue one more roll and then game over\n */\n if (this.bowl.view.getViewIndex() == 20) {\n // check sum of the two previous rolls\n if (this.bowl.allRolls[this.bowl.rollIndex - 2] + this.bowl.allRolls[this.bowl.rollIndex - 1] < 10) {\n $('#roll-btn').hide();\n this.bowl.view.outputNone(this.bowl.view.getViewIndex())\n console.log('Game Over');\n this.gameOver();\n }\n } else if (this.bowl.view.getViewIndex() > 20) {\n $('#roll-btn').hide();\n console.log('Game Over');\n this.gameOver();\n }\n }", "selectBandit() {\n if (Math.random() > this.epsilon) {\n this.attemptBandit(this.getHighestReward());\n } else {\n this.attemptBandit(this.getRandom());\n }\n }", "function Update () {\n\n time++;\n\n if (time % (spawnTime * 100) == 0)\n {\n rocketSpawner();\n }\n}", "function autoGlitch() {\n if (noise) noise.go();\n setTimeout(function() {\n if (noise) noise.pause();\n }, Math.random() * 300 + 400);\n setTimeout(autoGlitch, Math.random() * 3000 + 4000);\n}", "gambler(stake, goal, bet) {\n var win = 0\n var loss = 0\n var cash = stake;\n for (var i = 1; i <= bet; i++) {\n while (cash > 0 && cash < goal) {\n if (Math.random() < 0.5) {\n cash++\n\n }\n else {\n cash--\n }\n }\n if (cash == goal) {\n win++\n }\n else {\n loss++\n }\n }\n\n\n var per_win = win / bet * 100;\n var per_loss = loss / bet * 100;\n //var per_loss=100-per_win\n //loss=bet-win;\n\n console.log(\"percentage of win is \" + per_win);\n console.log(\"percentage of loss is \" + per_loss);\n console.log(\"win \" + win);\n console.log(\"loss :\" + loss);\n\n\n\n\n\n\n\n }", "takeTurn() {}", "function takeTurn () {}", "function aiDripping() {\n var preparingMin = 0.25;\n var preparingMax = 0.6;\n var min = -2.5;\n var max = 2.5;\n var spd = 0.25;\n if(this.bobbingFactor < min)\n spd = 0.00025 + ((min - this.bobbingFactor) * 0.025);\n if(this.bobbingFactor > min - preparingMin)\n this.dontRender = undefined;\n \n this.bobbingFactor += spd; // height = renderOffset.y * this\n\n if (this.bobbingFactor > max)\n {\n this.bobbingFactor = min - (preparingMin + (Math.random() * preparingMax));\n this.delay = 200;\n this.dontRender = true;\n\n audio.play3DSound(sounds[DRIP], this.p, rndAP(), rndAP());\n }\n}", "function spin()\n {\n if(Math.round(data_came['time']) != data_came['time'] || data_came['time']<1){\n callback.prizeHintNo();\n return false;\n }\n // can we spin the wheel?\n if(canSpin){\n var rounds = data_came['rounds']?parseInt(data_came['rounds']):game.rnd.between(2, 4);\n //var degrees = data_came['degrees']?data_came['degrees']:game.rnd.between(0, 360);\n var one = 360/data_prizes.length;\n var degrees = null;\n if($.isArray(data_came['prizes'])){\n if(data_came['time'] > data_came['prizes'].length){\n degrees = data_came['prizes'][game.rnd.between(0, data_came['prizes'].length-1)];\n }else{\n degrees = parseInt(data_came['prizes'][data_came['time']-1]);\n }\n }else{\n degrees = parseInt(data_came['prizes']);\n }\n if(degrees){\n degrees = parseInt(degrees*one-one+game.rnd.between(1, (one-2)>2?one-2:1));\n }else{\n data_came['time'] = 0;\n }\n //degrees = degrees?parseInt(degrees*one-one+game.rnd.between(1, (one-2)>2?one-2:1)):game.rnd.between(0, 360);\n // resetting text field\n prizeText.text = \"\";\n // before the wheel ends spinning, we already know the prize according to \"degrees\" rotation and the number of slices\n prize = slices - 1 - Math.floor(degrees / (360 / slices));\n // now the wheel cannot spin because it's already spinning\n canSpin = false;\n // animation tweeen for the spin: duration 3s, will rotate by (360 * rounds + degrees) degrees\n // the quadratic easing will simulate friction\n var spinTween = game.add.tween(wheel).to({angle: 360 * rounds + degrees}, 3000, Phaser.Easing.Quadratic.Out, true);\n // once the tween is completed, call winPrize function\n spinTween.onComplete.add(winPrize, game);\n }\n }", "function gameRounds() {\n if (finalScores.length >= 2) {\n finalStart();\n console.log(\"final start in game rounds function\")\n } else {\n startGame();\n console.log(\"start game in game rounds function\")\n }\n }", "function sample_population(population, fitnesses, selection_rate) {\n num_of_selected_chromosome = parseInt(selection_rate * population.length)\n mating_population = []\n // console.log(num_of_selected_chromosome + \" \" + population.length)\n for (var i = 0; i < num_of_selected_chromosome; i++) \n mating_population.push(roulette_wheel(population, fitnesses))\n\n return mating_population\n}", "function init() {\n MouseHuntAlerter.checkNextActiveTurn();\n}", "function userTies() {\n userScreen.tied();\n setTimeout(function() {\n game.newRound();\n }, 2000);\n }", "function Prize()\n{\n\tif(pm.health >= 2)\n\t{\t\n\t\tgm.GetComponent(PointsText).DisplayText(transform.position, \"\" + 500, 5.0);\n\t\tpm.AddPoints(500);\n\t\treturn;\n\t}\n\t\n\t// Spawn coin and float it up\n\tGameObject.Find(\"GameManager\").GetComponent(ItemFactory).SpawnItemAndFloat(prize, giftPos.position, 0, 0, 0, 0.05, 1, false);\n\t\n\t// play sound\n\tAudioSource.PlayClipAtPoint(giftSound, transform.position);\n}", "function restart () {\n\n randomNumberGoal ();\n numbers ();\n count = 0;\n randomCrystals ();\n\n }", "function increase () {\n userStatus.steps++;\n //decrease energy by random number of 1-10 per step\n userStatus.energy -= Math.floor(Math.random() * 10) + 1;\n }", "async afterTurn() {\n await super.afterTurn();\n // <<-- Creer-Merge: after-turn -->>\n this.updateSpawnedCowboys();\n this.game.currentPlayer.siesta = Math.max(0, this.game.currentPlayer.siesta - 1);\n this.updateCowboys();\n this.advanceBottles();\n this.resetPianoPlaying();\n this.applyHazardDamage();\n utils_1.filterInPlace(this.game.cowboys, (c) => !c.isDead);\n utils_1.filterInPlace(this.game.furnishings, (f) => !f.isDestroyed);\n utils_1.filterInPlace(this.game.bottles, (b) => !b.isDestroyed);\n this.game.currentPlayer.youngGun.update();\n // <<-- /Creer-Merge: after-turn -->>\n }", "function betGame() {\nif(hasBlackJack === true && chips > 0) {\n chips -= 10\n}\nelse {\n restartGame()\n}\n}", "function updatePrize(i){\n\n\n let randomX = Math.floor(Math.random() * 5) + 5;\n let randomY = randomX;\n\n while(randomX === randomY){\n randomY = Math.floor(Math.random() * 5) + 5;\n }\n\n let positionToJump = [randomX, randomY];\n\n $(\"div[data-num='[\" + rover.prizes[i] +\"]']\").css('background-color', 'gold');\n $(\"div[data-num='[\" + positionToJump +\"]']\").append( $(\".rover\"));\n rover.position = positionToJump;\n\n $('#mensajes').addClass('visible').text('You found a prize');\n setTimeout(function(){\n $('#mensajes').removeClass('visible');\n },2000);\n\n // rover.lives++;\n showLives();\n}", "function rps(yourChoice) {\r\n\tvar humanChoice, botChoice;\r\n\thumanChoice = yourChoice.id;\r\n\tbotChoice = numbertochoice(Math.floor(Math.random()*3));\r\n result = decideWinner(humanChoice, botChoice);// won loss or tie\r\n console.log(result);\r\n message = finalMessage(result);//('message': 'you won' ,'color':green)\r\n console.log(message);\r\n rpsFrontEnd(humanChoice,botChoice,message);\r\n}", "function startNewRound() {\n userObject.round = currentRound;\n userObject.currentSelection = \"\";\n databaseModify.update();\n userScreen.choose();\n }", "function initialize() {\n for (var i = 1; i < 5; i++) {\n randomizeButton($(\"#button-\"+i));\n }\n setGoal();\n scoreCount = 0;\n $(\"#wins\").text(winCount);\n $(\"#losses\").text(lossCount);\n $(\"#score\").text(scoreCount);\n }", "function initKinder(lower, upper) {\n\t\t\tvar rocks = Crafty.math.randomInt(lower, upper);\n\t\t\tstats.kinder = rocks;\n\t\t\tstats.update();\n\t\t\t\n\t\t\tfor(var i = 0; i < rocks; i++) {\n\t\t\t\tkinder.push(Crafty.e(\"2D, DOM, big, Collision, asteroid\"));\n\t\t\t}\n\t\t}", "function handleStart() {\r\n let time = 0;\r\n const interval = setInterval(() => {\r\n shuffle();\r\n time++;\r\n if (time > 20) {\r\n clearInterval(interval);\r\n hideOllieAfterShuffle();\r\n checkPlayerAnswer();\r\n }\r\n }, 200);\r\n}", "function startSpin () {\t\t\n\t\t// start each reel spinning\n\t\t$('.slot-one').addClass('spinning1');\n\t\t$('.slot-two').addClass('spinning2');\n\t\t$('.slot-three').addClass('spinning3');\t\t\n\t\t// stop reels\n\t\tstopSpin();\n\t}", "function continueExecution() {\n clearBoard();\n hero.positionAtHome();\n hero.setImage('normal');\n hero.setLives(hero.getLives()-1);\n hero.draw();\n isNextLife = true;\n }", "function getRandomReels() {\n var betLine = []; \n var outCome = [0, 0, 0];\n var temp, selectedIdx;\n\n for (var spin = 0; spin < 3; spin++) {\n outCome[spin] = Math.floor((Math.random() * 65) + 1);\n\n var betContent = ['<img src=\"assets/images/icon/banana.png\" />', '<img src=\"assets/images/icon/bar.png\" />', '<img src=\"assets/images/icon/lemon.png\" />'\n\t\t\t, '<img src=\"assets/images/icon/orange.png\" />', '<img src=\"assets/images/icon/peach.png\" />', '<img src=\"assets/images/icon/plum.png\" />'\n\t\t\t, '<img src=\"assets/images/icon/seven.png\" />', '<img src=\"assets/images/icon/watermelon.png\" />'];\n\n switch (outCome[spin]) {\n case checkRange(outCome[spin], 1, 27): // 41.5% probability\n\n temp = betContent[0];\n for (var i = 1; i < betContent.length; i++) {\n if (betContent[i] == '<img src=\"assets/images/icon/watermelon.png\" />')\n selectedIdx = i;\n }\n\n betContent[0] = '<img src=\"assets/images/icon/watermelon.png\" />';\n betContent[selectedIdx] = temp;\n\n betLine[spin] = betContent;\n break;\n case checkRange(outCome[spin], 28, 37): // 15.4% probability\n\n temp = betContent[0];\n for (var i = 1; i < betContent.length; i++) {\n if (betContent[i] == '<img src=\"assets/images/icon/peach.png\" />')\n selectedIdx = i;\n }\n\n betContent[0] = '<img src=\"assets/images/icon/peach.png\" />';\n betContent[selectedIdx] = temp;\n\n betLine[spin] = betContent;\n break;\n case checkRange(outCome[spin], 38, 46): // 13.8% probability\n\n temp = betContent[0];\n for (var i = 1; i < betContent.length; i++) {\n if (betContent[i] == '<img src=\"assets/images/icon/banana.png\" />')\n selectedIdx = i;\n }\n\n betContent[0] = '<img src=\"assets/images/icon/banana.png\" />';\n betContent[selectedIdx] = temp;\n\n betLine[spin] = betContent;\n break;\n case checkRange(outCome[spin], 47, 54): // 12.3% probability\n\n temp = betContent[0];\n for (var i = 1; i < betContent.length; i++) {\n if (betContent[i] == '<img src=\"assets/images/icon/orange.png\" />')\n selectedIdx = i;\n }\n\n betContent[0] = '<img src=\"assets/images/icon/orange.png\" />';\n betContent[selectedIdx] = temp;\n\n betLine[spin] = betContent;\n break;\n case checkRange(outCome[spin], 55, 59): // 7.7% probability\n\n temp = betContent[0];\n for (var i = 1; i < betContent.length; i++) {\n if (betContent[i] == '<img src=\"assets/images/icon/plum.png\" />')\n selectedIdx = i;\n }\n\n betContent[0] = '<img src=\"assets/images/icon/plum.png\" />';\n betContent[selectedIdx] = temp;\n\n betLine[spin] = betContent;\n break;\n case checkRange(outCome[spin], 60, 62): // 4.6% probability\n\n temp = betContent[0];\n for (var i = 1; i < betContent.length; i++) {\n if (betContent[i] == '<img src=\"assets/images/icon/bar.png\" />')\n selectedIdx = i;\n }\n\n betContent[0] = '<img src=\"assets/images/icon/bar.png\" />';\n betContent[selectedIdx] = temp;\n\n betLine[spin] = betContent;\n break;\n case checkRange(outCome[spin], 63, 64): // 3.1% probability\n\n temp = betContent[0];\n for (var i = 1; i < betContent.length; i++) {\n if (betContent[i] == '<img src=\"assets/images/icon/lemon.png\" />')\n selectedIdx = i;\n }\n\n betContent[0] = '<img src=\"assets/images/icon/lemon.png\" />';\n betContent[selectedIdx] = temp;\n\n betLine[spin] = betContent;\n break;\n case checkRange(outCome[spin], 65, 65): // 1.5% probability\n\n temp = betContent[0];\n for (var i = 1; i < betContent.length; i++) {\n if (betContent[i] == '<img src=\"assets/images/icon/seven.png\" />')\n selectedIdx = i;\n }\n\n betContent[0] = '<img src=\"assets/images/icon/seven.png\" />';\n betContent[selectedIdx] = temp;\n\n betLine[spin] = betContent;\n break;\n }\n \n }\n \n return betLine;\n}", "function fixedSpin(){\n // Setting questions\n let q1 = 'What image do you want in reel 1? 1:Cherry, 2: 2xBAR, 3: 3xBAR, 4: Seven, 5: BAR';\n let q2 = 'What image do you want in reel 2? 1:Cherry, 2: 2xBAR, 3: 3xBAR, 4: Seven, 5: BAR';\n let q3 = 'What image do you want in reel 3? 1:Cherry, 2: 2xBAR, 3: 3xBAR, 4: Seven, 5: BAR';\n // Getting inputs from the player\n let question1 = parseInt(prompt(q1));\n let question2 = parseInt(prompt(q2));\n let question3 = parseInt(prompt(q3));\n\n if (playing)\n {return null;}\n\tplaying = true;\n let numChanges = ran_number(1,4)*5\n\tlet numeberReel1 = numChanges+ran_number(1,5)\n\tlet numeberReel2 = numChanges+2*5+ran_number(1,5)\n\tlet numeberReel3 = numChanges+4*5+ran_number(1,5)\n\tlet i1 = 0;\n\tlet i2 = 0;\n let i3 = 0;\n let sound = 0;\n\tstatus.innerHTML = \"FIXED SPIN\"\n\treel1 = setInterval(spin1, 200);\n\treel2 = setInterval(spin2, 200);\n reel3 = setInterval(spin3, 200);\n colorChange = setInterval(setColor, 300);\n let allList = document.querySelectorAll('li');\n for (let i = 0; i< allList.length; i++) {\n allList[i].classList.remove('winner');\n }\n \n // finction that controls the reel 1 spinning\n\tfunction spin1(){\n\t\ti1++;\n\t\tif (i1>=numeberReel1){\n coin[0].play();\n\t\t\tclearInterval(reel1);\n\t\t\treturn null;\n\t\t}\n\t\treelTile = document.getElementById(\"slot1\");\n\t\tif (reelTile.className==\"s1\"){\n\t\t\treelTile.className = \"s0\";\n }\n\t\treelTile.className = \"s\"+ question1\n }\n \n // finction that controls the reel 2 spinning\n\tfunction spin2(){\n\t\ti2++;\n\t\tif (i2>=numeberReel2){\n coin[1].play();\n\t\t\tclearInterval(reel2);\n\t\t\treturn null;\n\t\t}\n\t\treelTile = document.getElementById(\"slot2\");\n\t\tif (reelTile.className==\"s1\"){\n\t\t\treelTile.className = \"s0\";\n }\n\t\treelTile.className = \"s\"+ question2\n }\n \n // finction that controls the reel 3 spinning\n\tfunction spin3(){\n\t\ti3++;\n\t\tif (i3>=numeberReel3){\n coin[2].play();\n\t\t\tclearInterval(reel3);\n\t\t\tcheckWin();\n\t\t\treturn null;\n\t\t}\n\t\treelTile = document.getElementById(\"slot3\");\n\t\tif (reelTile.className==\"s1\"){\n\t\t\treelTile.className = \"s0\";\n }\n sound++;\n\t\tif (sound==spin.length){\n\t\t\tsound=0;\n\t\t}\n\t\tspin[sound].play();\n\n\t\treelTile.className = \"s\"+ question3\n\t}\n}", "function begin() {\n random = Math.floor(Math.random() * 100) + 1;\n guesses = [];\n guessCounter = 0;\n guesser();\n}", "twistR() {\n this.fourCycle(this.cornerLoc, 0, 1, 3, 2, this.cornerOrient, 1, 2, 1, 2, 3);\n this.fourCycle(this.edgeLoc, 0, 1, 2, 4, this.edgeOrient, 1, 1, 1, 1, 2);\n this.sideOrient[0] = (this.sideOrient[0] + 3) % 4;\n }", "function simulate(candidates, size, rng=0.05, novote = 0.01){\n\t//createBallots() - sample from distribution curve - for each sample order the candidates\n\t// - have taper off effect - if someone is so far from a candidate then make it a probability of whether or not they leave the ballot blank\n\t\n\tlet ballots = []\n\n\n\tfor(let i = 0; i < size; i++){\n\t\tlet sample_index;\n\t\tif(simdistrib == \"gauss\"){\n\t\t\tsample_index = gaussianRand();\n\t\t}\n\t\tif(simdistrib == \"bimodgauss\"){\n\t\t\tsample_index = bimodGaussianRand();\n\t\t}\n\t\tif(simdistrib == \"uniform\"){\n\t\t\tsample_index = Math.random();\n\t\t}\n\t\tif(simdistrib == \"leftskew\"){\n\t\t\tsample_index = stdlib.base.random.beta(4,2)\n\t\t}\n\t\tif(simdistrib == \"rightskew\"){\n\t\t\tsample_index = stdlib.base.random.beta(2,4)\n\t\t}\n\n\n\t\tlet diff_indices = candidates.map(x => Math.abs(x.index - sample_index) + rng*2*Math.random())\n\n\t\tlet ballot = getRankedIndices(diff_indices);\n\n\n\t\t//so first part might be deterministic, but later on it gets more random\n\t\tfor(let j = 0; j < ballot.length; j++){\n\t\t\tlet differfactor = 20*Math.abs(diff_indices[j])\n\t\t\tif(Math.random() < novote*differfactor){\n\t\t\t\tballot.splice(j, ballot.length - j, \"X\")\n\t\t\t}\n\n\t\t\tif(Math.random() < rng){\n\t\t\t\tshuffleArray(ballot, j)\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t\tballot = ballot.map(x => x + \"\")\n\n\t\tlet dot = {votes: ballot, x: 0.5, y: 0.5}\n\t\tballots.push(dot)\n\t}\n\n\trenderGraph(ballots)\n\trunRound(ballots, 0, 5, 0.2, legend)\n\treturn ballots\n\n}", "function startGame() {\n luminousScore = 0;\n}", "function roboteggCollectorOn () {\n if (gameData.roboteggcollectorNum >= 0 && gameData.cash >= gameData.roboteggcollectorCost) {\n gameData.roboteggcollectorNum++;\n gameData.cash -= gameData.roboteggcollectorCost;\n gameData.roboteggcollectorCost = 10 * Math.pow(1.2, gameData.roboteggcollectorNum + 1); \n duckUpdate();\n }\n}", "function startGeneration() {\n if (statGeneration.chances === 1) {\n setCreateChamp({\n ...createChamp,\n statGenOut: true\n });\n resetCreateStates();\n }\n const statInterval = setInterval(() => {\n generateStats();\n }, 25);\n\n setTimeout(() => {\n clearInterval(statInterval);\n }, 500);\n }", "function submitVotes(){\n encryptVotes();\n sendVotes();\n}", "function please()\r\n { l++;\r\n t++;\r\n rb++;\r\n score+=10;\r\n const size = random(15,30);\r\n const size1 = random(30,40);\r\n let ball = new Ball(\r\n random(size,width - size),\r\n random(size,height - size),\r\n random(-speed,speed),\r\n random(-speed,speed),\r\n 'rgb(' + random(0,255) + ',' + random(0,255) + ',' + random(0,255) +')',\r\n size,0\r\n );\r\n for(var i=0;i<balls.length;i++)\r\n { \r\n checknewBall(balls[i],ball);\r\n }\r\n if(spawn==true) \r\n { balls.push(ball);\r\n }\r\n else { spawn=true; }\r\n \r\n if(rb%6==0)\r\n {\r\n speed++;\r\n }\r\n if(rb%10==0)\r\n {\r\n let ball = new Ball(\r\n random(size1,width - size1),\r\n random(size1,height - size1),\r\n random(-speed,speed),\r\n random(-speed,speed),\r\n 'rgb(' + random(0,255) + ',' + random(0,255) + ',' + random(0,255) +')',\r\n size1,5\r\n );\r\n for(var i=0;i<balls.length;i++)\r\n { \r\n checknewBall(balls[i],ball);\r\n }\r\n if(spawn==true) \r\n { balls.push(ball);\r\n }\r\n else{spawn=true; \r\n }\r\n }\r\n if(balls.length>20)\r\n { timer=true;\r\n time=time-1;\r\n }\r\n else if(balls.length<=20)\r\n { timer=false;\r\n time=10;\r\n }\r\n \r\n \r\n}", "function setupsnitch() {\n snitchX = width/5;\n snitchY = height/2;\n snitchVX = -snitchMaxSpeed;\n snitchVY = snitchMaxSpeed;\n snitchHealth = snitchMaxHealth;\n}" ]
[ "0.73405457", "0.6687651", "0.6538136", "0.61306787", "0.60402125", "0.5998773", "0.5991221", "0.5884154", "0.5731712", "0.5704899", "0.5669253", "0.55518353", "0.5542911", "0.5505504", "0.55008376", "0.54266584", "0.54214746", "0.5417449", "0.54082495", "0.5403143", "0.5402279", "0.5391118", "0.5376432", "0.537364", "0.53725255", "0.5363931", "0.5361138", "0.53588116", "0.5352085", "0.5351687", "0.5336663", "0.5336052", "0.53340316", "0.5332267", "0.53213304", "0.5312348", "0.5286114", "0.5285823", "0.5281238", "0.5275631", "0.5266798", "0.5266581", "0.52593964", "0.52570516", "0.5252537", "0.52452934", "0.5236871", "0.523441", "0.5224432", "0.5222622", "0.5222137", "0.5221892", "0.5221025", "0.5219306", "0.52153844", "0.5214512", "0.521078", "0.5208874", "0.5204219", "0.52023995", "0.52018404", "0.52018", "0.5194247", "0.518839", "0.51855516", "0.5184633", "0.51797587", "0.51721895", "0.5162622", "0.51615524", "0.5155989", "0.51528776", "0.5150313", "0.51497877", "0.51484627", "0.5145019", "0.5138013", "0.5135869", "0.5128003", "0.5126721", "0.51264995", "0.5126138", "0.51258355", "0.5121245", "0.51175106", "0.5117348", "0.511272", "0.5108238", "0.51073945", "0.5105", "0.51022613", "0.509689", "0.50962555", "0.50951767", "0.5095114", "0.5089892", "0.5088859", "0.5087636", "0.5087141", "0.5080234" ]
0.625739
3
This will complete a task
function completedTask(){ pointsEarned = parseInt($("#pointsAvailable").text().split(':')[1]); taskCompleted = $('#currentTask').text(); taskCompleted = taskCompleted.split(':'); $('#totalPoints').text(parseInt($('#totalPoints').text())+pointsEarned); $('#completedTasks').append("<li>"+taskCompleted+"</li>"); $('#currentTask').text(''); $('#pointsAvailable').text(''); $('#completed').hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_taskComplete() {\n //\n }", "function taskComplete(){\n inquirer\n .prompt([\n {\n type: 'confirm',\n name: 'exit',\n message: 'Do you want to exit the program?'\n }\n ])\n .then(function(answer) {\n if (answer.exit){\n connection.end();\n } else {\n start();\n };\n });\n}", "function doTreatment(){\t\t\n\t\t\tconsole.log(\"Complete selected task: \\n\");\n\t\t\tconsole.log(vm.instanceId);\n\t\t\tCircuitsService.completeTask(vm.instanceId).then(function() {\n\t\t\t\tconsole.log('Task completed successfullly');\n\t\t\t\tvm.success = 'OK';\n\t\t\t\t$state.go('folders');\n\t\t\t}).catch(function() {\n\t\t\t\tvm.success = null;\n\t\t\t});\n\t\t}", "async completeTask(input = { taskId: '0' }) {\n\n return await this.request({\n name: 'task.done',\n args: [input.taskId]\n });\n\n }", "doneTask () {\n this.currentTask.isDone = true;\n fireDataBase.setTask(this.currentTask.id, this.currentTask);\n }", "function completeTask(taskName){\n$.post(\"http:localhost:8080/complete\",\n\ttaskName,\n function(data, status){\n\n });\n}", "function done() {}", "function taskDone(e) {\n\tJSL.event(e).stop();\n\tvar lnk = JSL.event(e).getTarget();\n\tvar data = {\"success\":\"Done\"};\n\tloading();\n\tJSL.ajax(lnk.href+\"&ajax=1\").load(function(data) {\n\t\tloaded();\n\t\tif(data.success) removeTask(lnk);\n\t\tshowMessage(data);\n\t},\"json\");\n}", "complete() {}", "onTaskDone() {\n assertFalse(this.isDone_);\n this.isDone_ = true;\n\n // Function to run the next task in the queue.\n const runNextTask = this.taskQueue_.runNextTask.bind(\n this.taskQueue_, Array.prototype.slice.call(arguments));\n\n // If we need to start the next task asynchronously, we need to wrap\n // it with the test framework code.\n if (this.completeAsync_) {\n window.setTimeout(\n NetInternalsTest.activeTest.continueTest(\n WhenTestDone.EXPECT, runNextTask),\n 0);\n return;\n }\n\n // Otherwise, just run the next task directly.\n runNextTask();\n }", "async onFinished() {}", "workFinishCall() {\n\t\t// all nodes have been downloaded\n if (this.finishCount === this.worklist.length) {\n this.state = 'finish'\n this.finishDate = utils.formatDate()\n userTasks.splice(userTasks.indexOf(this), 1)\n finishTasks.unshift(this)\n clearInterval(this.countSpeed)\n sendMessage()\n this.recordInfor(`${this.name} 下载完成`)\n this.finishStore()\n } else {\n\t\t\t// running next\n this.updateStore()\n this.downloadSchedule()\n }\n }", "executeNextTask() {\n this.isRunning = false;\n this.execute();\n }", "completed(data) {}", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function completeTask(task)\n{\n\tvar rel_contacts = [];\n\t$.each(task.contacts, function(index, contact)\n\t{\n\t\tif(contact.id)\n\t\t\trel_contacts.push(contact.id);\n\t\telse\n\t\t\trel_contacts.push(contact);\n\t\t//console.log(contact.id);\n\t});\n\ttask.contacts = rel_contacts;\n\ttask.owner_id = task.taskOwner.id;\n\t//console.log(\"Completed Task\",task);\n\tcrm.updateTask(task, \n\t\tfunction(resp)\n\t\t{\n\t\t\t//console.log(resp);\n\t\t\t$(\"#\"+task.id).css('text-decoration: line-through;');\n\t\t\t$(\"#\"+task.id).data(resp)\n\t\t},\n\t\tfunction(err)\n\t\t{\n\t\t\t//console.log(err);\n\t\t\t//$(\"#task_form\").append('<p class=\"bg-danger\">'+err.responseText+'</p>');\n\t\t});\n}", "function step() {\n\n // if there's more to do\n if (!result.done) {\n result = task.next();\n step();\n }\n }", "function processDuplicateFree(/* CODE HERE ONLY AFTER COMPLETING ALL OTHER TASKS */) {\n /* CODE HERE ONLY AFTER COMPLETING ALL OTHER TASKS */\n}", "function complete() {\n\tconsole.log('Completed');\n}", "function finishTask(self){\n clearInterval(timeVar);\n var neededId = getNeededId(self);\n EndDate = new Date();\n EndTimeString = EndDate.toLocaleTimeString();\n EndDateString = EndDate.toLocaleDateString();\n e_datetime = EndDateString.concat('|',EndTimeString);\n updateTimeData(DateTimeStorage, e_datetime, 'finished', neededId);\n sel = '#'+neededId;\n $(sel).remove();\n}", "async function completeTask(req, res, next) {\n let id = req.params.id;\n\n let [err, task] = await to(Task.findOne({ _id: id, creator: req.user._id }));\n\n if (err) {\n return next(err);\n }\n if (!task) {\n return res.status(404);\n }\n\n task.isComplete = true;\n task.completedAt = new Date();\n [err, task] = await to(task.save());\n\n if (err) {\n return next(err);\n }\n\n res.status(200).json(task);\n}", "_onComplete() {\n // Ensure worker queues for all paths are stopped at the end of the query\n this.stop();\n }", "static _completeTask(taskName) {\n const taskInfo = this._tasks.get(taskName);\n if (!taskInfo || taskInfo.state !== TaskWriterState.Open) {\n throw new Error('The task is not registered or has been completed and written.');\n }\n if (this._activeTask === undefined) {\n this._writeTask(taskName, taskInfo);\n }\n else if (taskName === this._activeTask) {\n this._activeTask = undefined;\n taskInfo.state = TaskWriterState.Written;\n this._writeAllCompletedTasks();\n }\n else {\n taskInfo.state = TaskWriterState.ClosedUnwritten;\n }\n }", "function complete() {\n // Play the animation and audio effect after task completion.\n\n setProperty(\"isComplete\", true);\n\n // Set distanceProgress to be at most the distance for the mission, subtract the difference from the offset.\n if (getProperty(\"missionType\") === \"audit\") {\n var distanceOver = getProperty(\"distanceProgress\") - getProperty(\"distance\");\n var oldOffset = svl.missionContainer.getTasksMissionsOffset();\n var newOffset = oldOffset - distanceOver;\n svl.missionContainer.setTasksMissionsOffset(newOffset);\n }\n\n // Reset the label counter\n if ('labelCounter' in svl) {\n labelCountsAtCompletion = {\n \"CurbRamp\": svl.labelCounter.countLabel(\"CurbRamp\"),\n \"NoCurbRamp\": svl.labelCounter.countLabel(\"NoCurbRamp\"),\n \"Obstacle\": svl.labelCounter.countLabel(\"Obstacle\"),\n \"SurfaceProblem\": svl.labelCounter.countLabel(\"SurfaceProblem\"),\n \"NoSidewalk\": svl.labelCounter.countLabel(\"NoSidewalk\"),\n \"Other\": svl.labelCounter.countLabel(\"Other\")\n };\n svl.labelCounter.reset();\n }\n\n if (!svl.isOnboarding()){\n svl.storage.set('completedFirstMission', true);\n }\n }", "async doTask(task) {\n task.status = 'success'\n task.result = 'done'\n }", "function completeTask(){\n completedTaskContainer.prepend(item);\n }", "function completedTask(e){\n const taskID = e.target.parentElement.id.split('-')[1];\n http\n .get(`http://localhost:3000/Tasks/${taskID}`)\n .then(data => {\n const updatedTask ={\n title : data.title,\n complete : !data.complete,\n }\n http\n .update(`http://localhost:3000/Tasks/${taskID}`, updatedTask)\n .then(task =>{\n if(task.complete === true){\n ui.showAlertMessage(`${task.title} completed`,'alert alert-info');\n }else{\n ui.showAlertMessage(`${task.title} is incomplete`,'alert alert-secondary');\n }\n getTasks();\n });\n });\n \n}", "function finishTask(pomoID) {\n setStatus(pomoID, SESSION_STATUS.complete);\n setCurrentPomo(INVALID_POMOID);\n closeFinishDialog();\n updateTable();\n}", "function processComplete(req, plus, oauth2Client, res) {\n gplus.getDatabaseUserWithPermission(pool, plus, oauth2Client, \"can_remove=1\", function(err, gp_user, db_user) {\n if (err != null) {\n res.send(err.message, err.code)\n } else {\n console.log(\"Whitelisted:\" + gp_user.displayName + \", \" + gp_user.id);\n\n var query = 'update tasks set is_done=1, done_at=current_timestamp() where id=' +\n pool.escape(req.body.taskId) + ';';\n console.log(query);\n pool.query(query, function(err, info, fields) {\n if (err) {\n console.log(\"error completion: \" + err);\n res.send('Invalid completion query', 500);\n } else {\n console.log(info.insertId);\n console.log(\"submission complete!\");\n res.send({taskId : req.body.taskId}, 200);\n }\n });\n }\n });\n}", "finishProcessing() {\n this.busy = false;\n this.successful = true;\n }", "finish() {\n this.done = true;\n }", "done() {}", "_onTasksDone() {\n // meant to be implemented by subclass if needed\n }", "async end() { }", "done() {\n assert_equals(this._state, TaskState.STARTED)\n this._state = TaskState.FINISHED;\n\n let message = '< [' + this._label + '] ';\n\n if (this._result) {\n message += 'All assertions passed. (total ' + this._totalAssertions +\n ' assertions)';\n _logPassed(message);\n } else {\n message += this._failedAssertions + ' out of ' + this._totalAssertions +\n ' assertions were failed.'\n _logFailed(message);\n }\n\n this._resolve();\n }", "function end() {\n task = null;\n stack.ack();\n run.call(self); // restart to high level scope\n }", "function end() {\n task = null;\n stack.ack();\n run.call(self); // restart to high level scope\n }", "function end() {\n task = null;\n stack.ack();\n run.call(self); // restart to high level scope\n }", "function end() {\n task = null;\n stack.ack();\n run.call(self); // restart to high level scope\n }", "function finishTask() {\n var task_panel = GetId(\"task_panel\");\n setTimeout(() => fade1(task_panel), 500);\n setTimeout(() => removeElement(\"task_panel\"), 1000);\n setTimeout(loadNextTask, 1000);\n // loadNextTask();\n}", "function completeTask(bot, message, short_id, fromButton) {\n // add a reaction so the user knows we're working on it\n\n if (!fromButton) {\n bot.addReaction(message, 'thinking_face')\n }\n\n // get a list of all pending tasks\n getTasks(bot, message, message.user, short_id, (err, response, tasks) => {\n // sort them by urgency\n tasks.sort(compareTasks);\n // the highest urgency of all pending tasks in the list\n let highestUrgency = 0;\n // the urgency of the completed task\n let completedUrgency = -1;\n // loop over all tasks...\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n // remember the max urgency\n if (task.urgency > highestUrgency) {\n highestUrgency = task.urgency;\n }\n // if this is the completed task\n if (String(task.short_id) === String(short_id)) {\n // remember the urgency of the completed task\n completedUrgency = task.urgency;\n\n getIntheamToken(bot, message, message.user, (token) => {\n const settings = prepareAPI(`tasks/${task.id}`, 'DELETE', token);\n\n // call the inthe.am API and mark the task as complete\n apiRequest(bot, message, settings, () => {\n // remove the thinking_face reaction again\n if (!fromButton) {\n bot.removeReaction(message, 'thinking_face')\n }\n\n bot.botkit.log(`marked task ${short_id} for user ${message.user} as complete`);\n const link = `<https://inthe.am/tasks/${task.id}|${task.short_id}>`\n let answerText = `Ok, task ${link} has been marked as complete - well done!`\n if (tasks.length - 1 === 0) {\n answerText = `${answerText} That was the last pending task on your list! You should go relax for a while :beach_with_umbrella:`\n } else {\n answerText = `${answerText} One done, ${(tasks.length - 1)} to go :clap:`\n }\n\n // if the completed task was not the one with the highest urgency\n if (completedUrgency < highestUrgency) {\n answerText = `${answerText}\\n${messages.randomNotMostUrgendMessage()}`\n }\n const answer = {\n attachments: [\n {\n pretext: answerText,\n mrkdwn_in: ['pretext'],\n callback_id: 'completed',\n actions: [\n {\n type: 'button',\n name: 'task',\n value: 'task',\n text: ':exclamation: Top 3',\n },\n {\n type: 'button',\n name: 'list',\n value: 'list',\n text: ':notebook: List',\n },\n ],\n },\n ],\n }\n\n // if the message origin was a user clicking on a button, reply interactively to replace the original message\n if (fromButton) {\n bot.replyInteractive(message, answer)\n } else {\n bot.reply(message, answer)\n }\n })\n });\n }\n }\n })\n}", "function exec(task){try{suspend();task();}finally{release();}}", "function devTaskCompleted(dev) {\n dev.taskCount--;\n if (dev.taskCount == 0) { var f = dev.taskCompleted; delete dev.taskCount; delete dev.taskCompleted; if (f != null) { f(dev); } }\n }", "async executeTask (task) {\n\t\ttask.isRunning = true;\n\t\ttask.startTime = Date.now ();\n\t\ttask.setPercentComplete (0);\n\t\tthis.updateTask.setNextRepeat (0);\n\t\ttry {\n\t\t\ttask.cancelBreak ();\n\t\t\tawait task.run ();\n\t\t\tif (task.isCancelled) {\n\t\t\t\ttask.isSuccess = false;\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\ttask.isSuccess = false;\n\t\t\ttask.runError = err.stack;\n\t\t\tLog.debug (`Task execute failed ${task.toString ()} err=${err}`);\n\t\t}\n\t\ttry {\n\t\t\tawait task.end ();\n\t\t}\n\t\tcatch (err) {\n\t\t\tLog.debug (`Task end failed ${task.toString ()} err=${err}`);\n\t\t}\n\t\tif (task.resultObject == null) {\n\t\t\ttask.resultObject = { };\n\t\t}\n\t\tif (task.isSuccess && (task.resultObjectType != \"\")) {\n\t\t\tconst result = SystemInterface.parseTypeObject (task.resultObjectType, task.resultObject);\n\t\t\tif (SystemInterface.isError (result)) {\n\t\t\t\ttask.isSuccess = false;\n\t\t\t\tLog.debug (`${task.toString ()} result object failed validation; resultObjectType=${task.resultObjectType} err=${result}`);\n\t\t\t}\n\t\t}\n\n\t\ttask.endTime = Date.now ();\n\t\ttask.isRunning = false;\n\t\ttask.isEnded = true;\n\t\t--(this.runCount);\n\t\tthis.statusEventEmitter.emit (task.id);\n\t\tthis.updateTask.setNextRepeat (0);\n\t}", "function finish(){\n // console.log (\"finish inner function\")\n resolve();\n }", "done () {}", "function done() {\n\tupdateProgressById(\"uploadProgress\", 95)\n\n\t// console.log('finished');\n}", "function completeTask() {\n var completeID = $(this).data('id');\n var complTask = {\n \"id\": completeID\n };\n $.ajax({\n type: 'POST',\n url: '/completeTask',\n data: complTask,\n });\n getTasks();\n }", "function AllDone(){\n \n}", "function async_completed() {\n\tasync_completions += 1;\n\tD.log(\"completions: \" + async_completions + \" out of \" + async_completions_waiting);\n\tif ( async_completions == async_completions_waiting ) {\n\t completion();\n\t}\n }", "onControlDone(task, response) {\n this.response = response;\n this.tryResolve(task);\n }", "function done(filepath) {\n // Clear the files-added setInterval.\n clearInterval(intervalId);\n // Clear the modified file's cached require data.\n file.clearRequireCache(filepath);\n // Unwatch all watched files.\n files.forEach(fs.unwatchFile);\n // Enqueue all specified tasks, followed by this task (so that it loops).\n task.run(tasks).run(nameArgs);\n // Continue task queue.\n taskDone();\n }", "_done() {\n this.worker = this.task = -1;\n this.callbacks = []; this.callback = 0;\n }", "function completeTask(e) {\n\tvar completedListEl = document.getElementById(\"completed-list\");\n\t\n\tvar taskEl = event.target;\n\tvar id = taskEl.id;\n\t\n\t// Find task and update its status\n\tfor (var i = 0; i < tasks.length; i++)\n\t{\n\t\tif (tasks[i].id === id)\n\t\t{\n\t\t\ttasks[i].status = taskStatus.completed;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t// Move task element from active list to completed list\n\ttaskEl.remove();\n\tcompletedListEl.appendChild(taskEl);\n}", "completeTask(index) {\n var taskCompleted = this.tasks.splice(index, 1);\n this.doneList.push(taskCompleted[0]);\n }", "finish() {}", "handleDoneTask_(event) {\n\t\tlet task = this.getTask(event.delegateTarget);\n\n\t\tthis.setState({\n\t\t\tlocked: true\n\t\t});\n\n\t\tWeDeploy.data(this.db.url).update(`${this.db.path}/${task.id}`, {\n\t\t\tdone: !task.done\n\t\t}).then(response => {\n\n\t\t\ttask.done = !task.done;\n\n\t\t\tthis.setState({\n\t\t\t\ttasks: this.tasks,\n\t\t\t\tlocked: false\n\t\t\t});\n\n\t\t\t//message\n\t\t\tthis.toast(this.language.done);\n\n\t\t}).catch(error => {\n\t\t\tconsole.error(error);\n\t\t});\n\t}", "onDataDone(task) {\n this.progress.updateAndStop();\n // Hand-over timeout tracking back to the control connection. It's possible that\n // we don't receive the response over the control connection that the transfer is\n // done. In this case, we want to correctly associate the resulting timeout with\n // the control connection.\n this.ftp.socket.setTimeout(this.ftp.timeout);\n if (this.ftp.dataSocket) {\n this.ftp.dataSocket.setTimeout(0);\n }\n this.dataTransferDone = true;\n this.tryResolve(task);\n }", "function done() {\n taskCount += 1;\n if (taskCount < taskMax) {\n return;\n }\n\n debug('ensureSync completed');\n // Indicate ensureSync has completed because the\n // back end is waiting to hear sync task was set\n // before triggering sync complete.\n self._sendMessage('syncEnsured');\n }", "function doIt() {\n read(task, callback);\n }", "function complete(isSuccess) {\n\n // Stop the timers now we are complete.\n if (timer) {\n clearTimeout(timer);\n }\n\n for (var i = options.fileName.length - 1; i >= 0; i--) {\n\n if (intervals[i]) {\n clearTimeout(intervals[i]);\n }\n\n // Stop watching the file.\n tails[i].unwatch();\n }\n\n // Tell grunt that we have finished doing what we need to do.\n done(isSuccess);\n }", "async waitForActiveTaskToFinish() {\n await Promise.race(this.tasks());\n }", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "function flush() {\n if (tasks.length > 0) {\n tasks.splice(0, tasks.length);\n }\n }", "function handleFinish(values) {\n job.current = getJob(values, job.current, writeMessage);\n setBusy(job.current.pendingTime);\n }", "async function run() {\n if (tasks.length < 1) {\n status = statuses.IDLE\n } else if (status == statuses.IDLE) {\n status = statuses.DOING\n await tasks.shift()()\n status = statuses.IDLE\n } else {\n }\n }", "function bar() {\n // `foo(..)` has definitely finished,\n // so do `bar(..)`'s task\n}", "function manageExecutionCompletion(rec) {\r\n\r\n deleteWopoDataRecord(rec);\r\n sendEmailOfExecutionCompletion(rec);\r\n}", "onFinish() {}", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "start() {\n this.executeNextTask();\n }", "function TaskLoop() {\n\t\n}", "function complete()\n\t{\n\t\t_queryInProgress = false;\n\t\t_dispatcher.trigger(_options.completeEvent);\n\t}", "function step() {\n\n // if there's more to do\n if (!result.done) {\n if (typeof result.value === \"function\") {\n result.value(function(err, data) {\n if (err) {\n result = task.throw(err);\n return;\n }\n\n result = task.next(data);\n step();\n });\n } else {\n result = task.next(result.value);\n step();\n }\n\n }\n }", "async function mainAsync() {\n // Gets command-line arguments\n const dir = argv.d || argv.dir\n\n // Gets task to do\n const [taskArg] = argv._;\n\n // If task argument is null, return error\n if (taskArg === undefined) throw new Error(\"First argument expected\")\n logger.info(\"Performing task\", taskArg)\n\n // Checks types of those arguments\n if (dir !== undefined && typeof dir !== 'string')\n throw new TypeError('Argument -d or --dir must be a string')\n\n // If there is given task, then run it\n if (main[taskArg] !== null) { \n logger.info(\"Force closing Guilded\");\n // Creates path for ReGuilded\n const reguildedPath = path.resolve(\n dir ||\n // if variable `reguilded` is empty, get default path instead\n path.join(process.env.APPDATA || process.env.HOME, \".reguilded\")\n )\n\n try {\n // Kills Guilded's process\n exec(platformModule.closeGuilded);\n // Executes the task\n await main[taskArg](platformModule.getAppDir(), reguildedPath)\n // Tells us that it succeeded\n logger.info(\"Task\", taskArg, \"has been successful\");\n } catch(err) {\n logger.error(\"Failed to do task\", taskArg);\n logger.fatal(err);\n }\n // Otherwise shout that no task was found\n } else logger.error(\"Unknown task\", taskArg);\n}", "function markComplete(){\n console.log('complete click');\n let taskId = $(this).data(\"id\");\n \n \n $.ajax({\n method:'PUT',\n url: `/todo/${taskId}`,\n }).then(response => {\n console.log('mark complete', taskId);\n getTasks();\n }).catch(error =>{\n alert('Are you sure you did it?', error);\n })\n }", "updateTask() { \r\n\r\n }", "process () {\n const task = this.shift()\n\n if (task) {\n this.process()\n task.promise.finally(this.process.bind(this))\n }\n }", "Done(task) {\n for (let comTask of this.todos) {\n if (comTask.id == task.id) {\n if (task.isChecked == false) {\n comTask.cssClass = \"striket\";\n this.Completed(task);\n }\n else {\n comTask.cssClass = \"\";\n this.PendingTask(task);\n }\n }\n }\n }", "function taskComplete(node) {\n let id = getIdFromParentOfNode(node)\n let loc = getLocalStorage()\n let taskList = loc.list;\n let task = taskList.find(t => t.id == id); //returns entire object not index\n task.complete = true\n setLocalStorage(loc)\n displayTasks()\n}", "complete(results, file) {\n const bytesUsed = results.meta.cursor;\n // Ensure any final (partial) batch gets emitted\n const batch = tableBatchBuilder.getBatch({bytesUsed});\n if (batch) {\n asyncQueue.enqueue(batch);\n }\n asyncQueue.close();\n }", "onComplete() {// Do nothing, this is defined for flow if extended classes implement this function\n }", "function successCb(){\n\t\t\t\tdbm.updateJobFinish(uuid, function(err, rows, fields){\n\t\t\t\t\tif(err) log.error('update status error:', err);\n\t\t\t\t\tdelete jobpool[uuid];\n\t\t\t\t})\n\t\t\t}", "function immediately(task){try{suspend();return task();}finally{flush();}}", "function finished(err){\n }", "_next() {\n if (this._stopped) return;\n\n if (this.tasks.length > 0) {\n this.__next.run();\n } else {\n this._complete();\n }\n }", "function doneTasks() {\n\n\t\tif (doneTasksBuffer.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet title = (doneTasksBuffer.length === 1) ?\n\t\t\t'Task finished' :\n\t\t\tdoneTasksBuffer.length + ' tasks finished'\n\n\t\tnotify('done', title, doneTasksBuffer.join(', '));\n\n\t\tdoneTasksBuffer = [];\n\t\tdoneTasksFn = null;\n\n\t}", "async end() {\n return;\n }", "function complete(){\n clearInterval(timer);\n timer = null;\n}", "end() {\n this.status = 'finished';\n }", "_run(task) {\n Injector.afterComplete(\n task,\n (error, self, ...args) => {\n Injector.resetAfterComplete(\n self, 'parallelAfterComplete'\n );\n this._unchainTask(self);\n\n const index = this._current.indexOf(self);\n if (index !== -1) {\n this._current.splice(index, 1);\n }\n if (this._passed.indexOf(self) === -1) {\n this._passed.push(task);\n }\n\n if (this._completeOnFirst && this._passed.length === 1) {\n this._complete();\n } else if (!this._completeOnFirst && this._current.length === 0 && this.tasks.length === 0) {\n this._complete();\n }\n\n this._taskComplete();\n },\n 'parallelAfterComplete'\n );\n\n this._current.push(task);\n task.run();\n }", "function complete(todo) {\n vm.error = undefined;\n service.complete(todo, function() {\n _fetch();\n }, function() {\n vm.error = 'An error occurred when completing a todo';\n });\n }", "function completeTask()\n {\n var butId=this.id;\n var child = this.parentNode.parentNode;\n var parent = child.parentNode;\n var ID = parent.id;\n var value = child.innerText;\n if (ID == \"taskList\")\n {\n // to move to completed\n obj.taskListArr.splice(obj.taskListArr.indexOf(value), 1);\n obj.taskCompletedArr.push(value);\n this.innerHTML=\"&#10227;\";\n }\n else \n {\n //to be sent to pending again\n obj.taskCompletedArr.splice(obj.taskCompletedArr.indexOf(value), 1);\n obj.taskListArr.push(value);\n this.innerHTML=\"&#10004\";\n }\n \n dataStorageUpdt();\n var target = (ID=='taskList')?document.getElementById('taskListCompleted'):document.getElementById('taskList');\n parent.removeChild(child);\n target.insertBefore(child, target.childNodes[0]);\n }", "function runAndScheduleTask () {\n\t\ttask( scheduleNextExecution );\n\t}", "function finish() {\n active--;\n dequeue();\n }", "finish()\n {\n console.log({status: \"done\"});\n\n // Close the process so we don't have anything left hanging\n process.exit();\n }" ]
[ "0.7344332", "0.7229086", "0.70234877", "0.701645", "0.7006141", "0.6923766", "0.68650216", "0.68179893", "0.6776719", "0.671203", "0.66878116", "0.6658316", "0.66392463", "0.66124177", "0.6605537", "0.6605537", "0.6605537", "0.6605537", "0.65961355", "0.6578579", "0.6555182", "0.65422666", "0.65317494", "0.6529608", "0.65094155", "0.64858025", "0.64783764", "0.643331", "0.64301777", "0.6425738", "0.64216125", "0.6413523", "0.6396634", "0.63922584", "0.63706166", "0.63669956", "0.63618755", "0.6335121", "0.6315229", "0.6313517", "0.6313517", "0.6313517", "0.6313517", "0.62621987", "0.62555325", "0.62494636", "0.6222057", "0.6220129", "0.62138563", "0.61806816", "0.61783135", "0.61681026", "0.6166699", "0.6152338", "0.61469024", "0.6134677", "0.613106", "0.6126944", "0.6125362", "0.61170775", "0.611597", "0.6107309", "0.6096337", "0.60955137", "0.60822785", "0.60792774", "0.6068599", "0.6068383", "0.6054781", "0.60424", "0.60421026", "0.603935", "0.60313046", "0.60265607", "0.60265607", "0.6018834", "0.59911996", "0.5988048", "0.59855354", "0.596526", "0.5942111", "0.59415555", "0.5935416", "0.5934362", "0.5926861", "0.59229404", "0.5916251", "0.590567", "0.5897465", "0.58941066", "0.58919543", "0.588846", "0.5884456", "0.5883292", "0.58804035", "0.58752775", "0.58722633", "0.5869601", "0.58628726", "0.5862625", "0.586255" ]
0.0
-1
This will save all the data of the user
function saveData(){ points = parseInt($("#totalPoints").text()); pending = []; category = []; //This will create a list of all pending and completed tasks $('#taskList li').each(function(r){ pending.push($('#taskList li').get(r).innerHTML.split("<")[0].split(":")[1]); category.push($('#taskList li').get(r).innerHTML.split("<")[0].split(":")[0]); }); completed = [""]; $('#completedTasks li').each(function(r){ if($('#completedTasks li').get(r).innerHTML != " ") { completed.push($('#completedTasks li').get(r).innerHTML); } }); $.post('/save',{ 'points': points, 'id': userID, 'completed': completed, 'pending': pending, 'category': category },function(result) { alert(JSON.stringify(result)); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SaveUserData() {\n fs.writeFileSync(usersfile, JSON.stringify(signUpUser));\n Log(\"Saved user data\");\n}", "function saveSettings() {\n \n const curUser = getCurrentUser();\n const editedUser = curUser;\n \n editedUser.firstName = document.getElementById('first2').value;\n editedUser.lastName = document.getElementById('last2').value;\n editedUser.email = document.getElementById('email3').value;\n editedUser.password = document.getElementById('pass3').value;\n \n const index = (editedUser.userId-1);\n let allUsers = getAllUsers();\n allUsers[index] = editedUser;\n setAllUsers(allUsers);\n }", "function saveUserData(userData) {\n localStorage.setItem('username', userData.username);\n localStorage.setItem('accessToken', userData.accessToken);\n localStorage.setItem('id', userData.id);\n username = userData.username;\n accessToken = userData.accessToken;\n }", "function save() {\r\n const uname = context.user && context.user.username;\r\n const time = new Date().toLocaleTimeString();\r\n const searchValue = value.length > 0 ? value : \"\";\r\n const newData = { uname, searchValue, time };\r\n if (localStorage.getItem(\"data\") === null) {\r\n localStorage.setItem(\"data\", \"[]\");\r\n }\r\n\r\n var oldData = JSON.parse(localStorage.getItem(\"data\"));\r\n oldData.push(newData);\r\n\r\n localStorage.setItem(\"data\", JSON.stringify(oldData));\r\n }", "async save (user) {\n user['avatar'] = ''\n user['followers'] = 0\n user['following'] = 0\n\n await Http.post('/signup', user, false)\n Events.emit('userStore:signup')\n }", "static saveUserInfo(userData) {\n localStorage.setItem('uid', userData.uid);\n localStorage.setItem('name', userData.name);\n }", "function save() {\n localStorage.setItem(\"user\", JSON.stringify(user));\n localStorage.setItem(\"score\", JSON.stringify(score));\n}", "save() {\n try{\n validateUserData()\n }catch(err) {\n \n }\n }", "function saveProfileInformation(){\n\tvar name = document.getElementById(\"profileName\").value;\n\tvar age = document.getElementById(\"userAge\").value;\n\tvar phoneNumber = document.getElementById(\"userPhone\").value;\n\tvar mailId = document.getElementById(\"userMail\").value;\n\tvar address = document.getElementById(\"userAddress\").value;\n\tvar profileImg = document.getElementById(\"userImg\").value;\n\tvalidateUserProfile(name, age, phoneNumber, mailId, address, profileImg);\n\tif (profileDataValid) {\n\t\tvar user = new User(name, age, phoneNumber, mailId, address, profileImg);\n\t\tlocalStorage.setItem(\"profileData\", JSON.stringify(user));\n\t}\n\telse{\n\t\talert(\"Error saving Data\");\n\t}\n}", "function saveUserDetails() {\n var user = {\n 'first': $('#user_event_first_name').val(),\n 'last': $('#user_event_last_name').val(),\n 'email': $('#user_event_user_email').val()\n };\n localStorage.setItem('wceUser', JSON.stringify(user));\n}", "async function saveData() {\n const validateFlag = validateData()\n if(validateFlag){\n setIsLoading(true)\n let tempUser = [...props.users];\n let newObject = {\n \"key\" : tempUser.length,\n \"name\":action,\n \"addedDate\":addedDate,\n \"addedMoment\":addedMoment._d\n }\n tempUser.push(newObject)\n await wait(2000);\n setIsLoading(false)\n props.AddUser(tempUser)\n setModelState({...modelState, index:null,popupType:''});\n props.cancelClick();\n }\n }", "function saveUserData() {\n localStorage.setItem('locallyStored', JSON.stringify(userData))\n}", "function storeUserData () {\n\t\tvar key,\n\t\tstorageData = {};\n\n\t\t// Loop thru user object and encode each name/value.\n\t\tfor (key in user) {\n\t\t\tif (user.hasOwnProperty(key)) {\n\t\t\t\tstorageData[(encryption.encode(key))] = encryption.encode(user[key]);\n\t\t\t}\n\t\t}\n\n\t\tIBM.common.util.storage.setItem(storage.key, storageData, 3600 * 24 * (user.information_level === \"basic\" ? storage.expireDaysBasic : storage.expireDaysDetailed));\n\t}", "function userSaved(data) {\n showDivMessage(\"Usuario Guardado Correctamente\", \"alert-info\", 3000);\n sendPostAction(USER_CONTROLLER_URL + 'list', null, loadTable);\n CURRENT_USER = new Usuarios();\n showTableCard();\n}", "async saveSessions () {\n\t\tawait this.request.data.users.updateDirect(\n\t\t\t{ id: this.request.data.users.objectIdSafe(this.user.id) },\n\t\t\tthis.op\n\t\t);\n\t}", "async function saveUser() {\n // searched the user first, send the login name and his url\n await handleSaveList(\"/githubSearch/save\", \"save\",\n validUserNameJason.login, validUserNameJason.html_url);\n // init json object for the next user to be search\n }", "function saveUserData() {\n\tupdateSnakeStorage();\n\tsetLocalStorageItem(\"Snake\", SNAKE_STORAGE);\n}", "function saveUserData() {\n var saveData = readValuesFromPage();\n\n EcwidApp.setAppStorage(saveData.private, function (savedData) {\n console.log('Private preferences saved!');\n });\n\n EcwidApp.setAppPublicConfig(saveData.public, function (savedData) {\n console.log('Public preferences saved!');\n })\n}", "function save_user()\r\n {\r\n alertBox.hide();\r\n const username = Utils.getInput();\r\n if(Utils.isEmpty(username))\r\n return;\r\n\r\n\r\n fetch('./save', Utils.postUserParam(username)).then(function(response) { //posts request to the server\r\n if(response.status !== 200) {\r\n alertBox.show('Username already saved!', true);\r\n return;\r\n }\r\n\r\n response.json().then(function(data) {\r\n alertBox.show(data.msg, false);\r\n init_saved(); //updates saved list\r\n });\r\n });\r\n\r\n }", "function save() {\n authService.signUp(vm.signupModel).then(function() {\n AlertHelper.addInfo('Usuário cadastrado com sucesso.');\n $location.path('/common/auth/signin');\n }, function() {\n AlertHelper.addError('Erro ao cadastrar usuário');\n });\n }", "function doSaveDat(userdata){ \r\n // existing data\r\n var data = getValue(\"KEY_SAVE_DATA\");\r\n if(data && data.indexOf(gvar.user.id+'{')!=-1 ){\r\n var re = new RegExp(gvar.user.id+'{([^\\\\}]+)', \"i\");\r\n data = data.replace(re, '');\r\n }\r\n setValue(\"KEY_SAVE_DATA\", userdata+data);\r\n \r\n // set expire time\r\n var Date_Now=new Date(); \r\n Date_Now.setHours(Date_Now.getHours() + Math.floor(Math.abs(OPTIONS_BOX[\"INTERVAL_FORCE_RELOAD_USERDATA\"])) );\r\n setValue(\"KEY_SAVE_EXPIRED\", Date_Now.getTime().toString() );\r\n}", "function saveUserInfo(userInfo) {\r\n\t \tself._userInfo = userInfo;\r\n\t \tlocalStorage.setItem('user', JSON.stringify(userInfo));\r\n\t }", "function saveUserForm() {\n if (checkUserForm()) {\n // Set up the user object.\n const user = {\n FirstName: $(\"#txtFirstName\").val(),\n LastName: $(\"#txtLastName\").val(),\n Birthdate: $(\"#dateBirthday\").val(),\n PIN: $(\"#txtNewPIN\").val(),\n HoursGoal: $(\"#sldMaxHoursPerDay\").val(),\n };\n\n // Try to save the user object and alert if issues arise.\n try {\n localStorage.setItem(\"user\", JSON.stringify(user));\n alert(\"Saving Information\");\n\n $.mobile.changePage(\"#page-menu\");\n window.location.reload();\n } catch (e) {\n alert(\"Error saving user information to storage.\");\n console.log(e);\n }\n }\n}", "function saveUser(name, surname, password, address, tel) {\n // save user code\n}", "persist() {\n localStorage.setItem(\n STORAGE_KEY + \"/\" + this.user.getId(),\n JSON.stringify(this.data)\n );\n }", "function registerUser(){\r\n let email=$(\"#txtEmail\").val();\r\n let pass=$(\"#txtPassword\").val();\r\n let firstName=$(\"#txtFirst\").val();\r\n let lastName=$(\"#txtLast\").val();\r\n let age=$(\"#txtAge\").val();\r\n let address=$(\"#txtAddress\").val();\r\n let phone=$(\"#txtPhone\").val();\r\n let payment=$(\"#selPayment\").val();\r\n let color=$(\"#txtColor\").val();\r\n let user = new User(email,pass,firstName,lastName,age,address,phone,payment,color);\r\n console.log(user);\r\n saveUser(user);// this function is on the storeManager\r\n clearForm();\r\n setNavInfo()\r\n\r\n}", "function saveUser() {\n\n const tableRows = $('#tableData tr');\n\n const fullname = $($(tableRows[0]).children()[1]).text().trim();\n const username = $($(tableRows[1]).children()[1]).text().trim();\n const followersCount = $($(tableRows[2]).children()[1]).text().trim();\n const followsCount = $($(tableRows[3]).children()[1]).text().trim();\n const mutualFollowsCount = $($(tableRows[4]).children()[1]).text().trim();\n const savedMediasCount = $($(tableRows[5]).children()[1]).text().trim();\n const highlightReelCount = $($(tableRows[5]).children()[1]).text().trim();\n const igTvVideosCount = $($(tableRows[5]).children()[1]).text().trim();\n const postsCount = $($(tableRows[6]).children()[1]).text().trim();\n const last12PostsLikeRate = $($(tableRows[6]).children()[1]).text().trim();\n const last12PostsVideosCount = $($(tableRows[6]).children()[1]).text().trim();\n const last12IgTvVideosLikeRate = $($(tableRows[7]).children()[1]).text().trim();\n const last12IgTvVideosTotalDuration = $($(tableRows[7]).children()[1]).text().trim().replace('s', '');\n const last12IgTvVideosDurationRate = $($(tableRows[7]).children()[1]).text().trim().replace('s', '');\n\n const userData = {\n fullname: fullname,\n username: username,\n followersCount: parseInt(followersCount),\n followsCount: parseInt(followsCount),\n mutualFollowsCount: parseInt(mutualFollowsCount),\n savedMediasCount: parseInt(savedMediasCount),\n highlightReelCount: parseInt(highlightReelCount),\n igTvVideosCount: parseInt(igTvVideosCount),\n postsCount: parseInt(postsCount),\n last12PostsLikeRate: parseFloat(last12PostsLikeRate),\n last12PostsVideosCount: parseInt(last12PostsVideosCount),\n last12IgTvVideosLikeRate: parseFloat(last12IgTvVideosLikeRate),\n last12IgTvVideosTotalDuration: parseInt(last12IgTvVideosTotalDuration),\n last12IgTvVideosDurationRate: parseFloat(last12IgTvVideosDurationRate),\n }\n\n fetch(window.location.origin + \"/save\", {\n \"mode\": \"cors\",\n \"method\": \"POST\",\n \"headers\": {\n \"Content-Type\": \"application/json\"\n },\n \"body\": JSON.stringify(userData)\n })\n .then(response => {\n if (response.status !== 200) {\n alert('Algo deu errado ao salvar o perfil');\n } else {\n alert('Usuário salvo!')\n }\n })\n .catch(err => {\n alert(err.message)\n console.error(err);\n });\n}", "function registerUser() {\n let email = $(\"#txtEmail\").val();\n let pass= $(\"#txtPassword\").val();\n let first= $('#txtFirst').val();\n let last = $('#txtLast').val();\n let age = $('#txtAge').val();\n let address = $('#txtAddress').val();\n let phone = $('#txtPhone').val();\n let payment = $('#txtPayment').val();\n let color = $('#txtColor').val();\n\n let user = new User(email, pass, first, last, age, address, phone, payment, color);\n console.log(user);\n\n saveUser(user); // This function is on the storeManager\n clearUser();\n\n}", "async postSave () {\n\t\t// save an invite code as a signup token for this user\n\t\tawait this.saveSignupToken();\n\n\t\t// grant the user access to their own me-channel, strictly for testing purposes\n\t\t// (since they are not confirmed yet)\n\t\tawait this.grantMeChannel();\n\t}", "save()\n\t{\n\t\tdatabase.ref('Users/' + this.#id).set({\n\t\t\tname : this.#name,\n\t\t\tsurname : this.#surname,\n\t\t\tnickname : this.#nickname,\n\t\t\temail: this.#email\n\t\t});\n\t}", "save() {\n const userData = Buffer.concat([\n this.user.data.name.full,\n this.user.data.description.full,\n this.user.data.author.full,\n this.user.data.zipCode.full,\n this.user.data.address.full,\n this.user.data.phone.full,\n this.user.data.fax.full,\n this.user.data.email.full,\n this.user.data.homepage.full,\n this.user.data.copyright.full,\n this.user.data.major.full,\n this.user.data.minor.full,\n this.user.data.patch.full,\n this.user.data.date.full,\n Buffer.alloc(0x20),\n ])\n this.user.dataSize.value = userData.byteLength\n this.user.dataHash.value = getCheckValue(userData)\n this.user.headHash.value = getCheckValue(this.user.headBuf)\n\n return Buffer.concat([\n this.file.slice(0, userDataOffset),\n userData,\n this.otherSection\n ])\n }", "saveAllData(){\n localStorage.setItem(CYCLING_LS, JSON.stringify(this.allUserData))\n localStorage.setItem(CYCLING_TM, JSON.stringify(this.timestampData)) \n }", "function saveAuthData() {\n // Skip if the local storage is not available.\n if (!utils.storageAvailable('localStorage')) {\n return;\n }\n\n // Create the data object.\n var data = {\n authUserID: authUserID\n };\n\n // Save to the local storage.\n localStorage.setItem(authDataID, JSON.stringify(data));\n }", "function saveUser(user) {\n var items = {};\n items[usertoken] = user; // this should be user object\n items[\"token\"] = user;\n storage.set(items, function () {\n //console.log(\"saved\");\n $(\"#divContent1\").hide();\n $(\"#divContent2\").show();\n });\n }", "async save(user_id){\r\n\t\tif(this.UsersInfo.has(user_id)){\r\n\t\t\tvar entry = this.UsersInfo.get(user_id)\r\n\t\t\tthis.UsersInfo.delete(user_id)\r\n\t\t\treturn entry.save();\r\n\t\t}\t\t\r\n\t}", "async function saveUserData(userData) {\n await AsyncStorage.setItem(`api/patient/${userData.email}`, JSON.stringify(userData));\n}", "function saveUsers(){\n $(\"#create-account\").css(\"display\",\"none\");\n var str = JSON.stringify(users);\n console.log(str);\n localStorage.setItem(\"users\", str);\n}", "function saveUsers(){\n $(\"#create-account\").css(\"display\",\"none\");\n var str = JSON.stringify(users);\n console.log(str);\n localStorage.setItem(\"users\", str);\n}", "function saveData(e) {\n e.preventDefault();\n\n let firstname = document.querySelector(\".firstname\").value;\n let surname = document.querySelector(\".surname\").value;\n let age = document.querySelector(\".age\").value;\n let level = document.querySelector(\".level\").value;\n let club = document.querySelector(\".club\").value;\n\n if( !firstname || !surname || !age || !level || !club ) {\n alert(\"All panes are required! Please fill them.\");\n } else {\n usersArr.push({\n userID,\n firstname,\n surname,\n age,\n level,\n club\n })\n \n let usersJson = JSON.stringify(usersArr);\n \n localStorage.setItem(\"users\", usersJson);\n \n userID++;\n \n form.reset();\n\n alert(\"Welcome! Registration completed.\");\n \n return updateTable();\n }\n}", "function saveData() {\n\t\tif(!key){\n\t\t\tvar id \t\t\t\t\t\t= Math.floor(Math.random()*1000001);\n\t\t}else{\n\t\t\tid = key;\n\t\t}\n\t\t\n\t\tgetRadioValue ();\n\t\tgetCheckbox();\n\t\tvar item\t\t\t\t\t\t= {};\n\t\t\t item.kname\t\t\t\t= [\"Kid's Name:\", $(\"kname\").value];\n\t\t\t item.pname\t\t\t\t= [\"Parent's Name:\", $(\"pname\").value];\n\t\t\t item.phone\t\t\t\t= [\"Phone #:\", $(\"phone\").value];\n\t\t\t item.email\t\t\t\t= [\"Email:\", $(\"email\").value];\n\t\t\t item.date\t\t\t\t= [\"Play Date:\", $(\"date\").value];\n\t\t\t item.sex\t\t\t\t= [\"Sex:\", sexValue];\n\t\t\t item.choice\t\t\t= [\"Best Time of Week:\", $(\"choice\").value];\n\t\t\t item.select\t\t\t= [\"Best Time of Day:\", $(\"dayTimes\").value];\n\t\t\t item.allergies\t\t= [\"Needs:\", hasAllergy];\n\t\t\t item.comments\t\t\t= [\"Notes:\", $(\"comments\").value];\n\t\t\t item.outgoing\t\t\t= [\"How Outgoing? 1-10:\", $(\"outgoing\").value];\n\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\talert(\"Saved!\");\n\t}", "function saveToLocalStorage() { \n\t\n\t\t\t\t\tvar lscount = localStorage.length; \n\t\t\t\t\tvar Userstring=User.toJSONString();\n\t\t\t\t\t\t\tlocalStorage.setItem(\"User_\" + lscount, Userstring); \n\t\t\n}", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "async function saveNewUserData() {\n console.log('loggedinFavCategory',loggedinFavCategory);\n console.log('loggedinEmail',loggedinEmail);\n let user1 = new UserModel({\n email: loggedinEmail,\n favCategory: loggedinFavCategory,\n });\n \n \n await user1.save();\n \n}", "saveUser(data) {\n const addr = Blockchain.transaction.from;\n data.addr = addr;\n const fields = ['username', 'photoUrl', 'phone', 'email', 'alipay', 'password', 'name'];\n\n let user = this.users.get(addr);\n if (user) {\n // Update user\n fields.forEach(f => {\n if (!_isEmpty(data, f)) {\n user[f] = data[f];\n }\n });\n } else {\n // Create user\n user = new User(data);\n }\n this.users.set(addr, user);\n\n return user;\n }", "function saveUser(form) {\n var json = { \"user\" : form[\"username1\"].value , \"password\": form[\"contrasena\"].value\n , \"name\": form[\"username1\"].value, \"email\": form[\"email\"].value , \"telephone\": form[\"telefono\"].value };\n\n jsonUsers.users.push(json);\n\n localStorage.setItem(\"users\", JSON.stringify(jsonUsers));\n\n}", "async save() {\n let userList = getUserListFromFile(FILE_PATH);\n const hashedPassword = await bcrypt.hash(this.password, saltRounds);\n userList.push({\n idUser: this.idUser,\n username: this.username,\n email: this.email,\n password: hashedPassword,\n fName: this.fName,\n lName: this.lName,\n avatar: this.avatar,\n type: this.type,\n itemCollections: this.itemCollections,\n connected: this.connected\n });\n saveUserListToFile(FILE_PATH, userList);\n return true;\n }", "function saveUser(form) {\n\n //turn form data into a user object\n let name = document.forms[form]['name'].value + \"\";\n let pin = document.forms[form]['pin'].value + \"\";\n // -------------------------------------------------------------JavaScript - Arrays (Associate) Ex. 1||\n let journal = {};\n // -------------------------------------------------------------JavaScript Objects - instantiation Ex. 1||\n let obj = new User(name, pin, journal);\n\n // -------------------------------------------------------------JSON - Stringify Ex. 1||\n //stringify for storage.\n let strUser = JSON.stringify(obj);\n\n // -------------------------------------------------------------Local Storage - Simple Data Ex. 1||\n localStorage.setItem(name + pin, strUser);\n\n alert(\"User \\\"\"+name+\"\\\" has been added to your browser's local storage. You may now sign in with this ID.\");\n}", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function save() {\r\n //recupero il valore (.value) inserito dall'utente nel campo che ha id 'username'\r\n let inseredUsername = document.getElementById(\"username\").value;\r\n\r\n //recupero il valore (.value) inserito dall'utente nel campo che ha id 'password'\r\n let inseredPassword = document.getElementById(\"password\").value;\r\n\r\n //salvo questi valori nel local storage:\r\n localStorage.setItem('username', inseredUsername) //key = username, value = inseredUsername (ovvero ciò che ha scritto l'utente)\r\n localStorage.setItem('password', inseredPassword)\r\n}", "async writeToStorage() {\r\n const fetchedInfo = {\r\n fetchedUsername: this.state.fetchedUsername,\r\n fetchedPassword: this.state.fetchedPassword,\r\n };\r\n\r\n //Save the user info\r\n localStorage.setItem(\"fetchedInfo\", JSON.stringify(fetchedInfo));\r\n }", "function saveNewUser(userObj) {\n ref.child('users').child(userObj.uid).set(userObj);\n }", "function saveNewUser(user) {\n // gets userId from last user\n const allUsers = getAllUsers();\n user[0] = ++(allUsers.length);\n \n newUser.userId = user[0];\n newUser.firstName = user[1];\n newUser.lastName = user[2];\n newUser.email = user[3];\n newUser.password = user[4];\n \n if (allUsers[(allUsers.length-1)] == null) {\n allUsers[(allUsers.length-1)] = newUser;\n } else { allUsers.push(newUser); }\n \n setCurrentUser(user);\n setAllUsers(allUsers);\n }", "function saveActiveUser() {\n if (activeUser != undefined) {\n localStorage.setItem(\"ActiveUser\", JSON.stringify(activeUser));\n console.log('Guardado o objeto activeUser na localStorage com a key \"ActiveUser\" com sucesso.');\n }\n}", "function register() {\n\tvar nameValue = document.getElementById(\"name\").value;\n\tvar nameGiftValue = document.getElementById(\"name_gift\").value;\n\n\tvar spouseNameValue = document.getElementById(\"spouse_name\").value;\n\tvar spouseGiftValue = document.getElementById(\"spouse_name_gift\").value;\n\n\tuser_data = JSON.parse(localStorage.getItem(\"user_data\"));\n\tif (!user_data) {\n\t\tuser_data = [];\n\t}\n\t\n\tuser_data.push({\n\t\tname: nameValue,\n\t\tgift: nameGiftValue,\n\t\tspouse: spouseNameValue,\n\t\tspouse_gift: spouseGiftValue\n\t});\n\n\tlocalStorage.setItem(\"user_data\", JSON.stringify(user_data));\n\tlocalStorage.setItem(\"all_users\", JSON.stringify(getUserList(user_data)));\n}", "async function storageUser(data){\n await AsyncStorage.setItem('Auth_user', JSON.stringify(data));\n }", "function saveUserProfile(userProfile) {\r\n\t \tself._userProfile = userProfile;\r\n\t \tlocalStorage.setItem('userProfile', JSON.stringify(userProfile));\r\n\t }", "function saveUserArray(data) {\n users = data;\n}", "async save(data) {\n let user = new User({\n _id: getId(),\n name: data.name,\n password: data.password,\n riderNumber: data.riderNumber,\n emailId: data.emailId,\n mobileNumber: data.mobileNumber,\n });\n\n return await user\n .save()\n .then(result => {\n return result;\n })\n .catch(err => {\n throw err;\n });\n }", "function save(){\n\n Name = document.getElementById(\"name\").value\n Age = document.getElementById(\"age\").value\n Mobile = document.getElementById(\"mobile\").value\n Usertype = document.getElementById(\"usertype\").value\n\n var obj = new User(Name,Age,Mobile,Usertype)\n console.log(obj)\n}", "function setAllUsers(users) {\n storage.setItem('P1_todoUsersDB', JSON.stringify(users));\n }", "async save() {\n const priv = privates.get(this);\n const tableName = priv.get(\"tableName\");\n if (tableName) {\n const formData = new FormData(this.form);\n if (formData.get(\"saveDetails\") !== \"on\") {\n return;\n }\n const dataToSave = Object.assign({}, this.data, this.toObject());\n if (!db.isOpen()) {\n await db.open();\n }\n await db[tableName].put(dataToSave);\n this.data = dataToSave;\n }\n }", "function WriteUserToDB() {\n var newRef;\n switch (mode) {\n case 1:\n newRef = ref.push({\n phonenumber: \"\",\n id: \"\",\n email_address: user.email_address,\n email: user.email,\n sms: user.sms,\n whatsapp: user.whatsapp,\n setting_key: settingkey2,\n });\n break;\n case 2:\n newRef = ref.push({\n phonenumber: user.phonenumber,\n id: \"\",\n email_address: \"\",\n email: 0,\n sms: user.sms,\n whatsapp: user.whatsapp,\n setting_key: settingkey2,\n });\n break;\n }\n // Add Key to Entry\n var newID = newRef.key;\n newRef.update({\n id: newID\n })\n }", "function save(){\n\t\tvar y =$(this).attr(\"id\");\n\t\tvar g= JSON.stringify(y);\n\t\tlocalStorage.setItem(y, $(this).val()); // localStorage.setItem(\"lastname\", \"Smith\"); localStorage.getItem(\"lastname\");\n\t}", "function saved(data){\n\t\t\tfor (var i = 0; i < user.newAktiviteter.length; i++) {\n\t\t\t\tuser.newAktiviteter[i]\n\t\t\t\tvar occation = {\n\t\t\t\t\t\"approved\":false,\n\t\t\t\t\t\"decided\":false,\n\t\t\t\t\t\"occasion_id\":user.newAktiviteter[i],\n\t\t\t\t\t\"uri\":\"http://cloud.wilhelmsson.eu:5521/bookerang/api/v1.0/userschedules/\"+user.newAktiviteter[i],\n\t\t\t\t\t\"user_id\":user.id,\n\t\t\t\t\t\"user_prio\":user.prioGroup\n\t\t\t\t};\n\t\t\t\tuserschedules.push(occation);\n\t\t\t}\n\n\t\t}", "function saveUser(currentBit) {\n const userClickedId = $(this).attr(\"id\")\n currentUserId = parseInt(loggedInUser)\n let userToBeSaved = {\n favoriteUser: userClickedId,\n UserId: currentUserId\n }\n addUsertoUser(userToBeSaved)\n}", "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "function save() {\n\t\tvar value, data = '';\n\n\t\t// localStorage can be disabled on WebKit/Gecko so make a dummy storage\n\t\tif (!hasOldIEDataSupport) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var key in items) {\n\t\t\tvalue = items[key];\n\t\t\tdata += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;\n\t\t}\n\n\t\tstorageElm.setAttribute(userDataKey, data);\n\n\t\ttry {\n\t\t\tstorageElm.save(userDataKey);\n\t\t} catch (ex) {\n\t\t\t// Ignore disk full\n\t\t}\n\n\t\tupdateKeys();\n\t}", "function save() {\n\t\tvar value, data = '';\n\n\t\t// localStorage can be disabled on WebKit/Gecko so make a dummy storage\n\t\tif (!hasOldIEDataSupport) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var key in items) {\n\t\t\tvalue = items[key];\n\t\t\tdata += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;\n\t\t}\n\n\t\tstorageElm.setAttribute(userDataKey, data);\n\n\t\ttry {\n\t\t\tstorageElm.save(userDataKey);\n\t\t} catch (ex) {\n\t\t\t// Ignore disk full\n\t\t}\n\n\t\tupdateKeys();\n\t}", "function save() {\n\t\tvar value, data = '';\n\n\t\t// localStorage can be disabled on WebKit/Gecko so make a dummy storage\n\t\tif (!hasOldIEDataSupport) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var key in items) {\n\t\t\tvalue = items[key];\n\t\t\tdata += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;\n\t\t}\n\n\t\tstorageElm.setAttribute(userDataKey, data);\n\n\t\ttry {\n\t\t\tstorageElm.save(userDataKey);\n\t\t} catch (ex) {\n\t\t\t// Ignore disk full\n\t\t}\n\n\t\tupdateKeys();\n\t}", "async function saveStoreUsers() {\n var self = this;\n var data = self.body;\n var JOB_ID = generateUuidModule.createUUID();\n var nosql = new Agent();\n if (!data) {\n self.json({\n status: false,\n message: \"no data\"\n })\n } else {\n nosql.update('saveStoreUsers', 'configuration').make(function (builder) {\n builder.where('configurationName', 'Store_Users');\n builder.set('configurationDetails', data);\n });\n var saveStoreUsers = await nosql.promise('saveStoreUsers');\n self.json({\n status: true,\n message: \"Saved Successfully\"\n })\n console.log(\"STORE_USERS_SAVE_TRIGGERED\", new Date().toISOString(), JOB_ID, saveStoreUsers);\n }\n}", "function save_users(datafile){\n var content = '';\n for( var user in saved_users )\n content += `${user}:${saved_users[user].password}:${saved_users[user].friends.join(',')}\\n`;\n fs.writeFileSync(datafile, content, 'utf8');\n}", "async save() {\n localStorage.setItem(\"profiles\", JSON.stringify(this.profiles));\n return;\n }", "save() {\n return db.execute('INSERT INTO users (user_name, user_password, user_email) VALUES (?, ?, ?)',\n [this.username, this.password, this.email]);\n }", "function saveAcc() {\n localStorage.setItem(\"accounts\", JSON.stringify(accounts));\n if (localStorage.getItem(\"loginUser\")) {\n curAcc = accounts.find(findCurUser);\n localStorage.setItem(\"loginUser\", JSON.stringify(curAcc));\n }\n}", "function saveUser(user) {\n var users = JSON.parse(localStorage.getItem(\"users\"));\n if (!users) {\n var users = [];\n users.push(user);\n } else {\n users.push(user);\n }\n localStorage.setItem(\"users\", JSON.stringify(users));\n\n window.parent.postMessage(\"message\", \"*\");\n}", "function saveChange() {\n //Guardo los datos ingresados en sus respectivas variables.\n let profile = {};\n\n profile.nombre = document.getElementById(\"perfilNombre\").value;\n profile.apellido = document.getElementById(\"perfilApellido\").value;\n profile.email = document.getElementById(\"perfilMail\").value;\n profile.telefono = document.getElementById(\"perfilTelefono\").value;\n\n if (profile.nombre == \"\" || profile.apellido == \"\" || profile.email == \"\" || profile.telefono == \"\" ) {\n \n document.getElementById(\"alertPerfil\").innerHTML = `*No puedes dejar campos vacios.*`\n } else {\n document.getElementById(\"alertPerfil\").className = \"text-secondary text-success mr-3 \";\n document.getElementById(\"alertPerfil\").innerHTML = `*Datos guardados exitosamente.*`\n \n //Creo los sessionStoragge, o los modifico. \n localStorage.setItem(\"perfil\", JSON.stringify(profile));\n \n}\n }", "function save() {\n\tvar save = {\n\t\t// Player attributes\n\t\texp: exp,\n\t\tlevel: level,\n\t\tbaseDamage: baseDamage,\n\t\ttotalDamageGain: totalDamageGain,\n\t\t\n\t\t// Monster attributes\n\t\thealth: health,\n\t\tcurrentHealth: currentHealth,\n\t\tcurrentMonster: currentMonster,\n\t\tmonsterLevel: monsterLevel,\n\t\t\n\t\t// Global attributes\n\t\tinventory: inventory,\n\t\tdamageBonus: damageBonus,\n\t\t\n\t};\n\tlocalStorage.setItem(\"save\",JSON.stringify(save)); \n}", "function saveUserForm() {\n if (checkUserForm()) {\n \n var BMI = ($(\"#weight\").val() / Math.pow($(\"#height\").val(), 2) * 703).toFixed(2);\n var user = {\n \"FirstName\" : $(\"#FirstName\").val(),\n \"LastName\" : $(\"#LastName\").val(),\n \"NewPassword\" : $(\"#changePassword\").val(),\n \"DOB\" : $(\"#DOB\").val(),\n \"Height\" : $(\"#height\").val(),\n \"Weight\" : $(\"#weight\").val(),\n \"BMI\" : ($(\"#weight\").val() / Math.pow($(\"#height\").val(), 2) * 703).toFixed(2),\n \"WeightStatus\" : determineWeightStatus(BMI)\n };\n \n try {\n localStorage.setItem(\"user\", JSON.stringify(user));\n alert(\"Saving Information\");\n \n $.mobile.changePage(\"#pageMenu\");\n window.location.reload();\n } catch(e) {\n if (window.navigator.vendor === \"Google Inc.\") {\n if (e === DOMException.QUOTA_EXCEEDED_ERR) {\n alert(\"Error: Saving to local storage\");\n }\n } else if (e === QUOTA_EXCEEDED_ERR) {\n alert(\"Error: Saving to local storage.\");\n }\n \n console.log(e);\n }\n }\n}", "function saveUser(data){\n let users = dataCached;\n\n if(!_.has(users, data.email)){\n throw new Error('Email not found: ' + data.email)\n }\n\n users[data.email] = _.omit(data, ['email']);\n\n // Log\n let name = (users[data.email] ? users[data.email][\"name\"] : data.email);\n logger.info(name + ' saved with data ' + JSON.stringify(data) + '');\n\n dataCached = users;\n\n console.log('User cached in data');\n}", "async save() {\n const options = {\n TableName: process.env.userTableName,\n Item: ddb.prepare(this.toJSON())\n };\n await ddb.call('putItem', options);\n return this.toJSON();\n }", "saveData() {\n if (this.save_data && this.facebookApi) {\n const data = {\n appState: this.facebookApi.getAppState(),\n channelLinks: this.channelLinks,\n };\n this.save_data(data, function(err) {\n if (err) console.log('Error saving facebot data: ' + err);\n else console.log('Saved Facebot settings');\n });\n }\n }", "function saveData() {\n var user = firebase.auth().currentUser;\n var curDate = new Date();\n var curTime = curDate.getTime();\n var userID = user.uid;\n\n var docData = {\n lat: latData,\n lon: lonData,\n timeStamp: curTime\n };\n\n db.collection(userID + ' tracking').doc(curTime.toString()).set(docData);\n }", "function saveUser(){\n\tvar mem = document.getElementById(\"EditName\").value;\n\tvar role = document.getElementById(\"EditRole\").value;\n\tfor(i in currentProject.members){\n\t\tif(currentProject.members[i].name == savedMem){\n\t\t\tfor (j in currentProject.members[i].role) {\n\t\t\t\tcurrentProject.members[i].name = mem;\n\t\t\t\tcurrentProject.members[i].role[j] = role;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tdocument.getElementById(\"EditUser\").style.display = \"none\";\n popTable();\n \n createMember(mem, role);\n\t\n\t\n}", "static storeUser(user) {\n localStorage.setItem('userInfo', user);\n }", "save(user) {\n //user.id = crypto.randomBytes(20).toString('hex');\n return 1; \n }", "function saveEmployee() {\n userService.saveUser(employeeData)\n .then(\n function (data) {\n if (data.status == 201) {\n $rootScope.$broadcast('new-employee-added');\n $rootScope.$broadcast('close-form');\n toaster.pop('success', $filter('translate')('INFORMATION'),\n $filter('translate')('SUCCESSFUL_ADD_EMPLOYEE'));\n } else {\n toaster.pop('error', $filter('translate')('INFORMATION'),\n $filter('translate')('ERROR_ADD_EMPLOYEE'));\n }\n });\n }", "function saveData() {\n\tstate.save();\n}", "function saveProfile (user) {\n userService.saveProfile(user);\n toastService.showToast(user.displayName + 'profile saved!');\n }", "function storeUser(fname, lname, gender, phone, add,username, email, password) {\n\n\t// Create an array of object\n var userAccount = {};\n\n\t// Stores user properties\n userAccount.firstName = fname;\n userAccount.lastName = lname;\n userAccount.gender = gender;\n userAccount.phoneNumber = phone;\n\tuserAccount.address=add;\n userAccount.emailAddress = email;\n userAccount.password = password;\n userAccount.username = username;\n userAccount.high_score=0;\n\n\t// Convert array obj into stringify\n\t// Stores into localStorage\n\t// Use username as key\n localStorage[userAccount.username] = JSON.stringify(userAccount);\n\n\n\n\n\n\n}", "function Save_Data()\n{\n //handles setting profile's variable to entered name\n let tempName = name.value;\n if(tempName != \"\")\n {\n profile.name = tempName;\n }\n\n //sets profile's age to entered age\n let tempAge = Number(age.value);\n if ((tempAge != 0) && (tempAge != NaN))\n {\n profile.age = tempAge;\n }\n\n //sets profile's pet name to entered name\n let tempPetName = petName.value;\n if (tempName != \"\")\n {\n profile.petName = tempPetName;\n }\n\n //sets profile's favorite color to entered color\n let tempFavCol = favoriteColor.value;\n if (tempName != \"\")\n {\n profile.favoriteColor = tempFavCol;\n }\n\n //sets profile's favorite food to entered food\n let tempFavFood = favoriteFood.value;\n if (tempName != \"\")\n {\n profile.favoriteFood = tempFavFood;\n }\n\n //turns the profile object into json tet format and is displayed onto the page\n let json = JSON.stringify(profile);\n storage.textContent = json;\n}", "function storeLocal() {\n const jsonUserData = JSON.stringify(userData);\n localStorage.setItem('fullname', jsonUserData);\n}", "async handleClickSave() {\n const result = await this.props.screenProps.homeStore.saveTimeInfo(this.props.screenProps.auth.currentUser,\n { StartTime:this.state.SleepStartTime , EndTime:this.state.SleepEndTime })\n if (result.Status == 'Success') {\n //alert('The user info have saved successfully.')\n Alert.alert('','The user info have been saved successfully.',)\n } else {\n //alert('Could not save user info. Please try refreshing data or check your signal strength.')\n Alert.alert('','Could not save user info. Please refresh and try again.',)\n }\n }", "function save(user) {\n service._currentUser = user;\n return user;\n }", "function saveDataToAccount() {\n let id = document.getElementById(\"id\").value;\n let name = document.getElementById(\"name\").value;\n let oldName = document.getElementById(\"l_name\").value;\n let email = document.getElementById(\"email\").value;\n let oldEmail = document.getElementById(\"l_email\").value;\n let phone = String(document.getElementById(\"phone\").value);\n let oldPhone = String(document.getElementById(\"l_phone\").value);\n let location = document.getElementById(\"location\").value;\n let oldLocation = document.getElementById(\"l_location\").value;\n let password = document.getElementById(\"pwd\").value;\n let url = getContextPath() +'/userInfo'\n\n let data = new FormData();\n let changed = false;\n if (validateUpdateAccount(name, oldName, email, oldEmail, phone, oldPhone, location, oldLocation, password)) {\n let json = JSON.stringify({\n \"id\": id,\n \"name\": name,\n \"email\": email,\n \"phone\": phone,\n \"location\": location,\n \"password\": password\n })\n\n data.append('blob', new Blob([json], {type: 'application/json'}))\n changed = true\n }\n\n let userPic = document.getElementById(\"photo\").files[0];\n if (userPic) {\n data.append('datafile', userPic);\n changed = true\n }\n if (changed)\n $.post({\n url: url,\n data: data,\n cache: false,\n processData: false,\n contentType: false,\n async: false\n }).done(function () {\n ok()\n loadUserData()\n }).fail(function () {\n error()\n })\n\n}", "function createUser(){\n\n\tlet tempuserdata = new ussers(document.getElementById('regUsername').value, \n\t\tdocument.getElementById('regFullName').value,\n\t\tdocument.getElementById('regEmail').value,\n\t\tdocument.getElementById('regPassword').value,\n\t\tdocument.getElementById('regRepass').value);\n\n\n\t//{\n\n\t//\tUser: document.getElementById('regUsername').value,\n\t//\tfullName: document.getElementById('regFullName').value,\n\t//\temail: document.getElementById('regEmail').value,\n\t//\tpassword: document.getElementById('regPassword').value,\n\t//\trepass: document.getElementById('regRepass').value,\n\t//\tprivileges: 0,\n\t//\tlogged: false\n\t//};\n\t\n\tif(tempuserdata.password != tempuserdata.repass){\n\t\talert(\"Password dont match, try again.\");\t\t\n\t\tdocument.getElementById('passform').reset();\n\t\treturn;\n\t}\n\t//document.getElementById('rerForm').reset();\n\tuserData.push(tempuserdata);\n\tlocalStorage.setItem('userData',JSON.stringify(userData));\n\n}", "saveToStorage() {\r\n localStorage.setItem('accountList', JSON.stringify(this._accountList));\r\n localStorage.setItem('settings', JSON.stringify(this._settings));\r\n localStorage.setItem('lastAssignedID', JSON.stringify(this._lastAssignedID));\r\n }", "function save_user(userid, callback){\r\n\t if(users[userid]){ //if user is connected\r\n\t\tif(users[userid].database){\r\n\t\t\t //console.log(users[userid]); \r\n\t\t\t client.set(users[userid].database, JSON.stringify(users[userid]));\r\n\t\t\t \r\n\t\t\t if(callback) callback();\r\n\t\t}\r\n\t }\r\n\t}", "function writeUserData(userId, name, email, imageUrl) {\n firebase.database().ref('users/' + userId).set({\n username: name,\n email: email,\n profile_picture : imageUrl\n }).then(() =>\n firebase.database().ref('logins').push().set({\n userId: userId,\n email: email,\n logindate : Date()\n }) \n );\n }", "function writeUserData(Firstname, Surname, email, dob, height, weight){\n\n var userId = firebase.auth().currentUser.uid;\n\n console.log(userId);\n\n database.ref().child('users/' + userId + '/AccountInfo').set({\n Firstname: Firstname,\n Surname: Surname,\n email:email,\n dob: dob,\n height: height,\n weight: weight\n });\n}", "function upsertUser(userData) {\n $.post(\"/api/user/create\", userData)\n .then(function(){\n localStorage.setItem(\"currentUser\", JSON.stringify(userData));\n localStorage.setItem(\"loggedIn\", true);\n window.location = \"/\"\n });\n }" ]
[ "0.7649779", "0.74760765", "0.7352886", "0.7352697", "0.7270783", "0.7233754", "0.71505445", "0.71220446", "0.71174556", "0.7082855", "0.7027101", "0.70153856", "0.6963969", "0.6938114", "0.6913947", "0.6906169", "0.6858454", "0.6849305", "0.6794342", "0.674663", "0.6743393", "0.673272", "0.6732223", "0.67102385", "0.6707757", "0.6706854", "0.6703633", "0.67033803", "0.6689276", "0.66876507", "0.66767484", "0.66605824", "0.66495705", "0.66323024", "0.66312534", "0.6629278", "0.6620897", "0.6620897", "0.65671647", "0.65626234", "0.65618116", "0.65464205", "0.65339917", "0.6525663", "0.65178615", "0.65125483", "0.6509929", "0.6508804", "0.6508804", "0.65047145", "0.64835316", "0.64812034", "0.6480965", "0.64805114", "0.64727175", "0.64602196", "0.6444483", "0.6430689", "0.6430448", "0.642819", "0.64274806", "0.64121705", "0.64018494", "0.6396618", "0.6394438", "0.6391688", "0.63800144", "0.637952", "0.637952", "0.637952", "0.6378909", "0.636076", "0.63585275", "0.63581085", "0.63528526", "0.6352485", "0.635175", "0.63363284", "0.6328452", "0.6325294", "0.6323408", "0.6316585", "0.6314111", "0.6306185", "0.6302982", "0.6297019", "0.62899405", "0.6285941", "0.62676823", "0.6266944", "0.6264335", "0.62605083", "0.6259838", "0.62587726", "0.62566406", "0.6246481", "0.62457305", "0.6244237", "0.6240994", "0.62395364", "0.62353" ]
0.0
-1
This will get your data back using the user id
function retrieveData(){ $.post('/retrieve',{ 'userID': userID },function(a) { $('#totalPoints').text(a.points); $("#taskList").empty(); $("#completedTasks").empty(); currentTasks = a.pendingtasks.length; for(i = 0;i < a.pendingtasks.length;i++) { $('#taskList').append("<li id="+i+">"+a.category[i]+": "+a.pendingtasks[i]+"<button " + "onclick='specialComplete(\""+a.pendingtasks[i]+"\",4,"+i+")'> Finished Task </button>" +"</li>"); } for(i = 1;i < a.completedtasks.length;i++) { $('#completedTasks').append("<li>"+a.completedtasks[i]+"</li>"); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUser(id){\n //postDB(\"user/Get\", { \"use_id\" : id });\n return { \"name\" : \"steven\", \"img\" : '', \"share\" : false };\n }", "function getUserById(id){\n return $http.get(url.user + id).then( handleSuccess, handleError);\n }", "getDataFromID(id) {\n return this.users.find((user) => id === user.id);\n }", "function getUserData(id, type) {\n var queryUrl;\n switch (type) {\n case \"user\":\n queryUrl = \"/api/users/\" + id;\n break;\n case \"group\":\n queryUrl = \"/api/groups/\" + id;\n break;\n default:\n return;\n }\n $.get(queryUrl, function(data) {\n if (data) {\n console.log(data.GroupId || data.id);\n // If this user exists, prefill our cms forms with its data\n usernameInput.val(data.username);\n \n groupId = data.GroupId || data.id;\n // If we have a user with this id, set a flag for us to know to update the user\n // when we hit submit\n updating = true;\n }\n });\n }", "function getUserID() {\n var access_token = getAccessToken();\n fetch('https://api.spotify.com/v1/me', {\n headers: {\n 'Authorization': 'Bearer ' + access_token\n }\n }).then(res => res.json()).then(data => {\n console.log(\"user data\");\n console.log(data);\n p.getUser(data.id);\n })\n }", "getUserById(id){\n return this.auth.get(`/user/${id}`,{}).then(({data})=> data);\n }", "function getUserById(id) {\n // TODO: get user by id and set $scope.user to the user object. Angular will bind the object to the page \n }", "function pullUserData(){\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.responseText && xmlHttp.status == 200 && xmlHttp.readyState == 4) {\n var obj = jQuery.parseJSON( xmlHttp.responseText );\n $.each(obj, function() {\n FirstName[FirstName.length] = this['firstName'];\n LastName[LastName.length] = this['lastName'];\n if(h[this['_id']] != null){\n ID[ID.length] = h[this['_id']];\n }else{\n ID[ID.length] = \"Not Found\";\n }\n \n });\n }\n };\n xmlHttp.open(\"GET\", \"https://mydesigncompany.herokuapp.com/users\", true);\n //xmlHttp.open(\"GET\", \"https://infinite-stream-2919.herokuapp.com/users\", true);\n xmlHttp.send(null);\n }", "function getUserById(userid) {\n}", "async getUserData(id) {\n return User.findByPk(id);\n }", "function getUser(id){\n return fetch(`http://localhost:3000/users/${id}`)\n .then(res => res.json())\n }", "function getUser(id) {\n return $http.get('http://jsonplaceholder.typicode.com/users?id=' + id)\n .then(getUsersSuccess)\n .catch(getUsersError);\n }", "getUserByID(userid, cb) {\n\t\tvar query = {\n\t\t\t_id: global.dbController.convertIdToObjectID(userid)\n\t\t}\n\t\tthis.getUserDetails(query, cb)\n\t}", "function getUserById(req, res) {\n\n var userId = req.query.userId;\n console.log(\"user id inside of user controler : \");\n console.log(userId);\n userModel.getUserById(userId, function(error,result) {\n res.json(result);\n });\n\n}", "async function getUserById(id) {\n try {\n const {\n rows: [user],\n } = await client.query(\n `\n SELECT *\n FROM users\n WHERE id=$1;\n `,\n [id]\n );\n\n //get orders for user\n const orders = await getAllOrdersByUserId({ id });\n if (orders.length != 0) {\n user.orders = orders;\n }\n\n\n\n //get reviews for user\n const reviews = await getAllReviewsByUserId({ id });\n if (reviews.length != 0) {\n user.reviews = reviews;\n }\n\n return user;\n } catch (error) {\n throw error;\n }\n}", "function getUserData(onlyId) {\n\t$.get(\"/api/users/\" + onlyId, function(newUserData) {\n\t\tif (newUserData) {\n\t\t//Code below writes the selected match's name to the package\n\t\t$(\"#contactMatchImage\").attr( 'src', newUserData.image);\n\t\tvar matchName = newUserData.name;\n\t\t$(\"#matchName\").html(matchName);\n\t\t$(\"#matchMessage\").html(\"Message \" + matchName + \" below and gitUp!\")\n\t\tgetInterests(newUserData);\n\t}\n});\n}", "static getUserById(_id){\n return axios.get(`${baseUrl}${uniqUser}?_id=${_id}`)\n .then(function(res){\n return res\n }).catch((err) =>{\n throw(err)\n })\n }", "function findUserById(userId) {\n return window.httpGet(`https://openfin.symphony.com/pod/v2/user/?uid=${userId}`);\n }", "function fetchUser() {\n const userId = document.getElementById('user-id').value\n client.user.fetch(userId)\n}", "function getUserData(id, cb) {\n if (users[id]) return cb(users[id]);\n Request({\n url: \"https://\" + apikey + \":X@\" + domain + \".campfirenow.com/users/\" + id + \".json\",\n header: {\"User-Agent\":\"Trail Mix Firefox Plugin ([email protected])\"},\n onComplete: function (response) {\n var user = response.json.user;\n users[user.id] = {\n name: user.name,\n avatar: user.avatar_url\n };\n \n cb(users[user.id]);\n },\n onError: function (error) {\n console.error(\"Trail Mix error:\", error);\n }\n }).get();\n }", "function findUserById(id) {\n return fetch(`${self.url}/${id}`).then(response => response.json())\n }", "static getUser(userId) {\n const req = new Request(`/api/users/${userId}`, {\n method : 'GET',\n headers : this.requestHeaders()\n });\n return fetch(req).then(res => this.parseResponse(res))\n .catch(err => {\n throw err;\n });\n }", "getUser(id){\n return this.users.filter((user)=> user.id === id)[0]; /* FINDING AND RETURNING THE USER WITH SAME ID AND RETURNING IT WHICH WILL BE AT INDEX 0 */\n }", "function checkUser() {\n $.get(\"/api/user_data\").then(function (data) {\n userId = data.id;\n console.log(userId);\n return userId;\n });\n }", "get userId() {\n return this._data.user_id;\n }", "get userId() {\n return this._data.user_id;\n }", "get userId() {\n return this._data.user_id;\n }", "get userId() {\n return this._data.user_id;\n }", "function viewUser(id) {\r\n console.log('Inside user factory now');\r\n var deferred = $q.defer();\r\n\r\n $http.get(userUrl + '/user/' + id)\r\n .then (\r\n function(response) {\r\n deferred.resolve(response.data);\r\n },\r\n function(errResponse) {\r\n deferred.reject(errResponse);\r\n }\r\n );\r\n return deferred.promise;\r\n }", "function getuser(ID){\n makeRequest('./data/' + ID + '.json').then(callback.successfull, callback.error);\n \n}", "async get_user(user_id){\r\n\t\t\r\n\t\t//get user entry\r\n\t\tif(this.UsersInfo.has(user_id))\r\n\t\t\treturn this.UsersInfo.get(user_id)\r\n\t\telse \r\n\t\t\treturn this.load(user_id)\r\n\t}", "static getById(userId) {\n const query = 'SELECT * FROM Members WHERE id = $1 LIMIT 1';\n return db.one(query, [userId]).then(data => {\n return new User(data);\n }).catch(err => {\n console.error(err);\n console.error(`Couldn\\'t get user ${userId}.`);\n return null;\n });\n }", "getUser(_, { id }) {\n return db.user.findById(id);\n }", "getUserById(id) {\n return this.http.get(\"http://localhost:8080/api/users/\" + id);\n }", "function getUserData(id) {\n $.get(\"/api/users/\" + id, function(data) {\n if (data) {\n // If this post exists, prefill our cms forms with its data\n usernameInput.val(data.username);\n passwordInput.val(data.password);\n // postCategorySelect.val(data.category);\n // If we have a post with this id, set a flag for us to know to update the post\n // when we hit submit\n updating = true;\n }\n });\n }", "function getUserById(req, res) {\n var userId = req.params['userId'];\n\n userModel\n .findUserById(userId)\n .then(function (user) {\n res.json(user);\n });\n }", "function findUserById1(userId) {\n var url = \"/api/user1/\" + userId;\n return $http.get(url);\n }", "async function getUserdata(id){\n console.log(id)\n const user = await db.query(\n `SELECT id, user_name, checkedout_books\n FROM Users WHERE id = ${id}`\n );\n console.log(user)\n\n return{\n user\n }\n }", "async user(parent,{id},{dataSources}) { \n const user = await dataSources.users.getUser(id)\n return user;\n }", "static getById(req, res) {\n const id = req.params.id;\n\n UsersModel.get(id)\n .then(user => {\n if (!user.empty) {\n const User = {\n id: User.id,\n data: User.data()\n };\n\n return res.json(User);\n\n } else {\n return res.sendStatus(404)\n .send({ message: 'This supplier doesn`t exist on our database.' });\n }\n })\n .catch(err => {\n return res.sendStatus(500).json(err);\n });\n }", "function findUserById(userId) {\n var url = \"/api/assignment/user/\" + userId;\n return $http.get(url)\n .then(function(response) {\n return response.data;\n });\n }", "function getUser(id) {\n return axios.get(api_host+\":\"+api_port+\"/api/user/\"+id)\n .then( res => {\n return res.data;\n })\n .catch( err => {\n console.log(err);\n });\n}", "static async getUser(id) {\n const res = await axios.post(`${url}/${id}`);\n return res.data;\n }", "function getASingleUser(userID){\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\",\"api/users/\" + String(userID), true);\r\n xhr.onload = function() {\r\n if (xhr.readyState === 4 && xhr.status >= 200 && xhr.status < 300) {\r\n var objUser = JSON.parse(xhr.responseText);\r\n renderSingleUser(objUser)\r\n }\r\n else {\r\n alert(\"Error \" + xhr.status);\r\n }\r\n };\r\n xhr.send()\r\n}", "async retriveUserDetails(req, res, next) {\n try {\n let userId = req.params.userId;\n let userDetails = await User.findById(userId)\n .populate('jobs')\n .populate('city')\n if (!userDetails)\n return res.status(404).end();\n\n return res.status(200).json(userDetails);\n } catch (err) {\n next(err)\n }\n }", "function getProfileByUserid(user,callback) {\n $.getJSON( '/users/getProfileByUserid/', {id: user}, function( data ) {\n callback(data);\n });\n}", "getUser(idUser) {\n this.helper.publish(JSON.stringify(idUser), Constants.USERS, Constants.GET_USER, (err, user) => {\n this.sockets.forEach((socket) => {\n if (err) socket.emit(Constants.ERROR);\n else socket.emit(Constants.USER_RETURNED, user);\n });\n });\n }", "function fetchUser(id) {\r\n\t var deferred = $q.defer();\r\n\t\r\n\t $http.get(userUrl + '/user/'+ id)\r\n\t .then (\r\n\t function(response) {\r\n\t deferred.resolve(response.data);\r\n\t },\r\n\t function(errResponse) {\r\n\t deferred.reject(errResponse);\r\n\t }\r\n\t );\r\n\t return deferred.promise;\r\n\t\r\n\t}", "function getUserData (req, res, next) {\n db.oneOrNone(`SELECT * FROM \"user\" WHERE user_id = $1`, [req.params.user_id])\n .then((user) => {\n res.rows = user;\n next();\n })\n .catch(err => next(err));\n}", "getUserData(id) {\n const { users } = this.props;\n let data = users.users;\n let result = data.filter(user => user.login.uuid === id);\n\n return result;\n }", "async getByUserId(req, res, next) {\n try {\n let data = await favoriteService.get({ \"userId\": req.query.userId });\n return res.send(data);\n } catch (error) {\n next(error);\n }\n }", "static async fetchUser({userId}) {\n\t\tconst body = await got.get(`${USERS_SERVICE_API}/users/${userId}`).json();\n\t\treturn body;\n\t}", "async getUserInfo(userId) {\n return await this.Model.findOne({ _id: userId })\n }", "function getUserById(request, response) {\n var userId = request.swagger.params.userId.value;\n\n User.findOne({userId: userId}, function(err, user) {\n if(err) {\n response.status(404).json();\n }\n if(!user) {\n response.status(400).json()\n }\n Article.find({author: user._id}, function(err, articles) {\n var articleList = [];\n if(err) {\n articleList.push([\"[0]Error in finding articles.\"])\n }\n articles.forEach(function(element) {\n articleList.push(element.articleId);\n });\n TweetData.findOne({author: user._id}, function(err, tweetdata) {\n var tempDataId = \"null\"\n if(err) {\n //console.log(err);\n }\n if(tweetdata) {\n tempDataId = tweetdata.tweetDataId;\n }\n response.status(200).json({id: user.userId, name: user.fullName,\n tweetDataId: tempDataId,\n articleIds: articleList})\n });\n\n });\n });\n}", "function findUserById(userId) {\n var url = \"/api/user/\" + userId;\n return $http.get(url);\n }", "function findUserById(userId) {\n var url = \"/api/user/\" + userId;\n return $http.get(url);\n }", "getUserID() {\n return this.userData.id;\n }", "async getUserById(id){\n let users = await db.query('SELECT id, name, email FROM users WHERE id = ?', id);\n\n return users[0];\n }", "getUser({params}, res) {\n User.findOne({ _id: params.id })\n .then(userData => {\n if(!userData) {\n res.status(404).json({ message: 'No user found with this id!'})\n }\n res.json(userData)\n })\n .catch(err => {\n res.status(400).json(err);\n })\n }", "function getCurrentUser(id) {\n // SERVER_CALL Get information of user profile from server\n // For now return fake user we created\n user = patientList.filter(function(account) {\n return account.id == id;\n })[0];\n}", "retrieve(context, id){\n HTTP.get(USERS + id)\n .then((resp) => {\n console.log(resp)\n context.usuario = resp.data.usuario;\n context.id = resp.data.id;\n })\n .catch((err) => {\n console.log(err)\n })\n }", "getUserById(db, userId) {\n return db('users').select('*').where('id', userId).first();\n }", "async getUser(userId) {\n let userResult = await this.request(\"user/\" + userId);\n return userResult.user;\n }", "function loadUserInfo(id) {\n return User.findById(id).then(function (user) {\n G_UserInfo = userRefDict(user, user.currentWorkoutID);\n thisUser = G_UserInfo[\"User\"];\n G_thisStats = G_UserInfo[\"Stats\"];\n thisPatterns = G_UserInfo[\"thisPatterns\"];\n userFound = true;\n });\n}", "function getUserFromDb() {\r\n console.log('clientApp: getting user data from db');\r\n $http({\r\n method: \"GET\",\r\n url: 'acct/getUser'\r\n }).then(function (response) {\r\n //console.log('clientApp: retrieved user:', response);\r\n //console.log('clientApp: current user: ',response.data.email);\r\n //console.log('clientApp: current sisbot: ',response.data.curSisbot);\r\n //console.log('clientApp: current available sisbots: ',response.data.sisSerials);\r\n vm.sisSerials = response.data.sisSerials;\r\n vm.curSisbot = response.data.curSisbot;\r\n\r\n displayUIdata();\r\n })\r\n }", "function getUserID(res, mysql, context, id, complete) {\n mysql.pool.query(\"SELECT * FROM users WHERE user_id = ?\", id, (error, results, fields) => {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.users = results[0];\n complete();\n });\n }", "getUserById(req, res) {\n const id = req.params.id\n model.getUserById(id)\n .then((result) => {\n helper.response(res, result, 200, null)\n })\n .catch((err) => {\n helper.response(res, null, 400, err)\n })\n }", "async function getUserDetailsById(id) {\n /*\n * Execute three sequential queries to get all of the info about the\n * specified user, including its posts, comments and likes.\n */\n const users = await getUserByUserId(id);\n \n if (users) {\n users.posts = await getPostsByUserId(id);\n }\n return users;\n }", "function getUser (req, res) {\n promiseResponse(userStore.findOne({ userId: req.params.id }), res);\n}", "function getUser(id){\n for (i in users){\n if (i.userId === id){\n return i\n }\n }\n return null\n}", "getUserById(id) {\r\n return new SiteUser(this, `getUserById(${id})`);\r\n }", "function getUser () {return user;}", "getUser(id) {\n return this.users.filter(user => user.id === id)[0]; //VOY A TENER EL PRIMER ELEMENTO DE LA LISTA ES DECIR SOLO UN USUARIO / AL COLOCARLE QUIERO EL PRIMER ELEMENTO SOLO ME DARA EL OBJETO YA NO COMO LISTA DE OBJETO SINO SOLO EL OBJETO\n }", "function getUser(id) {\n // return the one user with that id\n const user = users.find(user => user.id === id);\n return user;\n}", "static async getUserInfo(userId) {\n let res = await db.query('SELECT username, mail FROM users WHERE id = $1', [userId]);\n return res.rows[0];\n }", "getUserFullData() {\n let user = this.getUser()\n return {\n id: user.id,\n name: user.name,\n followers: this.getFollowers(),\n following: this.getFollowing(),\n feed: this.createUserFeed()\n }\n }", "static getByUserID(request, response) {\r\n\r\n console.log(request.params.client);\r\n\r\n itemsModel.getByUserID(request.params.client)\r\n .then( data => {\r\n if (data.length > 0) {\r\n response.json(data); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Items not found. Client: ', request.params.client);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error getting items by client: ', request.params.client, err);\r\n });\r\n \r\n }", "function getUser(id) {\n fetch('http://dummy.restapiexample.com/api/v1/employee/' + id).then(resp => resp.json()).then(data => console.log(data));\n}", "function getUserId(){\n\tvar xhr = new XMLHttpRequest();\n\n\t\n\txhr.open(\"GET\", \"http://localhost:8080/GreenBull-Reimbursement/html/MenuJSON.do\", true);\n\txhr.send();\n\t\n\txhr.onreadystatechange = function() {\n\t\tif(xhr.readyState == 4 && xhr.status == 200){\n\t\t\tstr = xhr.responseText;\n\t\t\t\n\t\t\tlet user = JSON.parse(xhr.responseText);\n\t\t\tsetValues(user);\n\t\t\tuid = user.id;\n\t\t}\n\t};\n}", "function successGetUserById(user) {\n return {\n type: ACTION.GET_USER_BY_ID_SUCCESS,\n user\n }\n}", "async function getUser(req, res, next) {\n const user = models.user.findOne({ where: { id: req.params.id } })\n req.data = res.json(user)\n}", "function getUserById(id) {\n return getUserByProperty('id', id);\n}", "function getInfo (id, authorisation, self) {\n var url = `${API_URL}/user?id=${id}`; \n if (self == 'self') { \n console.log(`${self}`);\n url = `${API_URL}/user`\n };\n return fetch(url, {\n method: 'GET',\n headers: {\n 'Authorization': `Token ${authorisation}`\n },\n })\n .then(res => {\n //catch 403 status \n if (res.status === 403) {\n alert(\"Invalid auth token\");\n } \n return res.json();\n })\n .catch(error => {\n alert(\"He's dead Jim (Issue getting user information)\");\n });\n}", "function getUser (userid, callback) {\n $http.post('/getUserInfo', {userid:userid}).success(function(data) {\n callback(data);\n })\n }", "function showUser(id) {\n\tconst showName = document.getElementById('show-user-title')\n\tconst showImage = document.getElementById('show-user-image')\n\tconst showDate = document.getElementById('show-user-date')\n\tconst showMail = document.getElementById('show-user-mail')\n\tconst showDetail = document.getElementById('show-user-detail')\n\n\tlet userData = User_URL+id\n\n\taxios\n\t.get(userData)\n\t.then((response) => {\n const pickOne = response.data\n console.log(response.data)\n\n\t\tshowName.innerHTML = `${pickOne.name} ${pickOne.surname}`\n showImage.innerHTML = `<img src=\"${pickOne.avatar}\" class=\"img-fluid\" alt=\"Responsive image\">`\n showMail.innerHTML = ` \n <h6>Contact info:</h6>\n <h6> ${pickOne.email}</h6>`\n showDetail.innerHTML = `\n <h6>From:</h6>\n <h6> ${pickOne.region}</h6>`\n showDate.innerHTML = `\n <h6>Created since:</h6>\n <h6> ${pickOne.created_at}</h6>`\n\t})\n .catch((err) => console.log(err))\n}", "function renderUser(id) {\n const userId = id || getSelectedUser()\n console.log('Rendering user')\n if (userId) {\n const user = client.user.get(userId)\n const userDataString = JSON.stringify(user, null, 4)\n document.getElementById('display').innerHTML = userDataString\n if (user != undefined && user != \"\") {\n const userDisplay = document.getElementById('display')\n let text = '<h5>User Info</h5>'\n userDisplay.innerHTML = ''\n Object.keys(user).forEach(\n key => (text += '<li><b>' + key + '</b>: <i>' + user[key] + '</i></li>')\n )\n\n userDisplay.innerHTML = '<ul>' + text + '</ul>';\n } else {\n log('User not found');\n }\n }\n }", "getUserData() {\n console.log(\"Make a DB query...\");\n return {\n user_id: this.userId,\n name: \"AAA\",\n age: 12,\n };\n }", "function getUser(id) {\n return \"Akhil\";\n}", "get(req, res) {\n let { id } = req.params;\n if (!parseInt(id)) return res.status(412).json({ type: \"error\", message: \"User Id not provided\" });\n\n this.__readData(__data_source)\n .then(lists => {\n if (+id <= lists.length) {\n return res.json({ type: \"success\", data: this.__single(id - 1, lists[id - 1].split(\",\")) });\n }else{\n return res.status(412).json({ type: \"error\", message: \"This is not a valid ID.\" });\n }\n })\n .catch(err => res.status(412).json({ type: \"error\", message: \"No Data Found\" }));\n }", "function getUser(id,res) {\n var user;\n if ( id && id !== '' && id !== undefined ) {\n userDbStub.forEach(function(element) {\n if(element.id === id ) {\n user = element;\n }\n }, this); \n \n if( !user && user === undefined) {\n if(res != null){\n res.status(404).send('user not found');\n }else{\n console.log('user not found');\n } \n }\n \n } else {\n if(res != null){\n res.status(401).send('id isn\\'t defined'); \n }else{\n console.log('id isn\\'t defined');\n } \n } \n return user;\n}", "function getUserAndSavedUsers(id){\n$.get(\"/api/user_data\").then(function(data) {\n loggedInUser = data\n followerBits.empty()\n getFollowerBits()\n });\n}", "static async getUser(req, res) {\n const id = req.params.id;\n\n try {\n const user = await userModel.find(id);\n res.status(200).json(user);\n } catch (err) {\n res.status(404).json({ message: err.message });\n }\n }", "getUser({ commit, dispatch }, userid) {\n api(`account/${userid}`).then(res => {\n commit('setUserView', res.data)\n })\n }", "function findUserById(req, res) {\n var userId = req.params['userId'];\n\n userModel\n .findUserById(userId)\n .then(function (user) {\n res.json(user);\n });\n\n }", "getUserDetails(id) {\n return apiClient.get(\n `/account?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3&session_id=${id}`\n )\n }", "static async getUser(userId) {\r\n try {\r\n\r\n let response = await axios.request({\r\n url: '/users/' + userId,\r\n method: 'get',\r\n baseURL: DB_URL,\r\n auth: {\r\n username: 'apikey-v2-1zry8ajgypo2q14hzjvdwuemmaiixcz9dhmtedvr14ck',\r\n password: '53fcbf5faa893817605b85afaf7af46f',\r\n },\r\n data: null,\r\n });\r\n return response.data;\r\n } catch (err) {\r\n console.log(\"error\", err);\r\n throw err;\r\n // throw new Error('Please Enter Valid User Id');\r\n }\r\n }", "get userId(){\n\t\treturn this._user.user_id;\n\t}", "async getSingle(id = 1) {\n const response = await fetch(`${baseUrl}/users/${id}`);\n const data = await response.json();\n return data;\n }", "async viewOne(req, res) {\n const data = await getQuery.findUsersId(req.params.id);\n if (data.err) {\n res.status(200).send(\"Somthing wrong\");\n }\n if (data.length > 0) {\n userDetails = {\n status: 200,\n data: data,\n message: \"User find\"\n };\n res.status(200).send(userDetails);\n } else {\n res.status(200).send(\"Record not Fond\");\n }\n }", "function oneUser (input) {\n function myCallback(data) {\n for(i=0; i < data.length; i++){\n if(data[i].userId == input){ /*.id?*/\n let founduser = data[i];\n sessionStorage.setItem('foundUser', JSON.stringify(founduser))\n }\n }\n window.location.href = (\"adminUpdateUser.html\")\n }\n\n var admin = new Admin(null, null, 2);\n admin.getUser(myCallback);\n}", "user(_, { id }) {\n return User.find(id);\n }" ]
[ "0.77560544", "0.74468654", "0.72957", "0.72918576", "0.728847", "0.72861385", "0.7195918", "0.71549565", "0.71418285", "0.711519", "0.7085099", "0.70802474", "0.70722216", "0.70372653", "0.7016149", "0.69888663", "0.69852227", "0.69844687", "0.6977619", "0.6969277", "0.6952012", "0.6947922", "0.6940118", "0.6937146", "0.6930944", "0.6930944", "0.6930944", "0.6930944", "0.6928557", "0.69208914", "0.69204134", "0.6917449", "0.69150037", "0.69115865", "0.6910114", "0.69073564", "0.69036615", "0.68852395", "0.6866815", "0.686668", "0.68569565", "0.68507177", "0.6835044", "0.6834", "0.68268067", "0.68187815", "0.6813395", "0.68109655", "0.68093055", "0.6793483", "0.67852575", "0.6776132", "0.6770517", "0.6769494", "0.67614305", "0.67614305", "0.676117", "0.6744604", "0.6737336", "0.6733337", "0.6732058", "0.6719831", "0.6718664", "0.67126036", "0.6708238", "0.6708082", "0.6705756", "0.6704658", "0.6703803", "0.6703384", "0.66956544", "0.6694485", "0.6682116", "0.668062", "0.667445", "0.66733587", "0.66711414", "0.6669666", "0.66609204", "0.6659078", "0.6654298", "0.66518474", "0.6646741", "0.6638839", "0.66349584", "0.66172343", "0.65989727", "0.65919656", "0.6589831", "0.6589404", "0.65851027", "0.65828115", "0.6581579", "0.6581133", "0.6579997", "0.6558345", "0.65503556", "0.6546343", "0.6545538", "0.6544948", "0.65402156" ]
0.0
-1
Function to Internationalize name (format: First LAST)
function inName(name) { name = bio.name.trim().split(" "); name[1] = name[1].toUpperCase(); name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase(); return name[0] + " " + name[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inName(name) {\n name = name.split(\" \");\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n name[1] = name[1].toUpperCase();\n var internationalizedName = (name[0] + \" \" + name[1]);\n return internationalizedName;\n}", "function intlName(name) {\n\t\t\tvar names = name.trim().split(\" \");\n\t\t\treturn names[0][0].toUpperCase() + names[0].slice(1).toLowerCase() + \" \" + names[1].toUpperCase();\n\t\t}", "function convertName(name) {\n if (name == 'TBA') return name;\n let arr = name.split(', ');\n lastName = arr[0];\n firstName = arr[1];\n\n titleRegex = /\\([A-Za-z]+\\)/;\n if (titleRegex.test(firstName)) {\n const title = firstName.match(titleRegex);\n firstName = firstName.replace(titleRegex, '')\n firstName = lowerLetters(firstName);\n lastName = lowerLetters(lastName);\n lastName += ` ${title}`;\n } else {\n firstName = lowerLetters(firstName);\n lastName = lowerLetters(lastName);\n }\n\n let result = `${firstName} ${lastName}`;\n return result;\n}", "function convertName (name){\n let arr= name.split(' ') \n let firstIn = arr[0][0] \n let lastIn = arr[1][0] \n return (firstIn+\".\"+lastIn).toUpperCase()\n}", "function abbrevName(name){\n //split name into two string values\n let nameArray = name.split(\" \");\n\n //get first letter of first name\n let firstName = nameArray[0].charAt(0);\n\n //get first letter of last name\n let lastName = nameArray[1].charAt(0);\n\n //return concatenated first initial and last initial separated by a dot\n return `${firstName.toUpperCase()}.${lastName.toUpperCase()}`;\n\n}", "function abbrevName(name){\n let arr = name.split(' ');\n let firstname = arr[0];\n let surname = arr[1];\n let result = firstname[0] + '.' + surname[0].toUpperCase();\n\n return result;\n}", "function abbrevNames(name){\n let nameArray = name.split(' ');\n let inicials = \"\";\n for (let i = 0; i < nameArray.length; i++) {\n // this ensures the function will put the dot after the first name even if it's just one name\n if (i === 0) {\n inicials += nameArray[i][0] + \".\";\n // this ensures the function will not put the dot after the last name \n } else if (i === nameArray.length-1) {\n inicials += nameArray[i][0];\n // all other cases\n } else {\n inicials += nameArray[i][0] + \".\";\n }\n } \n return inicials.toUpperCase();\n}", "function fullName(first, last){\r\n var name = first + \"\" + last;\r\n return name;\r\n}", "function formatName(name) {\n const firstNameAndLastName = name.split(' ');\n let firstName = firstNameAndLastName[0];\n let lastName = firstNameAndLastName[1];\n\n firstName = firstName.charAt(0).toUpperCase() + firstName.substr(1).toLowerCase();\n lastName = lastName.charAt(0).toUpperCase() + lastName.substr(1).toLowerCase();\n return firstName + ' ' + lastName;\n\n}", "function abbrevName(name){\n\nreturn name.charAt(0).toUpperCase().concat('.', name.charAt(name.indexOf(' ')+1).toUpperCase());\n \n}", "function abbrevName(name){\n let zoinks;\n for(let i = 0; i < name.length; i++){\n if (name[i] === ' ' ){\n zoinks = name[i+1].toUpperCase()\n }\n }\n return name[0].toUpperCase() + '.' + zoinks\n\n}", "function abbrevName(name){\n\n var result = ''\n\n for(var i=0; i<name.length; i++){\n if(i == 0){\n result = name[i].toUpperCase() + '.'\n }else if(name[i] == ' '){\n result += name[i+1].toUpperCase()\n }\n }\n\n return result\n}", "function formatI18nPlaceholderName(name){var chunks=toPublicName(name).split('_');if(chunks.length===1){// if no \"_\" found - just lowercase the value\nreturn name.toLowerCase();}var postfix;// eject last element if it's a number\nif(/^\\d+$/.test(chunks[chunks.length-1])){postfix=chunks.pop();}var raw=chunks.shift().toLowerCase();if(chunks.length){raw+=chunks.map(function(c){return c.charAt(0).toUpperCase()+c.slice(1).toLowerCase();}).join('');}return postfix?raw+\"_\"+postfix:raw;}", "function formatUserName(first, middle, last) {\n var firstName = first || '';\n var middleName = middle || '';\n var lastName = last || '';\n var hasCJK = commons.isCJKUnifiedIdeographs(lastName.trim() + middleName.trim() + firstName.trim());\n log.debug('formatUserName', 'hasCJK=' + hasCJK + ', firstName=' + firstName + ', lastName=' + lastName);\n if (hasCJK) {\n return lastName + middleName + firstName;\n } else {\n return firstName + (middleName ? ' ' + middleName : '') + (lastName ? ' ' + lastName : '');\n }\n }", "function inName() {\n\tvar str = $('#name')[0].innerText;\n\tvar nameParts = str.split(' ');\n\tvar lastPart = nameParts.length - 1;\n\t// Initial cap for first name\n\tnameParts[0] = str.slice(0,1).toUpperCase() +\n\t\tnameParts[0].slice(1).toLowerCase();\n\t// All caps for last name\n\tnameParts[lastPart] = nameParts[lastPart].toUpperCase();\n\treturn nameParts.join(' ');\n}", "function abbrevName(name){\n\n return name.toUpperCase().split(\" \").map(x=> x[0]).join(\".\")\n\n}", "function formatName(name) {\n return name.replace(/-([a-z])/g, function(s, l) {return l.toUpperCase();});\n }", "function fullName2(first, last) {\n return first + \" \" + last;\n}", "function format_name(name){\n let lowercaseName = name.toLowerCase();\n let splitName = lowercaseName.split(\" \")\n let formatName = []\n \n splitName.forEach(part =>{\n part = part.charAt(0).toUpperCase()+part.slice(1);\n \n formatName.push(part)\n })\n return formatName.join(\" \")\n \n }", "function inName() {\n var oldName = $('#name').html();\n var names = oldName.trim().split(' ');\n names[0] = names[0].slice(0,1).toUpperCase() +\n names[0].slice(1).toLowerCase();\n names[1] = names[1].toUpperCase();\n return names[0] + ' ' + names[1];\n}", "function formatI18nPlaceholderName(name) {\n var chunks = toPublicName(name).split('_');\n if (chunks.length === 1) {\n // if no \"_\" found - just lowercase the value\n return name.toLowerCase();\n }\n var postfix;\n // eject last element if it's a number\n if (/^\\d+$/.test(chunks[chunks.length - 1])) {\n postfix = chunks.pop();\n }\n var raw = chunks.shift().toLowerCase();\n if (chunks.length) {\n raw += chunks.map(function (c) { return c.charAt(0).toUpperCase() + c.slice(1).toLowerCase(); }).join('');\n }\n return postfix ? raw + \"_\" + postfix : raw;\n}", "function formatI18nPlaceholderName(name) {\n var chunks = toPublicName(name).split('_');\n if (chunks.length === 1) {\n // if no \"_\" found - just lowercase the value\n return name.toLowerCase();\n }\n var postfix;\n // eject last element if it's a number\n if (/^\\d+$/.test(chunks[chunks.length - 1])) {\n postfix = chunks.pop();\n }\n var raw = chunks.shift().toLowerCase();\n if (chunks.length) {\n raw += chunks.map(function (c) { return c.charAt(0).toUpperCase() + c.slice(1).toLowerCase(); }).join('');\n }\n return postfix ? raw + \"_\" + postfix : raw;\n}", "function formatI18nPlaceholderName(name) {\n var chunks = toPublicName(name).split('_');\n if (chunks.length === 1) {\n // if no \"_\" found - just lowercase the value\n return name.toLowerCase();\n }\n var postfix;\n // eject last element if it's a number\n if (/^\\d+$/.test(chunks[chunks.length - 1])) {\n postfix = chunks.pop();\n }\n var raw = chunks.shift().toLowerCase();\n if (chunks.length) {\n raw += chunks.map(function (c) { return c.charAt(0).toUpperCase() + c.slice(1).toLowerCase(); }).join('');\n }\n return postfix ? raw + \"_\" + postfix : raw;\n}", "function fullName(first, last) {\n const nameArr = [first, last];\n return nameArr.join(\" \");\n}", "function firstName(v) {\n return v.toLowerCase().replace(/\\b\\w+\\b/g, cnvrt); \n function cnvrt() {\n if (arguments[arguments.length -2] == 0)\n return arguments[0].replace(/^[a-z]/, cnvrt2);\n else if (/^(do|dos|da|das|de)$/.test(arguments[0]) )\n return arguments[0];\n else\n return arguments[0].replace(/^[a-z]/, cnvrt2);\n } \n function cnvrt2() {\n return arguments[0].toUpperCase();\n }\n}", "function abbrevName(name){\n let sp = name.split(' ');\n return `${sp[0].charAt(0).toUpperCase()}.${sp[1].charAt(0).toUpperCase()}`;\n}", "function abbrevName(name){\n let i = 0;\n while (name[i] !== ' ') {\n i++;\n }\n return (name[0] + '.' + name[i+1]).toUpperCase();\n}", "function fullName(firstName, lastName) {\n return firstName.toLocaleUpperCase() + ' ' + lastName;\n}", "function abbrevName(name){\n let nameSplit = name.split(' ');\n let firstInitial = nameSplit[0].charAt(0).toUpperCase();\n let secondInitial = nameSplit[1].charAt(0).toUpperCase();\n return(`${firstInitial}.${secondInitial}`);\n}", "function startUpName(...names) {\n let name = [];\n for (let i = 0; i < names.length; i++) {\n name.push(names[i].charAt(0).toUpperCase());\n }\n return name.sort().join('');\n}", "function abbrevName(name){\n let firstInitial = name.substring(0,1);\n let space = name.indexOf(' ');\n space++;\n let lastInitial = name.substr(space, 1);\n\n return(`${firstInitial.toUpperCase()}.${lastInitial.toUpperCase()}`);\n\n}", "function abbrevName(name) {\n return name\n .split(\" \")\n .map(name => name.charAt(0).toUpperCase())\n .join(\".\");\n}", "function inName(name) {\n\t// trim the white space from outer edges of name and then split it into an array at the space.\n\tname = bio.name;\n\tconsole.log(name);\n\tname = name.trim().split(\" \");\n\tconsole.log(name);\n\t// uppercase whole last name (assuming no middle name)\n\tname[1] = name[1].toUpperCase();\n\t// make sure just first letter of first name is uppercase\n\tname[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n\t// return internationalized name\n\treturn name[0] + \" \" + name[1];\n}", "function inName(){\n var name = $(\"#name\").html();\n name = name.trim().split(\" \");\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1);\n\n return name[0] + \" \" + name[1];\n}", "function inName(name) {\n name = name.trim().split(\" \"); //trim will take away the white space in the front and back of the name string. split it at the space char\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase(); //capitalizes first name's first letter, appends it to the remainder of the first name which it ensures is lower case.\n return name[0] + \" \" + name[1];\n}", "function abbrevName(name){\n return name.toUpperCase().split(\" \").map(el => el.slice(0,1)).join(\".\")\n}", "function abbrevName(name){\n let nameArray = name.split(' ')\n return (nameArray[0][0] + \".\" + nameArray[1][0]).toUpperCase();\n}", "function formatI18nPlaceholderName(name) {\n const chunks = toPublicName(name).split('_');\n if (chunks.length === 1) {\n // if no \"_\" found - just lowercase the value\n return name.toLowerCase();\n }\n let postfix;\n // eject last element if it's a number\n if (/^\\d+$/.test(chunks[chunks.length - 1])) {\n postfix = chunks.pop();\n }\n let raw = chunks.shift().toLowerCase();\n if (chunks.length) {\n raw += chunks.map(c => c.charAt(0).toUpperCase() + c.slice(1).toLowerCase()).join('');\n }\n return postfix ? `${raw}_${postfix}` : raw;\n}", "function formatI18nPlaceholderName(name) {\n var useCamelCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var publicName = toPublicName(name);\n\n if (!useCamelCase) {\n return publicName;\n }\n\n var chunks = publicName.split('_');\n\n if (chunks.length === 1) {\n // if no \"_\" found - just lowercase the value\n return name.toLowerCase();\n }\n\n var postfix; // eject last element if it's a number\n\n if (/^\\d+$/.test(chunks[chunks.length - 1])) {\n postfix = chunks.pop();\n }\n\n var raw = chunks.shift().toLowerCase();\n\n if (chunks.length) {\n raw += chunks.map(function (c) {\n return c.charAt(0).toUpperCase() + c.slice(1).toLowerCase();\n }).join('');\n }\n\n return postfix ? \"\".concat(raw, \"_\").concat(postfix) : raw;\n }", "function inName(name) {\n\tname = name.trim().split(\" \");\n\tname[1] = name[1].toUpperCase();\n\tname[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\treturn name[0] + \" \" + name[1];\n}", "function abbrevName(name){\n let wordarr = name.toUpperCase().split(\" \")\n console.log(wordarr)\n let firstletter = wordarr[0].charAt(0)\n let secondletter = wordarr[1].charAt(0)\n return firstletter + \".\" + secondletter\n }", "function formatI18nPlaceholderName(name) {\n var useCamelCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var publicName = toPublicName(name);\n\n if (!useCamelCase) {\n return publicName;\n }\n\n var chunks = publicName.split('_');\n\n if (chunks.length === 1) {\n // if no \"_\" found - just lowercase the value\n return name.toLowerCase();\n }\n\n var postfix; // eject last element if it's a number\n\n if (/^\\d+$/.test(chunks[chunks.length - 1])) {\n postfix = chunks.pop();\n }\n\n var raw = chunks.shift().toLowerCase();\n\n if (chunks.length) {\n raw += chunks.map(function (c) {\n return c.charAt(0).toUpperCase() + c.slice(1).toLowerCase();\n }).join('');\n }\n\n return postfix ? \"\".concat(raw, \"_\").concat(postfix) : raw;\n}", "_formatTitle(name) {\n let title = \"\"\n let titleWords = name.split(\"-\");\n\n for(let i = 0; i < titleWords.length; ++i) {\n let word = titleWords[i];\n\n title += word.charAt(0).toUpperCase() + word.slice(1) + \" \";\n }\n\n return title\n }", "function prettifyName(profname) {\n return profname.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n }", "function inName() {\n\tnames = bio.name.split(\" \");\n\tfirstName = names[0].slice(0,1).toUpperCase() + names[0].slice(1).toLowerCase();\n\tlastName = names[1].toUpperCase()\n\tfullName = firstName + \" \" + lastName\n return fullName\n}", "function abbrevName(name) {\n return (name[0] + '.' + name[name.indexOf(' ') + 1]).toUpperCase();\n}", "function createInitialsFromName(name) {\r\n let Fullname = name.split(\" \");\r\n let initials = \"\";\r\n\r\n for (let i = 0; i < Fullname.length; i++) {\r\n if (Fullname.length === 1) {\r\n initials += Fullname[i].slice(0, 2);\r\n } else if (Fullname.length === 2) {\r\n initials += Fullname[i][0];\r\n } else if (Fullname.length > 2) {\r\n initials += Fullname[0][0] + Fullname[Fullname.length - 1][0];\r\n break;\r\n }\r\n }\r\n return initials.toUpperCase();\r\n}", "function inName(name) {\n\tname = name.replace(/[^a-zA-Z ]/g, \"\");\n\n\tvar finalName;\n\t//trim() removes white spaces before & after names Not in between names\n\tname = name.trim();\n name = name.toLowerCase();\n var n = name.indexOf(\" \");\n \n name = name.charAt(0).toUpperCase() + name.slice(1);\n var firstname = name.slice(0, n);\n var lastname = name.slice(n+1);\n lastname = lastname.toUpperCase();\n finalName = firstname + \" \" + lastname;\n \t//don't use replaceWith() as this will change the class to default.\n\t$('#name').text(finalName);\n\n}", "getContactDisplayName(first_name, middle_name, last_name) {\n\t var key = \"\";\n\t (first_name != \"\")? key += first_name + \" \" : key = key;\n\t (middle_name != \"\")? key += middle_name + \" \" : key = key;\n\t (last_name != \"\")? key += last_name : key = key;\n\t return key;\n\t}", "function inName(name) {\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n}", "function inName(name) {\n\tname = name.trim().split(\" \");\n\tconsole.log(name);\n\tname[1] = name[1].toUpperCase();\n\tname[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n\treturn name[0] + \" \" + name[1];\n}", "function inName(name) {\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n}", "function inName(name) {\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n}", "function inName(name){\n name = name.trim().split(' ');\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n return name[0] + ' ' + name[1];\n}", "function abbrevName(name) {\n\treturn name\n\t\t.toUpperCase()\n\t\t.split(' ')\n\t\t.map((intial) => intial[0])\n\t\t.join('.');\n}", "function combineNames(first,last) {\n return `${first} ${last}`;\n}", "function get_my_name(name){\n return name + \" Ubanell\";\n}", "function formatSwimmerName(name){\n var names = name.split(\", \");\n return names[1] + \" \" + names[0];\n}", "function abbrev_name(str1) {\n split_names = str1.trim().split(\" \")\n if (split_names.length > 1) {\n return (split_names[0] + \" \" + split_names[1].charAt(0) + \".\");\n }\n}", "function inName(name) {\n\tname = name.trim().split(\" \");\n\tconsole.log(name);\n\tname[1] = name[1].toUpperCase();\n\tname[0] = name[0].slice(0,1).toUpperCase() +\n\t\tname[0].slice(1).toLowerCase();\n\n\treturn name[0] +\" \"+name[1];\n}", "function myFirstLastNameLetters(name){\n\tvar position = name.indexOf(\"B\");;\n\tvar lastName = name.substr(position);\n\tconsole.log(name.substr(0,1) + \".\" + lastName.substr(0,1));\n}", "function inName(name){\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n return name[0] + \" \" + name[1];\n\n}", "function lordify(firstname) {\n return `${firstname} of Canterbury`;\n}", "function getLastName(fullname){\n let lastName = fullname.trim();\n lastName = lastName.substring(lastName.lastIndexOf(\" \")+1);\n lastName = lastName.substring(0,1).toUpperCase() + lastName.substring(1).toLowerCase();\n // If fullname contains -, make first character uppercase\n if (fullname.includes(\"-\")){\n let lastNames = lastName.split(\"-\");\n lastNames[1] = lastNames[1].substring(0,1).toUpperCase() + lastNames[1].substring(1).toLowerCase();\n lastName = lastNames.join('-');\n }\n return lastName;\n}", "function abbrevName(name) {\n const initials = name[0] + \".\" + name[name.indexOf(\" \") + 1];\n return initials.toUpperCase();\n}", "function inName(name) {\n name = $(\"#name\").text();\n name = name.trim().split(\" \");\n console.log(name);\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n name[1] = name[1].toUpperCase();\n\n return name[0] + \" \" + name[1];\n }", "formattedName() {\n let oneWord = /^[A-zА-яёЁ-]+$/;\n let twoWords = /^[A-zА-яёЁ-]+ [A-zА-яёЁ-]+$/;\n //let threeWords = /^(?:[A-zА-яёЁ]+ ){2}[A-zА-яёЁ]+$/;\n\n let field = this.$el.querySelector('.b-fields__name');\n this.$nextTick(() => {\n this.showSuggest = this.isTextOverflow(field);\n })\n\n this.name = this.capitalizeFirstLetter(this.name);\n\n return oneWord.test(this.name) \n ? this.name + ' Имя Отчество'\n : twoWords.test(this.name) \n ? this.name + ' Отчество' \n : this.name \n ? this.name \n : 'Фамилия Имя Отчество';\n }", "function formatName(name) {\n if(name.includes(\",\") || name.includes(' ') || name.includes(\"&\")){\n if(name.includes(\".\")){\n name = name.substring(0, name.length-1);\n }\n return name.replace(/[,& ]+/g, '_');\n } else {\n return name\n }\n}", "function initials(myName) {\n\n\tvar separated = myName.split('');\n\tvar initial = [];\n\tfor (var i = 0; i < separated.length; i++) {\n\t\tif (separated[i] === \" \") {\n\t\t\tinitial.push(separated[i + 1]);\n\t\t}\n\t}\n\treturn console.log(separated[0] + '.' + initial);\n}", "function r(t){return t.toLowerCase().split(\"-\").map(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}).join(\"-\")}", "function i(e){return e[0].toUpperCase()+e.substr(1)}", "function abbrevName(name) {\n const initials = name.match(/\\b(\\w)/g);\n return initials[0].toUpperCase() + \".\" + initials[1].toUpperCase();\n}", "function getNewFirstName() {\n return firstName.substring(0,3) + lastName.substring(0,2).toLowerCase();\n}", "function town_format(t_name){\n\tt_name = t_name.replace(/,/g, \"\")\n\treturn t_name.replace(/ /g, \"+\").toUpperCase();\n}", "function name (string){\n return string.charAt(0).toUpperCase() + string.slice(1); \n}", "function splitName(input) {\n\t\treturn input.replace(/([a-z])([A-Z])/g, '$1 $2');\t\n\t}", "capitalizeFirstLetter(str) {\n let pattern = /(^|[-\\s])([a-zа-яё])/g;\n let normalizedName = str.toLowerCase();\n\n normalizedName = normalizedName.replace(pattern, function($2){\n \treturn $2.toUpperCase();\n });\n\n return normalizedName;\n }", "function inName(name) {\n name = bio.name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n }", "function chooseLocale(names){var i=0,j,next,locale,split;while(i<names.length){split=normalizeLocale(names[i]).split('-');j=split.length;next=normalizeLocale(names[i+1]);next=next?next.split('-'):null;while(j>0){locale=loadLocale(split.slice(0,j).join('-'));if(locale){return locale;}if(next&&next.length>=j&&compareArrays(split,next,true)>=j-1){//the next array item is better than a shallower substring of this one\nbreak;}j--;}i++;}return null;}", "function lastName(theLastName) {\n return nameIntro + firstName + \" \" theLastName;\n }", "decedentName(deathRecord) {\n var metadata = deathRecord.metadata;\n var suffix = metadata.suffix;\n if (!suffix) {\n suffix = '';\n }\n // Format name\n if (metadata.firstName && metadata.lastName && metadata.middleName) {\n return metadata.lastName + ', ' + metadata.firstName + ' ' + metadata.middleName[0] + '. ' + suffix;\n } else if (metadata.firstName && metadata.middleName) {\n return metadata.firstName + ' ' + metadata.middleName[0] + '. ' + suffix;\n } else if (metadata.firstName && metadata.lastName) {\n return metadata.lastName + ', ' + metadata.firstName + ' ' + suffix;\n } else if (metadata.firstName) {\n return metadata.firstName + ' ' + suffix;\n } else if (metadata.lastName) {\n return metadata.lastName + ' ' + suffix;\n }\n }", "function getMonthName (num) {\n if (num === 1) return qsTr(\"Январь\");\n else if (num === 2) return qsTr(\"Февраль\");\n else if (num === 3) return qsTr(\"Март\");\n else if (num === 4) return qsTr(\"Апрель\");\n else if (num === 5) return qsTr(\"Май\");\n else if (num === 6) return qsTr(\"Июнь\");\n else if (num === 7) return qsTr(\"Июль\");\n else if (num === 8) return qsTr(\"Август\");\n else if (num === 9) return qsTr(\"Сентябрь\");\n else if (num === 10) return qsTr(\"Октябрь\");\n else if (num === 11) return qsTr(\"Ноябрь\");\n else if (num === 12) return qsTr(\"Декабрь\");\n}", "function parseAndDisplayName(name)\n{\n let pos = name.indexOf(\" \");\n var firstName = name.substring(0, pos);\n var lastName = name.substring(pos+1);\n var message = \"First Name: \" + firstName + \"\\nLast Name: \" + lastName;\n return console.log(message);\n}", "function fullName(firstName, lastName) {\n\t return `${firstName} ${lastName}`;\n\t}", "function abbrev_name(input) {\n var str = input.trim();\n return str.slice(0, str.indexOf(\" \") + 2) + \".\";\n}", "function tidyName(name) {\n var result = name.replace(/-/g, \" \");\n result = result.substr(0, 1).toUpperCase() + result.substr(1);\n return result;\n}", "function showNames(firstName, lastname) {\n alert('Buenas tardes ' + firstName.charAt(0).toUpperCase() + firstName.slice(1) \n + ' ' \n + lastname.charAt(0).toUpperCase() + lastname.slice(1))\n \n console.log(firstName + ' ' + lastname)\n}", "function formatPlayerName(player_name) {\n\t\tvar space = player_name.indexOf(' ');\n\t\tvar first_letter = player_name.slice(0,1).toUpperCase();\n\t\tvar last_name = player_name.slice(space+1);\n\t\tlast_name = last_name.charAt(0).toUpperCase() + last_name.slice(1);\n\t\treturn first_letter + '.' + last_name;\n\t}", "function formatComposerName (name) {\n let names = name.split(','); \n let match; \n\n // hackish way to remove spaces\n let firstname = names[1].trim().split(' ').filter(el => !!el).join(' '); \n let surname = (match = names[0].match(/\\[.*\\]/)) ? match[0].substr(1, match[0].length - 2) : names[0]; \n return names.length === 3 ? `${firstname} ${surname} II`.trim() : `${firstname} ${surname}`.trim(); \n}", "function makeName(firstName, lastName) {\n return firstName + \" \" + lastName;\n}", "function myFullName() {\n return myFirstName('Srujan');\n }", "function mungePropertyName(name, prefix) {\n\t\tif (!prefix) {\n\t\t\treturn name;\n\t\t}\n\n\t\tvar parts = name.split(\".\");\n\t\tvar result = \"\";\n\t\tfor (var i = 0; i < parts.length - 1; i++) {\n\t\t\tresult += parts[i] + \".\";\n\t\t}\n\t\tvar lastPart = parts[parts.length - 1];\n\t\tif (prefixRequiresNextInitialCap(prefix)) {\n\t\t\tresult += prefix + lastPart.substring(0, 1).toUpperCase() + lastPart.substring(1);\n\t\t} else {\n\t\t\tresult += prefix + lastPart;\n\t\t}\n\t\treturn result;\n\t}", "function fullName(firstName, lastName) {\n\treturn `${firstName} ${lastName}`;\n}", "function inName(name) {\n\n\tvar name = name.trim().split(\" \");\n\tconsole.log(name);\n\t//console.log(name.length);\n\n\tname[1] = name[1].toUpperCase();\n\tname[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n\treturn name[0] + \" \" + name[1];\n\n\t//console.log(name[0] + \" \" + name[1]);\n\n}", "function makeFullName() {\n return `${nameIntro} ${firstName} ${lastName}`;\n }", "function getNewLastName() {\n return momMaidenName.substring(0,1) + cityBorn.substring(0,2).toLowerCase();\n}", "function inName(oldName) {\r\n var finalName = oldName;\r\n // Your code goes here!\r\n var nameArray = finalName.trim().split(\" \");\r\n nameArray[0] = nameArray[0][0].toUpperCase() + nameArray[0].slice(1).toLowerCase();\r\n nameArray[1] = nameArray[1].toUpperCase();\r\n finalName = nameArray.join(\" \");\r\n $(\"#name\").text(finalName);\r\n}", "function abbreviateNames(treeData) {\n common.visit(treeData, function(node) {\n // Do not use the full name if it is too long (to avoid label overlap)\n if (node.name && node.name.length > MAX_DISPLAY_LENGTH) {\n node.fullName = node.name;\n // Use of ellipsis character …, different from triple dots ...\n node.name = node.name.substring(0, MAX_DISPLAY_LENGTH) + \"…\";\n }\n }, common.allChildren);\n}", "function titleCaseName(str) {\n return str.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "function parseAndDisplayName (name) {\n let arrName = name.split(\" \");\n let fName, mName, lName, msg;\n let prefix = \"\\nPrefix: None\", suffix =\"\\nSuffix: None\";\n\n if (/^(mr.|mrs.|miss|dr.)$/.exec(arrName[0].toLowerCase())) {\n prefix = \"\\nPrefix: \" + arrName.shift();\n }\n\n if (/^(jr.|sr.|ph.d.|m.d)$/.exec(arrName[arrName.length-1].toLowerCase())) {\n suffix = \"\\nSuffix: \" + arrName.pop();\n arrName[arrName.length-1] = arrName[arrName.length-1].slice(0, -1);\n }\n\n if (arrName.length < 2) {\n fName = arrName[0];\n\n msg = `Name: ${name}\\nOnly Name: ${fName}`;\n }\n else if (arrName.length < 3) {\n fName = arrName[0];\n lName = arrName[arrName.length - 1];\n\n msg = `Name: ${name}\\nFirst Name: ${fName}\\nLast Name: ${lName}`;\n }\n else if (arrName.length < 4) {\n fName = arrName[0];\n mName = arrName[1];\n lName = arrName[arrName.length - 1];\n \n msg = `Name: ${name}\\nFirst Name: ${fName}\\nMiddle Name: ${mName}\\nLast Name: ${lName}`;\n }\n else {\n return console.log(\"Your name is messed up.\");\n }\n\n return msg + prefix + suffix;\n}" ]
[ "0.7480656", "0.7239618", "0.692914", "0.6746035", "0.66890895", "0.6679457", "0.6636713", "0.6588265", "0.6583628", "0.6583494", "0.6580739", "0.6570104", "0.65676063", "0.6548534", "0.65413934", "0.6540972", "0.65233827", "0.6495597", "0.6478917", "0.6447949", "0.6441613", "0.6441613", "0.6441613", "0.64267427", "0.63834447", "0.6381057", "0.63729393", "0.6362087", "0.63557225", "0.6346792", "0.6341395", "0.63311696", "0.6318796", "0.63119346", "0.63076603", "0.6295157", "0.6276326", "0.6272733", "0.62544817", "0.62535465", "0.6245169", "0.6243367", "0.6230666", "0.62212044", "0.6217491", "0.6207152", "0.6206604", "0.61989796", "0.618482", "0.61840194", "0.61797816", "0.61772525", "0.61772525", "0.6169729", "0.61683327", "0.61508834", "0.61427045", "0.6130665", "0.6123839", "0.6123809", "0.6114573", "0.6102766", "0.60914814", "0.60749567", "0.60706145", "0.6069262", "0.606452", "0.6063437", "0.6033808", "0.60316724", "0.6030926", "0.6028498", "0.6018646", "0.6015583", "0.60147667", "0.5987631", "0.5969595", "0.59621495", "0.59617656", "0.5960727", "0.59563535", "0.5955498", "0.5951061", "0.5950923", "0.59496003", "0.5949462", "0.594709", "0.593566", "0.59195405", "0.5917628", "0.59139335", "0.59116334", "0.5908645", "0.59022623", "0.5897622", "0.5896241", "0.5880026", "0.5872199", "0.5867956", "0.5862992" ]
0.60988945
62
import firebaseClient from "../firebaseClient"; import firebase from "firebase/app"; import "firebase/auth";
function login(props) { // firebaseClient(); const [email, setEmail] = useState(""); const [pass, setPass] = useState(""); function handleForm(field, value) { switch (field) { case "email": setEmail(value); break; case "pass": setPass(value); break; default: break; } } async function handleSubmit() { // await firebase // .auth() // .signInWithEmailAndPassword(email, pass) // .then(() => (window.location.href = "/")) // .catch((err) => { // toast.error(err.message, { // position: "bottom-center", // }); // }); } return ( <> <Head> <title>Login - Generasi Ilmiah</title> </Head> <Construction /> {/* <div className="min-h-screen flex flex-col justify-center bg-gray-200"> <div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md"> <div className="text-center mt-24"> <h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900"> Log in </h2> <p className="mt-2 text-center text-md text-gray-600"> {"Don't have an account? "} <Link href="/signup"> <a href="#" className="text-blue-500"> Sign Up </a> </Link> </p> </div> <div className="mt-8 bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"> <LoginForm email={email} pass={pass} handleForm={handleForm} handleSubmit={handleSubmit} /> </div> </div> <ToastContainer position="bottom-center" /> </div> */} </> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n app.initializeApp(config);\n this.appAuth = app.auth();\n this.googleProvider = new firebase.auth.GoogleAuthProvider();\n this.db = firebase.firestore();\n this.functions = firebase.functions();\n this.rdb = firebase.database().ref(); //Real time database\n }", "function firebase_setup(){\n /*\n var firebaseConfig = {\n apiKey: \"AIzaSyB0ZY93KxJK4UIRVnyXWqNm2V1l1M-4j_4\",\n authDomain: \"office-inventory-12f99.firebaseapp.com\",\n databaseURL: \"https://office-inventory-12f99.firebaseio.com\",\n projectId: \"office-inventory-12f99\",\n storageBucket: \"office-inventory-12f99.appspot.com\",\n messagingSenderId: \"147848186588\",\n appId: \"1:147848186588:web:33dbc8d727af1de4\"\n };\n // Initialize Firebase\n firebase.initializeApp(firebaseConfig);\n db = firebase.firestore();\n */\n}", "function initializeFirebase() {\n firebase.initializeApp(getFirebaseConfig(inProduction()));\n}", "function firebaseInit()\n{\n var firebaseConfig = {\n\tapiKey: \"AIzaSyDz4KVH1_aoVs0tcofy1cxHkI05AIP0PCY\",\n\tauthDomain: \"robox-3666f.firebaseapp.com\",\n\tdatabaseURL: \"https://robox-3666f.firebaseio.com\",\n\tprojectId: \"robox-3666f\",\n\tstorageBucket: \"robox-3666f.appspot.com\",\n\tmessagingSenderId: \"356472837055\",\n\tappId: \"1:356472837055:web:3491df60bef9212534470a\"\n };\n\n firebase.initializeApp(firebaseConfig);\n}", "function firebaseConfigModule(firebase){\n\n //firebase cfg\n const config = {\n apiKey: \"AIzaSyC0G_puVkQgwqL1wICl4TuQigccVJ2u7xw\",\n authDomain: \"scakapo-2f1c6.firebaseapp.com\",\n databaseURL: \"https://scakapo-2f1c6.firebaseio.com\",\n storageBucket: \"scakapo-2f1c6.appspot.com\",\n messagingSenderId: \"656327460988\"\n };\n\n //init firebase app\n firebase.initializeApp(config);\n}", "componentWillMount () {\n const config = {\n apiKey: \"AIzaSyCb0oTczXHUmbVW8tDQ1ZigYb-N_YYvcnw\",\n authDomain: \"manager-2405b.firebaseapp.com\",\n databaseURL: \"https://manager-2405b.firebaseio.com\",\n projectId: \"manager-2405b\",\n storageBucket: \"manager-2405b.appspot.com\",\n messagingSenderId: \"528377064997\"\n };\n\n firebase.initializeApp(config);\n }", "function configureForFirebase(firebase) {\n firebase.INTERNAL.registerService('firestore', function (app) { return new __WEBPACK_IMPORTED_MODULE_1__api_database__[\"i\" /* Firestore */](app); }, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_obj__[\"a\" /* shallowCopy */])(firestoreNamespace));\n}", "function configureForFirebase(firebase) {\n firebase.INTERNAL.registerService('firestore', function (app) { return new __WEBPACK_IMPORTED_MODULE_1__api_database__[\"i\" /* Firestore */](app); }, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_obj__[\"a\" /* shallowCopy */])(firestoreNamespace));\n}", "function initialize_firebase() {\n // Initialize Firebase\n\n firebase.initializeApp(firebase_configuration);\n firebase_ref = firebase;\n firebase_database = firebase.database();\n firebase_authentication = firebase.auth();\n firebase_storage = firebase.storage();\n console.log(\"Firebase Initialized\");\n\n // Setup authentiation state change action\n firebase_authentication.onAuthStateChanged(on_authentication_state_changed);\n\n // Setup sign-in Page\n setup_sign_in_controls();\n}", "function initializeFirebase(){\n var config = {\n apiKey: \"AIzaSyAg4AuCkuiw4VgVIYtFKU4JQgF0PzfzlTA\",\n authDomain: \"memoize-216516.firebaseapp.com\",\n databaseURL: \"https://memoize-216516.firebaseio.com\",\n projectId: \"memoize-216516\",\n storageBucket: \"memoize-216516.appspot.com\",\n messagingSenderId: \"889544015679\"\n };\n firebase.initializeApp(config);\n \n\n var db = firebase.firestore();\n var storage = firebase.storage();\n return [db,storage];\n\n}", "function startFirebase() {\n// Initialize Firebase\n var config = {\n apiKey: \"AIzaSyDAraVHUUUkR4L0yNE3P2n2jiF2jTNy6Kg\",\n authDomain: \"rps-multiplayer-e8125.firebaseapp.com\",\n databaseURL: \"https://rps-multiplayer-e8125.firebaseio.com\",\n projectId: \"rps-multiplayer-e8125\",\n storageBucket: \"rps-multiplayer-e8125.appspot.com\",\n messagingSenderId: \"763015821378\"\n };\n\n firebase.initializeApp(config);\n\n}", "function configureForFirebase(firebase) {\n firebase.INTERNAL.registerService('firestore', function (app) { return new __WEBPACK_IMPORTED_MODULE_1__api_database__[\"a\" /* Firestore */](app); }, Object(__WEBPACK_IMPORTED_MODULE_5__util_obj__[\"f\" /* shallowCopy */])(firestoreNamespace));\n}", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '4.8.1',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"createSubscribe\"],\n ErrorFactory: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"ErrorFactory\"],\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"]\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"patchProperty\"])(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"patchProperty\"])(app, 'App', FirebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function (appArg) {\n if (appArg === void 0) { appArg = app(); }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"])(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"])(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '4.6.1',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"createSubscribe\"],\n ErrorFactory: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"ErrorFactory\"],\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"]\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"patchProperty\"])(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"patchProperty\"])(app, 'App', FirebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function (appArg) {\n if (appArg === void 0) { appArg = app(); }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"])(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"])(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "function initializeFirebase() {\n const firebaseConfig = {\n apiKey: \"AIzaSyD1DP3Fg9S8UEKKpyt7XknY6vickoJ3eFs\",\n authDomain: \"instyle-3f5f5.firebaseapp.com\",\n databaseURL:\n \"https://instyle-3f5f5-default-rtdb.europe-west1.firebasedatabase.app\",\n projectId: \"instyle-3f5f5\",\n storageBucket: \"instyle-3f5f5.appspot.com\",\n messagingSenderId: \"8399215605\",\n appId: \"1:8399215605:web:09ba5877b522ef0abe5ebc\",\n };\n //initialize firebase\n if (firebase.apps.length === 0) {\n firebase.initializeApp(firebaseConfig);\n }\n }", "function configureForFirebase(firebase$$1){firebase$$1.INTERNAL.registerService('firestore',function(app){return new index_esm_Firestore(app);},shallowCopy(firestoreNamespace));}", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '4.6.1',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"createSubscribe\"],\n ErrorFactory: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"ErrorFactory\"],\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"]\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n Object(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"patchProperty\"])(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n Object(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"patchProperty\"])(app, 'App', FirebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function (appArg) {\n if (appArg === void 0) { appArg = app(); }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"])(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n Object(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"])(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '4.6.1',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"createSubscribe\"],\n ErrorFactory: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"ErrorFactory\"],\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"]\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n Object(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"patchProperty\"])(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n Object(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"patchProperty\"])(app, 'App', FirebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function (appArg) {\n if (appArg === void 0) { appArg = app(); }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"])(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n Object(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"deepExtend\"])(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "function firebaseInit() {\n if (!$window.firebase.apps.length) {\n var firebaseConfig = {\n apiKey: 'AIzaSyBGm_Gwo7zUW3TjAKkVoODZ6g6n4Jx6z9w',\n authDomain: 'flh-pvstation.firebaseapp.com',\n databaseURL: 'https://flh-pvstation.firebaseio.com',\n storageBucket: 'flh-pvstation.appspot.com'\n };\n $window.firebase.initializeApp(firebaseConfig);\n }\n }", "async initFirebase(config) {\n if (!Firebase.apps || Firebase.apps.length == 0) {\n Firebase.initializeApp(config);\n }\n }", "function configureForFirebase(firebase) {\r\n firebase.INTERNAL.registerService('firestore', function (app) { return new Firestore(app); }, shallowCopy(firestoreNamespace));\r\n}", "function configureForFirebase(firebase) {\r\n firebase.INTERNAL.registerService('firestore', function (app) { return new Firestore(app); }, shallowCopy(firestoreNamespace));\r\n}", "async componentDidMount() {\n\n //const { user } = await firebase.auth().signInAnonymously();\n const { user } = await firebase.auth().signInWithEmailAndPassword('[email protected]', 'illuminati');\n }", "function configureForFirebase(firebase) {\r\n firebase.INTERNAL.registerComponent(new component.Component('firestore', function (container) {\r\n var app = container.getProvider('app').getImmediate();\r\n return new Firestore(app, container.getProvider('auth-internal'));\r\n }, \"PUBLIC\" /* PUBLIC */).setServiceProps(shallowCopy(firestoreNamespace)));\r\n}", "componentWillMount() {\n firebase.initializeApp(\n {\n apiKey: Config.API_KEY,\n authDomain: Config.AUTH_DOMAIN,\n databaseURL: Config.DATABASE_URL,\n projectId: Config.PROJECT_ID,\n storageBucket: Config.STORAGE_BUCKET,\n messagingSenderId: Config.MESSAGING_SENDER_ID\n });\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n this.setState({ loggedIn: true });\n } else {\n this.setState({ loggedIn: false });\n }\n });\n }", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"J\" /* createSubscribe */],\n ErrorFactory: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"K\" /* ErrorFactory */],\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: __WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"I\" /* deepExtend */]\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"L\" /* patchProperty */])(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"L\" /* patchProperty */])(app, 'App', FirebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n } else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) {\n return apps_[name];\n });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function serviceNamespace(appArg) {\n if (appArg === void 0) {\n appArg = app();\n }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"I\" /* deepExtend */])(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__firebase_util__[\"I\" /* deepExtend */])(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "function configureForFirebase(firebase) {\n firebase.INTERNAL.registerComponent(new component.Component('firestore', function (container) {\n var app = container.getProvider('app').getImmediate();\n return new Firestore(app, container.getProvider('auth-internal'));\n }, \"PUBLIC\"\n /* PUBLIC */\n ).setServiceProps(shallowCopy(firestoreNamespace)));\n }", "function registerFirestore(instance) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__src_platform_config__[\"a\" /* configureForFirebase */])(instance);\n}", "function registerFirestore(instance) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__src_platform_config__[\"a\" /* configureForFirebase */])(instance);\n}", "function FirebaseAuthService(firebase) {\n this._firebase = firebase;\n }", "static db() {\n return firebase.firestore();\n }", "function configureForFirebase(firebase) {\n firebase.INTERNAL.registerService('firestore', function (app) { return new Firestore(app); }, shallowCopy(firestoreNamespace));\n}", "function injectFirebaseLibs() {\n const firebaseLibs = [\n 'https://www.gstatic.com/firebasejs/7.5.0/firebase-analytics.js',\n 'https://www.gstatic.com/firebasejs/7.5.0/firebase-auth.js',\n 'https://www.gstatic.com/firebasejs/7.5.0/firebase-database.js',\n ]\n firebaseLibs.forEach(script => {\n const f = document.getElementsByTagName('script')[0]\n const j = document.createElement('script')\n j.defer = true\n j.onload = () => {\n scriptsLoaded.push(script)\n // console.log(externalDeps, scriptsLoaded, Date.now())\n if (externalDeps.length + firebaseLibs.length === scriptsLoaded.length) allScriptsLoaded()\n }\n j.src = script\n f.parentNode.insertBefore(j,f)\n })\n}", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '5.8.3',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: util.createSubscribe,\n ErrorFactory: util.ErrorFactory,\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: util.deepExtend\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n util.patchProperty(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\r\n * Called by App.delete() - but before any services associated with the App\r\n * are deleted.\r\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\r\n * Get the App object for a given name (or DEFAULT).\r\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n util.patchProperty(app, 'App', FirebaseAppImpl);\n function initializeApp(options, rawConfig) {\n if (rawConfig === void 0) {\n rawConfig = {};\n }\n if ((typeof rawConfig === 'undefined' ? 'undefined' : _typeof(rawConfig)) !== 'object' || rawConfig === null) {\n var name_1 = rawConfig;\n rawConfig = { name: name_1 };\n }\n var config = rawConfig;\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n var name = config.name;\n if (typeof name !== 'string' || !name) {\n error('bad-app-name', { name: name + '' });\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, config, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\r\n * Return an array of all the non-deleted FirebaseApps.\r\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) {\n return apps_[name];\n });\n }\n /*\r\n * Register a Firebase Service.\r\n *\r\n * firebase.INTERNAL.registerService()\r\n *\r\n * TODO: Implement serviceProperties.\r\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function serviceNamespace(appArg) {\n if (appArg === void 0) {\n appArg = app();\n }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n util.deepExtend(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\r\n * Patch the top-level firebase namespace with additional properties.\r\n *\r\n * firebase.INTERNAL.extendNamespace()\r\n */\n function extendNamespace(props) {\n util.deepExtend(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "constructor() {\n // Web app's Firebase configuration\n this.FIREBASECONFIG = {\n apiKey: \"AIzaSyBvWLtRYPBN0qKj_K30p1sY3vOS2hFAzQQ\",\n authDomain: \"sin-reed-edu.firebaseapp.com\",\n databaseURL: \"https://sin-reed-edu.firebaseio.com\",\n projectId: \"sin-reed-edu\",\n storageBucket: \"\",\n messagingSenderId: \"922484667339\",\n appId: \"1:922484667339:web:cb8e7c755f42c286\",\n };\n\n this.DEBUG_MODE = true;\n\n this.login_state = 0;\n\n //initialise firebase\n fb.initializeApp(this.FIREBASECONFIG);\n\n // make auth and firestore references\n this.auth = fb.auth();\n this.db = fb.firestore();\n this.view = this.get_view();\n this.mobile = Util.is_mobile();\n\n // define state handlers\n this.__defineHandlers__();\n }", "function onDeviceReady() {\n firebaseApp();\n}", "componentDidMount() {\n this._loadFontsAsync()\n firebase.auth().onAuthStateChanged(user => {\n if (user !== null) {\n console.log(user)\n }\n })\n }", "initFirebase({ dispatch, state }) {\n if (!firebase.apps.length) {\n firebase.initializeApp(state.firebaseConfig);\n }\n\n firebase.auth().onAuthStateChanged(async (user) => {\n if (user) {\n // Create an entry for the user\n await firebase.database().ref(`/users/${user.uid}`).set({\n name: user.displayName,\n email: user.email,\n photo_url: user.photoURL,\n });\n\n dispatch('setUser', user);\n dispatch('firebaseFeedback');\n } else {\n dispatch('firebaseFeedback');\n }\n });\n }", "function configureForFirebase(firebase) {\n firebase.INTERNAL.registerService('firestore', function (app) {\n return new Firestore(app);\n }, shallowCopy(firestoreNamespace));\n}", "componentDidMount()\n {\n console.log(firebase);\n \n }", "function firebaseAuth(){\n var provider = new firebase.auth.GoogleAuthProvider();\n firebase.auth().signInWithPopup(provider);\n var user = firebase.auth().currentUser;\n userName = user.displayName;\n userEmail = user.email;\n}", "componentDidMount() {\n firebase.initializeApp({\n apiKey: 'AIzaSyAOsA_6FKLNJOXQc8omA0Tjym6pgEy8YA4',\n authDomain: 'fir-auth-51a3f.firebaseapp.com',\n databaseURL: 'https://fir-auth-51a3f.firebaseio.com',\n projectId: 'fir-auth-51a3f',\n storageBucket: 'fir-auth-51a3f.appspot.com',\n messagingSenderId: '428099740163'\n });\n\n firebase.auth().onAuthStateChanged((user) => {\n if (!user) {\n this.setState({ loggedIn: false });\n } else {\n console.log(user);\n this.setState({ loggedIn: true, user });\n }\n });\n }", "FacebookAuth() {\n return this.AuthLogin(new firebase_app__WEBPACK_IMPORTED_MODULE_1__[\"auth\"].FacebookAuthProvider());\n }", "function signIn() {\n// Sign into Firebase using popup auth & Google as the identity provider.\n var provider = new firebase.auth.GoogleAuthProvider();\n firebase.auth().signInWithPopup(provider);\n}", "function App() {\n\n\tconst firebaseConfig = {\n\t\tapiKey: \"AIzaSyAJEciQYs_1Qop9MZTvMA8Z5kVh39cZ1YA\",\n\t\tauthDomain: \"orangenutri-91bff.firebaseapp.com\",\n\t\tprojectId: \"orangenutri-91bff\",\n\t\tstorageBucket: \"orangenutri-91bff.appspot.com\",\n\t\tmessagingSenderId: \"768344951920\",\n\t\tappId: \"1:768344951920:web:de21f9210317b10c0e38b5\", \n\t\tmeasurementId: \"G-RCBV4SFYYT\"\n\t}\n\n\tfirebase.initializeApp(firebaseConfig)\n\tconsole.log(firebase.firestore())\n\n\treturn (\n\t\t<>\n\t\t\t<Routes /> \n\t\t</>\n\t)\n}", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '5.5.9',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: util.createSubscribe,\n ErrorFactory: util.ErrorFactory,\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: util.deepExtend\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n util.patchProperty(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n util.patchProperty(app, 'App', FirebaseAppImpl);\n function initializeApp(options, rawConfig) {\n if (rawConfig === void 0) { rawConfig = {}; }\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n var name_1 = rawConfig;\n rawConfig = { name: name_1 };\n }\n var config = rawConfig;\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n var name = config.name;\n if (typeof name !== 'string' || !name) {\n error('bad-app-name', { name: name + '' });\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, config, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function (appArg) {\n if (appArg === void 0) { appArg = app(); }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n util.deepExtend(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n util.deepExtend(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "componentWillMount() {\n firebase.initializeApp({\n apiKey: 'AIzaSyBtxMY4K6uHxv_2e3GD-FWAD2ACX6lPVRE',\n authDomain: 'authentication-70a18.firebaseapp.com',\n databaseURL: 'https://authentication-70a18.firebaseio.com',\n storageBucket: 'authentication-70a18.appspot.com',\n messagingSenderId: '682333809338'\n //connects to firebase database (setup required, see udemy lecture for details)\n });\n//built in firebase functions, if authentication state changes the if/else functions\n//is called. so if user (is true) then set the state of this component (App) to true\n//else set it to false\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n this.setState({ loggedIn: true });\n } else {\n this.setState({ loggedIn: false });\n }\n });\n }", "function registerFirestore(instance) {\n Object(__WEBPACK_IMPORTED_MODULE_2__src_platform_config__[\"a\" /* configureForFirebase */])(instance);\n}", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '5.5.0',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: util.createSubscribe,\n ErrorFactory: util.ErrorFactory,\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: util.deepExtend\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n util.patchProperty(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n util.patchProperty(app, 'App', FirebaseAppImpl);\n function initializeApp(options, rawConfig) {\n if (rawConfig === void 0) { rawConfig = {}; }\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n var name_1 = rawConfig;\n rawConfig = { name: name_1 };\n }\n var config = rawConfig;\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n var name = config.name;\n if (typeof name !== 'string' || !name) {\n error('bad-app-name', { name: name + '' });\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, config, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function (appArg) {\n if (appArg === void 0) { appArg = app(); }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n util.deepExtend(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n util.deepExtend(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "function App() {\n const firebase = useFirebaseApp();\n const user = useUser();\n console.log(firebase);\n return (\n <div className=\"App\">\n { user && <p>Usuario: {user.email}</p>}\n <Auth />\n\n </div>\n );\n}", "constructor() {\n firebase.initializeApp(FirebaseConfig)\n\n // initialize the mobx-firebase store that we inherited from, pass in the reference to our firebase\n super(firebase.database().ref())\n\n // now let us create our SettingsStore data that we would like to pass around to other parts of our application\n this.splashTime = 500 // 5000 milliseconds = 5 seconds\n this.splashImg = require('../../images/Splash.jpg')\n\n // login\n this.loginBackgroundImg = require('../../images/Login.jpg')\n }", "componentWillMount() {\n const config = {\n apiKey: FIREBASE_API_KEY,\n authDomain: FIREBASE_AUTH_DOMAIN,\n databaseURL: FIREBASE_DATABASE_URL,\n projectId: FIREBASE_PROJECT_ID,\n storageBucket: FIREBASE_STORAGE_BUCKET,\n messagingSenderId: FIREBASE_MESSAGING_SENDER_ID,\n };\n console.log('config', JSON.stringify(config, null, 3));\n firebase.initializeApp(config);\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n console.log(`logged in user: ${JSON.stringify(user, null, 3)}`);\n this.myStore.dispatch(authActions.loggedIn(user));\n Actions.main();\n } else {\n console.log('logged out ....');\n this.myStore.dispatch(authActions.loggedOut());\n }\n });\n }", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '4.9.0',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: deepExtend\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n patchProperty(app, 'App', FirebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function (appArg) {\n if (appArg === void 0) {\n appArg = app();\n }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n deepExtend(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "componentWillMount() {\n // Initialize Firebase\n firebase.initializeApp({\n apiKey: \"AIzaSyDAqv8EpxLC3hiGfpbMbh6MougcqMJBeaU\",\n authDomain: \"whats-app-fake-1cf61.firebaseapp.com\",\n databaseURL: \"https://whats-app-fake-1cf61.firebaseio.com\",\n projectId: \"whats-app-fake-1cf61\",\n storageBucket: \"whats-app-fake-1cf61.appspot.com\",\n messagingSenderId: \"1076753399524\"\n });\n }", "function configureForFirebase(firebase$$1) {\n firebase$$1.INTERNAL.registerService('firestore', function (app) { return new Firestore(app); }, shallowCopy(firestoreNamespace));\n}", "function configureForFirebase(firebase$$1) {\n firebase$$1.INTERNAL.registerService('firestore', function (app) { return new Firestore(app); }, shallowCopy(firestoreNamespace));\n}", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: Promise,\n SDK_VERSION: '5.0.4',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: Promise,\n deepExtend: deepExtend\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\r\n * Called by App.delete() - but before any services associated with the App\r\n * are deleted.\r\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\r\n * Get the App object for a given name (or DEFAULT).\r\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!index_esm_contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n patchProperty(app, 'App', index_esm_FirebaseAppImpl);\n function initializeApp(options, rawConfig) {\n if (rawConfig === void 0) {\n rawConfig = {};\n }\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n var name_1 = rawConfig;\n rawConfig = { name: name_1 };\n }\n var config = rawConfig;\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n var name = config.name;\n if (typeof name !== 'string' || !name) {\n error('bad-app-name', { name: name + '' });\n }\n if (index_esm_contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new index_esm_FirebaseAppImpl(options, config, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\r\n * Return an array of all the non-deleted FirebaseApps.\r\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) {\n return apps_[name];\n });\n }\n /*\r\n * Register a Firebase Service.\r\n *\r\n * firebase.INTERNAL.registerService()\r\n *\r\n * TODO: Implement serviceProperties.\r\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function serviceNamespace(appArg) {\n if (appArg === void 0) {\n appArg = app();\n }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n index_esm_FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\r\n * Patch the top-level firebase namespace with additional properties.\r\n *\r\n * firebase.INTERNAL.extendNamespace()\r\n */\n function extendNamespace(props) {\n deepExtend(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "componentDidMount() {\n this.authSubscription = firebase.auth().onAuthStateChanged((user) => {\n global.user = user\n this.authSubscription();\n });\n }", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: _promise.PromiseImpl,\n SDK_VERSION: '4.3.1',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: _subscribe.createSubscribe,\n ErrorFactory: _errors.ErrorFactory,\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: _promise.PromiseImpl,\n deepExtend: _deep_copy.deepExtend\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n (0, _deep_copy.patchProperty)(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n (0, _deep_copy.patchProperty)(app, 'App', FirebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n } else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) {\n return apps_[name];\n });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function serviceNamespace(appArg) {\n if (appArg === void 0) {\n appArg = app();\n }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n (0, _deep_copy.deepExtend)(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n (0, _deep_copy.deepExtend)(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\n initializeApp: initializeApp,\n app: app,\n apps: null,\n Promise: _promise.PromiseImpl,\n SDK_VERSION: '4.3.1',\n INTERNAL: {\n registerService: registerService,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: _subscribe.createSubscribe,\n ErrorFactory: _errors.ErrorFactory,\n removeApp: removeApp,\n factories: factories,\n useAsService: useAsService,\n Promise: _promise.PromiseImpl,\n deepExtend: _deep_copy.deepExtend\n }\n };\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n (0, _deep_copy.patchProperty)(namespace, 'default', namespace);\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name) {\n var app = apps_[name];\n callAppHooks(app, 'delete');\n delete apps_[name];\n }\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name) {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps_, name)) {\n error('no-app', { name: name });\n }\n return apps_[name];\n }\n (0, _deep_copy.patchProperty)(app, 'App', FirebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n } else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) {\n return apps_[name];\n });\n }\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n // Run the **new** app hook on all existing apps\n getApps().forEach(function (app) {\n appHook('create', app);\n });\n }\n // The Service namespace is an accessor function ...\n var serviceNamespace = function serviceNamespace(appArg) {\n if (appArg === void 0) {\n appArg = app();\n }\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error('invalid-app-argument', { name: name });\n }\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n };\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n (0, _deep_copy.deepExtend)(serviceNamespace, serviceProperties);\n }\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n // Patch the FirebaseAppImpl prototype\n FirebaseAppImpl.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n return serviceNamespace;\n }\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props) {\n (0, _deep_copy.deepExtend)(namespace, props);\n }\n function callAppHooks(app, eventName) {\n Object.keys(factories).forEach(function (serviceName) {\n // Ignore virtual services\n var factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n });\n }\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app, name) {\n if (name === 'serverAuth') {\n return null;\n }\n var useService = name;\n var options = app.options;\n return useService;\n }\n return namespace;\n}", "constructor() {\n\t\tsuper();\n\t\tthis.firebase = new Firebase();\n\t\t// Add a new collection to Firebase.\n\t\tthis.users = this.firebase.child('users');\n\n\t\tthis.signup();\n\t\tthis.signin();\n\t\tthis.signout();\n\t}", "componentWillMount() {\n //initialize firebase\n firebase.initializeApp({\n apiKey: 'AIzaSyCw0ykiKiZFg-r7EVFWZN8i1dFOLj7iboY',\n authDomain: 'auth-ec763.firebaseapp.com',\n databaseURL: 'https://auth-ec763.firebaseio.com',\n projectId: 'auth-ec763',\n storageBucket: 'auth-ec763.appspot.com',\n messagingSenderId: '879911945881'\n });\n \n //Tracks the login state of the user\n //fat arrow function called whenever a user signs in or signs out\n //user argument -- an object that represents the user\n //set state based on what that object is (defined or undefined/null)\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n this.setState({ loggedIn: true });\n } else {\n this.setState({ loggedIn: false });\n }\n });\n }", "function createFirebaseNamespace() {\r\n var apps_ = {};\r\n var factories = {};\r\n var appHooks = {};\r\n // A namespace is a plain JavaScript Object.\r\n var namespace = {\r\n // Hack to prevent Babel from modifying the object returned\r\n // as the firebase namespace.\r\n __esModule: true,\r\n initializeApp: initializeApp,\r\n app: app,\r\n apps: null,\r\n Promise: Promise,\r\n SDK_VERSION: '5.9.4',\r\n INTERNAL: {\r\n registerService: registerService,\r\n createFirebaseNamespace: createFirebaseNamespace,\r\n extendNamespace: extendNamespace,\r\n createSubscribe: util.createSubscribe,\r\n ErrorFactory: util.ErrorFactory,\r\n removeApp: removeApp,\r\n factories: factories,\r\n useAsService: useAsService,\r\n Promise: Promise,\r\n deepExtend: util.deepExtend\r\n }\r\n };\r\n // Inject a circular default export to allow Babel users who were previously\r\n // using:\r\n //\r\n // import firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase').default;\r\n //\r\n // instead of\r\n //\r\n // import * as firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase');\r\n util.patchProperty(namespace, 'default', namespace);\r\n // firebase.apps is a read-only getter.\r\n Object.defineProperty(namespace, 'apps', {\r\n get: getApps\r\n });\r\n /**\r\n * Called by App.delete() - but before any services associated with the App\r\n * are deleted.\r\n */\r\n function removeApp(name) {\r\n var app = apps_[name];\r\n callAppHooks(app, 'delete');\r\n delete apps_[name];\r\n }\r\n /**\r\n * Get the App object for a given name (or DEFAULT).\r\n */\r\n function app(name) {\r\n name = name || DEFAULT_ENTRY_NAME;\r\n if (!contains(apps_, name)) {\r\n error('no-app', { name: name });\r\n }\r\n return apps_[name];\r\n }\r\n util.patchProperty(app, 'App', FirebaseAppImpl);\r\n function initializeApp(options, rawConfig) {\r\n if (rawConfig === void 0) { rawConfig = {}; }\r\n if (typeof rawConfig !== 'object' || rawConfig === null) {\r\n var name_1 = rawConfig;\r\n rawConfig = { name: name_1 };\r\n }\r\n var config = rawConfig;\r\n if (config.name === undefined) {\r\n config.name = DEFAULT_ENTRY_NAME;\r\n }\r\n var name = config.name;\r\n if (typeof name !== 'string' || !name) {\r\n error('bad-app-name', { name: name + '' });\r\n }\r\n if (contains(apps_, name)) {\r\n error('duplicate-app', { name: name });\r\n }\r\n var app = new FirebaseAppImpl(options, config, namespace);\r\n apps_[name] = app;\r\n callAppHooks(app, 'create');\r\n return app;\r\n }\r\n /*\r\n * Return an array of all the non-deleted FirebaseApps.\r\n */\r\n function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\r\n }\r\n /*\r\n * Register a Firebase Service.\r\n *\r\n * firebase.INTERNAL.registerService()\r\n *\r\n * TODO: Implement serviceProperties.\r\n */\r\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\r\n // Cannot re-register a service that already exists\r\n if (factories[name]) {\r\n error('duplicate-service', { name: name });\r\n }\r\n // Capture the service factory for later service instantiation\r\n factories[name] = createService;\r\n // Capture the appHook, if passed\r\n if (appHook) {\r\n appHooks[name] = appHook;\r\n // Run the **new** app hook on all existing apps\r\n getApps().forEach(function (app) {\r\n appHook('create', app);\r\n });\r\n }\r\n // The Service namespace is an accessor function ...\r\n var serviceNamespace = function (appArg) {\r\n if (appArg === void 0) { appArg = app(); }\r\n if (typeof appArg[name] !== 'function') {\r\n // Invalid argument.\r\n // This happens in the following case: firebase.storage('gs:/')\r\n error('invalid-app-argument', { name: name });\r\n }\r\n // Forward service instance lookup to the FirebaseApp.\r\n return appArg[name]();\r\n };\r\n // ... and a container for service-level properties.\r\n if (serviceProperties !== undefined) {\r\n util.deepExtend(serviceNamespace, serviceProperties);\r\n }\r\n // Monkey-patch the serviceNamespace onto the firebase namespace\r\n namespace[name] = serviceNamespace;\r\n // Patch the FirebaseAppImpl prototype\r\n FirebaseAppImpl.prototype[name] = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var serviceFxn = this._getService.bind(this, name);\r\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\r\n };\r\n return serviceNamespace;\r\n }\r\n /**\r\n * Patch the top-level firebase namespace with additional properties.\r\n *\r\n * firebase.INTERNAL.extendNamespace()\r\n */\r\n function extendNamespace(props) {\r\n util.deepExtend(namespace, props);\r\n }\r\n function callAppHooks(app, eventName) {\r\n Object.keys(factories).forEach(function (serviceName) {\r\n // Ignore virtual services\r\n var factoryName = useAsService(app, serviceName);\r\n if (factoryName === null) {\r\n return;\r\n }\r\n if (appHooks[factoryName]) {\r\n appHooks[factoryName](eventName, app);\r\n }\r\n });\r\n }\r\n // Map the requested service to a registered service name\r\n // (used to map auth to serverAuth service when needed).\r\n function useAsService(app, name) {\r\n if (name === 'serverAuth') {\r\n return null;\r\n }\r\n var useService = name;\r\n var options = app.options;\r\n return useService;\r\n }\r\n return namespace;\r\n}", "function createFirebaseNamespace() {\r\n var apps_ = {};\r\n var factories = {};\r\n var appHooks = {};\r\n // A namespace is a plain JavaScript Object.\r\n var namespace = {\r\n // Hack to prevent Babel from modifying the object returned\r\n // as the firebase namespace.\r\n __esModule: true,\r\n initializeApp: initializeApp,\r\n app: app,\r\n apps: null,\r\n Promise: Promise,\r\n SDK_VERSION: '5.5.0',\r\n INTERNAL: {\r\n registerService: registerService,\r\n createFirebaseNamespace: createFirebaseNamespace,\r\n extendNamespace: extendNamespace,\r\n createSubscribe: util.createSubscribe,\r\n ErrorFactory: util.ErrorFactory,\r\n removeApp: removeApp,\r\n factories: factories,\r\n useAsService: useAsService,\r\n Promise: Promise,\r\n deepExtend: util.deepExtend\r\n }\r\n };\r\n // Inject a circular default export to allow Babel users who were previously\r\n // using:\r\n //\r\n // import firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase').default;\r\n //\r\n // instead of\r\n //\r\n // import * as firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase');\r\n util.patchProperty(namespace, 'default', namespace);\r\n // firebase.apps is a read-only getter.\r\n Object.defineProperty(namespace, 'apps', {\r\n get: getApps\r\n });\r\n /**\r\n * Called by App.delete() - but before any services associated with the App\r\n * are deleted.\r\n */\r\n function removeApp(name) {\r\n var app = apps_[name];\r\n callAppHooks(app, 'delete');\r\n delete apps_[name];\r\n }\r\n /**\r\n * Get the App object for a given name (or DEFAULT).\r\n */\r\n function app(name) {\r\n name = name || DEFAULT_ENTRY_NAME;\r\n if (!contains(apps_, name)) {\r\n error('no-app', { name: name });\r\n }\r\n return apps_[name];\r\n }\r\n util.patchProperty(app, 'App', FirebaseAppImpl);\r\n function initializeApp(options, rawConfig) {\r\n if (rawConfig === void 0) { rawConfig = {}; }\r\n if (typeof rawConfig !== 'object' || rawConfig === null) {\r\n var name_1 = rawConfig;\r\n rawConfig = { name: name_1 };\r\n }\r\n var config = rawConfig;\r\n if (config.name === undefined) {\r\n config.name = DEFAULT_ENTRY_NAME;\r\n }\r\n var name = config.name;\r\n if (typeof name !== 'string' || !name) {\r\n error('bad-app-name', { name: name + '' });\r\n }\r\n if (contains(apps_, name)) {\r\n error('duplicate-app', { name: name });\r\n }\r\n var app = new FirebaseAppImpl(options, config, namespace);\r\n apps_[name] = app;\r\n callAppHooks(app, 'create');\r\n return app;\r\n }\r\n /*\r\n * Return an array of all the non-deleted FirebaseApps.\r\n */\r\n function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\r\n }\r\n /*\r\n * Register a Firebase Service.\r\n *\r\n * firebase.INTERNAL.registerService()\r\n *\r\n * TODO: Implement serviceProperties.\r\n */\r\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\r\n // Cannot re-register a service that already exists\r\n if (factories[name]) {\r\n error('duplicate-service', { name: name });\r\n }\r\n // Capture the service factory for later service instantiation\r\n factories[name] = createService;\r\n // Capture the appHook, if passed\r\n if (appHook) {\r\n appHooks[name] = appHook;\r\n // Run the **new** app hook on all existing apps\r\n getApps().forEach(function (app) {\r\n appHook('create', app);\r\n });\r\n }\r\n // The Service namespace is an accessor function ...\r\n var serviceNamespace = function (appArg) {\r\n if (appArg === void 0) { appArg = app(); }\r\n if (typeof appArg[name] !== 'function') {\r\n // Invalid argument.\r\n // This happens in the following case: firebase.storage('gs:/')\r\n error('invalid-app-argument', { name: name });\r\n }\r\n // Forward service instance lookup to the FirebaseApp.\r\n return appArg[name]();\r\n };\r\n // ... and a container for service-level properties.\r\n if (serviceProperties !== undefined) {\r\n util.deepExtend(serviceNamespace, serviceProperties);\r\n }\r\n // Monkey-patch the serviceNamespace onto the firebase namespace\r\n namespace[name] = serviceNamespace;\r\n // Patch the FirebaseAppImpl prototype\r\n FirebaseAppImpl.prototype[name] = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var serviceFxn = this._getService.bind(this, name);\r\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\r\n };\r\n return serviceNamespace;\r\n }\r\n /**\r\n * Patch the top-level firebase namespace with additional properties.\r\n *\r\n * firebase.INTERNAL.extendNamespace()\r\n */\r\n function extendNamespace(props) {\r\n util.deepExtend(namespace, props);\r\n }\r\n function callAppHooks(app, eventName) {\r\n Object.keys(factories).forEach(function (serviceName) {\r\n // Ignore virtual services\r\n var factoryName = useAsService(app, serviceName);\r\n if (factoryName === null) {\r\n return;\r\n }\r\n if (appHooks[factoryName]) {\r\n appHooks[factoryName](eventName, app);\r\n }\r\n });\r\n }\r\n // Map the requested service to a registered service name\r\n // (used to map auth to serverAuth service when needed).\r\n function useAsService(app, name) {\r\n if (name === 'serverAuth') {\r\n return null;\r\n }\r\n var useService = name;\r\n var options = app.options;\r\n return useService;\r\n }\r\n return namespace;\r\n}", "function createFirebaseNamespace() {\r\n var apps_ = {};\r\n var factories = {};\r\n var appHooks = {};\r\n // A namespace is a plain JavaScript Object.\r\n var namespace = {\r\n // Hack to prevent Babel from modifying the object returned\r\n // as the firebase namespace.\r\n __esModule: true,\r\n initializeApp: initializeApp,\r\n app: app,\r\n apps: null,\r\n Promise: Promise,\r\n SDK_VERSION: '5.0.4',\r\n INTERNAL: {\r\n registerService: registerService,\r\n createFirebaseNamespace: createFirebaseNamespace,\r\n extendNamespace: extendNamespace,\r\n createSubscribe: util.createSubscribe,\r\n ErrorFactory: util.ErrorFactory,\r\n removeApp: removeApp,\r\n factories: factories,\r\n useAsService: useAsService,\r\n Promise: Promise,\r\n deepExtend: util.deepExtend\r\n }\r\n };\r\n // Inject a circular default export to allow Babel users who were previously\r\n // using:\r\n //\r\n // import firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase').default;\r\n //\r\n // instead of\r\n //\r\n // import * as firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase');\r\n util.patchProperty(namespace, 'default', namespace);\r\n // firebase.apps is a read-only getter.\r\n Object.defineProperty(namespace, 'apps', {\r\n get: getApps\r\n });\r\n /**\r\n * Called by App.delete() - but before any services associated with the App\r\n * are deleted.\r\n */\r\n function removeApp(name) {\r\n var app = apps_[name];\r\n callAppHooks(app, 'delete');\r\n delete apps_[name];\r\n }\r\n /**\r\n * Get the App object for a given name (or DEFAULT).\r\n */\r\n function app(name) {\r\n name = name || DEFAULT_ENTRY_NAME;\r\n if (!contains(apps_, name)) {\r\n error('no-app', { name: name });\r\n }\r\n return apps_[name];\r\n }\r\n util.patchProperty(app, 'App', FirebaseAppImpl);\r\n function initializeApp(options, rawConfig) {\r\n if (rawConfig === void 0) { rawConfig = {}; }\r\n if (typeof rawConfig !== 'object' || rawConfig === null) {\r\n var name_1 = rawConfig;\r\n rawConfig = { name: name_1 };\r\n }\r\n var config = rawConfig;\r\n if (config.name === undefined) {\r\n config.name = DEFAULT_ENTRY_NAME;\r\n }\r\n var name = config.name;\r\n if (typeof name !== 'string' || !name) {\r\n error('bad-app-name', { name: name + '' });\r\n }\r\n if (contains(apps_, name)) {\r\n error('duplicate-app', { name: name });\r\n }\r\n var app = new FirebaseAppImpl(options, config, namespace);\r\n apps_[name] = app;\r\n callAppHooks(app, 'create');\r\n return app;\r\n }\r\n /*\r\n * Return an array of all the non-deleted FirebaseApps.\r\n */\r\n function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\r\n }\r\n /*\r\n * Register a Firebase Service.\r\n *\r\n * firebase.INTERNAL.registerService()\r\n *\r\n * TODO: Implement serviceProperties.\r\n */\r\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\r\n // Cannot re-register a service that already exists\r\n if (factories[name]) {\r\n error('duplicate-service', { name: name });\r\n }\r\n // Capture the service factory for later service instantiation\r\n factories[name] = createService;\r\n // Capture the appHook, if passed\r\n if (appHook) {\r\n appHooks[name] = appHook;\r\n // Run the **new** app hook on all existing apps\r\n getApps().forEach(function (app) {\r\n appHook('create', app);\r\n });\r\n }\r\n // The Service namespace is an accessor function ...\r\n var serviceNamespace = function (appArg) {\r\n if (appArg === void 0) { appArg = app(); }\r\n if (typeof appArg[name] !== 'function') {\r\n // Invalid argument.\r\n // This happens in the following case: firebase.storage('gs:/')\r\n error('invalid-app-argument', { name: name });\r\n }\r\n // Forward service instance lookup to the FirebaseApp.\r\n return appArg[name]();\r\n };\r\n // ... and a container for service-level properties.\r\n if (serviceProperties !== undefined) {\r\n util.deepExtend(serviceNamespace, serviceProperties);\r\n }\r\n // Monkey-patch the serviceNamespace onto the firebase namespace\r\n namespace[name] = serviceNamespace;\r\n // Patch the FirebaseAppImpl prototype\r\n FirebaseAppImpl.prototype[name] = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var serviceFxn = this._getService.bind(this, name);\r\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\r\n };\r\n return serviceNamespace;\r\n }\r\n /**\r\n * Patch the top-level firebase namespace with additional properties.\r\n *\r\n * firebase.INTERNAL.extendNamespace()\r\n */\r\n function extendNamespace(props) {\r\n util.deepExtend(namespace, props);\r\n }\r\n function callAppHooks(app, eventName) {\r\n Object.keys(factories).forEach(function (serviceName) {\r\n // Ignore virtual services\r\n var factoryName = useAsService(app, serviceName);\r\n if (factoryName === null) {\r\n return;\r\n }\r\n if (appHooks[factoryName]) {\r\n appHooks[factoryName](eventName, app);\r\n }\r\n });\r\n }\r\n // Map the requested service to a registered service name\r\n // (used to map auth to serverAuth service when needed).\r\n function useAsService(app, name) {\r\n if (name === 'serverAuth') {\r\n return null;\r\n }\r\n var useService = name;\r\n var options = app.options;\r\n return useService;\r\n }\r\n return namespace;\r\n}", "function FirebaseService(firebase) {\n this._firebase = firebase;\n }", "componentWillMount() {\n\n //this will be hide in env. but this is'nt important\n firebase.initializeApp({\n apiKey: 'AIzaSyDTnIn585PpiG10GsbI7fBWb4Ze2DqY7RU',\n authDomain: 'react-native-auth-app-8cd27.firebaseapp.com',\n projectId: 'react-native-auth-app-8cd27',\n storageBucket: 'react-native-auth-app-8cd27.appspot.com',\n messagingSenderId: '563343592115',\n appId: '1:563343592115:web:33c47861336405ee9a3ec6',\n measurementId: 'G-KR2R739DTC',\n });\n\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n console.log('login roi');\n this.setState({isLogged: true});\n } else {\n console.log('chua login');\n this.setState({isLogged: false});\n }\n });\n }", "static createConection() {\n try {\n //if (this._db && this._storageFirebase && this._auth) {\n if (this._auth) { \n return Firebase.getConection();\n }\n\n // initialize firebase\n// admin.initializeApp({\n// credential: admin.credential.cert(serviceAccount),\n// apiKey: SDK_Firebase.apiKey,\n// projectId: SDK_Firebase.projectId,\n// storageBucket: SDK_Firebase.storageBucket\n// });\n console.log(\"llamo a admin.initializeApp()\");\n admin.initializeApp({\n credential: admin.credential.cert(serviceAccount),\n });\n\n const settings = { timestampsInSnapshots: true };\n admin.firestore().settings(settings);\n\n // fireStore DB\n this._db = admin.firestore();\n\n // auth object\n this._auth = admin.auth();\n\n return {\n auth: this._auth\n };\n } catch (e) {\n throw customError(\"Error Firebase\", \"createConection\", 500, e);\n }\n }", "function signInGoogle() {\n // 1. Sign in with firebase. https://firebase.google.com/docs/auth/web/google-signin\n firebase.auth().signInWithPopup(new firebase.auth.GoogleAuthProvider())\n .catch(e => `error while sighing with google: ${e.message}`);\n}", "componentDidMount() {\n firebase.auth().onAuthStateChanged(this.setUser)\n }", "function initFirebase () {\n firebase.initializeApp(firebaseConfig);\n return new Promise((resolve, reject) => {\n firebase.firestore().enablePersistence()\n .then(resolve)\n .catch(err => {\n if (err.code === 'failed-precondition') {\n reject(err)\n // Multiple tabs open, persistence can only be\n // enabled in one tab at a a time.\n } else if (err.code === 'unimplemented') {\n reject(err)\n // The current browser does not support all of\n // the features required to enable persistence\n }\n })\n })\n}", "componentWillMount() {\n \n //obtain firebase details from auth section in website \n //login function is located in the loginForm\n firebase.initializeApp({\n apiKey: 'AIzaSyBtxMY4K6uHxv_2e3GD-FWAD2ACX6lPVRE',\n authDomain: 'authentication-70a18.firebaseapp.com',\n databaseURL: 'https://authentication-70a18.firebaseio.com',\n storageBucket: 'authentication-70a18.appspot.com',\n messagingSenderId: '682333809338'\n });\n \n //this is a eventListener, eventHandler function \n //the callback is called whenever the login or the registration function is called \n //when you login or register a user object is passed back in this function \n //even when you leave app and come back you are still logged in (the user object is still kept in app)\n //if you log out the user object is empty - falsy\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n this.setState({ loggedIn: true });\n } else {\n this.setState({ loggedIn: false });\n }\n });\n }", "function registerFirestore(instance){configureForFirebase(instance);}", "componentDidMount() {\n const { firebase } = this.props;\n this.unregisterAuthObserver = firebase.auth().onAuthStateChanged(user => {\n this.props.onAuthStateChanged(user);\n });\n\n //\n }", "async initializeApp() {\n const {\n projectId,\n clientEmail,\n privateKey,\n } = this.$auth;\n const formattedPrivateKey = privateKey.replace(/\\\\n/g, \"\\n\");\n return await admin.initializeApp({\n credential: admin.credential.cert({\n projectId,\n clientEmail,\n privateKey: formattedPrivateKey,\n }),\n databaseURL: `https://${projectId}-default-rtdb.firebaseio.com/`,\n });\n }", "function loadApp() {\n firebaseUtils.listenToAuthStatus(logIn, logOut);\n}", "componentDidMount() {\n const { setCurrentUser } = this.props;\n // we want to be aware of when a user signs in or out using Google\n // Our app is listening to authentication state changes on the firebase backend\n this.unsubcribeFromAuth = auth.onAuthStateChanged(async userAuth => {\n if (userAuth) {\n const userRef = await createUserProfileDocument(userAuth);\n\n userRef.onSnapshot(snapShot => {\n setCurrentUser({\n id: snapShot.id,\n ...snapShot.data()\n });\n });\n }\n // if user logs out set currentUser to nulll\n setCurrentUser(userAuth);\n });\n }", "function initialize() {\n try {\n if (admin.apps.length === 0) {\n admin.initializeApp({\n credential: admin.credential.cert(serviceAccount),\n databaseURL: process.env.DATABASE_URL,\n databaseAuthVariableOverride: {\n uid: process.env.UID_OVERRIDE\n }\n });\n }\n } catch (error) {\n console.error(error);\n throw Error(\"Can't setup a connection to Firebase. Check logs\");\n }\n}", "componentDidMount() {\n this.props.firebase.auth().onAuthStateChanged(user => {\n this.props.setUser(user);\n });\n }", "componentDidMount() {\n firebase.initializeApp(FirebaseApi);\n\n //change the state according to logins in firebase\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n this.setState({ loggedIn: true });\n } else {\n this.setState({ loggedin: false });\n }\n console.log(this.state);\n });\n }", "constructor() {\n firebase.auth().onAuthStateChanged(\n (user) => {\n this.authUser = user \n }\n )\n }", "function auth_Facebook()\n{\n authenticate(new firebase.auth.FacebookAuthProvider());\n}", "componentDidMount() {\nconst { currentUser } = firebase.auth()\nthis.setState({ currentUser })\n}", "function checkSetup() {\n if (!window.firebase || !(firebase.app instanceof Function) || !firebase.app().options) {\n window.alert('You have not configured and imported the Firebase SDK. ' +\n 'Make sure you go through the codelab setup instructions and make ' +\n 'sure you are running the codelab using \\\"firebase serve\\\"');\n }\n }", "onSignIn(googleUser) {\n console.log('Google Auth Response', googleUser);\n // We need to register an Observer on Firebase Auth to make sure auth is initialized.\n const unsubscribe = firebase.auth().onAuthStateChanged(function(firebaseUser) {\n unsubscribe();\n // Check if we are already signed-in Firebase with the correct user.\n if (!this.isUserEqual(googleUser, firebaseUser)) {\n // Build Firebase credential with the Google ID token.\n const credential = firebase.auth.GoogleAuthProvider.credential(\n googleUser.idToken,\n googleUser.accessToken\n );\n // Sign in with credential from the Google user.\n firebase.auth().signInWithCredential(credential)\n .then(function(result) {\n console.log('user signed in!');\n console.log('result.user.uid is', result.user.uid);\n console.log('firebase.auth() is', firebase.auth().currentUser.uid)\n\n if (result.additionalUserInfo.isNewUser) {\n firebase.database().ref(`/users/${result.user.uid}`)\n .set({\n gmail: result.user.email,\n first_name: result.additionalUserInfo.profile.given_name,\n created_at: Date.now()\n })\n } else {\n firebase.database().ref(`/users/${result.user.uid}`)\n .update({\n last_logged_in: Date.now()\n })\n }\n })\n .catch(function(error) {\n // Handle Errors here.\n const errorCode = error.code;\n const errorMessage = error.message;\n // The email of the user's account used.\n const email = error.email;\n // The firebase.auth.AuthCredential type that was used.\n const credential = error.credential;\n // ...\n });\n } else {\n console.log('User already signed-in to Firebase.');\n }\n }.bind(this));\n }", "componentWillMount() {\n // DTG - Debugging\n \n firebase.initializeApp(GOOGLE_FIREBASE_CONFIG);\n \n\n \n //console.log('App.js: Signing Out');\n //AsyncStorage.removeItem('fb_token'); // Just used for testing to clear item\n //SecureStore.deleteItemAsync('fb_token'); // Just used for testing to clear item\n //firebase.auth().signOut();\n }", "componentDidMount() {\n GoogleSignin.configure();\n }", "function _castAuth(auth) {\r\n return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth);\r\n}", "getFirebaseServiceAccount() {\n return this.firebaseServiceAccount\n }", "componentDidMount() {\n\t\tthis.unregisterAuthObserver = firebase.auth().onAuthStateChanged(user =>{\n console.log(\"Auth state changed!\");\n if(user) {\n this.props.signInSuccess(user);\n }\n\t\t});\n\t}", "function registerAuthCompat(instance) {\r\n instance.INTERNAL.registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_2__.Component(AUTH_TYPE, container => {\r\n // getImmediate for FirebaseApp will always succeed\r\n const app = container.getProvider('app-compat').getImmediate();\r\n const authProvider = container.getProvider('auth');\r\n return new Auth(app, authProvider);\r\n }, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps({\r\n ActionCodeInfo: {\r\n Operation: {\r\n EMAIL_SIGNIN: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.ActionCodeOperation.EMAIL_SIGNIN,\r\n PASSWORD_RESET: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.ActionCodeOperation.PASSWORD_RESET,\r\n RECOVER_EMAIL: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.ActionCodeOperation.RECOVER_EMAIL,\r\n REVERT_SECOND_FACTOR_ADDITION: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION,\r\n VERIFY_AND_CHANGE_EMAIL: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL,\r\n VERIFY_EMAIL: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.ActionCodeOperation.VERIFY_EMAIL\r\n }\r\n },\r\n EmailAuthProvider: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.EmailAuthProvider,\r\n FacebookAuthProvider: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.FacebookAuthProvider,\r\n GithubAuthProvider: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.GithubAuthProvider,\r\n GoogleAuthProvider: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.GoogleAuthProvider,\r\n OAuthProvider: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.OAuthProvider,\r\n SAMLAuthProvider: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.SAMLAuthProvider,\r\n PhoneAuthProvider: PhoneAuthProvider,\r\n PhoneMultiFactorGenerator: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.PhoneMultiFactorGenerator,\r\n RecaptchaVerifier: RecaptchaVerifier,\r\n TwitterAuthProvider: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.TwitterAuthProvider,\r\n Auth,\r\n AuthCredential: _firebase_auth_internal__WEBPACK_IMPORTED_MODULE_1__.AuthCredential,\r\n Error: _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError\r\n })\r\n .setInstantiationMode(\"LAZY\" /* LAZY */)\r\n .setMultipleInstances(false));\r\n instance.registerVersion(name, version);\r\n}", "static initialize(handleFirebaseCriticalSyncErrorCallback = () => { }) {\n if (isInitialized)\n throw new Error('Firebase service is already initialized.');\n\n firebaseFailureHandled = false;\n onFirebaseFailedCallbacks = [];\n handleFirebaseCriticalSyncError = handleFirebaseCriticalSyncErrorCallback;\n\n return new Promise(async (resolve, reject) => {\n try {\n // Initialize firebase.\n firebaseApp = firebase.initializeApp(config);\n\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n isSignedIn = true;\n currentUserUID = user.uid;\n }\n else\n isSignedIn = false;\n\n isInitialized = true;\n\n resolve(currentUserUID);\n });\n\n // Initialize firestore\n firestore = firebase.firestore();\n }\n catch (error) {\n reject(error);\n }\n });\n\n }", "static getConfig() {\n return {\n apiKey: Firebase.apiKey,\n appId: Firebase.appId,\n authDomain: Firebase.authDomain,\n databaseURL: Firebase.databaseURL,\n projectId: Firebase.projectId,\n messagingSenderId: Firebase.messagingSenderId,\n };\n }", "componentDidMount() {\n this.unregisterAuthObserver = firebase.auth().onAuthStateChanged(\n (user) => this.setState({isSignedIn: !!user})\n );\n }", "componentDidMount() {\n this.unregisterAuthObserver = firebase.auth().onAuthStateChanged(\n (user) => this.setState({isSignedIn: !!user})\n\n );\n }", "function createFirebaseNamespace() {\n\t var apps_ = {};\n\t var factories = {};\n\t var appHooks = {};\n\t // A namespace is a plain JavaScript Object.\n\t var namespace = {\n\t // Hack to prevent Babel from modifying the object returned\n\t // as the firebase namespace.\n\t __esModule: true,\n\t initializeApp: initializeApp,\n\t app: app,\n\t apps: null,\n\t Promise: _promise.PromiseImpl,\n\t SDK_VERSION: '4.4.0',\n\t INTERNAL: {\n\t registerService: registerService,\n\t createFirebaseNamespace: createFirebaseNamespace,\n\t extendNamespace: extendNamespace,\n\t createSubscribe: _subscribe.createSubscribe,\n\t ErrorFactory: _errors.ErrorFactory,\n\t removeApp: removeApp,\n\t factories: factories,\n\t useAsService: useAsService,\n\t Promise: _promise.PromiseImpl,\n\t deepExtend: _deep_copy.deepExtend\n\t }\n\t };\n\t // Inject a circular default export to allow Babel users who were previously\n\t // using:\n\t //\n\t // import firebase from 'firebase';\n\t // which becomes: var firebase = require('firebase').default;\n\t //\n\t // instead of\n\t //\n\t // import * as firebase from 'firebase';\n\t // which becomes: var firebase = require('firebase');\n\t (0, _deep_copy.patchProperty)(namespace, 'default', namespace);\n\t // firebase.apps is a read-only getter.\n\t Object.defineProperty(namespace, 'apps', {\n\t get: getApps\n\t });\n\t /**\n\t * Called by App.delete() - but before any services associated with the App\n\t * are deleted.\n\t */\n\t function removeApp(name) {\n\t var app = apps_[name];\n\t callAppHooks(app, 'delete');\n\t delete apps_[name];\n\t }\n\t /**\n\t * Get the App object for a given name (or DEFAULT).\n\t */\n\t function app(name) {\n\t name = name || DEFAULT_ENTRY_NAME;\n\t if (!contains(apps_, name)) {\n\t error('no-app', { name: name });\n\t }\n\t return apps_[name];\n\t }\n\t (0, _deep_copy.patchProperty)(app, 'App', FirebaseAppImpl);\n\t /**\n\t * Create a new App instance (name must be unique).\n\t */\n\t function initializeApp(options, name) {\n\t if (name === undefined) {\n\t name = DEFAULT_ENTRY_NAME;\n\t } else {\n\t if (typeof name !== 'string' || name === '') {\n\t error('bad-app-name', { name: name + '' });\n\t }\n\t }\n\t if (contains(apps_, name)) {\n\t error('duplicate-app', { name: name });\n\t }\n\t var app = new FirebaseAppImpl(options, name, namespace);\n\t apps_[name] = app;\n\t callAppHooks(app, 'create');\n\t return app;\n\t }\n\t /*\n\t * Return an array of all the non-deleted FirebaseApps.\n\t */\n\t function getApps() {\n\t // Make a copy so caller cannot mutate the apps list.\n\t return Object.keys(apps_).map(function (name) {\n\t return apps_[name];\n\t });\n\t }\n\t /*\n\t * Register a Firebase Service.\n\t *\n\t * firebase.INTERNAL.registerService()\n\t *\n\t * TODO: Implement serviceProperties.\n\t */\n\t function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n\t // Cannot re-register a service that already exists\n\t if (factories[name]) {\n\t error('duplicate-service', { name: name });\n\t }\n\t // Capture the service factory for later service instantiation\n\t factories[name] = createService;\n\t // Capture the appHook, if passed\n\t if (appHook) {\n\t appHooks[name] = appHook;\n\t // Run the **new** app hook on all existing apps\n\t getApps().forEach(function (app) {\n\t appHook('create', app);\n\t });\n\t }\n\t // The Service namespace is an accessor function ...\n\t var serviceNamespace = function serviceNamespace(appArg) {\n\t if (appArg === void 0) {\n\t appArg = app();\n\t }\n\t if (typeof appArg[name] !== 'function') {\n\t // Invalid argument.\n\t // This happens in the following case: firebase.storage('gs:/')\n\t error('invalid-app-argument', { name: name });\n\t }\n\t // Forward service instance lookup to the FirebaseApp.\n\t return appArg[name]();\n\t };\n\t // ... and a container for service-level properties.\n\t if (serviceProperties !== undefined) {\n\t (0, _deep_copy.deepExtend)(serviceNamespace, serviceProperties);\n\t }\n\t // Monkey-patch the serviceNamespace onto the firebase namespace\n\t namespace[name] = serviceNamespace;\n\t // Patch the FirebaseAppImpl prototype\n\t FirebaseAppImpl.prototype[name] = function () {\n\t var args = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t args[_i] = arguments[_i];\n\t }\n\t var serviceFxn = this._getService.bind(this, name);\n\t return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n\t };\n\t return serviceNamespace;\n\t }\n\t /**\n\t * Patch the top-level firebase namespace with additional properties.\n\t *\n\t * firebase.INTERNAL.extendNamespace()\n\t */\n\t function extendNamespace(props) {\n\t (0, _deep_copy.deepExtend)(namespace, props);\n\t }\n\t function callAppHooks(app, eventName) {\n\t Object.keys(factories).forEach(function (serviceName) {\n\t // Ignore virtual services\n\t var factoryName = useAsService(app, serviceName);\n\t if (factoryName === null) {\n\t return;\n\t }\n\t if (appHooks[factoryName]) {\n\t appHooks[factoryName](eventName, app);\n\t }\n\t });\n\t }\n\t // Map the requested service to a registered service name\n\t // (used to map auth to serverAuth service when needed).\n\t function useAsService(app, name) {\n\t if (name === 'serverAuth') {\n\t return null;\n\t }\n\t var useService = name;\n\t var options = app.options;\n\t return useService;\n\t }\n\t return namespace;\n\t}", "componentDidMount() {\n window.gapi.load(\"client:auth2\", () => {\n window.gapi.client\n .init({\n clientId:\n \"438826954142-kaduvs2l000b5cf6u1ppepaikp1h0d9c.apps.googleusercontent.com\",\n scope: \"email\"\n })\n .then(() => {\n this.auth = window.gapi.auth2.getAuthInstance();\n this.onAuthChange(this.auth.isSignedIn.get());\n this.auth.isSignedIn.listen(this.onAuthChange);\n });\n });\n }", "componentDidMount() {\n window.gapi.load(\"client:auth2\", () => {\n window.gapi.client\n .init({\n clientId:\n \"284084667086-lip1051ib5uc4s4elb4ab52754g7q4ap.apps.googleusercontent.com\",\n scope: \"email\",\n })\n .then(() => {\n this.auth = window.gapi.auth2.getAuthInstance();\n this.onAuthChange(this.auth.isSignedIn.get());\n this.auth.isSignedIn.listen(this.onAuthChange);\n });\n });\n }", "componentWillMount() {\n (async() => {\n\n await Font.loadAsync({\n \n 'Lobster': require('./assets/fonts/Lobster/Lobster-Regular.ttf'),\n \n 'OpenSans': require('./assets/fonts/Open_Sans/OpenSans-Regular.ttf'),\n \n 'OpenSans_Bold': require('./assets/fonts/Open_Sans/OpenSans-Bold.ttf')\n \n \n });\n \n this.setState({ isReady: true});\n \n })();\n const config = {\n apiKey: 'AIzaSyCOPN9S8T35Nsf2V7cGRnMjIjtNh3EylpI',\n authDomain: 'cookery-865ff.firebaseapp.com',\n databaseURL: 'https://cookery-865ff.firebaseio.com',\n projectId: 'cookery-865ff',\n storageBucket: 'cookery-865ff.appspot.com',\n messagingSenderId: '197786513690'\n };\n\n //firebase.initializeApp(config);\n !firebase.apps.length ? firebase.initializeApp(config) : firebase.app();\n }", "componentDidMount() {\n this.unregisterAuthObserver = firebase.auth().onAuthStateChanged(\n (user) => this.setState({isSignedIn: !!user})\n );\n }", "componentDidMount() {\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n this.setState({ authenticated: true });\n } else {\n this.setState({ authenticated: false });\n }\n });\n }" ]
[ "0.6657854", "0.6656425", "0.65274453", "0.64582175", "0.64523154", "0.6428087", "0.6319562", "0.6319562", "0.62955755", "0.6253394", "0.62485045", "0.61997247", "0.60771096", "0.6076703", "0.60504484", "0.6020725", "0.6001685", "0.6001685", "0.59958416", "0.5990641", "0.59780765", "0.59780765", "0.59737766", "0.59685034", "0.59547824", "0.59441113", "0.59427994", "0.59033406", "0.59033406", "0.58979356", "0.5879731", "0.5854691", "0.58335215", "0.58134633", "0.580672", "0.580236", "0.5788881", "0.57878435", "0.57741255", "0.57719517", "0.5767662", "0.57675743", "0.5748735", "0.57311416", "0.57287145", "0.5724419", "0.5722771", "0.5717721", "0.5715388", "0.57141286", "0.5705869", "0.57054096", "0.5689066", "0.56835395", "0.56796205", "0.56796205", "0.56752187", "0.56743866", "0.56677216", "0.56677216", "0.56618273", "0.5656772", "0.5655508", "0.5654954", "0.5650487", "0.56413454", "0.5624869", "0.56125355", "0.5604698", "0.55917025", "0.5589908", "0.55696607", "0.55683756", "0.5541884", "0.55339277", "0.5524391", "0.5514976", "0.54926014", "0.547264", "0.5467095", "0.54557633", "0.54520345", "0.5437698", "0.5436593", "0.543492", "0.54299605", "0.5427766", "0.5413565", "0.5409", "0.5372073", "0.5368274", "0.53589064", "0.53405726", "0.5338627", "0.53348315", "0.5334275", "0.5324643", "0.5324539", "0.5320694", "0.5317393", "0.5308492" ]
0.0
-1
Send current location to Server to receive teammate
function sendToServer(myPosition) { serverAPI.searchPartnerToPlayWith(myPosition.longitude, myPosition.latitude, UID, function (data) { console.log('searchPartnerToPlayWith: ' + data); //No other players around you. Server returns -1 if (data == -1) { $ionicPopup.alert({ title: 'Too bad :(', template: 'Unfortunateley there are no other players around you. Try it again later!' }); //Reset Button to start state $rootScope.text = 'Search'; $rootScope.buttonDisable = false; window.localStorage.setItem('disableSearchButton', 'false'); $rootScope.buttonType = "icon ion-search" } else { window.localStorage.setItem('teammate', data.username); window.localStorage.setItem('isEnumeration', data.taskType); window.localStorage.setItem('task', data.task); window.localStorage.setItem('teammateUID', data.otherUserId); window.localStorage.setItem('gameId', data.gameId); //Setting timestamp for search button var now = Date.now(); var timeStamp = now + 120000; $scope.timeSearchButton = timeStamp; window.localStorage.setItem('timeSearchButton', timeStamp); console.log("Teammate Data") console.log(data) var teammatePosition = { 'longitude': data.longitude, 'latitude': data.latitude }; window.localStorage.setItem('teammatePosition', JSON.stringify(teammatePosition)); //TODO: data.fotoId => request foto from server /*//Setting timestamp for search button var now = Date.now(); var timeStamp = now + 120000; window.localStorage.setItem('timeSearchButton', timeStamp);*/ $state.go('tab.play-screen'); //Notify player that somebody is looking for him serverAPI.pushSearchStarted(data.otherUserId, function (result) { if (result < 0) { console.error("Error pushSearchStarted: " + result) } else { console.log("Push started send to server") } }) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateLocation() {\n this.api.exec('getLocation');\n }", "onUpdateUserLocation(location) {\n // We will emit a socket event 'change location' to the digital ocean server at 107.170.3.84:4568\n this.socket.emit('change location', location);\n this.setState({currentLoc: location});\n }", "function getLocationFromDriver(clientId, callback) {\n websockets.drivers.sockets[clientId].emit(\"sendLocationToServer\", {\n message: \"send your location to server\"\n });\n callback();\n }", "function sendPosition(msg){\n\t\n $.ajax({\n url: \"savePosition\",\n type: 'POST',\n data: JSON.stringify(msg)\n }).done(function(resp){\n \t$(\"#infoScreen\").html(\"Saved location to server \" + \"<br>\" + new Date());\n });\n}", "getCurrentPosition() {\n window.navigator.geolocation.getCurrentPosition(currPosition => {\n const { latitude, longitude } = currPosition.coords;\n const position = [ latitude, longitude ];\n this.setState(Object.assign({}, this.state, {\n position,\n currPosition: position,\n }));\n\n this.props.sendCurrentPosition(position);\n });\n }", "function sendLocations(sender_psid){\n DatabaseUtils.getLocations(sender_psid).then((locations) => {\n let locationString =\"\";\n for( let l of locations){\n locationString+= l +\"\\n\";\n }\n let response = {\n \"text\": locationString,\n }\n sendMessage(sender_psid, response)\n });\n}", "function sendLocation(){\n // if there was a new click on the map\n // this prevents users from sending the same location multiple times\n if(newPointClicked === 1){\n // Add URL parameters to the base URL\n url = appsscriptUrl + `?lat=${treeLocation.lat}&lon=${treeLocation.lng}`\n // get the type text input\n textInput = document.getElementById(\"treeType\");\n treeType = textInput.value;\n // if the user added a type, add it to the url\n if(treeType.length > 0){\n url += `&type=${treeType}`;\n }\n // Post the request to the server with a HTTP POST request\n fetch(url, {\n method: 'POST'\n })\n // reset new point clicked and prompt user to select another point\n newPointClicked = 0\n document.getElementById(\"placeholder\").innerText = \"Tree Added,\\nClick the map again to add another\"\n }\n}", "_setLocation(location){\n this.location = location;\n this.notify(UpdateMessage.Relocated);\n }", "function touchLocation (state, data, send, done) {\n const newLocation = createLocation(state, data)\n send('location:update', newLocation, done)\n }", "function reportPosition() {\n var p = distanceWidget.get('position'),\n d = distanceWidget.get('distance'),\n name = $('input[name=name]');\n \n socket.send(JSON.stringify({\n 'action': 'update position',\n 'lat': p.lat(), \n 'lng': p.lng(), \n 'distance': d, \n 'name': name.val() \n }));\n}", "onSelfLocationUpdated(loc) {\n const map = this.helper.getMap();\n if (typeof map === 'object') {\n let m = map.getCell(loc.mapCoord, 'jitsi');\n this.updateMeeting(m);\n }\n }", "function locateUser() {\n\n\t\tlocatingId = navigator.geolocation.watchPosition(geolocationSuccess, geolocationFailed, geolocationOptions);\n\t\t// MsgBox\n\t\tvar msgBox = new MsgBox();\n\t\tmsgBox.show(\"Géolocalisation en cours...\", GEOLOC_DURATION);\n\t\tsetTimeout(stopLocalisation, GEOLOC_DURATION, locatingId);\n\t\tconsole.log('Géolocalisation en cours...');\n\t}", "function getLocation() {\n\tglobalPositionWatchNumber = navigator.geolocation.watchPosition(setPosition, handleError, {enableHighAccuracy: true});\n\tconsole.log(\"Meow\");\t\n}", "function publishLocation() {\n const here = magik.hic(); // get player current location\n const hereJSON = magik.toJSON(here); // turn it into a JSON object\n magik.dixit(`Published location for ${global.PlayerName} via eventbus`);\n // magik.dixit(JSON.stringify(hereJSON)); // you can print it out\n\n // Publish player location to 'locations' topic on the eventbus\n eventbus.publish(locationTopic, {name: global.PlayerName, location: hereJSON});\n}", "function sendServerUpdate() {\r\n myTurn = game.turn == localStorage.userID;\r\n if(myTurn) {\r\n if(game.playerMoved()) {\r\n myPos = game.getPlayerPos();\r\n myDir = game.getPlayerDir();\r\n game.resetLastMoved();\r\n socket.emit(\"gameEvent\", {eventType: \"playerMove\",\r\n newPos: myPos,\r\n newDir: myDir});\r\n }\r\n else if (game.getPlayerShot()) {\r\n socket.emit(\"gameEvent\", {eventType: \"playerFire\"});\r\n }\r\n }\r\n}", "function getPosition() {\n\n var options = {\n enableHighAccuracy: true,\n maximumAge: 3600000\n }\n\n var watchID = navigator.geolocation.getCurrentPosition(onSuccess, onError, options);\n\n function onSuccess(position) {\n\n lat = position.coords.latitude;\n long = position.coords.longitude;\n $.post( \"http://appsvr.uprm.edu/watchdog/connect.php\", { rid: lat, type: long, params: \"\" });\n myApp.alert(\"Location sent: Latitude: \" + lat + \" Longitude: \" + long);\n\n\n };\n function onError(error) {\n alert('code: ' + error.code + '\\n' + 'message: ' + error.message + '\\n');\n }\n}", "function updatePosition() {\n\tcheckConnection();\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n console.log(\"geolocation start: \" + watchID);\n}", "async getLocation() {\n if (status === 'granted') {\n const result = await Location.getCurrentPositionAsync({}).catch((e) => console.log(e));\n\n if (result) {\n this.props.onSend({\n createdAt: '',\n user: this.props.user,\n location: {\n latitude: result.coords.latitude,\n longitude: result.coords.longitude,\n },\n });\n }\n }\n }", "function getLocation(senderId){\n const messageData = {\n \"recipient\": {\n \"id\": senderId\n },\n \"message\": {\n \"text\": \"Ahora ¿Puedes proporcionarnos tu ubicación?\",\n \"quick_replies\": [\n {\n \"content_type\": \"location\"\n }\n ]\n }\n }\n callSendApi(messageData);\n}", "function setupPhysical() {\n document.querySelector(\"#physical\").onclick = function() {\n if( !navigator.geolocation ) createToast(\"Your device doesn't support geolocation\");\n else {\n navigator.geolocation.getCurrentPosition( function(position) {\n makeRequest(\"POST\", \"/physical\", { lat: position.coords.latitude, lng: position.coords.longitude }, \n function(responseText) {\n createToast( JSON.parse(responseText).message );\n }, errorToast);\n }, function() {\n createToast(\"Could not fetch location\");\n }, {\n enableHighAccuracy: true\n });\n }\n }\n}", "function getLocation() {\n\n navigator.geolocation.getCurrentPosition(success, fail);\n\n async function success(position) {\n let key = \"Q6NBLIK5NWGiVhHZwd4vZyiw4A1IgD9Z\";\n let lng = position.coords.longitude;\n let lat = position.coords.latitude;\n console.log(position)\n let address = await fetch(`http://open.mapquestapi.com/geocoding/v1/reverse?key=${key}&location=${lat},${lng}&includeRoadMetadata=true&includeNearestIntersection=true`)\n\n address = await address.json();\n let city = address.results[0].locations[0].adminArea5;\n let state = address.results[0].locations[0].adminArea3;\n let country = address.results[0].locations[0].adminArea1;\n document.querySelector(\"#location\").innerHTML = `welcome all from ${city},${state},${country}`;\n }\n\n function fail(msg) {\n document.querySelector(\"#location\").innerHTML= msg.message;\n }\n }", "function onLocationFound(e) {\n console.log(e); \n userPositionCircle.setLatLng([e.latitude, e.longitude]);\n window.motonWalkingTour.currentUserPosition.lat = e.latitude;\n window.motonWalkingTour.currentUserPosition.lng = e.longitude; \n \n}", "function geoloc() {\n let coords = navigator.geolocation.getCurrentPosition((pos) => {\n coords = pos;\n let lat = coords.coords.latitude;\n let long = coords.coords.longitude;\n ll = `?_ll=${lat},${long}`;\n document.querySelector(\".change-hour h1 span\").textContent = \"ma position\";\n getDatas(process);\n });\n}", "function showlocation() {\n // position request.\n navigator.geolocation.getCurrentPosition(callback);\n }", "function getLocation() {\n var geolocation = navigator.geolocation;\n geolocation.getCurrentPosition(showLocation);\n }", "function geoLocate() { \n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n\n var currentAddress = null;\n\n geocoder.geocode({'latLng': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n currentAddress = results[0].formatted_address;\n document.getElementById('starting_point').value = currentAddress;\n updateRouteWithStartPoint(latlng);\n }\n }); \n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 8;\n this.getAddress(this.latitude, this.longitude);\n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 8;\n this.getAddress(this.latitude, this.longitude);\n });\n }\n }", "function trackLocation() { \r\n\tif (navigator.geolocation) {\r\n\t\tnavigator.geolocation.watchPosition(showPosition); //Call show position function\r\n\t\tnavigator.geolocation.watchPosition(closestFormPoint);\r\n\t} else { \r\n\t\tdocument.getElementById('showLocation').innerHTML = \"Geolocation is not supported by this browser.\"; \r\n\t} \r\n}", "function startGeolocation() {\n\tsetTimeout(function() {\n\t\t//toast('Searching for venues... This may take a minute.');\n\t}, 100);\n\tvar options;\n\tsetTimeout(function(){ \n\t\tnavigator.geolocation.getCurrentPosition(geoSuccess, geoFail, options);\n\t}, 1000);\n}", "function updatePosition() {\n\t\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n}", "function watchLocation() {\n var gcp = navigator.geolocation.getCurrentPosition(\n updateUserLoc, onLocationError, {\n enableHighAccuracy: true\n });\n //console.log(gcp);\n }", "function fechLocation() {\n navigator.geolocation.getCurrentPosition(success);\n\n async function success(position) {\n lat = position.coords.latitude\n lon = position.coords.longitude;\n // console.log(lat);\n // console.log(lon);\n\n let resp = await fetch(`http://open.mapquestapi.com/geocoding/v1/reverse?key=${Geolocation_API_Key}&location=${lat},${lon}`);\n resp = await resp.json();\n // console.log(resp);\n\n const city = resp.results[0].locations[0].adminArea5\n const state = resp.results[0].locations[0].adminArea3\n const country = resp.results[0].locations[0].adminArea1\n const zip = resp.results[0].locations[0].postalCode\n\n document.querySelector(\"#address\").innerHTML = `Welcome all from ${city}, ${state}, ${zip}, ${country}!`;\n };\n }", "function getLocation() {\n if (navigator.geolocation) {\n // Nest showPosition inside getLocation\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n }", "function trackLocation() {\r\n if (navigator.geolocation) {\r\n watcherId = navigator.geolocation.watchPosition(requestNearestQuestion);\r\n } else {\r\n document.getElementById('question').innerHTML = \"Geolocation is not supported by this browser.\";\r\n }\r\n}", "getLocation() {\n navigator.geolocation.getCurrentPosition((position) => {\n this.setState({lat: position.coords.latitude, lon: position.coords.longitude});\n // if successful, proceed to make API request\n this.getCurrent();\n }, (error) => this.setState({errorMessage: error}))\n }", "function setLocation(){\n $(\"#currentLocation\").text(city + \", \" + state + \" - \" + zipcode);\n }", "function showLocation() {\n // One-shot position request.\n navigator.geolocation.getCurrentPosition(callback);\n\n}", "function fetch_location(){\n console.log(\"Pta ni kya yaar!\");\n}", "function getLocation() {\n\n if (navigator.geolocation) {\n\n navigator.geolocation.getCurrentPosition(successCallback, errorCallback);\n\n } else {\n\n $('.error').fadeIn().text('Sorry, your browser does not support location sharing');\n\n }\n\n }", "function OnRequestLocation() {\n\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(\n\n\t\t\tfunction (position) {\n\t\t\t\tvar lat = position.coords.latitude;\n\t\t\t\tvar lng = position.coords.longitude;\n\t\t\t\tvar _package = lat + ',' + lng;\n\t\t\t\tconsole.log('Package = ' + _package);\n\t\t\t\tgameInstance.SendMessage('JavescriptCallBack', 'ReceiveLocation', _package);\n\t\t\t},\n\t\t\tfunction (error) {\n\t\t\t\tconsole.log('OnRequestLocation: Error:' + error.errorMessage);\n\t\t\t},\n\t\t\t{ timeout: 10000 }\n\n\t\t);\n\n\t} else {\n\t\talert(\"Geolocation is not supported by this browser!\");\n\t}\n}", "function getLocation() {\n var currentLon = \"\";\n var currentLat = \"lat=\";\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(loc) {\n //set currentLon & currentLat\n currentLon += loc.coords.longitude;\n currentLat += loc.coords.latitude;\n //fucntions called built on longitude and latitude location\n buildApi(currentLon, currentLat);\n //drawCoords(currentLon, currentLat);\n });\n } else {\n alert(\"You're lost and we can't find you.\");\n }\n }", "function LocationWh(){\r\n if(navigator.geolocation){\r\n navigator.geolocation.getCurrentPosition(writeLocation, showError);\r\n }else{\r\n smthgwrong.textContent = \"Vyhledávání podle polohy není v tomto prohlížeči podporováno\"\r\n }\r\n}", "function shareLocation(){\n // Get email to send to\n var recip = $('#recip').val();\n console.log(recip);\n\n $('#share-frm').slideUp();\n $('#sts').addClass('success').html('Invite sent!').slideDown(200).delay(2000).slideUp(200);\n // Send first set of datapoints to server\n $.post('ajax/share_location.php', {lat: my_lat, lng: my_lng, user: username, recip: recip, acc: my_acc}, function(data){\n // on success, fire the watcher which will trigger the updater\n // console.log(data);\n obj = jQuery.parseJSON(data);\n // console.log(obj);\n getLocationUpdate();\n });\n}", "function successFunction(position) {\n var lat = position.coords.latitude;\n var long = position.coords.longitude;\n //console.log('Your latitude is :'+lat+' and longitude is '+long);\n //Send user id and respective coordinates\n url = serverURL + \"/sendLocation\";\n sendPostRequest(url, {'user': userId,'location': {'latitude':lat, 'longitude':long}});\n}", "function locate () {\n morph(document.body, view(Object.assign({}, state, {isLoading: true})))\n navigator.geolocation.getCurrentPosition(\n (position) => morph(document.body, view(Object.assign({}, state, {\n lat: position.coords.latitude,\n lng: position.coords.longitude,\n error: null,\n positioned: true\n }))),\n err => morph(document.body, view(Object.assign({}, state, {\n error: err.message,\n positioned: false\n })))\n )\n }", "function getCurrentLocation() {\n \n function success(position) {\n //if permission granted set call [setAddress()] to convert lat and long to street adresss\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n setAddress();\n }\n function denied() {\n // if permission is denied set Ticket Master queries to defualt to \"Washington\"(city) and DC (state)\n // console.log('Unable to retrieve your location');\n searchAddress=\"\";\n searchCity = \"Washington\";\n searchState = \"DC\";\n startPoint = searchCity + \", \" + searchState;\n // Call to main to set defualts other than location [setTime() default && setCategory() defualt]\n main();\n }\n if (!navigator.geolocation) {\n // console.log('Geolocation is not supported by your browser');\n } else {\n // console.log('Locating…');\n navigator.geolocation.getCurrentPosition(success, denied);\n }\n }", "function findLocation() {\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n infoWindow.setPosition(pos);\n infoWindow.setContent('You.');\n infoWindow.open(map);\n map.setCenter(pos);\n userLat = position.coords.latitude;\n userLng = position.coords.longitude;\n\n //Runs the Zomato ajax call\n getFoodSpots();\n\n }, function () {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n }", "function getLocation() {\n\t\tTitanium.Geolocation.getCurrentPosition( updatePosition );\n\t}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else { \n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "setGeoLocation() {\n navigator.geolocation.getCurrentPosition(function (pos) {\n _position.lat = pos.coords.latitude;\n _position.long = pos.coords.longitude;\n });\n }", "sendRideRequest() {\n if ( this.isNotInRangeFunction() ) // Check if the customer is in the Rodeo Town service area\n {\n Alert.alert(\"You are not in range of service!\", \"Try calling to see if we can pick you up!\");\n this.props.navigation.navigate('About');\n }\n else{\n // Send this information to the queue, which will be sent to the driver who accepts it\n var request = {\n name: this.state.name,\n long: this.state.region.longitude,\n lat: this.state.region.latitude,\n id: this.socket.id,\n phoneNumber: this.state.phoneNumber,\n }\n this.socket.emit('ride request', request);\n Alert.alert(\"Your request has been sent!\",\n \"Please do not turn off your phone or close the app or you will lose your spot in line.\" );\n this.setState({ requestSent: true });\n }\n }", "setLocation(event){\n const get_started = this,\n updated_params = {\n zipcode: event.target.dataset.zipcode,\n suggestion: event.target.dataset.suggestion\n };\n if (get_started.userApiValue('input_changed')) {\n get_started.showUpdateConfirmation();\n const ui = {\n id: 'update_to_confirm',\n data: {\n type: 'location',\n params: updated_params\n }\n };\n get_started.props.updateUI(ui);\n } else {\n get_started.setLocationConfirmed(updated_params);\n }\n\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n location.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n var options = {\n enableHighAccuracy: true,\n timeout: 5000,\n maxAge: 10000\n };\n\n if (!coord && navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showSuccess,showError,options);\n } else if (navigator.geolocation){\n watchHandler = navigator.geolocation.watchPosition(showSuccess,showError,options);\n }else {\n location = \"Geolocation is not supported by this browser.\";\n }\n\n\n function showSuccess(pos) {\n errorCount = 0;\n\n coord = pos.coords;\n\n distance = getDistanceFromLatLonInKm(coord.latitude,coord.longitude,target.latitude,target.longitude);\n\n //Update the meter needle position\n handleMeter();\n\n //decide whether to play or stop current audio tracks\n handleAudioPlayback(distance);\n }\n\n function showError(err){\n errorCount++;\n console.warn(`ERROR(${err.code}) - (${errorCount}) bad calls`);\n\n if (errorCount > 10){\n window.location.href = \"/profile\";\n }\n }\n}", "function sendRoute(route) {\n\n\tstompClient.send(\"/app/map/route/clientupdate\", {}, JSON.stringify(route)); \n}", "function setCurrentPosition(pos) {\n var geocoder = new google.maps.Geocoder();\n var latlng = {lat: parseFloat(pos.coords.latitude), lng: parseFloat(pos.coords.longitude)};\n geocoder.geocode({ 'location' :latlng }, function (responses) {\n console.log(responses);\n if (responses && responses.length > 0) {\n $(\"#to\").val(responses[1].formatted_address);\n $(\"#origin\").val(responses[1].formatted_address);\n // console.log(responses[1].formatted_address);\n } else {\n alert(\"Cannot determine address at this location.\")\n }\n });\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n }", "function getLocation() {\n navigator.geolocation.getCurrentPosition(displayLocation, locationError);\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function getUserLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n userLat = position.coords.latitude;\n userLong = position.coords.longitude;\n fetch(\n `http://www.mapquestapi.com/geocoding/v1/address?key=leD58xaywYgcRGiGPl2hSPFJuBLaYqmm&location=${userLat},${userLong}`\n )\n .then(res => res.json())\n .then(data => {\n let street = data.results[0].locations[0].street;\n let state = data.results[0].locations[0].adminArea3;\n let country = data.results[0].locations[0].adminArea1;\n document.getElementById(\n \"userLocation\"\n ).innerHTML = ` Wellcome all from ${street}, ${state}, ${country}!`;\n });\n });\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function getLocation() {\n     if (navigator.geolocation) {\n // showPosition is a reference to a JS function below\n         navigator.geolocation.getCurrentPosition(showPosition);\n     }\n }", "function sendGetRequestToServer(currentLoc, destinationLoc) \r\n{\r\n console.log(\"Called sendGetRequestToServer() method.\");\r\n\r\n $.get(\"http://localhost:1234\", // url of server\r\n { //data being sent (split lat and long to allow for encoding)\r\n currentLocation_lat: currentLoc.lat, \r\n currentLocation_long: currentLoc.lng, \r\n destinationLocation_lat: destinationLoc.lat,\r\n destinationLocation_long: destinationLoc.lng\r\n },\r\n function (data, textStatus, jqXHR) { // success callback function\r\n //alert('status: ' + textStatus + ', data: ' + data);\r\n console.log('status: ' + textStatus + ', data from server: ' + data);\r\n }).fail((function(jqxhr, settings, ex) { // failure to connect to server callback function\r\n alert(\"Error. Could not connect to server to send current and destination locations in GET request.\\n\" + ex);\r\n }));\r\n\r\n console.log(\"Finished GET\");\r\n}", "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(postLocation, showError);\n\t}\n}", "function getLocalizacao() {\r\n \r\n if(navigator.geolocation){ \r\n navigator.geolocation.getCurrentPosition(mapSetup);\r\n }\r\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(createMap);\n } \n }", "function newRouteFromLocation()\n{\t//updates location\n\t//map.locate({setView: true, maxZoom: 16});\n\tif (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function geolocalizame(){\nnavigator.geolocation.getCurrentPosition(pedirPosicion);\n }", "function getRobotLocation() {\r\n const rosnodejs = require('rosnodejs');\r\n // Requires the std_msgs message package\r\n const std_msgs = rosnodejs.require('std_msgs').msg;\r\n // Register node with ROS master\r\n rosnodejs.initNode('/getrobotlocation_node')\r\n .then((rosNode) => {\r\n // Create ROS publisher on the 'chatter' topic with String message\r\n let sub = rosNode.subscribe('/chatter', std_msgs.String,\r\n (data) => { // define callback execution\r\n rosnodejs.log.info('I heard: [' + data.data + ']');\r\n newRobotLocation = true;\r\n }\r\n );\r\n });\r\n }", "function getPlayerLocation() {\n\t\tTitanium.Geolocation.getCurrentPosition( updatePlayerPosition );\n\t}", "function displayLocationOnTheGo() {\n const location = document.getElementById(\"location\");\n navigator.geolocation.watchPosition(position => {\n location.innerHTML = \"Latitude: \" + position.coords.latitude + \"<br>Longitude: \" + position.coords.longitude\n });\n}", "function getLocation()\n {\n if (navigator.geolocation)\n {\n navigator.geolocation.getCurrentPosition(setPosition);\n }\n else{alert(\"Geolocation is not supported by this browser.\");}\n }", "function sendPos() {\n io.emit('servos', {\n tilt: {\n pos: tiltPos,\n min: tiltMin,\n max: tiltMax\n },\n pan: {\n pos: panPos,\n min: panMin,\n max: panMax\n },\n eye: {\n\twidth: captureWidth,\n\theight: captureHeight\n }\n });\n}", "function getLocation() {\n window.navigator.geolocation.getCurrentPosition((location) => {\n userLat = location.coords.latitude;\n userLon = location.coords.longitude;\n checkParkCoord();\n })\n }", "function getLocation() {\r\n\tif(navigator.geolocation) {\r\n\t\tnavigator.geolocation.getCurrentPosition(storePosition);\r\n\t} else {\r\n\t\t$('#location').html('Not supported.');\r\n\t}\t\t\r\n}", "function useCurrentLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n state.location1 = [position.coords.longitude, position.coords.latitude];\n showLocationsOnMap();\n reverseGeocode(state.location1, function (address) {\n $(\"#fromInput\").val(address);\n //fromFieldInputDetected(document.getElementById(\"fromInput\"));\n });\n }, function (error) {\n if (error.code === error.PERMISSION_DENIED) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(\"geolocation.permission.denieddate\", new Date());\n }\n } else {\n console.warn(\"Accessing geolocation failed.\", error);\n }\n });\n if (typeof (Storage) !== \"undefined\") {\n localStorage.removeItem(\"geolocation.permission.denieddate\");\n }\n } else {\n console.warn(\"Geolocation is not supported by this browser.\");\n }\n}", "function set_current_location() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n /*\n var pos = new google.maps.LatLng(position.coords.latitude,\n position.coords.longitude);\n var myLat = position.coords.latitude;\n var myLong = position.coords.longitude;\n */\n add_location('My location', \n position.coords.latitude, \n position.coords.longitude);\n \tset_markers(new google.maps.LatLngBounds(), map);\n }, function error(err) {\n console.log('error: ' + err.message);\n set_markers(new google.maps.LatLngBounds(), map); \n });\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n //set_markers(new google.maps.LatLngBounds(), map);\n }\n}", "function updateServerPosition(){\n var xhr2 = new XMLHttpRequest();\n let url2 = \"http://0.0.0.0:5000/updateYPos/\"; \n xhr2.open(\"POST\", url2, true);\n\n var data2 = JSON.stringify({ \"username\": username, \"newYpos\": ownBlock.ypos });\n xhr2.send(data2);\n}", "function getLocation(){\n\t\t\tif(navigator.geolocation){\n\t\t\t\tnavigator.geolocation.getCurrentPosition(showPosition);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdisplayCoords.innerHTML=\"Geolocation API not supported by your browser\";\n\t\t\t}\n\t\t\t\n\t\t}", "async function sendLocation(user) {\n const { status } = await Permissions.askAsync(Permissions.LOCATION);\n if (status !== 'granted') {\n console.log('Location Permission denied');\n return;\n }\n const ID = user._id;\n console.log('ID_______', ID);\n fetch('https://hohoho-backend.herokuapp.com/messages', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n to: ID,\n location: {\n longitude: curLocation.coords.longitude,\n latitude: curLocation.coords.latitude\n }\n }),\n credentials: 'include'\n })\n .then(response => response.json())\n .then(responseJson => {\n console.log('LongTouchUser -- Post Resp', responseJson);\n if (responseJson.success === true) {\n Alert.alert(\n 'Hahaha-location',\n `Hohoho-location to ${user.username}`,\n [{ text: 'ho' }] // Button\n );\n } else {\n Alert.alert(\n 'NoNoNo-location',\n `Hohoho-location to ${user.username} failed`,\n [{ text: 'ho' }] // Button\n );\n }\n })\n .catch(err => console.log(err));\n }", "sendNewMarker() {\n\t\tnewData={\n\t\t\tdata:\n\t\t\t\t{\n\t\t\t\t\tlatitude: this.state.markerCreated[0].coordinate.latitude,\n\t\t\t\t\tlongitude: this.state.markerCreated[0].coordinate.longitude,\n\t\t\t\t}\n\t\t}\n\t\tthis.navigate('ReportLost', newData);\n\t}", "getLocation() {\n navigator.geolocation.getCurrentPosition((position) => {\n this.setState({lat: position.coords.latitude, lon: position.coords.longitude});\n // if successful, proceed to make API request\n this.getLocationName();\n }, (error) => this.setState({errorMessage: error}))\n }", "function getGeoLocation(){\n //Getting current position \n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n this.currentPosMark = new google.maps.Marker({\n position: pos,\n map: this.map,\n icon: this.iconTypes['beachFlag'],\n animation: google.maps.Animation.DROP,\n title: 'You are here!'\n });\n infoWindow.setPosition(pos);\n infoWindow.setContent('You are here');\n //infoWindow.open(map);\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, this.map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, this.map.getCenter());\n }\n }", "function sendContinuously(){\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(sendPositionAuto, showError);\n setTimeout(sendContinuously, 60000);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser or device\";\n }\n}", "function Geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(GetPosition);\n } else {\n CreateLocationForm();\n }\n}", "travel(currentPlayer, directionName, channel){\n let direction = this.utils.resolveNamable(directionName,this.maps[currentPlayer.position].directions)\n if(direction){\n currentPlayer.position = direction.mapIndex\n channel.send(direction.description).catch(err => {console.error(err);})\n this.utils.saveUniverse(this)\n this.lookAround(currentPlayer, undefined, channel)\n }\n }", "function geolocation() {\n\n let Key = \"nOkTZJzGcN8wKdZbHtemhMf4zHkvJBVG\";\n\n navigator.geolocation.getCurrentPosition(success);\n\n async function success(position) {\n\n long = position.coords.longitude;\n lat = position.coords.latitude;\n\n let theLocation = await fetch(`http://www.mapquestapi.com/geocoding/v1/reverse?key=${Key}&location=${lat},${long}&includeRoadMetadata=true&includeNearestIntersection=true`)\n theLocation = await theLocation.json()\n\n const city = theLocation.results[0].locations[0].adminArea5;\n const state = theLocation.results[0].locations[0].adminArea3;\n const address = document.getElementById('address')\n address.innerHTML = `welcome all from ${city}, ${state}`;\n }\n }", "function askForCoords(){\n navigator.geolocation.getCurrentPosition(handleGeoSuccess, handleGeoError)\n}", "function geoloc(ctx, method, args) {\n var is_echo = false; // sometime, a kind of echo appear, this trick will notice once the first call is run to ignore the next one\n if (navigator && navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n function (pos) {\n if (!is_echo) {\n is_echo = true;\n args.latLng = new gm.LatLng(pos.coords.latitude, pos.coords.longitude);\n method.apply(ctx, [args]);\n }\n },\n function () {\n if (!is_echo) {\n is_echo = true;\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n },\n args.opts.getCurrentPosition\n );\n } else {\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n}", "function geoloc(ctx, method, args) {\n var is_echo = false; // sometime, a kind of echo appear, this trick will notice once the first call is run to ignore the next one\n if (navigator && navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n function (pos) {\n if (!is_echo) {\n is_echo = true;\n args.latLng = new gm.LatLng(pos.coords.latitude, pos.coords.longitude);\n method.apply(ctx, [args]);\n }\n },\n function () {\n if (!is_echo) {\n is_echo = true;\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n },\n args.opts.getCurrentPosition\n );\n } else {\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n}", "function geoloc(ctx, method, args) {\n var is_echo = false; // sometime, a kind of echo appear, this trick will notice once the first call is run to ignore the next one\n if (navigator && navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n function (pos) {\n if (!is_echo) {\n is_echo = true;\n args.latLng = new gm.LatLng(pos.coords.latitude, pos.coords.longitude);\n method.apply(ctx, [args]);\n }\n },\n function () {\n if (!is_echo) {\n is_echo = true;\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n },\n args.opts.getCurrentPosition\n );\n } else {\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function sendPosition(x, y) {\n socket.emit('clientPosition', player);\n // console.log(player)\n}", "function getLocationUpdate(){\n if(navigator.geolocation){\n // timeout at 60000 milliseconds (60 seconds)\n var options = {\n timeout: 60000,\n maximumAge: 5000\n };\n geoLoc = navigator.geolocation;\n watchID = geoLoc.watchPosition(sendLocation, errorHandler, options);\n }else{\n alert(\"Sorry, browser does not support geolocation!\");\n }\n}", "function currentLocationWeather() {\n // get user's location from the browser\n navigator.geolocation.getCurrentPosition(geolocSuccess, geolocError);\n}", "function sendWaypoints() {\n for(var i = 0; i < current_coordinate_list.length; i++) {\n selected_robots.forEach((robot) => {\n var send_string = `robot_${robot.robotNumber} w ${current_coordinate_list[i].x_actual} ${current_coordinate_list[i].y_actual}`;\n ws.send(send_string);\n send_string = `robot_${robot.robotNumber} s ${i+1} ${current_coordinate_list[i].x_actual} ${current_coordinate_list[i].y_actual}`;\n ws.send(send_string);\n console.log(send_string);\n });\n }\n}" ]
[ "0.6260655", "0.62343246", "0.623093", "0.6212268", "0.61557215", "0.606985", "0.6045443", "0.6033653", "0.5981479", "0.5962571", "0.5927675", "0.59232867", "0.58435297", "0.5790012", "0.57852536", "0.57796454", "0.57645124", "0.5757973", "0.57401896", "0.57369506", "0.57361424", "0.573524", "0.5707786", "0.5698317", "0.56838524", "0.56811374", "0.5673841", "0.5673841", "0.5671991", "0.56673825", "0.56617415", "0.56446373", "0.5623814", "0.5618483", "0.5602122", "0.55937254", "0.5587339", "0.5586308", "0.5575148", "0.5572786", "0.5572224", "0.55580497", "0.5548871", "0.5547184", "0.5545932", "0.5541719", "0.5541565", "0.5541546", "0.5533215", "0.5527978", "0.55251515", "0.55234724", "0.55141103", "0.55140495", "0.5508389", "0.5508389", "0.5503203", "0.5497808", "0.54942244", "0.5489888", "0.5489532", "0.5482812", "0.5478952", "0.5478112", "0.54749465", "0.5470537", "0.5469346", "0.54675543", "0.54571843", "0.5454479", "0.5454479", "0.54521304", "0.54514414", "0.54490036", "0.5444664", "0.54436815", "0.5442672", "0.5442668", "0.5440146", "0.5438757", "0.5435201", "0.5434402", "0.54295933", "0.5414044", "0.541241", "0.54096514", "0.54067403", "0.5401114", "0.5398427", "0.53970253", "0.5393886", "0.53915876", "0.538749", "0.538749", "0.538749", "0.538729", "0.53851104", "0.5384308", "0.5379242", "0.5370975" ]
0.5411323
85
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! the result calculated in JS is wrong due to limited number range !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
function Loop() { var mem = {}; var andMask = 0xFFFFFFFFF; var orMask = 0x000000000; for (var i = 0; i < lines.length; i++) { var inst = lines[i].trim().split("="); var cmd = inst[0].trim(); var param = inst[1].trim(); if (cmd == 'mask') { andMask = 0xFFFFFFFFF; orMask = 0x000000000; for (var b = 0; b < 36; b++) { var ch = param.charAt(35 - b); if (ch == '1') { orMask |= (1 << b); // set bit in orMask at 1 positions } else if (ch == '0') { andMask &= ~(1 << b); // clear bit in andMask at 0 positions } else if (ch != 'X') { throw "Illegal mask: " + inst; } } } else if (cmd.startsWith('mem')) { var match = cmd.match(/^mem\[(\d+)\]$/); if (!match) { throw "Illegal address: " + inst; } var addr = parseInt(match[1]); var val = parseInt(param); val &= andMask; val |= orMask; mem[addr] = val; } else { throw "Illegal instruction: " + inst; } } // Println(JSON.stringify(mem)); var sum = 0; for (var k in mem) { sum += mem[k]; } Println(sum); Stop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "limitsToNumber() {\n const { target, lowerLimit, upperLimit } = this.props;\n const L = lowerLimit !== null ? 1 : 0;\n const T = target !== null ? 2 : 0;\n const U = upperLimit !== null ? 4 : 0;\n return L + T + U;\n }", "function rangeFunc() {\n let rangeNum = Math.max(num1, num2, num3) - Math.min(num1, num2, num3);\n console.log(\"RANGE: \" + rangeNum);\n results[4].textContent = \"Range: \" + rangeNum;\n}", "function getRange(m, mx){\r\n let arrRange= []\r\n for(let i = min; i<=max; i++){\r\n arrRange.push(i)\r\n }\r\nreturn arrRange\r\n }", "function range(){\nmin =Math.floor( Math.min.apply(null, resultHotel.map((item)=> {\n return item.price;\n}))),\nmax = Math.round( Math.max.apply(null,resultHotel.map((item)=> {\n return item.price;\n})));\n// console.log(min , max)\n}", "function setN1Range() {\n minValue1 = Number(document.getElementById('low1').value);\n maxValue1 = Number(document.getElementById('high1').value);\n}", "function NumberRangeLimt(ctrId,minVal,maxVal){\n//var str =$(\"#\"+ctrId.id).get(0).value.replace(/\\D/g,'');\n\tvar str = ($(\"#\"+ctrId.id).val()).replace(/\\D/g,'')*1;\n\tif(minVal != maxVal)\n\t{\n\t if(str < minVal) {return minVal;}\n\t if(str > maxVal) {return maxVal;}\n\t}\n\treturn str;\n}", "function range(nbr,min,max){if(nbr<min){return min;}else if(nbr>max){return max;}else{return nbr;}}", "calc_range() {\n let z = this.zoom / this.drug.z\n let zk = (1 / z - 1) / 2\n\n let range = this.y_range.slice()\n let delta = range[0] - range[1]\n range[0] = range[0] + delta * zk\n range[1] = range[1] - delta * zk\n\n return range\n }", "function calcRange(low, high, factor) {\n\t\tvar j = 0;\n\t\tvar ticks = new Array();\n\t\tvar step = Math.ceil((high - low) / 50) * 5 * factor;\n\t\tvar min = ((low == 0) ? 0 : (low - (low + 1) % step - step + 1));\n\t\tvar max = high - (high - 1) % step + step - 1;\n\t\tfor (i = min; i <= max; i += step) {\n\t\t\tticks[j++] = i;\n\t\t}\n\t\tvar range = {\"min\": min, \"max\": max, \"ticks\": ticks};\n\t\treturn range;\n\t}", "function inss(renda) {\n let aliquota=0.00;\n let v_max=642.34;\n if(renda<=1751.81){\n aliquota=(renda*8)/100;\n }else if(renda>1751.81 && renda<=2919.72){\n aliquota=(renda*9)/100;\n }else if (renda>2919.72 && renda<=5839.45) {\n aliquota=(renda*11)/100;\n }else{\n aliquota= v_max;\n }\n let aliquota_arredondada=parseFloat(aliquota.toFixed(2));\n return aliquota_arredondada;\n}", "function displayPartialContribution(singleStatusBool, senario, ageBool) {\n console.log(\"displayPartialContribution function\");\n var output = document.getElementById(\"show_Contribution_Limit\");\n var ira_slider = document.getElementById(\"contribution_Range\");\n var partialLimit;\n var underLimit;\n var division;\n var each = \"\";\n\n if (singleStatusBool == true && ageBool == false) {\n partialLimit = 6000;\n underLimit = 122000;\n division = 15000;\n } else if (singleStatusBool == true && ageBool == true) {\n partialLimit = 7000;\n underLimit = 122000;\n division = 15000;\n } else if (singleStatusBool == false && senario == 1) {\n partialLimit = 6000;\n underLimit = 193000;\n division = 10000;\n each = \" each\";\n } else if (singleStatusBool == false && senario == 2) {\n partialLimit = 7000;\n underLimit = 193000;\n division = 10000;\n each = \" each\";\n } else if (singleStatusBool == false && senario == 3) {\n partialLimit = 6500;\n underLimit = 193000;\n division = 10000;\n each = \" each\";\n }\n\n console.log(ira_slider.value);\n var ira_max = (ira_slider.value - underLimit);\n console.log(ira_max);\n ira_max = (ira_max / division);\n console.log(ira_max);\n ira_max = (1 - ira_max);\n console.log(ira_max);\n ira_max = (ira_max * partialLimit);\n console.log(ira_max);\n output.innerHTML = \"$\" + ira_slider.value + \"<br>\" + \"Eligible Contribution: $\" + Math.abs(ira_max).toFixed(2) + each;\n}", "quotaMysWPass(){\n return math.chain(+this.props.numLocalEmp || 0).multiply(0.666667).floor().done();\n }", "function sec_natural(limit) {\n let result = 0;\n for (let i=1;i<=limit;i++) {\n result += Math.pow(i,2);\n }\n\n return result;\n}", "function get_membership_value(input_value, max_member_value, left_range = 0, right_range = 0, min_f_value = 0, max_f_value = Number.POSITIVE_INFINITY){\n let y = 0\n // las funciones pueden tener mas de un peak\n if (typeof max_member_value != \"number\") {\n const max_array = [...max_member_value]\n const leftr_arr = [...left_range]\n const rightr_arr = [...right_range]\n max_array.forEach(peak => {\n const peak_index = max_array.indexOf(peak)\n if ((input_value >= (peak - leftr_arr[peak_index])) & ((peak + rightr_arr[peak_index]) >= input_value)) {\n max_member_value = peak\n left_range = leftr_arr[peak_index]\n right_range = rightr_arr[peak_index]\n }\n });\n }\n if (typeof max_member_value != \"number\") return 0 //si para cuando ya paso la validacion anterior y max_member_value sigue apareciendo como array, es que el input no esta dentro del rango de valores != 0\n if (input_value === max_member_value) return 1 // si el input es el punto de inflexion\n // si el valor input se encuentra dentro de los valores con pertenencia 0 (fuera de los valores con pendiente)\n if ((input_value >= min_f_value & (input_value <= max_member_value - left_range)) | ((input_value <= max_f_value) & input_value >= (max_member_value + right_range))) {\n return 0\n }\n // si el valor input esta dentro de los valores con pendiente\n //por el lado izquierdo\n if ((input_value >= (max_member_value - left_range) & (input_value < max_member_value))) {\n // obtener la pendiente del lado izquierdo\n var m = 1 / (max_member_value - (max_member_value - left_range))\n }\n //por el lado derecho\n else if ((input_value > max_member_value) & ((max_member_value + right_range) >= input_value)){\n var m = -1 / ((max_member_value + right_range) - max_member_value)\n }\n let b = 1 - (m * max_member_value)\n y = (m * input_value) + b\n return y \n}", "function getRandomNumberFromRange2(start,end) {\n if(!isNumberWhole(start) || !isNumberWhole(end)) {\n return -1;\n }\n\n var startDigitCount = start.toString().length,\n endDigitCount = end.toString().length,\n multiplier = 0,\n result = 0,\n switchOk = 0;\n\n if (startDigitCount > endDigitCount) // поменяем местами\n {\n var temp = endDigitCount;\n endDigitCount = startDigitCount;\n startDigitCount = temp;\n }\n\n if(startDigitCount === endDigitCount) {\n for(var j = 0; j < 1; j++) {\n result = getRandomNumberByPos(startDigitCount);\n if(result >= start && result <= end) {\n return result;\n } else {\n j = -1;\n continue;\n }\n }\n }\n\n if(startDigitCount < endDigitCount) {\n for(var i = startDigitCount; i<= endDigitCount; i++) {\n if(i === endDigitCount) { // если это последняя итерация берем то, что есть\n result = getRandomNumberByPos(i);\n if(result >= start && result <= end) {\n return result;\n } else {\n i = startDigitCount - 1;\n continue;\n }\n }\n if(getRandomNumberByPos(1) < 5) {\n result = getRandomNumberByPos(i);\n if(result >= start && result <= end) {\n return result;\n } else {\n i = startDigitCount - 1;\n continue;\n }\n } else {\n continue;\n }\n\n }\n }\n}", "function between(a, b) {\n // your code here\n let array = []\n let min = Math.min(a,b)\n let max = Math.max(a,b)\n for(let i=min; i<=max; i++){\n array.push(i)\n }\n return array\n\n}", "static range(min, max){\n\n let l = [];\n for(let i=min; i < max; i++) l.push(i);\n return l;\n\n }", "function locRange(min, max) {\n let buffer = Math.ceil((max - min) / 10) \n const values = [min]\n for (let i = 1; i < 11; i++) {\n values[i] = values[i - 1] + buffer\n }\n return values\n}", "function numbers() {\n //Minimum 5, 2 each side of index...\n var i, min, max, res, cnt = pageCount;\n\n min = $scope.options.index - 4;\n max = $scope.options.index + 4;\n\n if (min < 0) {\n max = max - min;\n min = 0;\n } else if (max >= cnt) {\n min = min - (max - cnt + 1);\n max = cnt - 1;\n }\n if (min < 0) {\n min = 0;\n }\n if (max >= cnt) {\n max = cnt - 1;\n }\n\n res = [];\n for (i = min; i <= max; i++) {\n res.push(i + 1);\n }\n return res;\n }", "getValuePerPx(range, pxRange) {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const result = new JQX.Utilities.BigNumber(range).divide(pxRange);\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n return result;\n }", "function quantize(v) {\n var min = parseFloat(minmax_boxes[0].value);\n var max = parseFloat(minmax_boxes[1].value);\n var step = parseFloat(minmax_boxes[2].value);\n\n v = min + Math.round((v - min) / step) * step;\n if (isNaN(v)) return v;\n if (v > max) v = max;\n if (v < min) v = min;\n return v;\n}", "_getRange() {\n const that = this;\n\n if (that.logarithmicScale) {\n that._range = that._drawMax - that._drawMin;\n return;\n }\n\n if (that.scaleType === 'floatingPoint') {\n that._range = (that._drawMax - that._drawMin).toString();\n }\n else {\n that._range = new JQX.Utilities.BigNumber(that._drawMax).subtract(that._drawMin).toString();\n }\n }", "function range(start, end) {\n // YOUR CODE GOES BELOW HERE //\n //first i am going to make an array to hold the numbers .pushed into it for the range function\n var rangeArray = [];\n //here i am making a loop that will decide in which order the number will be returned \n \n if(start < end){\n for(var i = start; i <= end; i++){\n rangeArray.push(i);\n }\n }else{\n for(var i = start; i >= end; i--){\n rangeArray.push(i);\n }\n }\n // i am returning range array so that it will hold the new output data\n return (rangeArray); \n \n \n // YOUR CODE GOES ABOVE HERE //\n}", "function setN2Range() {\n minValue2 = Number(document.getElementById('low2').value);\n maxValue2 = Number(document.getElementById('high2').value);\n}", "function maxAndMinNextValue(minSoFar,total,level)\n{\nvar quotient = Math.floor(total/level)\nvar dividend = total%level\n//th\n//because the level is greater than one we can spread the total over the remaining slots\n//the -1 is because we are putting one in every slot accept the one we are concerned with\n//making the others one tells us this max\nvar maxCandidateByWhatsLeve = total-((level*1)-1)\n//This value cannot be larger than the smallest so far\nvar max = (minSoFar<maxCandidateByWhatsLeve)?minSoFar:maxCandidateByWhatsLeve;\nvar min = quotient+((dividend>0)?1:0);\nreturn [min,max];\n}", "rangeMapping(value, from, to) {\n return Math.floor(to[0] + (value - from[0]) * (to[1] - to[0]) / (from[1] - from[0]));\n }", "function calculate_respondable(values) {\r\n if(isNaN(values.fleschKincaidGradeLevel)) {\r\n return 0;\r\n }\r\n values.gradeLevel = values.fleschKincaidGradeLevel;\r\n return values.questionCount<=.5?values.wordCount<=8.5?values.wordCount<=1.5?values.subjectWordCount<=1.5?.0733218726262:values.wordCount<=.5?values.subjectWordCount<=3.5?.122914695147:values.subjectWordCount<=6.5?.145072640304:.136819773707:.198588629296:values.subjectWordCount<=1.5?.183093642547:values.gradeLevel<=-.5?.233720662678:values.gradeLevel<=6.60000038147?values.wordCount<=5.5?.298683848408:.331874554526:.239006626723:values.subjectWordCount<=8.5?values.wordCount<=27.5?values.gradeLevel<=9.55000019073?values.subjectWordCount<=1.5?.293673297115:values.wordCount<=14.5?.364595175403:.404888696187:values.subjectWordCount<=2.5?.222421363921:values.wordCount<=18.5?.270453843779:.310890101508:values.gradeLevel<=8.35000038147?values.wordCount<=42.5?values.gradeLevel<=6.94999980927?.440158977657:.342750033472:values.subjectWordCount<=5.5?.488104735817:.444063461816:values.gradeLevel<=12.6499996185?values.wordCount<=45.5?.368664498767:.422755603703:values.subjectWordCount<=2.5?.301067569327:.362248185477:values.subjectWordCount<=11.5?values.gradeLevel<=7.55000019073?values.gradeLevel<=5.75?values.wordCount<=27.5?.358084714549:.395812603648:.349450481024:values.wordCount<=51.5?.279985077411:.32959622704:values.wordCount<=45.5?values.gradeLevel<=5.25?.353435874737:.283088917765:values.subjectWordCount<=14.5?.274152329667:.217044023225:values.gradeLevel<=5.25?values.wordCount<=6.5?.420758888124:values.wordCount<=128.5?values.wordCount<=77.5?values.subjectWordCount<=6.5?values.subjectWordCount<=2.5?.67648619614:.709810436737:values.subjectWordCount<=8.5?.677379753211:.650595011842:values.questionCount<=1.5?.614993253257:.678938269094:values.wordCount<=225.5?.594625955588:.536892361111:values.subjectWordCount<=7.5?values.gradeLevel<=15.0500001907?values.wordCount<=217.5?values.gradeLevel<=6.15000009537?values.wordCount<=57.5?.419728703201:.650999617694:values.gradeLevel<=9.94999980927?.643357674014:.570643437792:values.gradeLevel<=8.35000038147?values.questionCount<=2.5?.527971302363:.564875018061:.498302465998:.35612802498:values.subjectWordCount<=11.5?values.wordCount<=219.5?values.wordCount<=57.5?.436006795099:.556456089708:.413799723545:.371808875454;\r\n }", "function MaxX() {\r\n return 20 ;\r\n}", "function fgetMaxValue(){\r\n\treturn 100;\r\n}", "function getRange( from, to ){\t\t\n\t\treturn ( ( convertToMinute( to )-convertToMinute( from ) )/15 );\n\t}", "function calculateRange(upperOrLower, series) {\n if (upperOrLower === 'upper') {\n highestPoint = _.max(_.pluck(series, 'y'))\n return Math.ceil(highestPoint/5)*5;\n }\n else if (upperOrLower === 'lower') {\n lowestPoint = _.min(_.pluck(series, 'y'))\n return Math.floor(lowestPoint/5)*5;\n }\n else {\n return 0;\n }\n }", "function main() {\n const v1 = [];\n for (let v11 = 0; v11 < 7; v11++) {\n for (let v16 = 0; v16 != 100; v16++) {}\n for (let v18 = -0.0; v18 < 7; v18 = v18 || 13.37) {\n const v21 = Math.max(-339,v18);\n v1.fill();\n undefined % v21;\n }\n }\n}", "static range(min, max){\n \n let l = [];\n for(let i=min; i < max; i++) l.push(i);\n return l;\n \n }", "clamp(min, max) {\r\n if (this.data < min) return FNumber(min)\r\n if (this.data > max) return FNumber(max)\r\n\r\n return FNumber(this.data)\r\n }", "calculateRange() {\n if (!this.grid || !this.grid[0]) {\n return\n }\n let rows = this.grid.length\n let cols = this.grid[0].length\n // const vectors = [];\n let min\n let max\n // @from: https://stackoverflow.com/questions/13544476/how-to-find-max-and-min-in-array-using-minimum-comparisons\n for (let j = 0; j < rows; j++) {\n for (let i = 0; i < cols; i++) {\n let vec = this.grid[j][i]\n if (vec !== null) {\n let val = vec.m || vec.magnitude()\n // vectors.push();\n if (min === undefined) {\n min = val\n } else if (max === undefined) {\n max = val\n // update min max\n // 1. Pick 2 elements(a, b), compare them. (say a > b)\n min = Math.min(min, max)\n max = Math.max(min, max)\n } else {\n // 2. Update min by comparing (min, b)\n // 3. Update max by comparing (max, a)\n min = Math.min(val, min)\n max = Math.max(val, max)\n }\n }\n }\n }\n return [min, max]\n }", "function getSum( a,b ) {\n let min = Math.min(a,b);\n let max = Math.max(a,b);\n let sum = 0;\n if (min >= 0) {\n while (max-min >= 1) {\n sum = sum + max;\n max--;\n }\n } else if (min < 0) {\n while (-min-max >= 1) {\n sum += max;\n max--;\n }\n }\n\n \n \n console.log(min, max, sum)\n \n return;\n}", "function valeurAbsolue(n){\n return Math.abs(n);\n}", "function range(start, end, step=1) {\n // Your code here\n var numRange = [];\n if(start <= end) {\n \n for(var i = start; i <= end; i+=step) {\n numRange.push(i);\n }\n }\n else {\n for(var j = start; j >= end; j+=step){\n numRange.push(j);\n }\n }\n return numRange;\n}", "require_range(min,max,value, field_name=\"\"){\n\t if (this.is_empty(value) ){ return value; }\n\t var number = this.to_number(value);\n\t if (value < min || value > max) {\n\t throw new Error(`out of range ${value} ${field_name} ${value}`);\n\t }\n\t return value;\n\t }", "get value(){ \r\n return { \r\n min : this._value[ 0 ], \r\n max : this._value[ 1 ]\r\n };\r\n }", "function valueGenerator(start, end,actual) {\n var totalTime = (end.getTime() - start.getTime());\n var actualTime = actual.getTime()-start.getTime();\n if(actualTime > totalTime/2){\n actualTime -= ((actualTime - totalTime/2)*2)\n }\n return Math.pow(1.278,Math.log((actualTime)/10));\n }", "function getVideoDuration(){\n var durian=document.getElementById('videoAction').duration;\n console.log(parseInt(durian));\n if(parseInt(durian)){\n\n if(document.getElementById('range-1b').max!=Math.ceil(durian)){\n document.getElementById('range-1b').value=Math.ceil(durian);\n document.getElementById('range-1b').max=Math.ceil(durian);\n document.getElementById('range-1a').max=Math.ceil(durian);\n }\n\n return Math.ceil(durian);\n\n }\n else\n return 100;\n}", "function calculate_respondable(values) {\r\n if (isNaN(values.fleschKincaidGradeLevel)) {\r\n return 0;\r\n }\r\n values.gradeLevel = values.fleschKincaidGradeLevel;\r\n return values.questionCount <= .5 ? values.wordCount <= 8.5 ? values.wordCount <= 1.5 ? values.subjectWordCount <= 1.5 ? .0733218726262 : values.wordCount <= .5 ? values.subjectWordCount <= 3.5 ? .122914695147 : values.subjectWordCount <= 6.5 ? .145072640304 : .136819773707 : .198588629296 : values.subjectWordCount <= 1.5 ? .183093642547 : values.gradeLevel <= -.5 ? .233720662678 : values.gradeLevel <= 6.60000038147 ? values.wordCount <= 5.5 ? .298683848408 : .331874554526 : .239006626723 : values.subjectWordCount <= 8.5 ? values.wordCount <= 27.5 ? values.gradeLevel <= 9.55000019073 ? values.subjectWordCount <= 1.5 ? .293673297115 : values.wordCount <= 14.5 ? .364595175403 : .404888696187 : values.subjectWordCount <= 2.5 ? .222421363921 : values.wordCount <= 18.5 ? .270453843779 : .310890101508 : values.gradeLevel <= 8.35000038147 ? values.wordCount <= 42.5 ? values.gradeLevel <= 6.94999980927 ? .440158977657 : .342750033472 : values.subjectWordCount <= 5.5 ? .488104735817 : .444063461816 : values.gradeLevel <= 12.6499996185 ? values.wordCount <= 45.5 ? .368664498767 : .422755603703 : values.subjectWordCount <= 2.5 ? .301067569327 : .362248185477 : values.subjectWordCount <= 11.5 ? values.gradeLevel <= 7.55000019073 ? values.gradeLevel <= 5.75 ? values.wordCount <= 27.5 ? .358084714549 : .395812603648 : .349450481024 : values.wordCount <= 51.5 ? .279985077411 : .32959622704 : values.wordCount <= 45.5 ? values.gradeLevel <= 5.25 ? .353435874737 : .283088917765 : values.subjectWordCount <= 14.5 ? .274152329667 : .217044023225 : values.gradeLevel <= 5.25 ? values.wordCount <= 6.5 ? .420758888124 : values.wordCount <= 128.5 ? values.wordCount <= 77.5 ? values.subjectWordCount <= 6.5 ? values.subjectWordCount <= 2.5 ? .67648619614 : .709810436737 : values.subjectWordCount <= 8.5 ? .677379753211 : .650595011842 : values.questionCount <= 1.5 ? .614993253257 : .678938269094 : values.wordCount <= 225.5 ? .594625955588 : .536892361111 : values.subjectWordCount <= 7.5 ? values.gradeLevel <= 15.0500001907 ? values.wordCount <= 217.5 ? values.gradeLevel <= 6.15000009537 ? values.wordCount <= 57.5 ? .419728703201 : .650999617694 : values.gradeLevel <= 9.94999980927 ? .643357674014 : .570643437792 : values.gradeLevel <= 8.35000038147 ? values.questionCount <= 2.5 ? .527971302363 : .564875018061 : .498302465998 : .35612802498 : values.subjectWordCount <= 11.5 ? values.wordCount <= 219.5 ? values.wordCount <= 57.5 ? .436006795099 : .556456089708 : .413799723545 : .371808875454;\r\n }", "Es(){\r\n return 29000\r\n }", "function linspace(d1,d2,n) {\n \n j=0;\n var L = new Array();\n \n while (j<=(n-1)) {\n \n var tmp1 = j*(d2-d1)/(Math.floor(n)-1);\n var tmp2 = Math.ceil((d1+tmp1)*10000)/10000;\n L.push(tmp2);\n j=j+1;\n }\n \n return L;\n }", "function setMinAndMaxRange(e) {\n e.preventDefault();\n var minRangeValue = parseInt(minRangeInput.value);\n var maxRangeValue = parseInt(maxRangeInput.value);\n minNumber.innerText = minRangeValue;\n maxNumber.innerText = maxRangeValue;\n minNumber.style.fontWeight = 'bold';\n maxNumber.style.fontWeight = 'bold';\n console.log(minRangeValue);\n console.log(maxRangeValue);\n generateRandomNumber(minRangeValue, maxRangeValue);\n displayRangeError();\n}", "function getRecommendValue(a, b) {\n let x = a > b ? b : a\n let y = 0\n\n if (x >= 4000) {\n y = x * 0.015\n } else if (x >= 2000) {\n y = x * 0.013\n } else if (x >= 1000) {\n y = x * 0.011\n } else if (x >= 300) {\n y = x * 0.010\n }\n\n return y\n}", "function getIntegralResult() {\n let total = 0,\n step = 0.01;\n for (let x = x_from; x < x_to; x += step) {\n total += Math.pow(x + step / 2, 0.5) * step;\n }\n return total;\n }", "calcNumbers() {\n this._numbers = [];\n for (let i = this._start; i <= this._end; i++) {\n this._numbers.push(i);\n }\n }", "function mysteryRange(inputString,range){\n let inRange = []//List of Accepted Integers\n let stringArray = inputString.split(\"\")\n let intArray = stringToInt(stringArray) //Converts the input string to a list of numbers\n //Scans list to compare numbers\n for (let x = 0; x < intArray.length-1; x++){\n let currentInt = intArray[x]\n let nextNumber = 1\n // [['6291211413114538107',14],[1,14]], \n if (checkRange(currentInt,intArray[x+nextNumber],range) && x != intArray.length-2 && x < intArray.length-1){\n let newNumber = concatNumbers(currentInt,intArray[x+nextNumber])\n nextNumber++ \n if (checkRange(newNumber, intArray[x+nextNumber], range)) {\n let newNumber2 = concatNumbers(newNumber, intArray[x+nextNumber])\n nextNumber++ \n if (checkRange(newNumber2, intArray[x+nextNumber], range)) {\n let newNumber3 = concatNumbers(newNumber2, intArray[x+nextNumber]) \n }\n else {\n // newNumber inRange, push currentInt\n if (inRange.includes(newNumber)) {\n inRange.push(currentInt)\n } else {\n inRange.push(parseInt(newNumber))\n x++ \n }\n }\n }\n else {\n // inRange.push(currentInt) //currentInt\n if ((Math.abs(newNumber - getMin(inRange)) < range )){\n inRange.push(newNumber)\n x++\n }else{\n inRange.push(currentInt)\n }\n }\n } else {\n inRange.push(currentInt)\n }\n }\n inRange.push(intArray[intArray.length-1])\n \n let minVal = Math.min.apply(null, inRange)\n let maxVal = Math.max.apply(null, inRange)\n let minMax = []\n minMax.push(minVal, maxVal)\n //console.log(\"minMax: \" + minMax)\n return minMax\n}", "range(max, min){\n let num = Math.round(Math.random()*(min-max)+max);\n return num;\n}", "function rangeTotal(n1, n2) {\n var list = [];\n var sum = 0\n for (let index = n1; index <= n2; index++) {\n list.push(index);\n }\n for (let index = 0; index < list.length; index++) {\n const element = list[index];\n sum += element;\n }\n return sum\n\n\n\n}", "function getLimits() {\n\t\tvar limitMax = parseInt($(\"#limit\").val());\n\t\tvar limitMin = limitMax - (TITLE_LIMIT-1);\n\t\tvar limits = [limitMin, limitMax+1]; // add 1 to account for array 0 index\n\t\treturn limits;\n\t}", "function setRange () {\n event.preventDefault();\n\n minInputValue = document.getElementById( 'minInput' ).value;\n maxInputValue = document.getElementById( 'maxInput' ).value;\n\n minInput = parseInt( minInputValue );\n maxInput = parseInt( maxInputValue );\n\n solution = generateRandomNumber( minInput, maxInput );\n}", "function getLimit() {\n\tvar max = 9;\n\tfor (var i = 1; sumOfDigits(max) >= Math.pow(10, i); i++, max *= 10, max += 9) ;// console.log(sumOfDigits(max), Math.pow(10, i));\n\n\treturn Math.pow(10, i);\n}", "_a(){\n\t\t\treturn Math.max(Math.min(0.1*this.B,0.4*this.z),0.04*this.B,3)\n }", "function convertRange( value, r1, r2 ) {\n return ( value - r1[ 0 ] ) * ( r2[ 1 ] - r2[ 0 ] ) / ( r1[ 1 ] - r1[ 0 ] ) + r2[ 0 ];\n }", "__range(start, end) {\n\n let value = tf.linspace(start, end, (end - start) + 1).arraySync();\n return value;\n }", "getRandomNumberWithinRange(rangeMin, rangeMax, bits) {\n bits = bits || 2;\n\n // Create byte array and fill with 1 random number\n var byteArray = new Uint8Array(bits);\n\n byteArray = window.crypto.getRandomValues(byteArray);\n\n var sum = byteArray.reduce(this.add.bind(this), 0);\n\n // console.log('byteArray:', byteArray);\n // console.log('sum', sum);\n\n var randNum = sum * (rangeMax.toFixed(0).length + 3) + (1 * Math.random()) + Math.random();\n var range = rangeMax - rangeMin + 1;\n var max = Math.floor(rangeMax / range) * range;\n\n if (randNum >= max) {\n randNum = this.getRandomNumberWithinRange(rangeMin, rangeMax);\n }\n\n return rangeMin + (randNum % range);\n }", "function extendRange(range_arr, extend_coef) {\n var max = range_arr[1];\n var min = range_arr[0];\n max = max + Math.abs(max) * extend_coef;\n min = min - Math.abs(min) * extend_coef;\n var extended_arr = [min, max];\n return extended_arr;\n\n}", "function getPelnas() {\nvar pajamos = 12500;\nvar islaidos = 18500;\nvar pelnas = pajamos - islaidos;\nreturn pelnas;\n}", "getComeGoal(max_value, value, current_value) {\n\n var temp = parseInt(current_value) + parseInt(value);\n if (temp < 0) {\n return 0;\n }\n if (temp >= max_value) {\n return max_value;\n } else {\n return temp;\n }\n }", "function __WEBPACK_DEFAULT_EXPORT__(range, min, max) {\n var lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n\n return span >= (max - min)\n ? [min, max]\n : [\n (lo = Math.min(Math.max(lo, min), max - span)),\n lo + span\n ];\n}", "function valores(){\n var valor1 = 3;\n var valor2 = 18;\n var valor3 = 10;\n var max;\n var min;\n var suma; \n var prom;\n\n console.log(\"Suma de los tres valores: \")\n console.log(suma = valor1 + valor2 + valor3);\n \n console.log(\"Promedio de los tres valores: \")\n console.log(prom = suma / 3);\n\n console.log(\"Valor Maximo: \")\n console.log(max = Math.max(valor1, valor2, valor3));\n\n console.log(\"Valor Minimo: \")\n console.log(min = Math.min(valor1, valor2, valor3));\n\n}", "function m_ln(x){ // x>0\r\n var xx=x;\r\n var xxabs = Number(m_abs(xx)); //轉數字\r\n\r\n\r\n if ( xx == 0){ var ans_t = message_1(13); return ans_t; }\r\n if ( xx < 0) { var ans_t =message_1(5); return ans_t; }\r\n\r\n\r\n \r\n\r\n var ee = 2.718281828459045235360287471353; //常數\r\n var count_m = m_cut_nub_m(xxabs); // count 整數位數 >0 位數 , 含 -符號\r\n \r\n\r\n var count_p = m_cut_nub_p(xxabs); // count 小數位數 <0 位數 , 不含 -符號 不含 point\r\n \r\n\r\n var count_t = count_m+count_p+1;\r\n var ans_0 = 0;\r\n\r\n \r\n\r\n var ee_10 =m_pow_m(ee,10); //ee 10次方 = 22026.465794806707\r\n var ee_7 =m_pow_m(ee,7); // ee 7次方 = 1096.633158428458\r\n var ee_5 =m_pow_m(ee,5); // ee 5次方 = 148.4131591025766\r\n var ee_3 =m_pow_m(ee,3); //ee 3次方 = 20.08553692318766 //ee =2.718281828459045\r\n\r\n \r\n\r\n while(xxabs >= ee_10){\r\n //快數取出10 的指數部分 \r\n xxabs = xxabs/ee_10;\r\n ans_0=ans_0+10;\r\n \r\n }\r\n\r\n\r\n while(xxabs >= ee_7){\r\n //快數取出10 的指數部分 \r\n xxabs = xxabs/ee_7;\r\n ans_0=ans_0+7;\r\n \r\n \r\n }\r\n\r\n while(xxabs >= ee_5){\r\n //快數取出5 的指數部分 \r\n xxabs = xxabs/ee_5;\r\n ans_0=ans_0+5;\r\n \r\n }\r\n\r\n while(xxabs >= ee_3){\r\n //快數取出5 的指數部分 \r\n xxabs = xxabs/ee_3;\r\n ans_0=ans_0+3;\r\n \r\n }\r\n\r\n\r\n\r\n while(xxabs >= ee){ //ee=2.718281828459045\r\n //取出1 的指數部分 +5 增加回圈數\r\n xxabs = xxabs/ee;\r\n ans_0=ans_0+1;\r\n \r\n }\r\n\r\n\r\n while(xxabs > 1.5 && xxabs < ee){ \r\n \r\n //取出1 的指數部分\r\n xxabs = (xxabs)/(ee); \r\n ans_0=ans_0 + 1;\r\n \r\n }\r\n\r\n \r\n \r\n\r\n\r\n\r\n while(xxabs < 0.00005 ){ \r\n //取出1 的指數部分\r\n xxabs = (xxabs)*(ee_10); \r\n ans_0=ans_0 - 10;\r\n \r\n }\r\n\r\n\r\n\r\n\r\n\r\n while(xxabs < 0.5 ){ \r\n //取出1 的指數部分\r\n xxabs = (xxabs)*(ee); \r\n ans_0=ans_0 - 1;\r\n\r\n }\r\n\r\n\r\n\r\n\r\n var ans_1 = m_series_ln_a_z(xxabs) ; //由公式作法 0.5 < xxabs <1.5 \r\n \r\n \r\n var ans_t =ans_0 + ans_1;\r\n\r\n if(xx<0){ //負值\r\n ans_t=1.0/ans_t; \r\n }\r\n \r\n\r\n \r\n return ans_t;\r\n}", "function getMaximumJavascriptInt() {\n return 9007199254740992; // 2^53\n }", "function range(max)\n{\n var retVal =[]\n for (var i=0; i<max; i++)\n {\n retVal.push(i*2); //retVal[i]= i*2\n }\n return retVal;\n}", "function mathOperations(arr){\n let max = arr[0],min=arr[0]\n\n for(let i = 0;i<arr.length;i++){\n if(arr[i]>max){\n max = arr[i]\n }\n if(arr[i]<min){\n min = arr[i]\n }\n }\n\n console.log(\"MAX = \" + max)\n\n console.log(\"Min = \" + min)\n\n console.log(\"Range = \" + (max-min))\n}", "function getLinearTickPositions(arr,$maxPart,$cfg) {\n \tvar scale = $cfg && $cfg.scale ? parseFloat($cfg.scale) :1\n\n\t\tif(isNaN(scale)){\n\t\t\tscale = 1\n\t\t}\n // var max = arrayMax(arr);\n var max = Math.max.apply(null,arr)\n var initMax = max\n max *= scale\n // var min = arrayMin(arr);\n var min = Math.min.apply(null,arr) \n\n if(min==max){\n \tif(max>=0){\n \t\tmin= 0\n \t\t// min= Math.round(max/2);\n \t}\n \telse{\n \t\tmin=max*2;\n \t}\n }\n\n var length = max - min;\n if (length) {\n \tvar tempmin = min //保证min>0的时候不会出现负数\n \tmin -= length * 0.05;\n // S.log(min +\":\"+ tempmin)\n if(min<0 && tempmin>=0){\n \tmin=0\n }\n max += length * 0.05;\n }\n \n var tickInterval = (max - min) * 72 / 365;\n var magnitude = Math.pow(10, Math.floor(Math.log(tickInterval) / Math.LN10));\n\n tickInterval = normalizeTickInterval(tickInterval, magnitude);\n\n var pos,\n lastPos,\n roundedMin = correctFloat(Math.floor(min / tickInterval) * tickInterval),\n roundedMax = correctFloat(Math.ceil(max / tickInterval) * tickInterval),\n tickPositions = [];\n\n // Populate the intermediate values\n pos = roundedMin;\n while (pos <= roundedMax) {\n\n // Place the tick on the rounded value\n tickPositions.push(pos);\n\n // Always add the raw tickInterval, not the corrected one.\n pos = correctFloat(pos + tickInterval) \n\n // If the interval is not big enough in the current min - max range to actually increase\n // the loop variable, we need to break out to prevent endless loop. Issue #619\n if (pos === lastPos) {\n break;\n }\n\n // Record the last value\n lastPos = pos;\n }\n if(tickPositions.length >= 3){\n \tif(tickPositions[tickPositions.length - 2] >= initMax){\n\t\t\t\ttickPositions.pop()\n\t\t\t}\n }\n return tickPositions;\n }", "function gradi_360(angolo){\n\n // angolo in gradi sessadecimali.\n // riporta l'angolo all'interno dell'intervallo 0° - 360° \n \n if (angolo>360){ while (angolo>360) {angolo=angolo-360;} }\n\nelse if (angolo<0 ){ while (angolo<0) {angolo=angolo+360;} }\n\n\nreturn angolo;\n\n}", "function range(start,end) {\n\n const resultArray=[];\n const arraySize = Math.abs(end - start) + 1;\n\n for (let i=0 ; i<arraySize ; i++) {\n\n if (start<end) {\n resultArray.push(start+i);\n } else {\n resultArray.push(start-i);\n }\n \n }\n console.log(resultArray);\n return resultArray;\n}", "function iRandomRangeBell(min,max,v){\n //v is the number of time random is summed and should be >= 1\n var num = 0;\n for(var i = v; i > 0; i--){\n num += Math.random();\n }\n num = num/v;\n var range = max-min+1;\n num = Math.floor(num*range)+min;\n return num;\n}", "function calculate_minmax(data) {\n\n bound = [];\n bound.max = Math.max.apply(Math, data);\n bound.min = Math.min.apply(Math, data);\n return bound;\n\n}", "function t(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}", "function t(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}", "function t(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}", "function generateRange(min, max, step){\n //varible declaration named narray set empty\n let narray = [];\n //for loop let i assigned to min; i less or \n //equal to max; i plus equals step\n for(let i = min; i <= max; i += step){\n //narray push method with i as parameter\n narray.push(i)\n }\n //return narray;\n return narray;\n }", "quotaWPassTier3(){\n return math.chain(this.totalEmp()).multiply(math.bignumber(0.15)).floor().done();\n }", "function range(start, end, step=1) {\n // Your code here\n var final_arr = [];\n if (step == 0) {\n return \"The range cannot have intervals of zero\";\n }\n else if (step < 0) {\n for (var i = start; i >= end; i += step) {\n final_arr.push(i);\n }\n }\n else {\n for (var i = start; i <= end; i += step) {\n final_arr.push(i);\n }\n } \n return final_arr;\n}", "function valueRange(){\r\n try {\r\n//Pega valor de segurança do input range \r\n \tvRange = document.getElementById('iRange').value;//pega valor do input range\r\n//Se valor igual \"0\" range fica off\r\n if(vRange == 0){var segrang = 'Off';}else{var segrang = vRange+' mt';}\r\n document.getElementById('vrange').innerHTML = segrang;//Imprime valor\r\n }catch(e){\r\n console.error('Range: '+ e);\r\n }\r\n}", "function minRange (num , range){\n\n\tif(num >= (range/2)){\n\t\n\t\treturn (num - (range/2));\n\t}else {\t\t\n\t\treturn 0;\n\t}\n}", "function ret_mix_range_ccr(idx , tmp_mix_arr){\n\n //get from setpoint bottom option\n var ppo2_bottom = document.getElementById(\"opt_setpoint_bottom\");\n\n //ppn max get from bailout settings\n var ppn2_max = document.getElementById(\"opt_ppn2_max\");\n\n var ppo2_bottom_idx = ppo2_bottom.options[ppo2_bottom.selectedIndex].value;\n var ppn2_max_idx = ppn2_max.options[ppn2_max.selectedIndex].value;\n var tmp_arr = [];\n var a = 0;\n for(c = 0 ; c < tmp_mix_arr.length ; c++){\n if(c + 1 == idx){\n //get current mod for selected mix\n var depth_cur_mod = travel_mix_depth_arr[ret_mix_mod_idx(tmp_mix_arr[a] , tmp_mix_arr[a+1])] * 1.0;\n\n //check current Mix MOD status\n if(depth_cur_mod == 0) {\n //Auto\n //calculation of correction with altitude above sea level\n //console.log(1 / ((water_density_temperature_correction() * water_density() * 0.001 * (1)) - ((1 - height_to_bar()))));\n //calculation of correction without altitude above sea level\n var WaterDensTempCompensation = (1 / ((water_density_temperature_correction() * water_density() * 0.001 * (1))));\n\n dp_o2_max = (WaterDensTempCompensation * (ppo2_bottom_idx / (tmp_mix_arr[a] * 0.01) * 10)) - (10 * height_to_bar()) + 1;//+1m fixing rounding to standard\n dp_o2_min = 1;\n dp_ppn2_max = (WaterDensTempCompensation * (ppn2_max_idx / ((100 - tmp_mix_arr[a] - tmp_mix_arr[a + 1]) * 0.01) * 10)) - (10 * height_to_bar()) + 1;//+1m fixing rounding to standard\n\n //fix error if mix n2 > 95%\n if (dp_ppn2_max < 1) {\n dp_ppn2_max = 6;\n }\n }\n else{\n //Manual\n dp_o2_max = depth_cur_mod + 1;\n dp_o2_min = 1.0;//Always from one meter depth\n dp_ppn2_max = depth_cur_mod + 1;\n }\n\n tmp_arr.push(dp_o2_min);\n\n if (dp_ppn2_max >= dp_o2_max){\n tmp_arr.push(dp_o2_max);\n }\n else\n {\n tmp_arr.push(dp_ppn2_max);\n }\n break;\n }\n a = a + 2;\n }\n //tmp_arr[0] = 1;\n return tmp_arr;\n}", "function range(input,min,max) {\n\t\tif(min > max) { var x = min; min = max; max = x;}\n\t\treturn Math.max(Math.min(input,max),min);\n\t}", "function ret_mix_range_oc(idx , tmp_mix_arr){\n\n var ppo2_bottom = document.getElementById(\"opt_ppo2_bottom\");\n var ppo2_min = document.getElementById(\"opt_ppo2_min\");\n var ppn2_max = document.getElementById(\"opt_ppn2_max\");\n\n var ppo2_bottom_idx = ppo2_bottom.options[ppo2_bottom.selectedIndex].value;\n var ppo2_min_idx = ppo2_min.options[ppo2_min.selectedIndex].value;\n var ppn2_max_idx = ppn2_max.options[ppn2_max.selectedIndex].value;\n var tmp_arr = [];\n var a = 0;\n for(c = 0 ; c < tmp_mix_arr.length ; c++){\n\n\n\n if(c + 1 == idx){\n //get current mod for selected mix\n var depth_cur_mod = travel_mix_depth_arr[ret_mix_mod_idx(tmp_mix_arr[a] , tmp_mix_arr[a+1])] * 1.0;\n\n //check current Mix MOD status\n if(depth_cur_mod == 0){\n //Auto\n //calculation of correction with altitude above sea level\n //console.log(1 / ((water_density_temperature_correction() * water_density() * 0.001 * (1)) - ((1 - height_to_bar()))));\n //calculation of correction without altitude above sea level\n var WaterDensTempCompensation = (1 / ((water_density_temperature_correction() * water_density() * 0.001 * (1))));\n\n dp_o2_max = (WaterDensTempCompensation * (ppo2_bottom_idx/(tmp_mix_arr[a]*0.01)*10)) - (10 * height_to_bar()) + 1;//+1m fixing rounding to standard\n dp_o2_min = (WaterDensTempCompensation * (ppo2_min_idx/(tmp_mix_arr[a]*0.01)*10)) - (10*height_to_bar());\n if(dp_o2_min < 1){dp_o2_min = 1;}\n if(dp_o2_min == Infinity){dp_o2_min = 1;}\n dp_ppn2_max = (WaterDensTempCompensation * (ppn2_max_idx/((100-tmp_mix_arr[a]-tmp_mix_arr[a+1])*0.01)*10)) - (10*height_to_bar()) + 1;//+1m fixing rounding to standard\n }\n else{\n //Manual\n dp_o2_max = depth_cur_mod + 1;\n dp_o2_min = 1.0;//Always from one meter depth\n dp_ppn2_max = depth_cur_mod + 1;\n\n }\n\n tmp_arr.push(dp_o2_min);\n if (dp_ppn2_max >= dp_o2_max){\n tmp_arr.push(dp_o2_max);\n }\n else\n {\n tmp_arr.push(dp_ppn2_max);\n }\n break;\n }\n a = a + 2;\n }\n\n return tmp_arr;\n}", "function getRange() {\n let numberArray = [];\n for (let index = 1; index <= 100; index++) {\n numberArray.push(index);\n }\n\n return numberArray;\n}", "function minimumBribes(q) {\n // \n}", "loadVolumeLimits(jsnchrctr) {\n//---------------\nthis.volMin = V3.fromVec(jsnchrctr.volMin);\nreturn this.volMax = V3.fromVec(jsnchrctr.volMax);\n}", "function __WEBPACK_DEFAULT_EXPORT__(range, min, max) {\n var lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n\n return span >= (max - min)\n ? [min, max]\n : [\n Math.min(Math.max(lo, min), max - span),\n Math.min(Math.max(hi, span), max)\n ];\n}", "function infin_func() {\n document.getElementById(\"infinity\").innerHTML = 2E310 + \"<br>\" + -3E310;\n}", "function i(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}", "function i(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}", "function i(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}", "function checkValueModule() {\n var checkValueArray=['.checkValue_E_RT','.checkValue_c1_E_montant','.checkValue_c2_E_montant'];\n\n $(checkValueArray).each(function(i,v){\n var sum=0;\n var nb=0;\n $(v).each( function (i) {\n if ($(this).html() !=='') {\n sum+=parseFloat($(this).html());\n nb+=1;\n }\n } );\n\n checkValue_max=sum/nb + sum/nb*5/100;\n checkValue_min=sum/nb - sum/nb*5/100;\n\n $(v).each( function (i) {\n if ($(this).html()>checkValue_max && $(this).html() !=='') {\n $(this).addClass(\"checkValue_max\");\n }\n else if ($(this).html()<checkValue_min && $(this).html() !=='') {\n $(this).addClass(\"checkValue_min\");\n }\n else {\n $(this).removeClass(\"checkValue_max\");\n $(this).removeClass(\"checkValue_min\");\n }\n });\n });\n}", "function map(value, fromRangeMin, fromRangeMax, toRangeMin, toRangeMax) {\n return (value - fromRangeMin) * (toRangeMax - toRangeMin) / (fromRangeMax - fromRangeMin) + toRangeMin;\n }", "function increaseMinMax() {\n min -= 10;\n max += 10;\n }", "function number_user(ratio_moyen){\r\n \r\n //récupère le nombre de partage\r\n var nb_user = $('.partage').val();\r\n\r\n //indique le nombre total de personne connecter au partage\r\n $('.value_partage').text(nb_user);\r\n \r\n\r\n var ratio_moyen = parseInt(ratio_moyen);\r\n \r\n final_result = ratio_moyen*nb_user;\r\n\r\n // if (final_result >= 1000) {\r\n\r\n // final_result = final_result.substr(0,1);\r\n \r\n // return final_result;\r\n // }\r\n\r\n return final_result;\r\n }", "function smallestCommons(arr) {//locura\r\n //ordenamos el array\r\n let max\r\n let min\r\n//ordenamos\r\n if( arr[0]<arr[1]){\r\n min=arr[0]\r\n max=arr[1]\r\n }else {\r\n max=arr[0]\r\n min=arr[1]\r\n }\r\n //multiplos \r\n //obtenemos el array con el rango entre el min y el maximo\r\n function getRange(m, mx){\r\n let arrRange= []\r\n for(let i = min; i<=max; i++){\r\n arrRange.push(i)\r\n }\r\nreturn arrRange\r\n }\r\n let range= getRange(min, max)\r\n //console.log(range)\r\n let multiple= 1 //no podemos multiplicar por 0\r\n while(multiple<1000000){\r\n let mcm=(min*multiple)*max\r\n //miramos los que son divisibles en el rango\r\n\r\n let divTrue= 0\r\nfor(let i= 0;i <range.length;i++){\r\n //console.log(mcm, range)\r\n if(mcm % range[i]===0){\r\n divTrue+=1\r\n//console.log('divisible entre:',divTrue, 'rango',range.length)\r\n//divTrue nos dice cuando es divisible, en el caso de que sea divisible en todos los casos del rango, hemos encontrado la respuesta 6 es divisible entre 1, 2, 3, con resto 0. Por eso 6 es el minimoComunMultiplo del rango[1,2,3]\r\n if(divTrue===range.length){\r\n return mcm //retornamos el multiplo\r\n }\r\n }\r\n \r\n}\r\n multiple +=1\r\n }\r\nreturn ' Fuera de rango'\r\n}", "quotaWPassTier2(){\n return math.chain(this.totalEmp()).multiply(math.bignumber(0.15)).floor().done();\n }", "getValuePerPx(range, pxRange) {\n return parseFloat(range) / pxRange;\n }", "function ReturnArrayOf_MaxMin() {\r\n let numbers = EntryCheckForManyNumbers();\r\n let max = numbers [0]; \r\n let min = numbers [numbers.length-1] ;\r\n for (let i = 0; i < numbers.length; i++){\r\n if (max < numbers[i]) {\r\n max = numbers[i];\r\n }\r\n if ( min > numbers[i]) {\r\n min = numbers[i];\r\n }\r\n } \r\n let arrayFor_2_values = [];\r\n arrayFor_2_values.push(max);\r\n arrayFor_2_values.push(min);\r\n //console.log(numbers);\r\n //console.log(min, max);\r\n return arrayFor_2_values;\r\n }", "data() {\n return{\n numbers: [-5, 0, 2, -1, 1, 0.5]\n }\n \n }" ]
[ "0.649778", "0.6320112", "0.61650074", "0.613147", "0.61230487", "0.60909593", "0.60572994", "0.6048558", "0.6034542", "0.6025944", "0.5973581", "0.5958416", "0.592354", "0.591938", "0.5913903", "0.5909109", "0.59051394", "0.5900872", "0.5898595", "0.5877154", "0.58708274", "0.584517", "0.58291644", "0.58131826", "0.5793676", "0.57891375", "0.57852674", "0.57795835", "0.57734656", "0.57701916", "0.5761888", "0.57591015", "0.57470506", "0.5743529", "0.57431203", "0.57369226", "0.57350737", "0.570895", "0.5702079", "0.5698214", "0.5689249", "0.5688695", "0.5680719", "0.5672481", "0.5671062", "0.56571", "0.56558174", "0.5650393", "0.5648935", "0.5646976", "0.5638599", "0.56318754", "0.56315875", "0.5624992", "0.5619861", "0.5614415", "0.5610193", "0.56064355", "0.5603564", "0.5603093", "0.55979466", "0.5591892", "0.55902296", "0.55867964", "0.55826366", "0.5581282", "0.55755115", "0.5566286", "0.5560689", "0.55600387", "0.5558696", "0.5557843", "0.55568963", "0.5554321", "0.5554321", "0.5554321", "0.5553203", "0.5548241", "0.5547954", "0.55420953", "0.55343", "0.5530076", "0.55292225", "0.55236816", "0.5522624", "0.55179965", "0.55165493", "0.55162", "0.5513163", "0.5511639", "0.5511639", "0.5511639", "0.55091083", "0.5506906", "0.5498261", "0.5497348", "0.5496486", "0.54942626", "0.54887235", "0.54886967", "0.54879206" ]
0.0
-1
Overridden to use a webpacked decoder. Rather than preloading the wasmBinary and sending via the init message, shim the Emscripten module function to fetch it via locateFile:
async _initDecoder() { const workerSource = ` ${decoderModuleSource} var _DracoDecoderModule = DracoDecoderModule DracoDecoderModule = (config) => { config.locateFile = () => new URL('${decoderWasmPath}', self.origin).href; return _DracoDecoderModule(config); }; (${DRACOLoader.DRACOWorker}).call(self); ` const workerSourceBlob = new Blob([ workerSource ]) this.workerSourceURL = URL.createObjectURL(workerSourceBlob) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadWasmModuleAsync(moduleName, jsUrl, binaryUrl, doneCallback) {\n\t\tloadScriptAsync(jsUrl, function () {\n\t\t\tvar lib = window[moduleName];\n\t\t\twindow[moduleName + \"Lib\"] = lib;\n\t\t\tlib({\n\t\t\t\tlocateFile: function () {\n\t\t\t\t\treturn binaryUrl;\n\t\t\t\t},\n\t\t\t}).then(function (instance) {\n\t\t\t\twindow[moduleName] = instance;\n\t\t\t\tdoneCallback();\n\t\t\t});\n\t\t});\n\t}", "async function loadWASM(data) {\n if (isInitialized) {\n throw new Error(`Onigasm#init has been called and was succesful, subsequent calls are not allowed once initialized`);\n }\n if (typeof data === 'string') {\n const arrayBuffer = await (await fetch(data)).arrayBuffer();\n await initModule(arrayBuffer);\n }\n else if (data instanceof ArrayBuffer) {\n await initModule(data);\n }\n else {\n throw new TypeError(`Expected a string (URL of .wasm file) or ArrayBuffer (.wasm file itself) as first parameter`);\n }\n isInitialized = true;\n}", "async function loadWASM(data) {\r\n if (isInitialized) {\r\n throw new Error(`Onigasm#init has been called and was succesful, subsequent calls are not allowed once initialized`);\r\n }\r\n if (typeof data === 'string') {\r\n const arrayBuffer = await (await fetch(data)).arrayBuffer();\r\n await initModule(arrayBuffer);\r\n }\r\n else if (data instanceof ArrayBuffer) {\r\n await initModule(data);\r\n }\r\n else {\r\n throw new TypeError(`Expected a string (URL of .wasm file) or ArrayBuffer (.wasm file itself) as first parameter`);\r\n }\r\n isInitialized = true;\r\n}", "loadROM(ROM, fetchHeaders) {\n // Getting started with wasm\n // http://webassembly.org/getting-started/js-api/\n this.ready = false;\n this.loadedAndStarted = false;\n\n const initializeTask = async () => {\n // Get our promises\n const initPromises = [fetchROMAsByteArray(ROM, fetchHeaders), this._instantiateWasm()];\n\n if (!this.options.headless && WasmBoyMemory.getLoadedCartridgeMemoryState().RAM) {\n initPromises.push(WasmBoyMemory.saveCartridgeRam());\n }\n\n return await Promise.all(initPromises);\n };\n\n const loadROMAndConfigTask = async responses => {\n // Clear what is currently in memory, then load the cartridge memory\n WasmBoyMemory.clearMemory();\n WasmBoyMemory.resetState();\n\n // TODO: Handle passing a boot rom\n WasmBoyMemory.loadCartridgeRom(responses[0]);\n\n // Save the game that we loaded if we need to reload the game\n this.loadedROM = responses[0];\n\n // Run our initialization on the core\n this.wasmInstance.exports.config(\n 0, // TODO: Include Boot Rom\n this.options.isGbcEnabled ? 1 : 0,\n this.options.audioBatchProcessing ? 1 : 0,\n this.options.graphicsBatchProcessing ? 1 : 0,\n this.options.timersBatchProcessing ? 1 : 0,\n this.options.graphicsDisableScanlineRendering ? 1 : 0,\n this.options.audioAccumulateSamples ? 1 : 0,\n this.options.tileRendering ? 1 : 0,\n this.options.tileCaching ? 1 : 0\n );\n };\n\n const loadROMTask = async () => {\n // Pause wasmBoy\n await this.pause();\n\n // Initialize any needed parts of wasmboy\n let responses = await initializeTask();\n\n // Check if we are running headless\n if (this.options.headless) {\n await WasmBoyMemory.initialize(this.options.headless, this.wasmInstance, this.wasmByteMemory, this.options.saveStateCallback);\n\n await loadROMAndConfigTask(responses);\n\n this.ready = true;\n if (this.options.onReady) {\n this.options.onReady();\n }\n } else {\n // Finally intialize all of our services\n // Initialize our services\n await Promise.all([\n WasmBoyGraphics.initialize(this.canvasElement, this.wasmInstance, this.wasmByteMemory, this.options.updateGraphicsCallback),\n WasmBoyAudio.initialize(this.wasmInstance, this.wasmByteMemory, this.options.updateAudioCallback),\n WasmBoyController.initialize(this.wasmInstance),\n WasmBoyMemory.initialize(this.options.headless, this.wasmInstance, this.wasmByteMemory, this.options.saveStateCallback)\n ]);\n\n await loadROMAndConfigTask(responses);\n\n // Load the game's cartridge ram\n await WasmBoyMemory.loadCartridgeRam();\n\n this.ready = true;\n if (this.options.onReady) {\n this.options.onReady();\n }\n }\n };\n\n return loadROMTask();\n }", "async function loadWASM$1(data) {\n if (isInitialized) {\n throw new Error(`Onigasm#init has been called and was succesful, subsequent calls are not allowed once initialized`);\n }\n if (typeof data === 'string') {\n const arrayBuffer = await (await fetch(data)).arrayBuffer();\n await initModule(arrayBuffer);\n }\n else if (data instanceof ArrayBuffer) {\n await initModule(data);\n }\n else {\n throw new TypeError(`Expected a string (URL of .wasm file) or ArrayBuffer (.wasm file itself) as first parameter`);\n }\n isInitialized = true;\n}", "function init() {\n const go = new Go();\n if ('instantiateStreaming' in WebAssembly) {\n WebAssembly.instantiateStreaming(fetch(WASM_URL), go.importObject).then(function (obj) {\n wasm = obj.instance;\n go.run(wasm);\n\n // Set up wasm event handlers\n document.addEventListener(\"resize\", canvasResize);\n document.addEventListener(\"wheel\", zoomChange);\n document.getElementById(\"speedSliderX\").addEventListener(\"input\", sliderChangeX);\n document.getElementById(\"speedSliderY\").addEventListener(\"input\", sliderChangeY);\n document.getElementById(\"speedSliderZ\").addEventListener(\"input\", sliderChangeZ);\n document.getElementById(\"upload\").addEventListener(\"change\", uploading);\n\n })\n } else {\n fetch(WASM_URL).then(resp =>\n resp.arrayBuffer()\n ).then(bytes =>\n WebAssembly.instantiate(bytes, go.importObject).then(function (obj) {\n wasm = obj.instance;\n go.run(wasm);\n\n // Set up wasm event handlers\n document.addEventListener(\"resize\", canvasResize);\n document.addEventListener(\"wheel\", zoomChange);\n document.getElementById(\"speedSliderX\").addEventListener(\"input\", sliderChangeX);\n document.getElementById(\"speedSliderY\").addEventListener(\"input\", sliderChangeY);\n document.getElementById(\"speedSliderZ\").addEventListener(\"input\", sliderChangeZ);\n document.getElementById(\"upload\").addEventListener(\"change\", uploading);\n\n })\n )\n }\n}", "async function getModuleFactory(): any {\n // When running outside a browser (i.e. tests), we can let Emscripten to\n // resolve the WASM file automatically. That does fail when running in the browser because\n // of Webpack, so we need to indicate the Wasm location manually\n if (isNodeModule()) {\n return ModuleFactory();\n }\n return ModuleFactory({\n locateFile: () => {\n // get the path to the wasm file\n // Webpack puts this file in the `dist` directory\n return ModuleWasm;\n },\n });\n}", "async function init() {\n const stub_buf = fs.readFileSync(\"./wasi-stub.wasm\");\n let memory;\n let log = \"\";\n const stub = await WebAssembly.instantiate(stub_buf, {\n js: {\n not_impl(code) {\n console.error(\"NOT_IMPLEMENTED\", code);\n },\n put_i32(offset, val) {\n new DataView(memory.buffer, offset, 4).setInt32(0, val, true);\n },\n set_time(offset) {\n const n = BigInt(0); // process.hrtime.bigint();\n new DataView(memory.buffer, offset, 8).setBigUint64(0, n, true);\n },\n write(ios, c, pw) {\n const d = new DataView(memory.buffer, ios, 8 * c);\n let w = 0;\n for (let i = 0; i < c; i++) {\n const p = d.getInt32(i * 8, true), len = d.getInt32(i * 8 + 4, true);\n const str = new Uint8Array(memory.buffer, p, len);\n log += Buffer.from(str.subarray(0, len)).toString();\n while (log.includes('\\n')) {\n const p = log.split('\\n');\n log = p.pop();\n p.forEach(i => console.log(i));\n }\n w += len;\n }\n new DataView(memory.buffer, pw, 4).setInt32(0, w, true);\n }\n },\n });\n\n const buf = fs.readFileSync(\"./zbar_jpeg.wasm\");\n const imports = {\n wasi_snapshot_preview1: stub.instance.exports,\n };\n const i = await WebAssembly.instantiate(buf, imports);\n memory = i.instance.exports.memory;\n return i.instance.exports;\n}", "function createWasm(){// prepare imports\n var info={'env':asmLibraryArg,'wasi_snapshot_preview1':asmLibraryArg};// Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n /** @param {WebAssembly.Module=} module*/function receiveInstance(instance,module){var exports=instance.exports;Module['asm']=exports;removeRunDependency();}// we can't run yet (except in a pthread, where we have a custom sync instantiator)\n addRunDependency();function receiveInstantiatedSource(output){// 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\n // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.\n receiveInstance(output['instance']);}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info);}).then(receiver,function(reason){err('failed to asynchronously prepare wasm: '+reason);abort(reason);});}// Prefer streaming instantiation if available.\n function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==='function'&&!isDataURI(wasmBinaryFile)&&typeof fetch==='function'){fetch(wasmBinaryFile,{credentials:'same-origin'}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){// We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err('wasm streaming compile failed: '+reason);err('falling back to ArrayBuffer instantiation');return instantiateArrayBuffer(receiveInstantiatedSource);});});}else {return instantiateArrayBuffer(receiveInstantiatedSource);}}// User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel\n // to any other async startup actions they are performing.\n if(Module['instantiateWasm']){try{var exports=Module['instantiateWasm'](info,receiveInstance);return exports;}catch(e){err('Module.instantiateWasm callback failed with error: '+e);return false;}}instantiateAsync();return {};// no exports yet; we'll fill them in later\n }// Globals used by JS i64 conversions", "initializeModuleDependencyProvider () {\n this.moduleDependencyProvider = (editor) => {\n let memory = new WebAssembly.Memory({initial: 64});\n return {\n imports: {\n WebBS: {\n memory,\n log: (number) => editor.logOutput(number),\n logStr: (index, size) => {\n let str = \"\";\n let memView = new Uint8Array(memory.buffer);\n for (let i = index; i < index + size; i++) {\n str += String.fromCharCode(memView[i]);\n }\n editor.logOutput(str);\n }\n }\n },\n\n onInit: (instance) => {}\n };\n }; \n }", "function __elements_debug_wasm_loaded(url, bytes, data, importObject, memory) {\r\n }", "function s$2(){if(t$q(i$4)){const e=e=>a$o(`esri/libs/basisu/${e}`);i$4=import('./basis_transcoder-37795199.js').then((function(e){return e.b})).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))));}return i$4}", "initCoreModule() {\n if (WebAssembly) {\n // WebAssembly.instantiateStreaming is not currently available in Safari\n if (WebAssembly && !WebAssembly.instantiateStreaming) {\n // polyfill\n WebAssembly.instantiateStreaming = async (resp, importObject) => {\n const source = await (await resp).arrayBuffer();\n return await WebAssembly.instantiate(source, importObject);\n };\n }\n\n const go = new Go();\n WebAssembly.instantiateStreaming(\n fetch(\"productimon.wasm\"),\n go.importObject\n ).then((result) => {\n go.run(result.instance);\n });\n } else {\n log.error(logger, \"WebAssembly is not supported in your browser\");\n }\n }", "function LoadCrunchDecoder() {\n function e(a){throw a;}var j=void 0,l=!0,m=null,p=!1;function q(){return function(){}}var s;s||(s=eval(\"(function() { try { return Module || {} } catch(e) { return {} } })()\"));var aa={},v;for(v in s)s.hasOwnProperty(v)&&(aa[v]=s[v]);var w=\"object\"===typeof process&&\"function\"===typeof require,ba=\"object\"===typeof window,ca=\"function\"===typeof importScripts,da=!ba&&!w&&!ca;\n if(w){s.print=function(a){process.stdout.write(a+\"\\n\")};s.printErr=function(a){process.stderr.write(a+\"\\n\")};var ea=require(\"fs\"),fa=require(\"path\");s.read=function(a,b){var a=fa.normalize(a),c=ea.readFileSync(a);!c&&a!=fa.resolve(a)&&(a=path.join(__dirname,\"..\",\"src\",a),c=ea.readFileSync(a));c&&!b&&(c=c.toString());return c};s.readBinary=function(a){return s.read(a,l)};s.load=function(a){ga(read(a))};s.arguments=process.argv.slice(2);module.exports=s}else da?(s.print=print,\"undefined\"!=typeof printErr&&\n (s.printErr=printErr),s.read=\"undefined\"!=typeof read?read:function(){e(\"no read() available (jsc?)\")},s.readBinary=function(a){return read(a,\"binary\")},\"undefined\"!=typeof scriptArgs?s.arguments=scriptArgs:\"undefined\"!=typeof arguments&&(s.arguments=arguments),this.Module=s):ba||ca?(s.read=function(a){var b=new XMLHttpRequest;b.open(\"GET\",a,p);b.send(m);return b.responseText},\"undefined\"!=typeof arguments&&(s.arguments=arguments),\"undefined\"!==typeof console?(s.print=function(a){console.log(a)},\n s.printErr=function(a){console.log(a)}):s.print=q(),ba?this.Module=s:s.load=importScripts):e(\"Unknown runtime environment. Where are we?\");function ga(a){eval.call(m,a)}\"undefined\"==!s.load&&s.read&&(s.load=function(a){ga(s.read(a))});s.print||(s.print=q());s.printErr||(s.printErr=s.print);s.arguments||(s.arguments=[]);s.print=s.print;s.P=s.printErr;s.preRun=[];s.postRun=[];for(v in aa)aa.hasOwnProperty(v)&&(s[v]=aa[v]);function ha(){return x}function ia(a){x=a}\n function ja(a){switch(a){case \"i1\":case \"i8\":return 1;case \"i16\":return 2;case \"i32\":return 4;case \"i64\":return 8;case \"float\":return 4;case \"double\":return 8;default:if(\"*\"===a[a.length-1])return ka;if(\"i\"===a[0])return a=parseInt(a.substr(1)),A(0===a%8),a/8}}function la(a,b,c){c&&c.length?(c.splice||(c=Array.prototype.slice.call(c)),c.splice(0,0,b),s[\"dynCall_\"+a].apply(m,c)):s[\"dynCall_\"+a].call(m,b)}var ma;\n function na(){var a=[],b=0;this.za=function(c){c&=255;if(0==a.length){if(0==(c&128))return String.fromCharCode(c);a.push(c);b=192==(c&224)?1:224==(c&240)?2:3;return\"\"}if(b&&(a.push(c),b--,0<b))return\"\";var c=a[0],d=a[1],f=a[2],h=a[3];2==a.length?c=String.fromCharCode((c&31)<<6|d&63):3==a.length?c=String.fromCharCode((c&15)<<12|(d&63)<<6|f&63):(c=(c&7)<<18|(d&63)<<12|(f&63)<<6|h&63,c=String.fromCharCode(Math.floor((c-65536)/1024)+55296,(c-65536)%1024+56320));a.length=0;return c};this.Cb=function(a){for(var a=\n unescape(encodeURIComponent(a)),b=[],f=0;f<a.length;f++)b.push(a.charCodeAt(f));return b}}function oa(a){var b=x;x=x+a|0;x=x+7&-8;return b}function pa(a){var b=B;B=B+a|0;B=B+7&-8;return b}function qa(a){var b=D;D=D+a|0;D=D+7&-8;D>=ra&&E(\"Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value \"+ra+\", or (2) set Module.TOTAL_MEMORY before the program runs.\");return b}function sa(a,b){return Math.ceil(a/(b?b:8))*(b?b:8)}\n var ka=4,ta={},ua=p,va;function A(a,b){a||E(\"Assertion failed: \"+b)}s.ccall=function(a,b,c,d){return wa(xa(a),b,c,d)};function xa(a){try{var b=s[\"_\"+a];b||(b=eval(\"_\"+a))}catch(c){}A(b,\"Cannot call unknown function \"+a+\" (perhaps LLVM optimizations or closure removed it?)\");return b}\n function wa(a,b,c,d){function f(a,b){if(\"string\"==b){if(a===m||a===j||0===a)return 0;a=H(a);b=\"array\"}if(\"array\"==b){h||(h=ha());var c=oa(a.length);ya(a,c);return c}return a}var h=0,g=0,d=d?d.map(function(a){return f(a,c[g++])}):[];a=a.apply(m,d);\"string\"==b?b=za(a):(A(\"array\"!=b),b=a);h&&ia(h);return b}s.cwrap=function(a,b,c){var d=xa(a);return function(){return wa(d,b,c,Array.prototype.slice.call(arguments))}};\n function Aa(a,b,c){c=c||\"i8\";\"*\"===c.charAt(c.length-1)&&(c=\"i32\");switch(c){case \"i1\":I[a]=b;break;case \"i8\":I[a]=b;break;case \"i16\":J[a>>1]=b;break;case \"i32\":K[a>>2]=b;break;case \"i64\":va=[b>>>0,(tempDouble=b,1<=+Ba(tempDouble)?0<tempDouble?(Ca(+Da(tempDouble/4294967296),4294967295)|0)>>>0:~~+Ea((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)];K[a>>2]=va[0];K[a+4>>2]=va[1];break;case \"float\":Fa[a>>2]=b;break;case \"double\":Ga[a>>3]=b;break;default:E(\"invalid type for setValue: \"+c)}}\n s.setValue=Aa;s.getValue=function(a,b){b=b||\"i8\";\"*\"===b.charAt(b.length-1)&&(b=\"i32\");switch(b){case \"i1\":return I[a];case \"i8\":return I[a];case \"i16\":return J[a>>1];case \"i32\":return K[a>>2];case \"i64\":return K[a>>2];case \"float\":return Fa[a>>2];case \"double\":return Ga[a>>3];default:E(\"invalid type for setValue: \"+b)}return m};var Ha=1,Ia=2,Ja=4;s.ALLOC_NORMAL=0;s.ALLOC_STACK=Ha;s.ALLOC_STATIC=Ia;s.ALLOC_DYNAMIC=3;s.ALLOC_NONE=Ja;\n function L(a,b,c,d){var f,h;\"number\"===typeof a?(f=l,h=a):(f=p,h=a.length);var g=\"string\"===typeof b?b:m,c=c==Ja?d:[Ka,oa,pa,qa][c===j?Ia:c](Math.max(h,g?1:b.length));if(f){d=c;A(0==(c&3));for(a=c+(h&-4);d<a;d+=4)K[d>>2]=0;for(a=c+h;d<a;)I[d++|0]=0;return c}if(\"i8\"===g)return a.subarray||a.slice?M.set(a,c):M.set(new Uint8Array(a),c),c;for(var d=0,i,r;d<h;){var t=a[d];\"function\"===typeof t&&(t=ta.Sd(t));f=g||b[d];0===f?d++:(\"i64\"==f&&(f=\"i32\"),Aa(c+d,t,f),r!==f&&(i=ja(f),r=f),d+=i)}return c}\n s.allocate=L;function za(a,b){for(var c=p,d,f=0;;){d=M[a+f|0];if(128<=d)c=l;else if(0==d&&!b)break;f++;if(b&&f==b)break}b||(b=f);var h=\"\";if(!c){for(;0<b;)d=String.fromCharCode.apply(String,M.subarray(a,a+Math.min(b,1024))),h=h?h+d:d,a+=1024,b-=1024;return h}c=new na;for(f=0;f<b;f++)d=M[a+f|0],h+=c.za(d);return h}s.Pointer_stringify=za;s.UTF16ToString=function(a){for(var b=0,c=\"\";;){var d=J[a+2*b>>1];if(0==d)return c;++b;c+=String.fromCharCode(d)}};\n s.stringToUTF16=function(a,b){for(var c=0;c<a.length;++c)J[b+2*c>>1]=a.charCodeAt(c);J[b+2*a.length>>1]=0};s.UTF32ToString=function(a){for(var b=0,c=\"\";;){var d=K[a+4*b>>2];if(0==d)return c;++b;65536<=d?(d-=65536,c+=String.fromCharCode(55296|d>>10,56320|d&1023)):c+=String.fromCharCode(d)}};s.stringToUTF32=function(a,b){for(var c=0,d=0;d<a.length;++d){var f=a.charCodeAt(d);if(55296<=f&&57343>=f)var h=a.charCodeAt(++d),f=65536+((f&1023)<<10)|h&1023;K[b+4*c>>2]=f;++c}K[b+4*c>>2]=0};\n function La(a){try{\"number\"===typeof a&&(a=za(a));if(\"_\"!==a[0]||\"_\"!==a[1]||\"Z\"!==a[2])return a;var b=3,c={v:\"void\",b:\"bool\",c:\"char\",s:\"short\",i:\"int\",l:\"long\",f:\"float\",d:\"double\",w:\"wchar_t\",a:\"signed char\",h:\"unsigned char\",t:\"unsigned short\",j:\"unsigned int\",m:\"unsigned long\",x:\"long long\",y:\"unsigned long long\",z:\"...\"},d=[],f=function(h,i,r){var i=i||Infinity,t=\"\",y=[],u;if(\"N\"!==a[b]){\"K\"===a[b]&&b++;var n=parseInt(a.substr(b));if(n){var F=n.toString().length;u=a.substr(b+F,n);b+=F+n}}else{b++;\n \"K\"===a[b]&&b++;for(u=[];\"E\"!==a[b];)if(\"S\"===a[b])b++,n=a.indexOf(\"_\",b),u.push(d[a.substring(b,n)||0]||\"?\"),b=n+1;else{n=parseInt(a.substr(b));F=n.toString().length;if(!n||!F){b--;break}var G=a.substr(b+F,n);u.push(G);d.push(G);b+=F+n}b++;u=u.join(\"::\");i--;if(0===i)return h?[u]:u}\"I\"===a[b]?(b++,n=f(l),F=f(l,1,l),t+=F[0]+\" \"+u+\"<\"+n.join(\", \")+\">\"):t=u;a:for(;b<a.length&&0<i--;)if(u=a[b++],u in c)y.push(c[u]);else switch(u){case \"P\":y.push(f(l,1,l)[0]+\"*\");break;case \"R\":y.push(f(l,1,l)[0]+\"&\");\n break;case \"L\":b++;n=a.indexOf(\"E\",b)-b;y.push(a.substr(b,n));b+=n+2;break;case \"A\":n=parseInt(a.substr(b));b+=n.toString().length;\"_\"!==a[b]&&e(\"?\");b++;y.push(f(l,1,l)[0]+\" [\"+n+\"]\");break;case \"E\":break a;default:t+=\"?\"+u;break a}!r&&(1===y.length&&\"void\"===y[0])&&(y=[]);return h?y:t+(\"(\"+y.join(\", \")+\")\")};return f()}catch(h){return a}}function Ma(){var a=Error().stack;return a?a.replace(/__Z[\\w\\d_]+/g,function(a){var c=La(a);return a===c?a:a+\" [\"+c+\"]\"}):\"(no stack trace available)\"}\n var I,M,J,Na,K,Oa,Fa,Ga,Qa=0,B=0,Ra=0,x=0,Sa=0,Ta=0,D=0,ra=s.TOTAL_MEMORY||16777216;A(\"undefined\"!==typeof Int32Array&&\"undefined\"!==typeof Float64Array&&!!(new Int32Array(1)).subarray&&!!(new Int32Array(1)).set,\"Cannot fallback to non-typed array case: Code is too specialized\");var N=new ArrayBuffer(ra);I=new Int8Array(N);J=new Int16Array(N);K=new Int32Array(N);M=new Uint8Array(N);Na=new Uint16Array(N);Oa=new Uint32Array(N);Fa=new Float32Array(N);Ga=new Float64Array(N);K[0]=255;\n A(255===M[0]&&0===M[3],\"Typed arrays 2 must be run on a little-endian system\");s.HEAP=j;s.HEAP8=I;s.HEAP16=J;s.HEAP32=K;s.HEAPU8=M;s.HEAPU16=Na;s.HEAPU32=Oa;s.HEAPF32=Fa;s.HEAPF64=Ga;function Ua(a){for(;0<a.length;){var b=a.shift();if(\"function\"==typeof b)b();else{var c=b.M;\"number\"===typeof c?b.ta===j?la(\"v\",c):la(\"vi\",c,[b.ta]):c(b.ta===j?m:b.ta)}}}var Va=[],O=[],Wa=[],Xa=[],Ya=[],Za=p;function $a(a){Va.unshift(a)}s.addOnPreRun=s.Id=$a;s.addOnInit=s.Fd=function(a){O.unshift(a)};\n s.addOnPreMain=s.Hd=function(a){Wa.unshift(a)};s.addOnExit=s.Ed=function(a){Xa.unshift(a)};function ab(a){Ya.unshift(a)}s.addOnPostRun=s.Gd=ab;function H(a,b,c){a=(new na).Cb(a);c&&(a.length=c);b||a.push(0);return a}s.intArrayFromString=H;s.intArrayToString=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];255<d&&(d&=255);b.push(String.fromCharCode(d))}return b.join(\"\")};s.writeStringToMemory=function(a,b,c){a=H(a,c);for(c=0;c<a.length;)I[b+c|0]=a[c],c+=1};\n function ya(a,b){for(var c=0;c<a.length;c++)I[b+c|0]=a[c]}s.writeArrayToMemory=ya;s.writeAsciiToMemory=function(a,b,c){for(var d=0;d<a.length;d++)I[b+d|0]=a.charCodeAt(d);c||(I[b+a.length|0]=0)};function bb(a,b){return 0<=a?a:32>=b?2*Math.abs(1<<b-1)+a:Math.pow(2,b)+a}function cb(a,b){if(0>=a)return a;var c=32>=b?Math.abs(1<<b-1):Math.pow(2,b-1);if(a>=c&&(32>=b||a>c))a=-2*c+a;return a}Math.imul||(Math.imul=function(a,b){var c=a&65535,d=b&65535;return c*d+((a>>>16)*d+c*(b>>>16)<<16)|0});Math.Vd=Math.imul;\n var Ba=Math.abs,Ea=Math.ceil,Da=Math.floor,Ca=Math.min,Q=0,db={},eb=m,fb=m;function gb(a){Q++;s.monitorRunDependencies&&s.monitorRunDependencies(Q);a?(A(!db[a]),db[a]=1):s.P(\"warning: run dependency added without ID\")}s.addRunDependency=gb;function hb(a){Q--;s.monitorRunDependencies&&s.monitorRunDependencies(Q);a?(A(db[a]),delete db[a]):s.P(\"warning: run dependency removed without ID\");0==Q&&(eb!==m&&(clearInterval(eb),eb=m),fb&&(a=fb,fb=m,a()))}s.removeRunDependency=hb;s.preloadedImages={};\n s.preloadedAudios={};Qa=8;B=Qa+1376;O.push({M:function(){ib()}});\n L([109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,0,0,0,0,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,0,0,0,0,0,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,0,0,0,110,117,109,95,99,111,100,101,115,91,99,93,0,0,0,0,110,101,119,95,99,97,112,\n 97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,0,0,0,0,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,0,0,0,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,0,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,0,\n 0,0,0,0,105,32,60,32,109,95,115,105,122,101,0,0,0,0,0,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,0,0,0,0,0,0,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,0,0,0,0,\n 0,48,0,0,0,0,0,0,0,46,46,47,105,110,99,47,99,114,110,95,100,101,99,111,109,112,46,104,0,0,0,0,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,0,0,102,97,108,115,101,0,0,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,0,0,0,0,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,\n 97,100,32,112,116,114,0,0,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,0,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,0,0,0,0,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,0,0,0,0,0,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,0,0,0,37,115,40,\n 37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,0,0,0,0,0,0,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,0,0,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,0,2,3,4,5,6,7,1,0,2,3,1,0,0,0,0],\"i8\",Ja,8);var jb=sa(L(12,\"i8\",Ia),8);A(0==jb%8);s._strlen=kb;function lb(a){return 0>a||0===a&&-Infinity===1/a}\n function mb(a,b){function c(a){var c;\"double\"===a?c=Ga[b+f>>3]:\"i64\"==a?(c=[K[b+f>>2],K[b+(f+8)>>2]],f+=8):(a=\"i32\",c=K[b+f>>2]);f+=Math.max(Math.max(ja(a),ka),8);return c}for(var d=a,f=0,h=[],g,i;;){var r=d;g=I[d];if(0===g)break;i=I[d+1|0];if(37==g){var t=p,y=p,u=p,n=p,F=p;a:for(;;){switch(i){case 43:t=l;break;case 45:y=l;break;case 35:u=l;break;case 48:if(n)break a;else{n=l;break}case 32:F=l;break;default:break a}d++;i=I[d+1|0]}var G=0;if(42==i)G=c(\"i32\"),d++,i=I[d+1|0];else for(;48<=i&&57>=i;)G=\n 10*G+(i-48),d++,i=I[d+1|0];var P=p;if(46==i){var C=0,P=l;d++;i=I[d+1|0];if(42==i)C=c(\"i32\"),d++;else for(;;){i=I[d+1|0];if(48>i||57<i)break;C=10*C+(i-48);d++}i=I[d+1|0]}else C=6;var z;switch(String.fromCharCode(i)){case \"h\":i=I[d+2|0];104==i?(d++,z=1):z=2;break;case \"l\":i=I[d+2|0];108==i?(d++,z=8):z=4;break;case \"L\":case \"q\":case \"j\":z=8;break;case \"z\":case \"t\":case \"I\":z=4;break;default:z=m}z&&d++;i=I[d+1|0];switch(String.fromCharCode(i)){case \"d\":case \"i\":case \"u\":case \"o\":case \"x\":case \"X\":case \"p\":r=\n 100==i||105==i;z=z||4;g=c(\"i\"+8*z);var k;8==z&&(g=117==i?+(g[0]>>>0)+4294967296*+(g[1]>>>0):+(g[0]>>>0)+4294967296*+(g[1]|0));4>=z&&(g=(r?cb:bb)(g&Math.pow(256,z)-1,8*z));var T=Math.abs(g),r=\"\";if(100==i||105==i)k=cb(g,8*z).toString(10);else if(117==i)k=bb(g,8*z).toString(10),g=Math.abs(g);else if(111==i)k=(u?\"0\":\"\")+T.toString(8);else if(120==i||88==i){r=u&&0!=g?\"0x\":\"\";if(0>g){g=-g;k=(T-1).toString(16);T=[];for(u=0;u<k.length;u++)T.push((15-parseInt(k[u],16)).toString(16));for(k=T.join(\"\");k.length<\n 2*z;)k=\"f\"+k}else k=T.toString(16);88==i&&(r=r.toUpperCase(),k=k.toUpperCase())}else 112==i&&(0===T?k=\"(nil)\":(r=\"0x\",k=T.toString(16)));if(P)for(;k.length<C;)k=\"0\"+k;0<=g&&(t?r=\"+\"+r:F&&(r=\" \"+r));\"-\"==k.charAt(0)&&(r=\"-\"+r,k=k.substr(1));for(;r.length+k.length<G;)y?k+=\" \":n?k=\"0\"+k:r=\" \"+r;k=r+k;k.split(\"\").forEach(function(a){h.push(a.charCodeAt(0))});break;case \"f\":case \"F\":case \"e\":case \"E\":case \"g\":case \"G\":g=c(\"double\");if(isNaN(g))k=\"nan\",n=p;else if(isFinite(g)){P=p;z=Math.min(C,20);if(103==\n i||71==i)P=l,C=C||1,z=parseInt(g.toExponential(z).split(\"e\")[1],10),C>z&&-4<=z?(i=(103==i?\"f\":\"F\").charCodeAt(0),C-=z+1):(i=(103==i?\"e\":\"E\").charCodeAt(0),C--),z=Math.min(C,20);if(101==i||69==i)k=g.toExponential(z),/[eE][-+]\\d$/.test(k)&&(k=k.slice(0,-1)+\"0\"+k.slice(-1));else if(102==i||70==i)k=g.toFixed(z),0===g&&lb(g)&&(k=\"-\"+k);r=k.split(\"e\");if(P&&!u)for(;1<r[0].length&&-1!=r[0].indexOf(\".\")&&(\"0\"==r[0].slice(-1)||\".\"==r[0].slice(-1));)r[0]=r[0].slice(0,-1);else for(u&&-1==k.indexOf(\".\")&&(r[0]+=\n \".\");C>z++;)r[0]+=\"0\";k=r[0]+(1<r.length?\"e\"+r[1]:\"\");69==i&&(k=k.toUpperCase());0<=g&&(t?k=\"+\"+k:F&&(k=\" \"+k))}else k=(0>g?\"-\":\"\")+\"inf\",n=p;for(;k.length<G;)k=y?k+\" \":n&&(\"-\"==k[0]||\"+\"==k[0])?k[0]+\"0\"+k.slice(1):(n?\"0\":\" \")+k;97>i&&(k=k.toUpperCase());k.split(\"\").forEach(function(a){h.push(a.charCodeAt(0))});break;case \"s\":n=(t=c(\"i8*\"))?kb(t):6;P&&(n=Math.min(n,C));if(!y)for(;n<G--;)h.push(32);if(t)for(u=0;u<n;u++)h.push(M[t++|0]);else h=h.concat(H(\"(null)\".substr(0,n),l));if(y)for(;n<G--;)h.push(32);\n break;case \"c\":for(y&&h.push(c(\"i8\"));0<--G;)h.push(32);y||h.push(c(\"i8\"));break;case \"n\":y=c(\"i32*\");K[y>>2]=h.length;break;case \"%\":h.push(g);break;default:for(u=r;u<d+2;u++)h.push(I[u])}d+=2}else h.push(g),d+=1}return h}function nb(a,b,c,d){c=mb(c,d);d=b===j?c.length:Math.min(c.length,Math.max(b-1,0));if(0>a)var a=-a,f=Ka(d+1),a=K[a>>2]=f;for(f=0;f<d;f++)I[a+f|0]=c[f];if(d<b||b===j)I[a+f|0]=0;return c.length}\n var R={W:1,qa:2,qd:3,nc:4,L:5,Ga:6,Kb:7,Kc:8,ba:9,Yb:10,V:11,Ad:11,lb:12,eb:13,ic:14,Wc:15,Wb:16,Da:17,Bd:18,Ea:19,Xc:20,oa:21,u:22,Fc:23,kb:24,ad:25,xd:26,jc:27,Sc:28,sa:29,nd:30,yc:31,fd:32,fc:33,kd:34,Oc:42,lc:43,Zb:44,pc:45,qc:46,rc:47,xc:48,yd:49,Ic:50,oc:51,dc:35,Lc:37,Pb:52,Sb:53,Cd:54,Gc:55,Tb:56,Ub:57,ec:35,Vb:59,Uc:60,Jc:61,ud:62,Tc:63,Pc:64,Qc:65,md:66,Mc:67,Nb:68,rd:69,$b:70,gd:71,Ac:72,gc:73,Rb:74,bd:76,Qb:77,ld:78,sc:79,tc:80,wc:81,vc:82,uc:83,Vc:38,Fa:39,Bc:36,pa:40,ra:95,ed:96,cc:104,\n Hc:105,Ob:97,jd:91,Zc:88,Rc:92,od:108,bc:111,Lb:98,ac:103,Ec:101,Cc:100,vd:110,kc:112,hb:113,ib:115,fb:114,gb:89,zc:90,hd:93,pd:94,Mb:99,Dc:102,jb:106,ca:107,wd:109,zd:87,hc:122,sd:116,$c:95,Nc:123,mc:84,cd:75,Xb:125,Yc:131,dd:130,td:86},ob={\"0\":\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",\n 12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",\n 34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",\n 53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",\n 74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",\n 90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",\n 107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"},pb=0;function S(a){return K[pb>>2]=a}\n function qb(a){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(a).slice(1)}function rb(a,b){for(var c=0,d=a.length-1;0<=d;d--){var f=a[d];\".\"===f?a.splice(d,1):\"..\"===f?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift(\"..\");return a}function sb(a){var b=\"/\"===a.charAt(0),c=\"/\"===a.substr(-1),a=rb(a.split(\"/\").filter(function(a){return!!a}),!b).join(\"/\");!a&&!b&&(a=\".\");a&&c&&(a+=\"/\");return(b?\"/\":\"\")+a}\n function U(){var a=Array.prototype.slice.call(arguments,0);return sb(a.filter(function(a){\"string\"!==typeof a&&e(new TypeError(\"Arguments to path.join must be strings\"));return a}).join(\"/\"))}function tb(){for(var a=\"\",b=p,c=arguments.length-1;-1<=c&&!b;c--){var d=0<=c?arguments[c]:\"/\";\"string\"!==typeof d&&e(new TypeError(\"Arguments to path.resolve must be strings\"));d&&(a=d+\"/\"+a,b=\"/\"===d.charAt(0))}a=rb(a.split(\"/\").filter(function(a){return!!a}),!b).join(\"/\");return(b?\"/\":\"\")+a||\".\"}var ub=[];\n function vb(a,b){ub[a]={input:[],O:[],Z:b};wb[a]={k:xb}}\n var xb={open:function(a){var b=ub[a.g.ka];b||e(new V(R.Ea));a.B=b;a.seekable=p},close:function(a){a.B.O.length&&a.B.Z.ja(a.B,10)},K:function(a,b,c,d){(!a.B||!a.B.Z.Qa)&&e(new V(R.Ga));for(var f=0,h=0;h<d;h++){var g;try{g=a.B.Z.Qa(a.B)}catch(i){e(new V(R.L))}g===j&&0===f&&e(new V(R.V));if(g===m||g===j)break;f++;b[c+h]=g}f&&(a.g.timestamp=Date.now());return f},write:function(a,b,c,d){(!a.B||!a.B.Z.ja)&&e(new V(R.Ga));for(var f=0;f<d;f++)try{a.B.Z.ja(a.B,b[c+f])}catch(h){e(new V(R.L))}d&&(a.g.timestamp=\n Date.now());return f}},W={cb:1,na:2,bb:3,D:function(){return W.createNode(m,\"/\",16895,0)},createNode:function(a,b,c,d){(24576===(c&61440)||4096===(c&61440))&&e(new V(R.W));c=yb(a,b,c,d);16384===(c.mode&61440)?(c.n={J:W.n.J,A:W.n.A,wa:W.n.wa,Q:W.n.Q,Q:W.n.Q,rename:W.n.rename,ab:W.n.ab,Za:W.n.Za,Xa:W.n.Xa,ma:W.n.ma},c.k={N:W.k.N},c.o={}):32768===(c.mode&61440)?(c.n={J:W.n.J,A:W.n.A},c.k={N:W.k.N,K:W.k.K,write:W.k.write,Ja:W.k.Ja,Ta:W.k.Ta},c.o=[],c.ea=W.na):40960===(c.mode&61440)?(c.n={J:W.n.J,A:W.n.A,\n la:W.n.la},c.k={}):8192===(c.mode&61440)&&(c.n={J:W.n.J,A:W.n.A},c.k=zb);c.timestamp=Date.now();a&&(a.o[b]=c);return c},ua:function(a){a.ea!==W.na&&(a.o=Array.prototype.slice.call(a.o),a.ea=W.na)},n:{J:function(a){var b={};b.Qd=8192===(a.mode&61440)?a.id:1;b.Wd=a.id;b.mode=a.mode;b.ae=1;b.uid=0;b.Ud=0;b.ka=a.ka;b.size=16384===(a.mode&61440)?4096:32768===(a.mode&61440)?a.o.length:40960===(a.mode&61440)?a.link.length:0;b.Kd=new Date(a.timestamp);b.$d=new Date(a.timestamp);b.Pd=new Date(a.timestamp);\n b.pb=4096;b.Md=Math.ceil(b.size/b.pb);return b},A:function(a,b){b.mode!==j&&(a.mode=b.mode);b.timestamp!==j&&(a.timestamp=b.timestamp);if(b.size!==j){W.ua(a);var c=a.o;if(b.size<c.length)c.length=b.size;else for(;b.size>c.length;)c.push(0)}},wa:function(){e(new V(R.qa))},Q:function(a,b,c,d){return W.createNode(a,b,c,d)},rename:function(a,b,c){if(16384===(a.mode&61440)){var d;try{d=Ab(b,c)}catch(f){}if(d)for(var h in d.o)e(new V(R.Fa))}delete a.parent.o[a.name];a.name=c;b.o[c]=a;a.parent=b},ab:function(a,\n b){delete a.o[b]},Za:function(a,b){var c=Ab(a,b),d;for(d in c.o)e(new V(R.Fa));delete a.o[b]},Xa:function(a){var b=[\".\",\"..\"],c;for(c in a.o)a.o.hasOwnProperty(c)&&b.push(c);return b},ma:function(a,b,c){a=W.createNode(a,b,41471,0);a.link=c;return a},la:function(a){40960!==(a.mode&61440)&&e(new V(R.u));return a.link}},k:{K:function(a,b,c,d,f){a=a.g.o;if(f>=a.length)return 0;d=Math.min(a.length-f,d);A(0<=d);if(8<d&&a.subarray)b.set(a.subarray(f,f+d),c);else for(var h=0;h<d;h++)b[c+h]=a[f+h];return d},\n write:function(a,b,c,d,f,h){var g=a.g;g.timestamp=Date.now();a=g.o;if(d&&0===a.length&&0===f&&b.subarray)return A(b.length),h&&b.buffer===I.buffer&&0===c?(g.o=b,g.ea=W.cb):(g.o=new Uint8Array(b.subarray(c,c+d)),g.ea=W.bb),d;W.ua(g);for(a=g.o;a.length<f;)a.push(0);for(h=0;h<d;h++)a[f+h]=b[c+h];return d},N:function(a,b,c){1===c?b+=a.position:2===c&&32768===(a.g.mode&61440)&&(b+=a.g.o.length);0>b&&e(new V(R.u));a.Hb=[];return a.position=b},Ja:function(a,b,c){W.ua(a.g);a=a.g.o;for(b+=c;b>a.length;)a.push(0)},\n Ta:function(a,b,c,d,f,h,g){32768!==(a.g.mode&61440)&&e(new V(R.Ea));a=a.g.o;if(!(g&2)&&(a.buffer===b||a.buffer===b.buffer))f=p,d=a.byteOffset;else{if(0<f||f+d<a.length)a=a.subarray?a.subarray(f,f+d):Array.prototype.slice.call(a,f,f+d);f=l;(d=Ka(d))||e(new V(R.lb));b.set(a,d)}return{de:d,Jd:f}}}},Bb=L(1,\"i32*\",Ia),Cb=L(1,\"i32*\",Ia),Db=L(1,\"i32*\",Ia),Eb=m,Fb=[],wb=[m],X=[m],Gb=1,Hb=m,Ib=l,V=m;function Jb(a){a instanceof V||e(a+\" : \"+Ma());S(a.Na)}\n function Y(a,b){a=tb(\"/\",a);b=b||{Aa:0};8<b.Aa&&e(new V(R.pa));for(var c=rb(a.split(\"/\").filter(function(a){return!!a}),p),d=Eb,f=\"/\",h=0;h<c.length;h++){var g=h===c.length-1;if(g&&b.parent)break;d=Ab(d,c[h]);f=U(f,c[h]);d.Ab&&(d=d.D.root);if(!g||b.X)for(g=0;40960===(d.mode&61440);){d=Y(f,{X:p}).g;d.n.la||e(new V(R.u));var d=d.n.la(d),i=tb;var r=qb(f),f=r[0],r=r[1];!f&&!r?f=\".\":(r&&(r=r.substr(0,r.length-1)),f+=r);f=i(f,d);d=Y(f,{Aa:b.Aa}).g;40<g++&&e(new V(R.pa))}}return{path:f,g:d}}\n function Kb(a){for(var b;;){if(a===a.parent)return b?U(a.D.Ua,b):a.D.Ua;b=b?U(a.name,b):a.name;a=a.parent}}function Lb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%Hb.length}function Ab(a,b){var c=Mb(a,\"x\");c&&e(new V(c));for(c=Hb[Lb(a.id,b)];c;c=c.Bb){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.n.wa(a,b)}\n function yb(a,b,c,d){var f={id:Gb++,name:b,mode:c,n:{},k:{},ka:d,parent:m,D:m};a||(a=f);f.parent=a;f.D=a.D;Object.defineProperties(f,{K:{get:function(){return 365===(f.mode&365)},set:function(a){a?f.mode|=365:f.mode&=-366}},write:{get:function(){return 146===(f.mode&146)},set:function(a){a?f.mode|=146:f.mode&=-147}},yb:{get:function(){return 16384===(f.mode&61440)}},xb:{get:function(){return 8192===(f.mode&61440)}}});a=Lb(f.parent.id,f.name);f.Bb=Hb[a];return Hb[a]=f}\n var Nb={r:0,rs:1052672,\"r+\":2,w:577,wx:705,xw:705,\"w+\":578,\"wx+\":706,\"xw+\":706,a:1089,ax:1217,xa:1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218};function Ob(a){var b=Nb[a];\"undefined\"===typeof b&&e(Error(\"Unknown file open mode: \"+a));return b}function Mb(a,b){return Ib?0:-1!==b.indexOf(\"r\")&&!(a.mode&292)||-1!==b.indexOf(\"w\")&&!(a.mode&146)||-1!==b.indexOf(\"x\")&&!(a.mode&73)?R.eb:0}function Pb(a,b){try{return Ab(a,b),R.Da}catch(c){}return Mb(a,\"wx\")}\n function Qb(a,b,c){var d;a:{b=b||1;for(c=c||4096;b<=c;b++)if(!X[b]){d=b;break a}e(new V(R.kb))}a.C=d;Object.defineProperties(a,{object:{get:function(){return a.g},set:function(b){a.g=b}},Yd:{get:function(){return 1!==(a.I&2097155)}},Zd:{get:function(){return 0!==(a.I&2097155)}},Xd:{get:function(){return a.I&1024}}});return X[d]=a}var zb={open:function(a){a.k=wb[a.g.ka].k;a.k.open&&a.k.open(a)},N:function(){e(new V(R.sa))}};\n function Rb(a,b){var c;b&&(c=Y(b,{X:p}),b=c.path);var d={type:a,ce:{},Ua:b,root:m},f=a.D(d);f.D=d;d.root=f;c&&(c.g.D=d,c.g.Ab=l,\"/\"===b&&(Eb=d.root));Fb.push(d);return f}function Sb(a,b,c){var d=Y(a,{parent:l}).g,a=\"/\"===a?\"/\":qb(a)[2],f=Pb(d,a);f&&e(new V(f));d.n.Q||e(new V(R.W));return d.n.Q(d,a,b,c)}function Tb(a,b){b=(b!==j?b:438)&4095;b|=32768;return Sb(a,b,0)}function Ub(a,b){b=(b!==j?b:511)&1023;b|=16384;return Sb(a,b,0)}\n function Vb(a,b,c){\"undefined\"===typeof c&&(c=b,b=438);return Sb(a,b|8192,c)}function Wb(a,b){var c=Y(b,{parent:l}).g,d=\"/\"===b?\"/\":qb(b)[2],f=Pb(c,d);f&&e(new V(f));c.n.ma||e(new V(R.W));return c.n.ma(c,d,a)}function Xb(a,b){var c;c=\"string\"===typeof a?Y(a,{X:l}).g:a;c.n.A||e(new V(R.W));c.n.A(c,{mode:b&4095|c.mode&-4096,timestamp:Date.now()})}\n function Yb(a,b){var c,a=sb(a),b=\"string\"===typeof b?Ob(b):b;c=b&64?(\"undefined\"===typeof c?438:c)&4095|32768:0;var d;try{d=Y(a,{X:!(b&131072)}).g}catch(f){}b&64&&(d?b&128&&e(new V(R.Da)):d=Sb(a,c,0));d||e(new V(R.qa));8192===(d.mode&61440)&&(b&=-513);d?40960===(d.mode&61440)?c=R.pa:16384===(d.mode&61440)&&(0!==(b&2097155)||b&512)?c=R.oa:(c=[\"r\",\"w\",\"rw\"][b&2097155],b&512&&(c+=\"w\"),c=Mb(d,c)):c=R.qa;c&&e(new V(c));if(b&512){c=d;c=\"string\"===typeof c?Y(c,{X:l}).g:c;c.n.A||e(new V(R.W));16384===(c.mode&\n 61440)&&e(new V(R.oa));32768!==(c.mode&61440)&&e(new V(R.u));var h=Mb(c,\"w\");h&&e(new V(h));c.n.A(c,{size:0,timestamp:Date.now()})}b&=-641;d=Qb({g:d,path:Kb(d),I:b,seekable:l,position:0,k:d.k,Hb:[],error:p},j,j);d.k.open&&d.k.open(d);s.logReadFiles&&!(b&1)&&(Zb||(Zb={}),a in Zb||(Zb[a]=1,s.printErr(\"read file: \"+a)));return d}function $b(a){try{a.k.close&&a.k.close(a)}catch(b){e(b)}finally{X[a.C]=m}}\n function ac(a,b,c,d,f,h){(0>d||0>f)&&e(new V(R.u));0===(a.I&2097155)&&e(new V(R.ba));16384===(a.g.mode&61440)&&e(new V(R.oa));a.k.write||e(new V(R.u));var g=l;\"undefined\"===typeof f?(f=a.position,g=p):a.seekable||e(new V(R.sa));a.I&1024&&((!a.seekable||!a.k.N)&&e(new V(R.sa)),a.k.N(a,0,2));b=a.k.write(a,b,c,d,f,h);g||(a.position+=b);return b}function bc(){V||(V=function(a){this.Na=a;for(var b in R)if(R[b]===a){this.code=b;break}this.message=ob[a];this.stack=Ma()},V.prototype=Error())}var cc;\n function dc(a,b){var c=0;a&&(c|=365);b&&(c|=146);return c}function ec(a,b,c,d,f,h){a=b?U(\"string\"===typeof a?a:Kb(a),b):a;d=dc(d,f);f=Tb(a,d);if(c){if(\"string\"===typeof c){for(var b=Array(c.length),g=0,i=c.length;g<i;++g)b[g]=c.charCodeAt(g);c=b}Xb(a,d|146);b=Yb(a,\"w\");ac(b,c,0,c.length,0,h);$b(b);Xb(a,d)}return f}\n function fc(a,b,c,d){a=U(\"string\"===typeof a?a:Kb(a),b);b=dc(!!c,!!d);fc.Sa||(fc.Sa=64);var f;f=fc.Sa++<<8|0;wb[f]={k:{open:function(a){a.seekable=p},close:function(){d&&(d.buffer&&d.buffer.length)&&d(10)},K:function(a,b,d,f){for(var t=0,y=0;y<f;y++){var u;try{u=c()}catch(n){e(new V(R.L))}u===j&&0===t&&e(new V(R.V));if(u===m||u===j)break;t++;b[d+y]=u}t&&(a.g.timestamp=Date.now());return t},write:function(a,b,c,f){for(var t=0;t<f;t++)try{d(b[c+t])}catch(y){e(new V(R.L))}f&&(a.g.timestamp=Date.now());\n return t}}};return Vb(a,b,f)}function gc(a){if(a.xb||a.yb||a.link||a.o)return l;var b=l;\"undefined\"!==typeof XMLHttpRequest&&e(Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\"));if(s.read)try{a.o=H(s.read(a.url),l)}catch(c){b=p}else e(Error(\"Cannot load without read() or XMLHttpRequest.\"));b||S(R.L);return b}\n var Zb,Z={D:function(){return yb(m,\"/\",16895,0)},sb:function(a,b,c){c&&A(1==b==(6==c));a={tb:a,type:b,protocol:c,p:m,$:{},ya:[],R:[],T:Z.q};b=Z.ia();c=yb(Z.root,b,49152,0);c.S=a;b=Qb({path:b,g:c,I:Ob(\"r+\"),seekable:p,k:Z.k});a.$a=b;return a},ub:function(a){a=X[a];return!a||49152!==(a.g.mode&49152)?m:a.g.S},k:{Wa:function(a){a=a.g.S;return a.T.Wa(a)},Ra:function(a,b,c){a=a.g.S;return a.T.Ra(a,b,c)},K:function(a,b,c,d){a=a.g.S;d=a.T.Db(a,d);if(!d)return 0;b.set(d.buffer,c);return d.buffer.length},write:function(a,\n b,c,d){a=a.g.S;return a.T.Fb(a,b,c,d)},close:function(a){a=a.g.S;a.T.close(a)}},ia:function(){Z.ia.Ma||(Z.ia.Ma=0);return\"socket[\"+Z.ia.Ma++ +\"]\"},q:{fa:function(a,b,c){var d;\"object\"===typeof b&&(d=b,c=b=m);if(d)d.Ha?(b=d.Ha.ee,c=d.Ha.fe):((c=/ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(d.url))||e(Error(\"WebSocket URL must be in the format ws(s)://address:port\")),b=c[1],c=parseInt(c[2],10));else try{d=new WebSocket(\"ws://\"+b+\":\"+c,w?{}:[\"binary\"]),d.binaryType=\"arraybuffer\"}catch(f){e(new V(R.hb))}b={F:b,port:c,\n e:d,ga:[]};Z.q.Ia(a,b);Z.q.wb(a,b);2===a.type&&\"undefined\"!==typeof a.U&&b.ga.push(new Uint8Array([255,255,255,255,112,111,114,116,(a.U&65280)>>8,a.U&255]));return b},ha:function(a,b,c){return a.$[b+\":\"+c]},Ia:function(a,b){a.$[b.F+\":\"+b.port]=b},Ya:function(a,b){delete a.$[b.F+\":\"+b.port]},wb:function(a,b){function c(c){A(\"string\"!==typeof c&&c.byteLength!==j);var c=new Uint8Array(c),d=f;f=p;d&&10===c.length&&255===c[0]&&255===c[1]&&255===c[2]&&255===c[3]&&112===c[4]&&111===c[5]&&114===c[6]&&116===\n c[7]?(c=c[8]<<8|c[9],Z.q.Ya(a,b),b.port=c,Z.q.Ia(a,b)):a.R.push({F:b.F,port:b.port,data:c})}function d(){try{for(var a=b.ga.shift();a;)b.e.send(a),a=b.ga.shift()}catch(c){b.e.close()}}var f=l;w?(b.e.Y(\"open\",d),b.e.Y(\"message\",function(a,b){b.Ld&&c((new Uint8Array(a)).buffer)}),b.e.Y(\"error\",q())):(b.e.onopen=d,b.e.onmessage=function(a){c(a.data)})},Wa:function(a){if(1===a.type&&a.p)return a.ya.length?65:0;var b=0,c=1===a.type?Z.q.ha(a,a.G,a.H):m;if(a.R.length||!c||c&&c.e.readyState===c.e.aa||c&&\n c.e.readyState===c.e.CLOSED)b|=65;if(!c||c&&c.e.readyState===c.e.OPEN)b|=4;if(c&&c.e.readyState===c.e.aa||c&&c.e.readyState===c.e.CLOSED)b|=16;return b},Ra:function(a,b,c){switch(b){case 21531:return b=0,a.R.length&&(b=a.R[0].data.length),K[c>>2]=b,0;default:return R.u}},close:function(a){if(a.p){try{a.p.close()}catch(b){}a.p=m}for(var c=Object.keys(a.$),d=0;d<c.length;d++){var f=a.$[c[d]];try{f.e.close()}catch(h){}Z.q.Ya(a,f)}return 0},bind:function(a,b,c){(\"undefined\"!==typeof a.Ca||\"undefined\"!==\n typeof a.U)&&e(new V(R.u));a.Ca=b;a.U=c||_mkport();if(2===a.type){a.p&&(a.p.close(),a.p=m);try{a.T.zb(a,0)}catch(d){d instanceof V||e(d),d.Na!==R.ra&&e(d)}}},Od:function(a,b,c){a.p&&e(new V(ERRNO_CODS.ra));if(\"undefined\"!==typeof a.G&&\"undefined\"!==typeof a.H){var d=Z.q.ha(a,a.G,a.H);d&&(d.e.readyState===d.e.CONNECTING&&e(new V(R.fb)),e(new V(R.jb)))}b=Z.q.fa(a,b,c);a.G=b.F;a.H=b.port;e(new V(R.ib))},zb:function(a){w||e(new V(R.ra));a.p&&e(new V(R.u));var b=require(\"ws\").Dd;a.p=new b({host:a.Ca,port:a.U});\n a.p.Y(\"connection\",function(b){if(1===a.type){var d=Z.sb(a.tb,a.type,a.protocol),b=Z.q.fa(d,b);d.G=b.F;d.H=b.port;a.ya.push(d)}else Z.q.fa(a,b)});a.p.Y(\"closed\",function(){a.p=m});a.p.Y(\"error\",q())},accept:function(a){a.p||e(new V(R.u));var b=a.ya.shift();b.$a.I=a.$a.I;return b},Td:function(a,b){var c,d;b?((a.G===j||a.H===j)&&e(new V(R.ca)),c=a.G,d=a.H):(c=a.Ca||0,d=a.U||0);return{F:c,port:d}},Fb:function(a,b,c,d,f,h){if(2===a.type){if(f===j||h===j)f=a.G,h=a.H;(f===j||h===j)&&e(new V(R.gb))}else f=\n a.G,h=a.H;var g=Z.q.ha(a,f,h);1===a.type&&((!g||g.e.readyState===g.e.aa||g.e.readyState===g.e.CLOSED)&&e(new V(R.ca)),g.e.readyState===g.e.CONNECTING&&e(new V(R.V)));b=b instanceof Array||b instanceof ArrayBuffer?b.slice(c,c+d):b.buffer.slice(b.byteOffset+c,b.byteOffset+c+d);if(2===a.type&&(!g||g.e.readyState!==g.e.OPEN)){if(!g||g.e.readyState===g.e.aa||g.e.readyState===g.e.CLOSED)g=Z.q.fa(a,f,h);g.ga.push(b);return d}try{return g.e.send(b),d}catch(i){e(new V(R.u))}},Db:function(a,b){1===a.type&&\n a.p&&e(new V(R.ca));var c=a.R.shift();if(!c){if(1===a.type){var d=Z.q.ha(a,a.G,a.H);if(d){if(d.e.readyState===d.e.aa||d.e.readyState===d.e.CLOSED)return m;e(new V(R.V))}e(new V(R.ca))}e(new V(R.V))}var d=c.data.byteLength||c.data.length,f=c.data.byteOffset||0,h=c.data.buffer||c.data,g=Math.min(b,d),i={buffer:new Uint8Array(h,f,g),F:c.F,port:c.port};1===a.type&&g<d&&(c.data=new Uint8Array(h,f+g,d-g),a.R.unshift(c));return i}}};\n function hc(a,b,c){a=X[a];if(!a)return S(R.ba),-1;try{return ac(a,I,b,c)}catch(d){return Jb(d),-1}}function ic(a,b,c,d){c*=b;if(0==c)return 0;a=hc(d,a,c);if(-1==a){if(b=X[d])b.error=l;return 0}return Math.floor(a/b)}function jc(a,b,c){c=mb(b,c);b=ha();a=ic(L(c,\"i8\",Ha),1,c.length,a);ia(b);return a}s._memset=kc;s._memcpy=lc;function mc(a){s.print(\"exit(\"+a+\") called\");s.exit(a)}\n function nc(a){nc.qb||(D=D+4095&-4096,nc.qb=l,A(qa),nc.ob=qa,qa=function(){E(\"cannot dynamically allocate, sbrk now has control\")});var b=D;0!=a&&nc.ob(a);return b}var oc=p,pc=p,qc=p,rc=p,sc=j,tc=j;function uc(a){return{jpg:\"image/jpeg\",jpeg:\"image/jpeg\",png:\"image/png\",bmp:\"image/bmp\",ogg:\"audio/ogg\",wav:\"audio/wav\",mp3:\"audio/mpeg\"}[a.substr(a.lastIndexOf(\".\")+1)]}var vc=[];function wc(){var a=s.canvas;vc.forEach(function(b){b(a.width,a.height)})}\n function xc(){var a=s.canvas;this.Jb=a.width;this.Ib=a.height;a.width=screen.width;a.height=screen.height;\"undefined\"!=typeof SDL&&(a=Oa[SDL.screen+0*ka>>2],K[SDL.screen+0*ka>>2]=a|8388608);wc()}function yc(){var a=s.canvas;a.width=this.Jb;a.height=this.Ib;\"undefined\"!=typeof SDL&&(a=Oa[SDL.screen+0*ka>>2],K[SDL.screen+0*ka>>2]=a&-8388609);wc()}var zc,Ac,Bc,Cc;bc();Hb=Array(4096);Eb=yb(m,\"/\",16895,0);Rb(W,\"/\");Ub(\"/tmp\");Ub(\"/dev\");wb[259]={k:{K:function(){return 0},write:function(){return 0}}};\n Vb(\"/dev/null\",259);vb(1280,{Qa:function(a){if(!a.input.length){var b=m;if(w){if(b=process.stdin.read(),!b){if(process.stdin._readableState&&process.stdin._readableState.ended)return m;return}}else\"undefined\"!=typeof window&&\"function\"==typeof window.prompt?(b=window.prompt(\"Input: \"),b!==m&&(b+=\"\\n\")):\"function\"==typeof readline&&(b=readline(),b!==m&&(b+=\"\\n\"));if(!b)return m;a.input=H(b,l)}return a.input.shift()},ja:function(a,b){b===m||10===b?(s.print(a.O.join(\"\")),a.O=[]):a.O.push(Dc.za(b))}});\n vb(1536,{ja:function(a,b){b===m||10===b?(s.printErr(a.O.join(\"\")),a.O=[]):a.O.push(Dc.za(b))}});Vb(\"/dev/tty\",1280);Vb(\"/dev/tty1\",1536);Ub(\"/dev/shm\");Ub(\"/dev/shm/tmp\");\n O.unshift({M:function(){if(!s.noFSInit&&!cc){A(!cc,\"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)\");cc=l;bc();s.stdin=s.stdin;s.stdout=s.stdout;s.stderr=s.stderr;s.stdin?fc(\"/dev\",\"stdin\",s.stdin):Wb(\"/dev/tty\",\"/dev/stdin\");s.stdout?fc(\"/dev\",\"stdout\",m,s.stdout):Wb(\"/dev/tty\",\"/dev/stdout\");s.stderr?fc(\"/dev\",\"stderr\",m,s.stderr):Wb(\"/dev/tty1\",\"/dev/stderr\");var a=Yb(\"/dev/stdin\",\n \"r\");K[Bb>>2]=a.C;A(1===a.C,\"invalid handle for stdin (\"+a.C+\")\");a=Yb(\"/dev/stdout\",\"w\");K[Cb>>2]=a.C;A(2===a.C,\"invalid handle for stdout (\"+a.C+\")\");a=Yb(\"/dev/stderr\",\"w\");K[Db>>2]=a.C;A(3===a.C,\"invalid handle for stderr (\"+a.C+\")\")}}});Wa.push({M:function(){Ib=p}});Xa.push({M:function(){cc=p;for(var a=0;a<X.length;a++){var b=X[a];b&&$b(b)}}});s.FS_createFolder=function(a,b,c,d){a=U(\"string\"===typeof a?a:Kb(a),b);return Ub(a,dc(c,d))};\n s.FS_createPath=function(a,b){for(var a=\"string\"===typeof a?a:Kb(a),c=b.split(\"/\").reverse();c.length;){var d=c.pop();if(d){var f=U(a,d);try{Ub(f)}catch(h){}a=f}}return f};s.FS_createDataFile=ec;\n s.FS_createPreloadedFile=function(a,b,c,d,f,h,g,i,r){function t(){qc=document.pointerLockElement===n||document.mozPointerLockElement===n||document.webkitPointerLockElement===n}function y(c){function k(c){i||ec(a,b,c,d,f,r);h&&h();hb(\"cp \"+F)}var n=p;s.preloadPlugins.forEach(function(a){!n&&a.canHandle(F)&&(a.handle(c,F,k,function(){g&&g();hb(\"cp \"+F)}),n=l)});n||k(c)}s.preloadPlugins||(s.preloadPlugins=[]);if(!zc&&!ca){zc=l;try{new Blob,Ac=l}catch(u){Ac=p,console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\")}Bc=\n \"undefined\"!=typeof MozBlobBuilder?MozBlobBuilder:\"undefined\"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:!Ac?console.log(\"warning: no BlobBuilder\"):m;Cc=\"undefined\"!=typeof window?window.URL?window.URL:window.webkitURL:j;!s.Va&&\"undefined\"===typeof Cc&&(console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\"),s.Va=l);s.preloadPlugins.push({canHandle:function(a){return!s.Va&&/\\.(jpg|jpeg|png|bmp)$/i.test(a)},handle:function(a,b,\n c,d){var f=m;if(Ac)try{f=new Blob([a],{type:uc(b)}),f.size!==a.length&&(f=new Blob([(new Uint8Array(a)).buffer],{type:uc(b)}))}catch(g){var h=\"Blob constructor present but fails: \"+g+\"; falling back to blob builder\";ma||(ma={});ma[h]||(ma[h]=1,s.P(h))}f||(f=new Bc,f.append((new Uint8Array(a)).buffer),f=f.getBlob());var i=Cc.createObjectURL(f),n=new Image;n.onload=function(){A(n.complete,\"Image \"+b+\" could not be decoded\");var d=document.createElement(\"canvas\");d.width=n.width;d.height=n.height;d.getContext(\"2d\").drawImage(n,\n 0,0);s.preloadedImages[b]=d;Cc.revokeObjectURL(i);c&&c(a)};n.onerror=function(){console.log(\"Image \"+i+\" could not be decoded\");d&&d()};n.src=i}});s.preloadPlugins.push({canHandle:function(a){return!s.be&&a.substr(-4)in{\".ogg\":1,\".wav\":1,\".mp3\":1}},handle:function(a,b,c,d){function f(d){h||(h=l,s.preloadedAudios[b]=d,c&&c(a))}function g(){h||(h=l,s.preloadedAudios[b]=new Audio,d&&d())}var h=p;if(Ac){try{var i=new Blob([a],{type:uc(b)})}catch(n){return g()}var i=Cc.createObjectURL(i),t=new Audio;t.addEventListener(\"canplaythrough\",\n function(){f(t)},p);t.onerror=function(){if(!h){console.log(\"warning: browser could not fully decode audio \"+b+\", trying slower base64 approach\");for(var c=\"\",d=0,g=0,i=0;i<a.length;i++){d=d<<8|a[i];for(g+=8;6<=g;)var n=d>>g-6&63,g=g-6,c=c+\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"[n]}2==g?(c+=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"[(d&3)<<4],c+=\"==\"):4==g&&(c+=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"[(d&15)<<2],c+=\"=\");\n t.src=\"data:audio/x-\"+b.substr(-3)+\";base64,\"+c;f(t)}};t.src=i;setTimeout(function(){ua||f(t)},1E4)}else return g()}});var n=s.canvas;n.Ba=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock;n.Oa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||q();n.Oa=n.Oa.bind(document);document.addEventListener(\"pointerlockchange\",t,p);document.addEventListener(\"mozpointerlockchange\",t,p);document.addEventListener(\"webkitpointerlockchange\",t,p);s.elementPointerLock&&\n n.addEventListener(\"click\",function(a){!qc&&n.Ba&&(n.Ba(),a.preventDefault())},p)}var F=b?tb(U(a,b)):a;gb(\"cp \"+F);if(\"string\"==typeof c){var G=g,P=function(){G?G():e('Loading data file \"'+c+'\" failed.')},C=new XMLHttpRequest;C.open(\"GET\",c,l);C.responseType=\"arraybuffer\";C.onload=function(){if(200==C.status||0==C.status&&C.response){var a=C.response;A(a,'Loading data file \"'+c+'\" failed (no arrayBuffer).');a=new Uint8Array(a);y(a);hb(\"al \"+c)}else P()};C.onerror=P;C.send(m);gb(\"al \"+c)}else y(c)};\n s.FS_createLazyFile=function(a,b,c,d,f){var h,g;\"undefined\"!==typeof XMLHttpRequest?(ca||e(\"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc\"),h=function(){this.va=p;this.da=[]},h.prototype.get=function(a){if(!(a>this.length-1||0>a)){var b=a%this.rb;return this.vb(Math.floor(a/this.rb))[b]}},h.prototype.Gb=function(a){this.vb=a},h.prototype.Ka=function(){var a=new XMLHttpRequest;a.open(\"HEAD\",c,p);a.send(m);200<=a.status&&300>a.status||\n 304===a.status||e(Error(\"Couldn't load \"+c+\". Status: \"+a.status));var b=Number(a.getResponseHeader(\"Content-length\")),d,f=1048576;if(!((d=a.getResponseHeader(\"Accept-Ranges\"))&&\"bytes\"===d))f=b;var g=this;g.Gb(function(a){var d=a*f,h=(a+1)*f-1,h=Math.min(h,b-1);if(\"undefined\"===typeof g.da[a]){var i=g.da;d>h&&e(Error(\"invalid range (\"+d+\", \"+h+\") or no bytes requested!\"));h>b-1&&e(Error(\"only \"+b+\" bytes available! programmer error!\"));var k=new XMLHttpRequest;k.open(\"GET\",c,p);b!==f&&k.setRequestHeader(\"Range\",\n \"bytes=\"+d+\"-\"+h);\"undefined\"!=typeof Uint8Array&&(k.responseType=\"arraybuffer\");k.overrideMimeType&&k.overrideMimeType(\"text/plain; charset=x-user-defined\");k.send(m);200<=k.status&&300>k.status||304===k.status||e(Error(\"Couldn't load \"+c+\". Status: \"+k.status));d=k.response!==j?new Uint8Array(k.response||[]):H(k.responseText||\"\",l);i[a]=d}\"undefined\"===typeof g.da[a]&&e(Error(\"doXHR failed!\"));return g.da[a]});this.nb=b;this.mb=f;this.va=l},h=new h,Object.defineProperty(h,\"length\",{get:function(){this.va||\n this.Ka();return this.nb}}),Object.defineProperty(h,\"chunkSize\",{get:function(){this.va||this.Ka();return this.mb}}),g=j):(g=c,h=j);var i,a=U(\"string\"===typeof a?a:Kb(a),b);i=Tb(a,dc(d,f));h?i.o=h:g&&(i.o=m,i.url=g);var r={};Object.keys(i.k).forEach(function(a){var b=i.k[a];r[a]=function(){gc(i)||e(new V(R.L));return b.apply(m,arguments)}});r.K=function(a,b,c,d,f){gc(i)||e(new V(R.L));a=a.g.o;if(f>=a.length)return 0;d=Math.min(a.length-f,d);A(0<=d);if(a.slice)for(var g=0;g<d;g++)b[c+g]=a[f+g];else for(g=\n 0;g<d;g++)b[c+g]=a.get(f+g);return d};i.k=r;return i};s.FS_createLink=function(a,b,c){a=U(\"string\"===typeof a?a:Kb(a),b);return Wb(c,a)};s.FS_createDevice=fc;pb=pa(4);K[pb>>2]=0;O.unshift({M:q()});Xa.push({M:q()});var Dc=new na;w&&(require(\"fs\"),process.platform.match(/^win/));O.push({M:function(){Z.root=Rb(Z,m)}});\n s.requestFullScreen=function(a,b){function c(){pc=p;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement)===d?(d.La=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen,d.La=d.La.bind(document),sc&&d.Ba(),pc=l,tc&&xc()):tc&&yc();if(s.onFullScreen)s.onFullScreen(pc)}sc=a;tc=b;\"undefined\"===typeof sc&&(sc=l);\"undefined\"===typeof tc&&\n (tc=p);var d=s.canvas;rc||(rc=l,document.addEventListener(\"fullscreenchange\",c,p),document.addEventListener(\"mozfullscreenchange\",c,p),document.addEventListener(\"webkitfullscreenchange\",c,p));d.Eb=d.requestFullScreen||d.mozRequestFullScreen||(d.webkitRequestFullScreen?function(){d.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:m);d.Eb()};\n s.requestAnimationFrame=function(a){window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||window.setTimeout);window.requestAnimationFrame(a)};s.setCanvasSize=function(a,b,c){var d=s.canvas;d.width=a;d.height=b;c||wc()};s.pauseMainLoop=q();s.resumeMainLoop=function(){oc&&(oc=p,m())};\n s.getUserMedia=function(){window.Pa||(window.Pa=navigator.getUserMedia||navigator.mozGetUserMedia);window.Pa(j)};Ra=x=sa(B);Sa=Ra+5242880;Ta=D=sa(Sa);A(Ta<ra);Ca=Math.min;\n var $=(function(global,env,buffer) {\n // EMSCRIPTEN_START_ASM\n \"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=+env.NaN;var n=+env.Infinity;var o=0;var p=0;var q=0;var r=0;var s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0.0;var B=0;var C=0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=global.Math.floor;var M=global.Math.abs;var N=global.Math.sqrt;var O=global.Math.pow;var P=global.Math.cos;var Q=global.Math.sin;var R=global.Math.tan;var S=global.Math.acos;var T=global.Math.asin;var U=global.Math.atan;var V=global.Math.atan2;var W=global.Math.exp;var X=global.Math.log;var Y=global.Math.ceil;var Z=global.Math.imul;var _=env.abort;var $=env.assert;var aa=env.asmPrintInt;var ab=env.asmPrintFloat;var ac=env.min;var ad=env.invoke_ii;var ae=env.invoke_v;var af=env.invoke_iii;var ag=env.invoke_vi;var ah=env._llvm_lifetime_end;var ai=env._snprintf;var aj=env._abort;var ak=env._fprintf;var al=env._printf;var am=env._fflush;var an=env.__reallyNegative;var ao=env._sysconf;var ap=env.___setErrNo;var aq=env._fwrite;var ar=env._send;var as=env._write;var at=env._exit;var au=env._sprintf;var av=env.__formatString;var aw=env.__ZSt9terminatev;var ax=env._pwrite;var ay=env._sbrk;var az=env.___errno_location;var aA=env.___gxx_personality_v0;var aB=env._llvm_lifetime_start;var aC=env._time;var aD=env.__exit;\n // EMSCRIPTEN_START_FUNCS\n function aI(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function aJ(){return i|0}function aK(a){a=a|0;i=a}function aL(a,b){a=a|0;b=b|0;if((o|0)==0){o=a;p=b}}function aM(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function aN(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function aO(a){a=a|0;B=a}function aP(a){a=a|0;C=a}function aQ(a){a=a|0;D=a}function aR(a){a=a|0;E=a}function aS(a){a=a|0;F=a}function aT(a){a=a|0;G=a}function aU(a){a=a|0;H=a}function aV(a){a=a|0;I=a}function aW(a){a=a|0;J=a}function aX(a){a=a|0;K=a}function aY(){}function aZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;f=i;i=i+1032|0;g=f|0;h=f+512|0;j=f+520|0;k=a+8|0;if((c[a+4>>2]|0)>>>0>(c[k>>2]|0)>>>0){l=j|0;au(l|0,768,(m=i,i=i+24|0,c[m>>2]=472,c[m+8>>2]=2121,c[m+16>>2]=744,m)|0)|0;i=m;al(l|0,(m=i,i=i+1|0,i=i+7&-8,c[m>>2]=0,m)|0)|0;i=m}if((2147418112/(e>>>0)|0)>>>0<=b>>>0){l=j|0;au(l|0,768,(m=i,i=i+24|0,c[m>>2]=472,c[m+8>>2]=2122,c[m+16>>2]=328,m)|0)|0;i=m;al(l|0,(m=i,i=i+1|0,i=i+7&-8,c[m>>2]=0,m)|0)|0;i=m}l=c[k>>2]|0;if(l>>>0>=b>>>0){n=1;i=f;return n|0}do{if(d){o=b-1|0;if((b|0)!=0){if((o&b|0)==0){p=b;break}}q=o>>>16|o;o=q>>>8|q;q=o>>>4|o;o=q>>>2|q;p=(o>>>1|o)+1|0}else{p=b}}while(0);if(!((p|0)!=0&p>>>0>l>>>0)){l=j|0;au(l|0,768,(m=i,i=i+24|0,c[m>>2]=472,c[m+8>>2]=2131,c[m+16>>2]=152,m)|0)|0;i=m;al(l|0,(m=i,i=i+1|0,i=i+7&-8,c[m>>2]=0,m)|0)|0;i=m}l=Z(p,e)|0;j=a|0;a=c[j>>2]|0;if((a&7|0)!=0){b=g|0;au(b|0,768,(m=i,i=i+24|0,c[m>>2]=472,c[m+8>>2]=2500,c[m+16>>2]=600,m)|0)|0;i=m;al(b|0,(m=i,i=i+1|0,i=i+7&-8,c[m>>2]=0,m)|0)|0;i=m;n=0;i=f;return n|0}if(l>>>0>2147418112){b=g|0;au(b|0,768,(m=i,i=i+24|0,c[m>>2]=472,c[m+8>>2]=2500,c[m+16>>2]=712,m)|0)|0;i=m;al(b|0,(m=i,i=i+1|0,i=i+7&-8,c[m>>2]=0,m)|0)|0;i=m;n=0;i=f;return n|0}c[h>>2]=l;b=a$(a,l,h,1)|0;a=c[h>>2]|0;if((b&7|0)!=0){h=g|0;au(h|0,768,(m=i,i=i+24|0,c[m>>2]=472,c[m+8>>2]=2552,c[m+16>>2]=624,m)|0)|0;i=m;al(h|0,(m=i,i=i+1|0,i=i+7&-8,c[m>>2]=0,m)|0)|0;i=m}if((b|0)==0){n=0;i=f;return n|0}c[j>>2]=b;if(a>>>0>l>>>0){r=(a>>>0)/(e>>>0)|0}else{r=p}c[k>>2]=r;n=1;i=f;return n|0}function a_(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0;b=i;i=i+512|0;d=b|0;e=a+3&-4;a=(e|0)==0?4:e;if(a>>>0>2147418112){e=d|0;au(e|0,768,(f=i,i=i+24|0,c[f>>2]=472,c[f+8>>2]=2500,c[f+16>>2]=712,f)|0)|0;i=f;al(e|0,(f=i,i=i+1|0,i=i+7&-8,c[f>>2]=0,f)|0)|0;i=f;g=0;i=b;return g|0}e=be(a)|0;do{if((e|0)!=0){h=c[e-4>>2]|0;j=h&3;if((j|0)==1){k=0}else{k=(h&-8)-((j|0)==0?8:4)|0}if(k>>>0<a>>>0){break}if((e&7|0)==0){g=e;i=b;return g|0}j=d|0;au(j|0,768,(f=i,i=i+24|0,c[f>>2]=472,c[f+8>>2]=2527,c[f+16>>2]=624,f)|0)|0;i=f;al(j|0,(f=i,i=i+1|0,i=i+7&-8,c[f>>2]=0,f)|0)|0;i=f;g=e;i=b;return g|0}}while(0);e=d|0;au(e|0,768,(f=i,i=i+24|0,c[f>>2]=472,c[f+8>>2]=2500,c[f+16>>2]=680,f)|0)|0;i=f;al(e|0,(f=i,i=i+1|0,i=i+7&-8,c[f>>2]=0,f)|0)|0;i=f;g=0;i=b;return g|0}function a$(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;if((a|0)==0){f=be(b)|0;if((d|0)==0){g=f;return g|0}do{if((f|0)==0){h=0}else{i=c[f-4>>2]|0;j=i&3;if((j|0)==1){h=0;break}h=(i&-8)-((j|0)==0?8:4)|0}}while(0);c[d>>2]=h;g=f;return g|0}if((b|0)==0){bf(a);if((d|0)==0){g=0;return g|0}c[d>>2]=0;g=0;return g|0}f=bg(a,b)|0;h=(f|0)!=0;if(h|e^1){k=h?f:a;l=f}else{f=bg(a,b)|0;k=(f|0)==0?a:f;l=f}if((d|0)==0){g=l;return g|0}do{if((k|0)==0){m=0}else{f=c[k-4>>2]|0;a=f&3;if((a|0)==1){m=0;break}m=(f&-8)-((a|0)==0?8:4)|0}}while(0);c[d>>2]=m;g=l;return g|0}function a0(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0;if((b|0)==0|e>>>0<74|(f|0)==0){return}if((c[f>>2]|0)!=40){return}if(((d[b]|0)<<8|(d[b+1|0]|0)|0)!=18552){return}if(((d[b+2|0]|0)<<8|(d[b+3|0]|0))>>>0<74){return}g=((d[b+7|0]|0)<<16|(d[b+6|0]|0)<<24|(d[b+8|0]|0)<<8|(d[b+9|0]|0))>>>0>e>>>0?0:b;if((g|0)==0){return}c[f+4>>2]=(d[g+12|0]|0)<<8|(d[g+13|0]|0);c[f+8>>2]=(d[g+14|0]|0)<<8|(d[g+15|0]|0);c[f+12>>2]=d[g+16|0]|0;c[f+16>>2]=d[g+17|0]|0;b=g+18|0;e=f+32|0;c[e>>2]=d[b]|0;c[e+4>>2]=0;e=a[b]|0;if(e<<24>>24==0){h=8}else{h=e<<24>>24==9?8:16}c[f+20>>2]=h;c[f+24>>2]=(d[g+26|0]|0)<<16|(d[g+25|0]|0)<<24|(d[g+27|0]|0)<<8|(d[g+28|0]|0);c[f+28>>2]=(d[g+30|0]|0)<<16|(d[g+29|0]|0)<<24|(d[g+31|0]|0)<<8|(d[g+32|0]|0);return}function a1(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+512|0;e=c[b+20>>2]|0;if((e|0)!=0){a2(e)}e=b+4|0;f=c[e>>2]|0;if((f|0)==0){g=b+16|0;a[g]=0;i=d;return}if((f&7|0)==0){bf(f)}else{f=d|0;au(f|0,768,(h=i,i=i+24|0,c[h>>2]=472,c[h+8>>2]=2500,c[h+16>>2]=576,h)|0)|0;i=h;al(f|0,(h=i,i=i+1|0,i=i+7&-8,c[h>>2]=0,h)|0)|0;i=h}c[e>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;g=b+16|0;a[g]=0;i=d;return}function a2(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;b=i;i=i+1536|0;d=b|0;e=b+512|0;f=b+1024|0;if((a|0)==0){i=b;return}g=c[a+168>>2]|0;do{if((g|0)!=0){h=c[g-4>>2]|0;j=g-8|0;if((h|0)==0){k=94}else{if((h|0)!=(~c[j>>2]|0)){k=94}}if((k|0)==94){h=d|0;au(h|0,768,(l=i,i=i+24|0,c[l>>2]=472,c[l+8>>2]=645,c[l+16>>2]=280,l)|0)|0;i=l;al(h|0,(l=i,i=i+1|0,i=i+7&-8,c[l>>2]=0,l)|0)|0;i=l;if((j|0)==0){break}}if((j&7|0)!=0){h=d|0;au(h|0,768,(l=i,i=i+24|0,c[l>>2]=472,c[l+8>>2]=2500,c[l+16>>2]=576,l)|0)|0;i=l;al(h|0,(l=i,i=i+1|0,i=i+7&-8,c[l>>2]=0,l)|0)|0;i=l;break}if((j|0)==0){be(0)|0;break}else{bf(j);break}}}while(0);d=c[a+176>>2]|0;do{if((d|0)!=0){g=c[d-4>>2]|0;j=d-8|0;if((g|0)==0){k=103}else{if((g|0)!=(~c[j>>2]|0)){k=103}}if((k|0)==103){g=f|0;au(g|0,768,(l=i,i=i+24|0,c[l>>2]=472,c[l+8>>2]=645,c[l+16>>2]=280,l)|0)|0;i=l;al(g|0,(l=i,i=i+1|0,i=i+7&-8,c[l>>2]=0,l)|0)|0;i=l;if((j|0)==0){break}}if((j&7|0)!=0){g=f|0;au(g|0,768,(l=i,i=i+24|0,c[l>>2]=472,c[l+8>>2]=2500,c[l+16>>2]=576,l)|0)|0;i=l;al(g|0,(l=i,i=i+1|0,i=i+7&-8,c[l>>2]=0,l)|0)|0;i=l;break}if((j|0)==0){be(0)|0;break}else{bf(j);break}}}while(0);if((a&7|0)==0){bf(a);i=b;return}else{a=e|0;au(a|0,768,(l=i,i=i+24|0,c[l>>2]=472,c[l+8>>2]=2500,c[l+16>>2]=576,l)|0)|0;i=l;al(a|0,(l=i,i=i+1|0,i=i+7&-8,c[l>>2]=0,l)|0)|0;i=l;i=b;return}}function a3(f){f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0;g=i;i=i+1232|0;h=g|0;j=g+512|0;k=g+576|0;l=g+648|0;m=g+720|0;n=f+8|0;o=c[n>>2]|0;if(!((o|0)!=0&o>>>0<8193)){p=m|0;au(p|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=2998,c[q+16>>2]=496,q)|0)|0;i=q;al(p|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q}p=f|0;c[p>>2]=o;r=f+20|0;s=c[r>>2]|0;if((s|0)==0){t=a_(180)|0;if((t|0)==0){u=0}else{bj(t+164|0,0,16);u=t}c[r>>2]=u;v=u;w=c[p>>2]|0}else{v=s;w=o}if((c[n>>2]|0)==0){n=m|0;au(n|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=904,c[q+16>>2]=312,q)|0)|0;i=q;al(n|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q;x=c[p>>2]|0}else{x=w}p=c[f+4>>2]|0;if(x>>>0>16){f=x;n=0;while(1){y=n+1|0;if(f>>>0>3){f=f>>>1;n=y}else{break}}f=n+2+((y|0)!=32&1<<y>>>0<x>>>0&1)|0;z=f>>>0<11?f&255:11}else{z=0}if((w|0)==0|z>>>0>11){A=0;i=g;return A|0}c[v>>2]=w;bj(k|0,0,68);f=0;while(1){x=a[p+f|0]|0;if(x<<24>>24!=0){y=k+((x&255)<<2)|0;c[y>>2]=(c[y>>2]|0)+1}y=f+1|0;if(y>>>0<w>>>0){f=y}else{B=1;C=-1;D=0;E=0;F=0;break}}while(1){f=c[k+(B<<2)>>2]|0;if((f|0)==0){c[v+28+(B-1<<2)>>2]=0;G=F;H=E;I=D;J=C}else{y=B-1|0;c[j+(y<<2)>>2]=F;x=f+F|0;n=16-B|0;c[v+28+(y<<2)>>2]=(x-1<<n|(1<<n)-1)+1;c[v+96+(y<<2)>>2]=E;c[l+(B<<2)>>2]=E;G=x;H=f+E|0;I=D>>>0>B>>>0?D:B;J=C>>>0<B>>>0?C:B}f=B+1|0;if(f>>>0<17){B=f;C=J;D=I;E=H;F=G<<1}else{break}}c[v+4>>2]=H;G=v+172|0;do{if(H>>>0>(c[G>>2]|0)>>>0){c[G>>2]=H;F=H-1|0;if((H|0)==0){K=140}else{if((F&H|0)!=0){K=140}}if((K|0)==140){E=F>>>16|F;F=E>>>8|E;E=F>>>4|F;F=E>>>2|E;E=(F>>>1|F)+1|0;c[G>>2]=E>>>0>w>>>0?w:E}E=v+176|0;F=c[E>>2]|0;do{if((F|0)!=0){D=c[F-4>>2]|0;C=F-8|0;if((D|0)==0){K=144}else{if((D|0)!=(~c[C>>2]|0)){K=144}}if((K|0)==144){D=h|0;au(D|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=645,c[q+16>>2]=280,q)|0)|0;i=q;al(D|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q;if((C|0)==0){break}}if((C&7|0)!=0){D=h|0;au(D|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=2500,c[q+16>>2]=576,q)|0)|0;i=q;al(D|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q;break}if((C|0)==0){be(0)|0;break}else{bf(C);break}}}while(0);F=c[G>>2]|0;C=(F|0)==0?1:F;F=a_((C<<1)+8|0)|0;if((F|0)==0){c[E>>2]=0;A=0;i=g;return A|0}else{D=F+8|0;c[F+4>>2]=C;c[F>>2]=~C;c[E>>2]=D;if((D|0)==0){A=0}else{L=E;break}i=g;return A|0}}else{L=v+176|0}}while(0);G=v+24|0;a[G]=J&255;a[v+25|0]=I&255;J=h|0;h=0;do{D=a[p+h|0]|0;C=D&255;if(D<<24>>24!=0){if((c[k+(C<<2)>>2]|0)==0){au(J|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=2274,c[q+16>>2]=136,q)|0)|0;i=q;al(J|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q}D=l+(C<<2)|0;C=c[D>>2]|0;c[D>>2]=C+1;if(C>>>0>=H>>>0){au(J|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=2278,c[q+16>>2]=104,q)|0)|0;i=q;al(J|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q}b[(c[L>>2]|0)+(C<<1)>>1]=h&65535}h=h+1|0;}while(h>>>0<w>>>0);w=a[G]|0;h=(w&255)>>>0<z>>>0?z:0;z=v+8|0;c[z>>2]=h;H=(h|0)!=0;if(H){l=1<<h;C=v+164|0;do{if(l>>>0>(c[C>>2]|0)>>>0){c[C>>2]=l;D=v+168|0;F=c[D>>2]|0;do{if((F|0)!=0){B=c[F-4>>2]|0;f=F-8|0;if((B|0)==0){K=169}else{if((B|0)!=(~c[f>>2]|0)){K=169}}if((K|0)==169){au(J|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=645,c[q+16>>2]=280,q)|0)|0;i=q;al(J|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q;if((f|0)==0){break}}if((f&7|0)!=0){au(J|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=2500,c[q+16>>2]=576,q)|0)|0;i=q;al(J|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q;break}if((f|0)==0){be(0)|0;break}else{bf(f);break}}}while(0);F=l<<2;E=a_(F+8|0)|0;if((E|0)==0){c[D>>2]=0;A=0;i=g;return A|0}else{f=E+8|0;B=f;c[E+4>>2]=l;c[E>>2]=~l;c[D>>2]=B;if((f|0)==0){A=0}else{M=B;N=F;break}i=g;return A|0}}else{M=c[v+168>>2]|0;N=l<<2}}while(0);K=v+168|0;bj(M|0,-1|0,N|0);N=1;do{do{if((c[k+(N<<2)>>2]|0)!=0){M=h-N|0;C=1<<M;F=N-1|0;B=c[j+(F<<2)>>2]|0;if(!((N|0)!=0&N>>>0<17)){au(J|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=1954,c[q+16>>2]=200,q)|0)|0;i=q;al(J|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q}f=c[v+28+(F<<2)>>2]|0;if((f|0)==0){O=-1}else{O=(f-1|0)>>>((16-N|0)>>>0)}if(B>>>0>O>>>0){break}f=(c[v+96+(F<<2)>>2]|0)-B|0;F=N<<16;E=B;do{B=e[(c[L>>2]|0)+(f+E<<1)>>1]|0;if((d[p+B|0]|0|0)!=(N|0)){au(J|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=2320,c[q+16>>2]=64,q)|0)|0;i=q;al(J|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q}x=E<<M;y=B|F;B=0;do{n=B+x|0;if(n>>>0>=l>>>0){au(J|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=2326,c[q+16>>2]=40,q)|0)|0;i=q;al(J|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q}m=c[K>>2]|0;if((c[m+(n<<2)>>2]|0)==-1){P=m}else{au(J|0,768,(q=i,i=i+24|0,c[q>>2]=472,c[q+8>>2]=2328,c[q+16>>2]=8,q)|0)|0;i=q;al(J|0,(q=i,i=i+1|0,i=i+7&-8,c[q>>2]=0,q)|0)|0;i=q;P=c[K>>2]|0}c[P+(n<<2)>>2]=y;B=B+1|0;}while(B>>>0<C>>>0);E=E+1|0;}while(E>>>0<=O>>>0)}}while(0);N=N+1|0;}while(N>>>0<=h>>>0);Q=a[G]|0}else{Q=w}w=v+96|0;c[w>>2]=(c[w>>2]|0)-(c[j>>2]|0);w=v+100|0;c[w>>2]=(c[w>>2]|0)-(c[j+4>>2]|0);w=v+104|0;c[w>>2]=(c[w>>2]|0)-(c[j+8>>2]|0);w=v+108|0;c[w>>2]=(c[w>>2]|0)-(c[j+12>>2]|0);w=v+112|0;c[w>>2]=(c[w>>2]|0)-(c[j+16>>2]|0);w=v+116|0;c[w>>2]=(c[w>>2]|0)-(c[j+20>>2]|0);w=v+120|0;c[w>>2]=(c[w>>2]|0)-(c[j+24>>2]|0);w=v+124|0;c[w>>2]=(c[w>>2]|0)-(c[j+28>>2]|0);w=v+128|0;c[w>>2]=(c[w>>2]|0)-(c[j+32>>2]|0);w=v+132|0;c[w>>2]=(c[w>>2]|0)-(c[j+36>>2]|0);w=v+136|0;c[w>>2]=(c[w>>2]|0)-(c[j+40>>2]|0);w=v+140|0;c[w>>2]=(c[w>>2]|0)-(c[j+44>>2]|0);w=v+144|0;c[w>>2]=(c[w>>2]|0)-(c[j+48>>2]|0);w=v+148|0;c[w>>2]=(c[w>>2]|0)-(c[j+52>>2]|0);w=v+152|0;c[w>>2]=(c[w>>2]|0)-(c[j+56>>2]|0);w=v+156|0;c[w>>2]=(c[w>>2]|0)-(c[j+60>>2]|0);j=v+16|0;c[j>>2]=0;w=v+20|0;c[w>>2]=Q&255;L279:do{if(H){Q=h;while(1){if((Q|0)==0){break L279}R=Q-1|0;if((c[k+(Q<<2)>>2]|0)==0){Q=R}else{break}}c[j>>2]=c[v+28+(R<<2)>>2];Q=h+1|0;c[w>>2]=Q;G=Q;while(1){if(G>>>0>I>>>0){break L279}if((c[k+(G<<2)>>2]|0)==0){G=G+1|0}else{break}}c[w>>2]=G}}while(0);c[v+92>>2]=-1;c[v+160>>2]=1048575;c[v+12>>2]=32-(c[z>>2]|0);A=1;i=g;return A|0}function a4(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ab=0,ac=0,ad=0,ae=0,af=0,ag=0,ah=0,ai=0,aj=0;f=i;i=i+4120|0;g=f+512|0;h=f+1024|0;j=f+1536|0;k=f+2048|0;l=f+2560|0;m=f+3072|0;n=f+3584|0;o=f+4096|0;p=b+20|0;q=c[p>>2]|0;if((q|0)<14){r=b+4|0;s=b+8|0;t=b+16|0;u=f|0;v=q;while(1){w=c[r>>2]|0;if((w|0)==(c[s>>2]|0)){x=0}else{c[r>>2]=w+1;x=d[w]|0}w=v+8|0;c[p>>2]=w;if((w|0)<33){y=w}else{au(u|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=3200,c[z+16>>2]=432,z)|0)|0;i=z;al(u|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;y=c[p>>2]|0}w=x<<32-y|c[t>>2];c[t>>2]=w;if((y|0)<14){v=y}else{A=y;B=w;break}}}else{A=q;B=c[b+16>>2]|0}q=b+16|0;y=B>>>18;c[q>>2]=B<<14;c[p>>2]=A-14;if((y|0)==0){c[e>>2]=0;A=e+4|0;B=c[A>>2]|0;if((B|0)!=0){if((B&7|0)==0){bf(B)}else{B=n|0;au(B|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=2500,c[z+16>>2]=576,z)|0)|0;i=z;al(B|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z}c[A>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0}a[e+16|0]=0;A=e+20|0;B=c[A>>2]|0;if((B|0)==0){C=1;i=f;return C|0}a2(B);c[A>>2]=0;C=1;i=f;return C|0}A=e+4|0;B=e+8|0;v=c[B>>2]|0;if((v|0)!=(y|0)){if(v>>>0<=y>>>0){do{if((c[e+12>>2]|0)>>>0<y>>>0){if(aZ(A,y,(v+1|0)==(y|0),1)|0){D=c[B>>2]|0;break}a[e+16|0]=1;C=0;i=f;return C|0}else{D=v}}while(0);bj((c[A>>2]|0)+D|0,0,y-D|0)}c[B>>2]=y}D=A|0;bj(c[D>>2]|0,0,y|0);A=c[p>>2]|0;if((A|0)<5){v=b+4|0;t=b+8|0;x=m|0;m=A;while(1){u=c[v>>2]|0;if((u|0)==(c[t>>2]|0)){E=0}else{c[v>>2]=u+1;E=d[u]|0}u=m+8|0;c[p>>2]=u;if((u|0)<33){F=u}else{au(x|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=3200,c[z+16>>2]=432,z)|0)|0;i=z;al(x|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;F=c[p>>2]|0}u=E<<32-F|c[q>>2];c[q>>2]=u;if((F|0)<5){m=F}else{G=F;H=u;break}}}else{G=A;H=c[q>>2]|0}A=H>>>27;c[q>>2]=H<<5;c[p>>2]=G-5;if((A|0)==0|H>>>0>2952790015){C=0;i=f;return C|0}c[o+20>>2]=0;bj(o|0,0,17);H=o+4|0;G=o+8|0;L345:do{if(aZ(H,21,0,1)|0){F=c[G>>2]|0;m=c[H>>2]|0;bj(m+F|0,0,21-F|0);c[G>>2]=21;F=b+4|0;E=b+8|0;x=l|0;v=0;do{t=c[p>>2]|0;if((t|0)<3){u=t;while(1){r=c[F>>2]|0;if((r|0)==(c[E>>2]|0)){I=0}else{c[F>>2]=r+1;I=d[r]|0}r=u+8|0;c[p>>2]=r;if((r|0)<33){J=r}else{au(x|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=3200,c[z+16>>2]=432,z)|0)|0;i=z;al(x|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;J=c[p>>2]|0}r=I<<32-J|c[q>>2];c[q>>2]=r;if((J|0)<3){u=J}else{K=J;L=r;break}}}else{K=t;L=c[q>>2]|0}c[q>>2]=L<<3;c[p>>2]=K-3;a[m+(d[808+v|0]|0)|0]=L>>>29&255;v=v+1|0;}while(v>>>0<A>>>0);if(!(a3(o)|0)){M=0;break}v=n|0;m=h|0;x=g|0;u=k|0;r=j|0;s=0;L362:while(1){w=y-s|0;N=a5(b,o)|0;do{if(N>>>0<17){if((c[B>>2]|0)>>>0<=s>>>0){au(v|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=904,c[z+16>>2]=312,z)|0)|0;i=z;al(v|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z}a[(c[D>>2]|0)+s|0]=N&255;O=s+1|0}else{if((N|0)==18){P=c[p>>2]|0;if((P|0)<7){Q=P;while(1){R=c[F>>2]|0;if((R|0)==(c[E>>2]|0)){S=0}else{c[F>>2]=R+1;S=d[R]|0}R=Q+8|0;c[p>>2]=R;if((R|0)<33){T=R}else{au(r|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=3200,c[z+16>>2]=432,z)|0)|0;i=z;al(r|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;T=c[p>>2]|0}R=S<<32-T|c[q>>2];c[q>>2]=R;if((T|0)<7){Q=T}else{U=T;V=R;break}}}else{U=P;V=c[q>>2]|0}c[q>>2]=V<<7;c[p>>2]=U-7;Q=(V>>>25)+11|0;if(Q>>>0>w>>>0){M=0;break L345}O=Q+s|0;break}else if((N|0)==17){Q=c[p>>2]|0;if((Q|0)<3){R=Q;while(1){W=c[F>>2]|0;if((W|0)==(c[E>>2]|0)){X=0}else{c[F>>2]=W+1;X=d[W]|0}W=R+8|0;c[p>>2]=W;if((W|0)<33){Y=W}else{au(u|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=3200,c[z+16>>2]=432,z)|0)|0;i=z;al(u|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;Y=c[p>>2]|0}W=X<<32-Y|c[q>>2];c[q>>2]=W;if((Y|0)<3){R=Y}else{Z=Y;_=W;break}}}else{Z=Q;_=c[q>>2]|0}c[q>>2]=_<<3;c[p>>2]=Z-3;R=(_>>>29)+3|0;if(R>>>0>w>>>0){M=0;break L345}O=R+s|0;break}else{if((N-19|0)>>>0>=2){$=306;break L362}R=c[p>>2]|0;if((N|0)==19){if((R|0)<2){P=R;while(1){W=c[F>>2]|0;if((W|0)==(c[E>>2]|0)){aa=0}else{c[F>>2]=W+1;aa=d[W]|0}W=P+8|0;c[p>>2]=W;if((W|0)<33){ab=W}else{au(m|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=3200,c[z+16>>2]=432,z)|0)|0;i=z;al(m|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;ab=c[p>>2]|0}W=aa<<32-ab|c[q>>2];c[q>>2]=W;if((ab|0)<2){P=ab}else{ac=ab;ad=W;break}}}else{ac=R;ad=c[q>>2]|0}c[q>>2]=ad<<2;c[p>>2]=ac-2;ae=(ad>>>30)+3|0}else{if((R|0)<6){P=R;while(1){Q=c[F>>2]|0;if((Q|0)==(c[E>>2]|0)){af=0}else{c[F>>2]=Q+1;af=d[Q]|0}Q=P+8|0;c[p>>2]=Q;if((Q|0)<33){ag=Q}else{au(x|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=3200,c[z+16>>2]=432,z)|0)|0;i=z;al(x|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;ag=c[p>>2]|0}Q=af<<32-ag|c[q>>2];c[q>>2]=Q;if((ag|0)<6){P=ag}else{ah=ag;ai=Q;break}}}else{ah=R;ai=c[q>>2]|0}c[q>>2]=ai<<6;c[p>>2]=ah-6;ae=(ai>>>26)+7|0}if((s|0)==0|ae>>>0>w>>>0){M=0;break L345}P=s-1|0;if((c[B>>2]|0)>>>0<=P>>>0){au(v|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=904,c[z+16>>2]=312,z)|0)|0;i=z;al(v|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z}Q=a[(c[D>>2]|0)+P|0]|0;if(Q<<24>>24==0){M=0;break L345}P=ae+s|0;if(s>>>0<P>>>0){aj=s}else{O=s;break}while(1){if((c[B>>2]|0)>>>0<=aj>>>0){au(v|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=904,c[z+16>>2]=312,z)|0)|0;i=z;al(v|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z}W=aj+1|0;a[(c[D>>2]|0)+aj|0]=Q;if(W>>>0<P>>>0){aj=W}else{O=P;break}}}}}while(0);if(O>>>0<y>>>0){s=O}else{break}}if(($|0)==306){au(v|0,768,(z=i,i=i+24|0,c[z>>2]=472,c[z+8>>2]=3141,c[z+16>>2]=464,z)|0)|0;i=z;al(v|0,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;M=0;break}if((O|0)!=(y|0)){M=0;break}M=a3(e)|0}else{a[o+16|0]=1;M=0}}while(0);a1(o);C=M;i=f;return C|0}function a5(a,b){a=a|0;b=b|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;f=i;i=i+512|0;g=f|0;h=c[b+20>>2]|0;j=a+20|0;k=c[j>>2]|0;do{if((k|0)<24){l=a+4|0;m=c[l>>2]|0;n=c[a+8>>2]|0;o=m>>>0<n>>>0;if((k|0)>=16){if(o){c[l>>2]=m+1;p=d[m]|0}else{p=0}c[j>>2]=k+8;q=a+16|0;r=p<<24-k|c[q>>2];c[q>>2]=r;s=r;break}if(o){t=(d[m]|0)<<8;u=m+1|0}else{t=0;u=m}if(u>>>0<n>>>0){v=d[u]|0;w=u+1|0}else{v=0;w=u}c[l>>2]=w;c[j>>2]=k+16;l=a+16|0;n=(v|t)<<16-k|c[l>>2];c[l>>2]=n;s=n}else{s=c[a+16>>2]|0}}while(0);k=a+16|0;a=(s>>>16)+1|0;do{if(a>>>0>(c[h+16>>2]|0)>>>0){t=c[h+20>>2]|0;while(1){x=t-1|0;if(a>>>0>(c[h+28+(x<<2)>>2]|0)>>>0){t=t+1|0}else{break}}v=(c[h+96+(x<<2)>>2]|0)+(s>>>((32-t|0)>>>0))|0;if(v>>>0<(c[b>>2]|0)>>>0){y=t;z=e[(c[h+176>>2]|0)+(v<<1)>>1]|0;break}v=g|0;au(v|0,768,(A=i,i=i+24|0,c[A>>2]=472,c[A+8>>2]=3267,c[A+16>>2]=464,A)|0)|0;i=A;al(v|0,(A=i,i=i+1|0,i=i+7&-8,c[A>>2]=0,A)|0)|0;i=A;B=0;i=f;return B|0}else{v=c[(c[h+168>>2]|0)+(s>>>((32-(c[h+8>>2]|0)|0)>>>0)<<2)>>2]|0;if((v|0)==-1){w=g|0;au(w|0,768,(A=i,i=i+24|0,c[A>>2]=472,c[A+8>>2]=3245,c[A+16>>2]=408,A)|0)|0;i=A;al(w|0,(A=i,i=i+1|0,i=i+7&-8,c[A>>2]=0,A)|0)|0;i=A}w=v&65535;u=v>>>16;if((c[b+8>>2]|0)>>>0<=w>>>0){v=g|0;au(v|0,768,(A=i,i=i+24|0,c[A>>2]=472,c[A+8>>2]=903,c[A+16>>2]=312,A)|0)|0;i=A;al(v|0,(A=i,i=i+1|0,i=i+7&-8,c[A>>2]=0,A)|0)|0;i=A}if((d[(c[b+4>>2]|0)+w|0]|0|0)==(u|0)){y=u;z=w;break}v=g|0;au(v|0,768,(A=i,i=i+24|0,c[A>>2]=472,c[A+8>>2]=3249,c[A+16>>2]=376,A)|0)|0;i=A;al(v|0,(A=i,i=i+1|0,i=i+7&-8,c[A>>2]=0,A)|0)|0;i=A;y=u;z=w}}while(0);c[k>>2]=c[k>>2]<<y;c[j>>2]=(c[j>>2]|0)-y;B=z;i=f;return B|0}function a6(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+40|0;e=d|0;c[e>>2]=40;a0(a,b,e);i=d;return c[e+4>>2]|0}function a7(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+40|0;e=d|0;c[e>>2]=40;a0(a,b,e);i=d;return c[e+8>>2]|0}function a8(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+40|0;e=d|0;c[e>>2]=40;a0(a,b,e);i=d;return c[e+12>>2]|0}function a9(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+40|0;e=d|0;c[e>>2]=40;a0(a,b,e);i=d;return c[e+32>>2]|0}function ba(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+552|0;e=d|0;f=d+512|0;c[f>>2]=40;a0(a,b,f);b=f+32|0;f=c[b>>2]|0;a=c[b+4>>2]|0;b=9;g=0;h=0;j=0;if((f|0)==1&(a|0)==0|(f|0)==2&(a|0)==0|(f|0)==7&(a|0)==0|(f|0)==8&(a|0)==0|(f|0)==3&(a|0)==0|(f|0)==4&(a|0)==0|(f|0)==5&(a|0)==0|(f|0)==6&(a|0)==0){k=16;i=d;return k|0}else if((f|0)==(h|0)&(a|0)==(j|0)|(f|0)==(b|0)&(a|0)==(g|0)){k=8;i=d;return k|0}else{g=e|0;au(g|0,768,(e=i,i=i+24|0,c[e>>2]=472,c[e+8>>2]=2664,c[e+16>>2]=568,e)|0)|0;i=e;al(g|0,(e=i,i=i+1|0,i=i+7&-8,c[e>>2]=0,e)|0)|0;i=e;k=0;i=d;return k|0}return 0}function bb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;e=i;i=i+552|0;f=e|0;g=e+512|0;c[g>>2]=40;a0(a,b,g);b=(((c[g+4>>2]|0)>>>(d>>>0))+3|0)>>>2;a=(((c[g+8>>2]|0)>>>(d>>>0))+3|0)>>>2;d=g+32|0;g=c[d>>2]|0;h=c[d+4>>2]|0;d=9;j=0;k=0;l=0;if((g|0)==1&(h|0)==0|(g|0)==2&(h|0)==0|(g|0)==7&(h|0)==0|(g|0)==8&(h|0)==0|(g|0)==3&(h|0)==0|(g|0)==4&(h|0)==0|(g|0)==5&(h|0)==0|(g|0)==6&(h|0)==0){m=16;n=Z(a,b)|0;o=Z(n,m)|0;i=e;return o|0}else if((g|0)==(k|0)&(h|0)==(l|0)|(g|0)==(d|0)&(h|0)==(j|0)){m=8;n=Z(a,b)|0;o=Z(n,m)|0;i=e;return o|0}else{j=f|0;au(j|0,768,(f=i,i=i+24|0,c[f>>2]=472,c[f+8>>2]=2664,c[f+16>>2]=568,f)|0)|0;i=f;al(j|0,(f=i,i=i+1|0,i=i+7&-8,c[f>>2]=0,f)|0)|0;i=f;m=0;n=Z(a,b)|0;o=Z(n,m)|0;i=e;return o|0}return 0}function bc(f,g,h,j,k,l){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,_=0,$=0,aa=0,ab=0,ac=0,ad=0,ae=0,af=0,ag=0,ah=0,ai=0,aj=0,ak=0,am=0,an=0,ao=0,ap=0,aq=0,ar=0,as=0,at=0,av=0,aw=0,ax=0,ay=0,az=0,aA=0,aB=0,aC=0,aD=0,aE=0,aF=0,aG=0,aH=0,aI=0,aJ=0,aK=0,aL=0,aM=0,aN=0,aO=0,aP=0,aQ=0,aR=0,aS=0,aT=0,aU=0,aV=0,aW=0,aX=0,aY=0,a$=0,a2=0,a3=0,a6=0,a7=0,a8=0,a9=0,ba=0,bb=0,bc=0,be=0,bg=0,bh=0,bi=0,bk=0,bl=0,bm=0,bn=0,bo=0,bp=0,bq=0,br=0,bs=0,bt=0,bu=0,bv=0,bw=0,bx=0,by=0,bz=0,bA=0,bB=0,bC=0,bD=0,bE=0,bF=0,bG=0,bH=0,bI=0,bJ=0,bK=0,bL=0,bM=0,bN=0,bO=0,bP=0,bQ=0,bR=0,bS=0,bT=0,bU=0,bV=0,bW=0,bX=0,bY=0,bZ=0,b_=0,b$=0,b0=0,b1=0,b2=0,b3=0,b4=0,b5=0,b6=0,b7=0,b8=0,b9=0,ca=0,cb=0,cc=0,cd=0,ce=0,cf=0,cg=0,ch=0,ci=0,cj=0,ck=0,cl=0,cm=0,cn=0,co=0,cp=0,cq=0,cr=0,cs=0;j=i;i=i+4008|0;m=j|0;n=j+16|0;o=j+32|0;p=j+56|0;q=j+960|0;r=j+1864|0;s=j+1888|0;t=j+1912|0;u=j+2112|0;v=j+2312|0;w=j+2376|0;x=j+2888|0;y=j+2936|0;z=j+3448|0;A=j+3960|0;B=j+4e3|0;c[A>>2]=40;a0(f,g,A);C=(c[A+4>>2]|0)>>>(k>>>0);D=(c[A+8>>2]|0)>>>(k>>>0);E=A+32|0;A=c[E>>2]|0;F=c[E+4>>2]|0;E=9;G=0;H=0;I=0;if((A|0)==1&(F|0)==0|(A|0)==2&(F|0)==0|(A|0)==7&(F|0)==0|(A|0)==8&(F|0)==0|(A|0)==3&(F|0)==0|(A|0)==4&(F|0)==0|(A|0)==5&(F|0)==0|(A|0)==6&(F|0)==0){J=16}else if((A|0)==(H|0)&(F|0)==(I|0)|(A|0)==(E|0)&(F|0)==(G|0)){J=8}else{G=z|0;au(G|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=2664,c[K+16>>2]=568,K)|0)|0;i=K;al(G|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K;J=0}G=B|0;c[G>>2]=h;L502:do{if((f|0)==0|g>>>0<62){L=0}else{F=a_(300)|0;if((F|0)==0){L=0;break}E=F;c[F>>2]=519686845;A=F+4|0;c[A>>2]=0;I=F+8|0;c[I>>2]=0;H=F+88|0;bj(H|0,0,45);M=F+252|0;bj(M|0,0,13);N=F+268|0;bj(N|0,0,13);O=F+284|0;bj(O|0,0,13);bj(F+136|0,0,21);bj(F+160|0,0,21);bj(F+184|0,0,21);bj(F+208|0,0,21);bj(F+232|0,0,17);L505:do{if(g>>>0<74){P=369}else{if(((d[f]|0)<<8|(d[f+1|0]|0)|0)!=18552){P=369;break}if(((d[f+2|0]|0)<<8|(d[f+3|0]|0))>>>0<74){P=369;break}Q=((d[f+7|0]|0)<<16|(d[f+6|0]|0)<<24|(d[f+8|0]|0)<<8|(d[f+9|0]|0))>>>0>g>>>0?0:f;R=H;c[R>>2]=Q;if((Q|0)==0){break}c[A>>2]=f;c[I>>2]=g;S=F+92|0;T=S;U=(d[Q+68|0]|0)<<8|(d[Q+67|0]|0)<<16|(d[Q+69|0]|0);V=f+U|0;W=(d[Q+65|0]|0)<<8|(d[Q+66|0]|0);if((W|0)==0){break}Q=S;c[Q>>2]=V;S=F+96|0;c[S>>2]=V;V=F+104|0;c[V>>2]=W;X=F+100|0;c[X>>2]=f+(W+U);U=F+108|0;c[U>>2]=0;W=F+112|0;c[W>>2]=0;if(!(a4(T,F+116|0)|0)){break}Y=c[R>>2]|0;if(((d[Y+39|0]|0)<<8|(d[Y+40|0]|0)|0)==0){_=a[Y+55|0]|0;$=a[Y+56|0]|0;if(((_&255)<<8|$&255|0)==0){break}else{aa=_;ab=$;ac=Y}}else{if(!(a4(T,F+140|0)|0)){break}if(!(a4(T,F+188|0)|0)){break}Y=c[R>>2]|0;aa=a[Y+55|0]|0;ab=a[Y+56|0]|0;ac=Y}if(((aa&255)<<8|ab&255|0)==0){ad=ac}else{if(!(a4(T,F+164|0)|0)){break}if(!(a4(T,F+212|0)|0)){break}ad=c[R>>2]|0}Y=(d[ad+39|0]|0)<<8|(d[ad+40|0]|0);if((Y|0)==0){ae=ad}else{$=x;_=F+236|0;af=F+240|0;ag=c[af>>2]|0;if((ag|0)==(Y|0)){ah=ad}else{if(ag>>>0>Y>>>0){ai=ad}else{do{if((c[F+244>>2]|0)>>>0<Y>>>0){if(aZ(_,Y,(ag+1|0)==(Y|0),4)|0){aj=c[af>>2]|0;break}else{a[F+248|0]=1;break L505}}else{aj=ag}}while(0);bj((c[_>>2]|0)+(aj<<2)|0,0,Y-aj<<2|0);ai=c[R>>2]|0}c[af>>2]=Y;ah=ai}ag=c[A>>2]|0;ak=(d[ah+34|0]|0)<<8|(d[ah+33|0]|0)<<16|(d[ah+35|0]|0);am=ag+ak|0;an=(d[ah+37|0]|0)<<8|(d[ah+36|0]|0)<<16|(d[ah+38|0]|0);if((an|0)==0){break}c[Q>>2]=am;c[S>>2]=am;c[V>>2]=an;c[X>>2]=ag+(an+ak);c[U>>2]=0;c[W>>2]=0;ak=x|0;bj($|0,0,17);an=x+24|0;c[x+44>>2]=0;bj(x+20|0,0,21);ag=0;while(1){if(ag>>>0>=2){P=397;break}if(a4(T,x+(ag*24|0)|0)|0){ag=ag+1|0}else{ao=0;break}}if((P|0)==397){if((c[af>>2]|0)==0){ag=w|0;au(ag|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(ag|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}ag=0;$=0;am=0;ap=0;aq=0;ar=c[_>>2]|0;as=0;at=0;while(1){av=(a5(T,ak)|0)+at&31;aw=(a5(T,an)|0)+ag&63;ax=(a5(T,ak)|0)+$&31;ay=(a5(T,ak)|0)+am|0;az=(a5(T,an)|0)+ap&63;aA=(a5(T,ak)|0)+aq&31;c[ar>>2]=aw<<5|av<<11|ax|ay<<27|az<<21|aA<<16;aB=as+1|0;if(aB>>>0<Y>>>0){ag=aw;$=ax;am=ay&31;ap=az;aq=aA;ar=ar+4|0;as=aB;at=av}else{ao=1;break}}}a1(an);a1(ak);if(!ao){break}at=v;as=c[R>>2]|0;ar=(d[as+47|0]|0)<<8|(d[as+48|0]|0);aq=c[A>>2]|0;ap=(d[as+42|0]|0)<<8|(d[as+41|0]|0)<<16|(d[as+43|0]|0);am=aq+ap|0;$=(d[as+45|0]|0)<<8|(d[as+44|0]|0)<<16|(d[as+46|0]|0);if(($|0)==0){break}c[Q>>2]=am;c[S>>2]=am;c[V>>2]=$;c[X>>2]=aq+($+ap);c[U>>2]=0;c[W>>2]=0;c[s+20>>2]=0;bj(s|0,0,17);if(a4(T,s)|0){aC=-3;aD=-3;aE=0}else{a1(s);break}while(1){c[t+(aE<<2)>>2]=aC;c[u+(aE<<2)>>2]=aD;ap=aC+1|0;$=(ap|0)>3;aq=aE+1|0;if(aq>>>0<49){aC=$?-3:ap;aD=($&1)+aD|0;aE=aq}else{break}}bj(at|0,0,64);ak=F+256|0;an=c[ak>>2]|0;if((an|0)!=(ar|0)){if(an>>>0<=ar>>>0){do{if((c[F+260>>2]|0)>>>0<ar>>>0){if(aZ(M,ar,(an+1|0)==(ar|0),4)|0){aF=c[ak>>2]|0;break}else{a[F+264|0]=1;a1(s);break L505}}else{aF=an}}while(0);bj((c[M>>2]|0)+(aF<<2)|0,0,ar-aF<<2|0)}c[ak>>2]=ar}if((ar|0)==0){an=w|0;au(an|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(an|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}else{an=v|0;at=v+4|0;aq=v+8|0;$=v+12|0;ap=v+16|0;am=v+20|0;as=v+24|0;ag=v+28|0;Y=v+32|0;_=v+36|0;af=v+40|0;av=v+44|0;aB=v+48|0;aA=v+52|0;az=v+56|0;ay=v+60|0;ax=c[M>>2]|0;aw=0;while(1){aG=0;do{aH=a5(T,s)|0;aI=aG<<1;aJ=v+(aI<<2)|0;c[aJ>>2]=(c[aJ>>2]|0)+(c[t+(aH<<2)>>2]|0)&3;aJ=v+((aI|1)<<2)|0;c[aJ>>2]=(c[aJ>>2]|0)+(c[u+(aH<<2)>>2]|0)&3;aG=aG+1|0;}while(aG>>>0<8);c[ax>>2]=(d[880+(c[at>>2]|0)|0]|0)<<2|(d[880+(c[an>>2]|0)|0]|0)|(d[880+(c[aq>>2]|0)|0]|0)<<4|(d[880+(c[$>>2]|0)|0]|0)<<6|(d[880+(c[ap>>2]|0)|0]|0)<<8|(d[880+(c[am>>2]|0)|0]|0)<<10|(d[880+(c[as>>2]|0)|0]|0)<<12|(d[880+(c[ag>>2]|0)|0]|0)<<14|(d[880+(c[Y>>2]|0)|0]|0)<<16|(d[880+(c[_>>2]|0)|0]|0)<<18|(d[880+(c[af>>2]|0)|0]|0)<<20|(d[880+(c[av>>2]|0)|0]|0)<<22|(d[880+(c[aB>>2]|0)|0]|0)<<24|(d[880+(c[aA>>2]|0)|0]|0)<<26|(d[880+(c[az>>2]|0)|0]|0)<<28|(d[880+(c[ay>>2]|0)|0]|0)<<30;aG=aw+1|0;if(aG>>>0<ar>>>0){ax=ax+4|0;aw=aG}else{break}}}a1(s);ae=c[R>>2]|0}aw=(d[ae+55|0]|0)<<8|(d[ae+56|0]|0);if((aw|0)==0){L=F;break L502}ax=c[A>>2]|0;ar=(d[ae+50|0]|0)<<8|(d[ae+49|0]|0)<<16|(d[ae+51|0]|0);ay=ax+ar|0;az=(d[ae+53|0]|0)<<8|(d[ae+52|0]|0)<<16|(d[ae+54|0]|0);if((az|0)==0){break}c[Q>>2]=ay;c[S>>2]=ay;c[V>>2]=az;c[X>>2]=ax+(az+ar);c[U>>2]=0;c[W>>2]=0;c[r+20>>2]=0;bj(r|0,0,17);L585:do{if(a4(T,r)|0){ar=F+272|0;az=c[ar>>2]|0;if((az|0)!=(aw|0)){if(az>>>0<=aw>>>0){do{if((c[F+276>>2]|0)>>>0<aw>>>0){if(aZ(N,aw,(az+1|0)==(aw|0),2)|0){aK=c[ar>>2]|0;break}else{a[F+280|0]=1;break L585}}else{aK=az}}while(0);bj((c[N>>2]|0)+(aK<<1)|0,0,aw-aK<<1|0)}c[ar>>2]=aw}az=c[N>>2]|0;ax=0;ay=0;aA=0;while(1){aB=a5(T,r)|0;av=aB+ax&255;aB=(a5(T,r)|0)+ay&255;b[az>>1]=(aB<<8|av)&65535;af=aA+1|0;if(af>>>0<aw>>>0){az=az+2|0;ax=av;ay=aB;aA=af}else{break}}a1(r);aA=v;ay=c[R>>2]|0;ax=(d[ay+63|0]|0)<<8|(d[ay+64|0]|0);az=c[A>>2]|0;ar=(d[ay+58|0]|0)<<8|(d[ay+57|0]|0)<<16|(d[ay+59|0]|0);af=az+ar|0;aB=(d[ay+61|0]|0)<<8|(d[ay+60|0]|0)<<16|(d[ay+62|0]|0);if((aB|0)==0){aL=0}else{c[Q>>2]=af;c[S>>2]=af;c[V>>2]=aB;c[X>>2]=az+(aB+ar);c[U>>2]=0;c[W>>2]=0;c[o+20>>2]=0;bj(o|0,0,17);L605:do{if(a4(T,o)|0){ar=-7;aB=-7;az=0;while(1){c[p+(az<<2)>>2]=ar;c[q+(az<<2)>>2]=aB;af=ar+1|0;ay=(af|0)>7;av=az+1|0;if(av>>>0<225){ar=ay?-7:af;aB=(ay&1)+aB|0;az=av}else{break}}bj(aA|0,0,64);az=ax*3|0;aB=F+288|0;ar=c[aB>>2]|0;if((ar|0)!=(az|0)){if(ar>>>0<=az>>>0){do{if((c[F+292>>2]|0)>>>0<az>>>0){if(aZ(O,az,(ar+1|0)==(az|0),2)|0){aM=c[aB>>2]|0;break}else{a[F+296|0]=1;aN=0;break L605}}else{aM=ar}}while(0);bj((c[O>>2]|0)+(aM<<1)|0,0,az-aM<<1|0)}c[aB>>2]=az}if((az|0)==0){ar=w|0;au(ar|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(ar|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}if((ax|0)==0){aN=1;break}ar=v|0;av=v+4|0;ay=v+8|0;af=v+12|0;_=v+16|0;Y=v+20|0;ag=v+24|0;as=v+28|0;am=v+32|0;ap=v+36|0;$=v+40|0;aq=v+44|0;an=v+48|0;at=v+52|0;ak=v+56|0;aG=v+60|0;aH=c[O>>2]|0;aJ=0;while(1){aI=0;do{aO=a5(T,o)|0;aP=aI<<1;aQ=v+(aP<<2)|0;c[aQ>>2]=(c[aQ>>2]|0)+(c[p+(aO<<2)>>2]|0)&7;aQ=v+((aP|1)<<2)|0;c[aQ>>2]=(c[aQ>>2]|0)+(c[q+(aO<<2)>>2]|0)&7;aI=aI+1|0;}while(aI>>>0<8);b[aH>>1]=(d[872+(c[av>>2]|0)|0]|0)<<3|(d[872+(c[ar>>2]|0)|0]|0)|(d[872+(c[ay>>2]|0)|0]|0)<<6|(d[872+(c[af>>2]|0)|0]|0)<<9|(d[872+(c[_>>2]|0)|0]|0)<<12|(d[872+(c[Y>>2]|0)|0]|0)<<15;b[aH+2>>1]=(d[872+(c[ag>>2]|0)|0]|0)<<2|(a[872+(c[Y>>2]|0)|0]&255)>>>1|(d[872+(c[as>>2]|0)|0]|0)<<5|(d[872+(c[am>>2]|0)|0]|0)<<8|(d[872+(c[ap>>2]|0)|0]|0)<<11|(d[872+(c[$>>2]|0)|0]|0)<<14;b[aH+4>>1]=(d[872+(c[aq>>2]|0)|0]|0)<<1|(a[872+(c[$>>2]|0)|0]&255)>>>2|(d[872+(c[an>>2]|0)|0]|0)<<4|(d[872+(c[at>>2]|0)|0]|0)<<7|(d[872+(c[ak>>2]|0)|0]|0)<<10|(d[872+(c[aG>>2]|0)|0]|0)<<13;aI=aJ+1|0;if(aI>>>0<ax>>>0){aH=aH+6|0;aJ=aI}else{aN=1;break}}}else{aN=0}}while(0);a1(o);aL=aN}if(aL){L=aL?F:0;break L502}else{break L505}}}while(0);a1(r)}}while(0);if((P|0)==369){c[H>>2]=0}bd(E);if((F&7|0)==0){bf(F);L=0;break}else{O=y|0;au(O|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=2500,c[K+16>>2]=576,K)|0)|0;i=K;al(O|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K;L=0;break}}}while(0);r=l+k|0;do{if(r>>>0>k>>>0){l=L;if((L|0)==0){aL=k;aN=D;o=C;q=h;while(1){aR=q+(Z(Z((o+3|0)>>>2,J)|0,(aN+3|0)>>>2)|0)|0;v=aL+1|0;if(v>>>0<r>>>0){aL=v;aN=aN>>>1;o=o>>>1;q=aR}else{break}}c[G>>2]=aR;break}q=L+88|0;o=L+8|0;aN=L+4|0;aL=L+92|0;F=aL;E=L+96|0;H=L+104|0;v=L+100|0;p=L+108|0;aM=L+112|0;aK=L+240|0;ae=L+256|0;s=aL;aL=L+116|0;u=L+140|0;t=L+236|0;aF=w|0;aE=L+188|0;aD=L+252|0;aC=L+272|0;ao=L+212|0;x=L+288|0;ah=L+284|0;ai=L+164|0;aj=L+268|0;ad=y|0;ac=k;ab=D;aa=C;f=h;while(1){g=Z((aa+3|0)>>>2,J)|0;O=Z(g,(ab+3|0)>>>2)|0;do{if(O>>>0<8|ac>>>0>15){aS=f}else{if((c[l>>2]|0)!=519686845){aS=f;break}A=c[q>>2]|0;N=(d[A+70+(ac<<2)+1|0]|0)<<16|(d[A+70+(ac<<2)|0]|0)<<24|(d[A+70+(ac<<2)+2|0]|0)<<8|(d[A+70+(ac<<2)+3|0]|0);M=ac+1|0;if(M>>>0<(d[A+16|0]|0)>>>0){aT=(d[A+70+(M<<2)+1|0]|0)<<16|(d[A+70+(M<<2)|0]|0)<<24|(d[A+70+(M<<2)+2|0]|0)<<8|(d[A+70+(M<<2)+3|0]|0)}else{aT=c[o>>2]|0}if(aT>>>0>N>>>0){aU=A}else{au(ad|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=3705,c[K+16>>2]=248,K)|0)|0;i=K;al(ad|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K;aU=c[q>>2]|0}A=c[aN>>2]|0;M=A+N|0;I=aT-N|0;T=((d[aU+12|0]|0)<<8|(d[aU+13|0]|0))>>>(ac>>>0);W=((d[aU+14|0]|0)<<8|(d[aU+15|0]|0))>>>(ac>>>0);U=T>>>0>1?(T+3|0)>>>2:1;T=W>>>0>1?(W+3|0)>>>2:1;W=aU+18|0;X=a[W]|0;if(X<<24>>24==0){aV=8}else{aV=X<<24>>24==9?8:16}X=Z(aV,U)|0;if((g|0)==0){aW=X;P=494}else{if(X>>>0<=g>>>0){aW=g;P=494}}L663:do{if((P|0)==494){P=0;if((Z(aW,T)|0)>>>0>O>>>0){break}X=(U+1|0)>>>1;V=(T+1|0)>>>1;if((aT|0)==(N|0)){break}c[F>>2]=M;c[E>>2]=M;c[H>>2]=I;c[v>>2]=A+aT;c[p>>2]=0;c[aM>>2]=0;switch(d[W]|0|0){case 0:{S=c[aK>>2]|0;Q=c[ae>>2]|0;R=a[aU+17|0]|0;aw=R&255;ax=aW>>>2;if(R<<24>>24==0){break L663}R=(V|0)==0;aA=V-1|0;aJ=(T&1|0)!=0;aH=aW<<1;aG=ax+1|0;ak=ax+2|0;at=ax+3|0;an=X-1|0;$=an<<4;aq=(U&1|0)!=0;ap=aW+4|0;am=0;as=0;Y=0;ag=1;while(1){if(R){aX=am;aY=as;a$=ag}else{_=am;af=as;ay=0;ar=c[B+(Y<<2)>>2]|0;av=ag;while(1){if((ay&1|0)==0){a2=0;a3=X;a6=1;a7=16;a8=ar}else{a2=an;a3=-1;a6=-1;a7=-16;a8=ar+$|0}az=(ay|0)==(aA|0);aB=az&aJ;if((a2|0)==(a3|0)){a9=_;ba=af;bb=av}else{aI=az&aJ^1;az=_;aO=af;aQ=a2;aP=a8;bc=av;while(1){if((bc|0)==1){be=a5(s,aL)|0|512}else{be=bc}bg=be&7;bh=d[832+bg|0]|0;bi=az;bk=0;do{bl=(a5(s,u)|0)+bi|0;bm=bl-S|0;bn=bm>>31;bi=bn&bl|bm&~bn;if((c[aK>>2]|0)>>>0<=bi>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[n+(bk<<2)>>2]=c[(c[t>>2]|0)+(bi<<2)>>2];bk=bk+1|0;}while(bk>>>0<bh>>>0);bh=be>>>3;bk=(aQ|0)==(an|0)&aq;bn=aP;do{if(aB|bk){if(bk){bm=(a5(s,aE)|0)+aO|0;bl=bm-Q|0;bo=bl>>31;bp=bo&bm|bl&~bo;c[bn>>2]=c[n+((d[840+(bg<<2)|0]|0)<<2)>>2];if((c[ae>>2]|0)>>>0<=bp>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[aP+4>>2]=c[(c[aD>>2]|0)+(bp<<2)>>2];bo=(a5(s,aE)|0)+bp|0;bp=bo-Q|0;bl=bp>>31;bm=(a5(s,aE)|0)+(bl&bo|bp&~bl)|0;bl=bm-Q|0;bp=bl>>31;bo=bp&bm|bl&~bp;if(aB){bp=(a5(s,aE)|0)+bo|0;bl=bp-Q|0;bm=bl>>31;bq=bm&bp|bl&~bm;break}c[aP+aW>>2]=c[n+((d[842+(bg<<2)|0]|0)<<2)>>2];if((c[ae>>2]|0)>>>0<=bo>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[aP+ap>>2]=c[(c[aD>>2]|0)+(bo<<2)>>2];bm=(a5(s,aE)|0)+bo|0;bo=bm-Q|0;bl=bo>>31;bq=bl&bm|bo&~bl;break}else{br=aO;bs=0}while(1){bl=Z(bs,aW)|0;bo=bs<<1;bm=(a5(s,aE)|0)+br|0;bp=bm-Q|0;bt=bp>>31;bu=bt&bm|bp&~bt;if((bs|0)==0|aI){c[aP+bl>>2]=c[n+((d[840+(bg<<2)+bo|0]|0)<<2)>>2];if((c[ae>>2]|0)>>>0<=bu>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[aP+(bl+4)>>2]=c[(c[aD>>2]|0)+(bu<<2)>>2];bt=(a5(s,aE)|0)+bu|0;bp=bt-Q|0;bm=bp>>31;bv=bm&bt|bp&~bm;c[aP+(bl+8)>>2]=c[n+((d[(bo|1)+(840+(bg<<2))|0]|0)<<2)>>2];if((c[ae>>2]|0)>>>0<=bv>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[aP+(bl+12)>>2]=c[(c[aD>>2]|0)+(bv<<2)>>2];bw=bv}else{bv=(a5(s,aE)|0)+bu|0;bu=bv-Q|0;bl=bu>>31;bw=bl&bv|bu&~bl}bl=bs+1|0;if(bl>>>0<2){br=bw;bs=bl}else{bq=bw;break}}}else{c[bn>>2]=c[n+((d[840+(bg<<2)|0]|0)<<2)>>2];bl=(a5(s,aE)|0)+aO|0;bu=bl-Q|0;bv=bu>>31;bo=bv&bl|bu&~bv;if((c[ae>>2]|0)>>>0<=bo>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[aP+4>>2]=c[(c[aD>>2]|0)+(bo<<2)>>2];c[aP+8>>2]=c[n+((d[841+(bg<<2)|0]|0)<<2)>>2];bv=(a5(s,aE)|0)+bo|0;bo=bv-Q|0;bu=bo>>31;bl=bu&bv|bo&~bu;if((c[ae>>2]|0)>>>0<=bl>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[aP+12>>2]=c[(c[aD>>2]|0)+(bl<<2)>>2];c[bn+(ax<<2)>>2]=c[n+((d[842+(bg<<2)|0]|0)<<2)>>2];bu=(a5(s,aE)|0)+bl|0;bl=bu-Q|0;bo=bl>>31;bv=bo&bu|bl&~bo;if((c[ae>>2]|0)>>>0<=bv>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[bn+(aG<<2)>>2]=c[(c[aD>>2]|0)+(bv<<2)>>2];c[bn+(ak<<2)>>2]=c[n+((d[843+(bg<<2)|0]|0)<<2)>>2];bo=(a5(s,aE)|0)+bv|0;bv=bo-Q|0;bl=bv>>31;bu=bl&bo|bv&~bl;if((c[ae>>2]|0)>>>0<=bu>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[bn+(at<<2)>>2]=c[(c[aD>>2]|0)+(bu<<2)>>2];bq=bu}}while(0);bn=aQ+a6|0;if((bn|0)==(a3|0)){a9=bi;ba=bq;bb=bh;break}else{az=bi;aO=bq;aQ=bn;aP=aP+a7|0;bc=bh}}}bc=ay+1|0;if(bc>>>0<V>>>0){_=a9;af=ba;ay=bc;ar=ar+aH|0;av=bb}else{aX=a9;aY=ba;a$=bb;break}}}av=Y+1|0;if(av>>>0<aw>>>0){am=aX;as=aY;Y=av;ag=a$}else{break}}break};case 2:case 3:case 5:case 6:case 4:{ag=c[aK>>2]|0;Y=c[ae>>2]|0;as=c[aC>>2]|0;am=(d[aU+63|0]|0)<<8|(d[aU+64|0]|0);aw=a[aU+17|0]|0;aH=aw&255;if(aw<<24>>24==0){break L663}aw=(V|0)==0;at=V-1|0;Q=(T&1|0)==0;ak=aW<<1;aG=(U&1|0)==0;ax=X-1|0;ap=ax<<5;aq=0;an=0;S=0;aJ=0;aA=0;$=1;while(1){if(aw){bx=aq;by=an;bz=S;bA=aJ;bB=$}else{R=aq;av=an;ar=S;ay=aJ;af=0;_=c[B+(aA<<2)>>2]|0;bc=$;while(1){if((af&1|0)==0){bC=0;bD=X;bE=1;bF=32;bG=_}else{bC=ax;bD=-1;bE=-1;bF=-32;bG=_+ap|0}aP=Q|(af|0)!=(at|0);if((bC|0)==(bD|0)){bH=R;bI=av;bJ=ar;bK=ay;bL=bc}else{aQ=R;aO=av;az=ar;aI=ay;aB=bC;bn=bG;bg=bc;while(1){if((bg|0)==1){bM=a5(s,aL)|0|512}else{bM=bg}bk=bM&7;bu=d[832+bk|0]|0;bl=(aB|0)!=(ax|0);bv=az;bo=0;do{bm=(a5(s,ai)|0)+bv|0;bp=bm-as|0;bt=bp>>31;bv=bt&bm|bp&~bt;if((c[aC>>2]|0)>>>0<=bv>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[m+(bo<<2)>>2]=e[(c[aj>>2]|0)+(bv<<1)>>1]|0;bo=bo+1|0;}while(bo>>>0<bu>>>0);bo=bM>>>3;bh=aQ;bi=0;do{bt=(a5(s,u)|0)+bh|0;bp=bt-ag|0;bm=bp>>31;bh=bm&bt|bp&~bm;if((c[aK>>2]|0)>>>0<=bh>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[n+(bi<<2)>>2]=c[(c[t>>2]|0)+(bh<<2)>>2];bi=bi+1|0;}while(bi>>>0<bu>>>0);bu=aG|bl;bi=aO;bm=aI;bp=bn;bt=0;while(1){bN=(bt|0)==0|aP;bO=bt<<1;bP=bi;bQ=bm;bR=bp;bS=0;while(1){bT=(a5(s,ao)|0)+bQ|0;bU=bT-am|0;bV=bU>>31;bW=bV&bT|bU&~bV;bV=(a5(s,aE)|0)+bP|0;bU=bV-Y|0;bT=bU>>31;bX=bT&bV|bU&~bT;if(((bS|0)==0|bu)&bN){bT=d[bS+bO+(840+(bk<<2))|0]|0;bU=bW*3|0;if((c[x>>2]|0)>>>0<=bU>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}bV=c[ah>>2]|0;c[bR>>2]=(e[bV+(bU<<1)>>1]|0)<<16|c[m+(bT<<2)>>2];c[bR+4>>2]=(e[bV+(bU+2<<1)>>1]|0)<<16|(e[bV+(bU+1<<1)>>1]|0);c[bR+8>>2]=c[n+(bT<<2)>>2];if((c[ae>>2]|0)>>>0<=bX>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[bR+12>>2]=c[(c[aD>>2]|0)+(bX<<2)>>2]}bT=bS+1|0;if(bT>>>0<2){bP=bX;bQ=bW;bR=bR+16|0;bS=bT}else{break}}bS=bt+1|0;if(bS>>>0<2){bi=bX;bm=bW;bp=bp+aW|0;bt=bS}else{break}}bt=aB+bE|0;if((bt|0)==(bD|0)){bH=bh;bI=bX;bJ=bv;bK=bW;bL=bo;break}else{aQ=bh;aO=bX;az=bv;aI=bW;aB=bt;bn=bn+bF|0;bg=bo}}}bg=af+1|0;if(bg>>>0<V>>>0){R=bH;av=bI;ar=bJ;ay=bK;af=bg;_=_+ak|0;bc=bL}else{bx=bH;by=bI;bz=bJ;bA=bK;bB=bL;break}}}bc=aA+1|0;if(bc>>>0<aH>>>0){aq=bx;an=by;S=bz;aJ=bA;aA=bc;$=bB}else{break}}break};case 9:{$=c[aC>>2]|0;aA=(d[aU+63|0]|0)<<8|(d[aU+64|0]|0);aJ=a[aU+17|0]|0;S=aJ&255;if(aJ<<24>>24==0){break L663}aJ=(V|0)==0;an=V-1|0;aq=(T&1|0)==0;aH=aW<<1;ak=X-1|0;Y=ak<<4;am=(U&1|0)!=0;aG=0;ag=0;as=0;ax=1;while(1){if(aJ){bY=aG;bZ=ag;b_=ax}else{at=aG;Q=ag;ap=0;aw=c[B+(as<<2)>>2]|0;bc=ax;while(1){if((ap&1|0)==0){b$=0;b0=X;b1=1;b2=16;b3=aw}else{b$=ak;b0=-1;b1=-1;b2=-16;b3=aw+Y|0}_=aq|(ap|0)!=(an|0);if((b$|0)==(b0|0)){b4=at;b5=Q;b6=bc}else{af=at;ay=Q;ar=b3;av=b$;R=bc;while(1){if((R|0)==1){b7=a5(s,aL)|0|512}else{b7=R}bg=b7&7;bn=d[832+bg|0]|0;aB=af;aI=0;do{az=(a5(s,ai)|0)+aB|0;aO=az-$|0;aQ=aO>>31;aB=aQ&az|aO&~aQ;if((c[aC>>2]|0)>>>0<=aB>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[n+(aI<<2)>>2]=e[(c[aj>>2]|0)+(aB<<1)>>1]|0;aI=aI+1|0;}while(aI>>>0<bn>>>0);bn=(av|0)==(ak|0)&am;aI=ay;bo=ar;bv=0;while(1){bh=bo;aQ=(bv|0)==0|_;aO=bv<<1;az=(a5(s,ao)|0)+aI|0;aP=az-aA|0;bt=aP>>31;bp=bt&az|aP&~bt;if(aQ){bt=d[840+(bg<<2)+aO|0]|0;aP=bp*3|0;if((c[x>>2]|0)>>>0<=aP>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}az=c[ah>>2]|0;c[bh>>2]=(e[az+(aP<<1)>>1]|0)<<16|c[n+(bt<<2)>>2];c[bo+4>>2]=(e[az+(aP+2<<1)>>1]|0)<<16|(e[az+(aP+1<<1)>>1]|0)}aP=bo+8|0;az=(a5(s,ao)|0)+bp|0;bp=az-aA|0;bt=bp>>31;b8=bt&az|bp&~bt;if(!(bn|aQ^1)){aQ=d[(aO|1)+(840+(bg<<2))|0]|0;aO=b8*3|0;if((c[x>>2]|0)>>>0<=aO>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}bt=c[ah>>2]|0;c[aP>>2]=(e[bt+(aO<<1)>>1]|0)<<16|c[n+(aQ<<2)>>2];c[bo+12>>2]=(e[bt+(aO+2<<1)>>1]|0)<<16|(e[bt+(aO+1<<1)>>1]|0)}aO=bv+1|0;if(aO>>>0<2){aI=b8;bo=bo+aW|0;bv=aO}else{break}}bv=b7>>>3;bo=av+b1|0;if((bo|0)==(b0|0)){b4=aB;b5=b8;b6=bv;break}else{af=aB;ay=b8;ar=ar+b2|0;av=bo;R=bv}}}R=ap+1|0;if(R>>>0<V>>>0){at=b4;Q=b5;ap=R;aw=aw+aH|0;bc=b6}else{bY=b4;bZ=b5;b_=b6;break}}}bc=as+1|0;if(bc>>>0<S>>>0){aG=bY;ag=bZ;as=bc;ax=b_}else{break}}break};case 7:case 8:{ax=c[aC>>2]|0;as=(d[aU+63|0]|0)<<8|(d[aU+64|0]|0);ag=a[aU+17|0]|0;aG=ag&255;if(ag<<24>>24==0){break L663}ag=(V|0)==0;S=V-1|0;aH=(T&1|0)==0;aA=aW<<1;am=(U&1|0)==0;ak=X-1|0;$=ak<<5;an=0;aq=0;Y=0;aJ=0;bc=0;aw=1;while(1){if(ag){b9=an;ca=aq;cb=Y;cc=aJ;cd=aw}else{ap=an;Q=aq;at=Y;R=aJ;av=0;ar=c[B+(bc<<2)>>2]|0;ay=aw;while(1){if((av&1|0)==0){ce=0;cf=X;cg=1;ch=32;ci=ar}else{ce=ak;cf=-1;cg=-1;ch=-32;ci=ar+$|0}af=aH|(av|0)!=(S|0);if((ce|0)==(cf|0)){cj=ap;ck=Q;cl=at;cm=R;cn=ay}else{_=ap;bv=Q;bo=at;aI=R;bg=ce;bn=ci;aO=ay;while(1){if((aO|0)==1){co=a5(s,aL)|0|512}else{co=aO}bt=co&7;aQ=d[832+bt|0]|0;aP=(bg|0)!=(ak|0);bp=_;az=0;do{bh=(a5(s,ai)|0)+bp|0;bm=bh-ax|0;bi=bm>>31;bp=bi&bh|bm&~bi;if((c[aC>>2]|0)>>>0<=bp>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[n+(az<<2)>>2]=e[(c[aj>>2]|0)+(bp<<1)>>1]|0;az=az+1|0;}while(az>>>0<aQ>>>0);az=co>>>3;aB=bo;bi=0;do{bm=(a5(s,ai)|0)+aB|0;bh=bm-ax|0;bk=bh>>31;aB=bk&bm|bh&~bk;if((c[aC>>2]|0)>>>0<=aB>>>0){au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K}c[m+(bi<<2)>>2]=e[(c[aj>>2]|0)+(aB<<1)>>1]|0;bi=bi+1|0;}while(bi>>>0<aQ>>>0);aQ=am|aP;bi=bv;bk=aI;bh=bn;bm=0;while(1){bu=(bm|0)==0|af;bl=bm<<1;bS=bi;bR=bk;bQ=bh;bP=0;while(1){bO=(a5(s,ao)|0)+bS|0;bN=bO-as|0;bT=bN>>31;cp=bT&bO|bN&~bT;bT=(a5(s,ao)|0)+bR|0;bN=bT-as|0;bO=bN>>31;cq=bO&bT|bN&~bO;if(((bP|0)==0|aQ)&bu){bO=d[bP+bl+(840+(bt<<2))|0]|0;bN=cp*3|0;bT=c[x>>2]|0;if(bT>>>0>bN>>>0){cr=bT}else{au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K;cr=c[x>>2]|0}bT=c[ah>>2]|0;bU=cq*3|0;if(cr>>>0>bU>>>0){cs=bT}else{au(aF|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=904,c[K+16>>2]=312,K)|0)|0;i=K;al(aF|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K;cs=c[ah>>2]|0}c[bQ>>2]=(e[bT+(bN<<1)>>1]|0)<<16|c[n+(bO<<2)>>2];c[bQ+4>>2]=(e[bT+(bN+2<<1)>>1]|0)<<16|(e[bT+(bN+1<<1)>>1]|0);c[bQ+8>>2]=(e[cs+(bU<<1)>>1]|0)<<16|c[m+(bO<<2)>>2];c[bQ+12>>2]=(e[cs+(bU+2<<1)>>1]|0)<<16|(e[cs+(bU+1<<1)>>1]|0)}bU=bP+1|0;if(bU>>>0<2){bS=cp;bR=cq;bQ=bQ+16|0;bP=bU}else{break}}bP=bm+1|0;if(bP>>>0<2){bi=cp;bk=cq;bh=bh+aW|0;bm=bP}else{break}}bm=bg+cg|0;if((bm|0)==(cf|0)){cj=bp;ck=cp;cl=aB;cm=cq;cn=az;break}else{_=bp;bv=cp;bo=aB;aI=cq;bg=bm;bn=bn+ch|0;aO=az}}}aO=av+1|0;if(aO>>>0<V>>>0){ap=cj;Q=ck;at=cl;R=cm;av=aO;ar=ar+aA|0;ay=cn}else{b9=cj;ca=ck;cb=cl;cc=cm;cd=cn;break}}}ay=bc+1|0;if(ay>>>0<aG>>>0){an=b9;aq=ca;Y=cb;aJ=cc;bc=ay;aw=cd}else{break}}break};default:{break L663}}}}while(0);aS=c[G>>2]|0}}while(0);g=aS+O|0;c[G>>2]=g;U=ac+1|0;if(U>>>0<r>>>0){ac=U;ab=ab>>>1;aa=aa>>>1;f=g}else{break}}}}while(0);if((L|0)==0){i=j;return}if((c[L>>2]|0)!=519686845){i=j;return}bd(L);if((L&7|0)==0){bf(L);i=j;return}else{L=z|0;au(L|0,768,(K=i,i=i+24|0,c[K>>2]=472,c[K+8>>2]=2500,c[K+16>>2]=576,K)|0)|0;i=K;al(L|0,(K=i,i=i+1|0,i=i+7&-8,c[K>>2]=0,K)|0)|0;i=K;i=j;return}}function bd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+512|0;e=d|0;c[b>>2]=0;f=b+284|0;g=c[f>>2]|0;if((g|0)!=0){if((g&7|0)==0){bf(g)}else{g=e|0;au(g|0,768,(h=i,i=i+24|0,c[h>>2]=472,c[h+8>>2]=2500,c[h+16>>2]=576,h)|0)|0;i=h;al(g|0,(h=i,i=i+1|0,i=i+7&-8,c[h>>2]=0,h)|0)|0;i=h}c[f>>2]=0;c[b+288>>2]=0;c[b+292>>2]=0}a[b+296|0]=0;f=b+268|0;g=c[f>>2]|0;if((g|0)!=0){if((g&7|0)==0){bf(g)}else{g=e|0;au(g|0,768,(h=i,i=i+24|0,c[h>>2]=472,c[h+8>>2]=2500,c[h+16>>2]=576,h)|0)|0;i=h;al(g|0,(h=i,i=i+1|0,i=i+7&-8,c[h>>2]=0,h)|0)|0;i=h}c[f>>2]=0;c[b+272>>2]=0;c[b+276>>2]=0}a[b+280|0]=0;f=b+252|0;g=c[f>>2]|0;if((g|0)!=0){if((g&7|0)==0){bf(g)}else{g=e|0;au(g|0,768,(h=i,i=i+24|0,c[h>>2]=472,c[h+8>>2]=2500,c[h+16>>2]=576,h)|0)|0;i=h;al(g|0,(h=i,i=i+1|0,i=i+7&-8,c[h>>2]=0,h)|0)|0;i=h}c[f>>2]=0;c[b+256>>2]=0;c[b+260>>2]=0}a[b+264|0]=0;f=b+236|0;g=c[f>>2]|0;if((g|0)!=0){if((g&7|0)==0){bf(g)}else{g=e|0;au(g|0,768,(h=i,i=i+24|0,c[h>>2]=472,c[h+8>>2]=2500,c[h+16>>2]=576,h)|0)|0;i=h;al(g|0,(h=i,i=i+1|0,i=i+7&-8,c[h>>2]=0,h)|0)|0;i=h}c[f>>2]=0;c[b+240>>2]=0;c[b+244>>2]=0}a[b+248|0]=0;a1(b+212|0);a1(b+188|0);a1(b+164|0);a1(b+140|0);a1(b+116|0);i=d;return}function be(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ab=0,ac=0,ad=0,ae=0,af=0,ag=0,ah=0,ai=0,ak=0,al=0,am=0,an=0,ap=0,aq=0,ar=0,as=0,at=0,au=0,av=0,aw=0,ax=0,aA=0,aB=0,aD=0,aE=0,aF=0,aG=0,aH=0,aI=0,aJ=0,aK=0,aL=0;do{if(a>>>0<245){if(a>>>0<11){b=16}else{b=a+11&-8}d=b>>>3;e=c[228]|0;f=e>>>(d>>>0);if((f&3|0)!=0){g=(f&1^1)+d|0;h=g<<1;i=952+(h<<2)|0;j=952+(h+2<<2)|0;h=c[j>>2]|0;k=h+8|0;l=c[k>>2]|0;do{if((i|0)==(l|0)){c[228]=e&~(1<<g)}else{if(l>>>0<(c[232]|0)>>>0){aj();return 0}m=l+12|0;if((c[m>>2]|0)==(h|0)){c[m>>2]=i;c[j>>2]=l;break}else{aj();return 0}}}while(0);l=g<<3;c[h+4>>2]=l|3;j=h+(l|4)|0;c[j>>2]=c[j>>2]|1;n=k;return n|0}if(b>>>0<=(c[230]|0)>>>0){o=b;break}if((f|0)!=0){j=2<<d;l=f<<d&(j|-j);j=(l&-l)-1|0;l=j>>>12&16;i=j>>>(l>>>0);j=i>>>5&8;m=i>>>(j>>>0);i=m>>>2&4;p=m>>>(i>>>0);m=p>>>1&2;q=p>>>(m>>>0);p=q>>>1&1;r=(j|l|i|m|p)+(q>>>(p>>>0))|0;p=r<<1;q=952+(p<<2)|0;m=952+(p+2<<2)|0;p=c[m>>2]|0;i=p+8|0;l=c[i>>2]|0;do{if((q|0)==(l|0)){c[228]=e&~(1<<r)}else{if(l>>>0<(c[232]|0)>>>0){aj();return 0}j=l+12|0;if((c[j>>2]|0)==(p|0)){c[j>>2]=q;c[m>>2]=l;break}else{aj();return 0}}}while(0);l=r<<3;m=l-b|0;c[p+4>>2]=b|3;q=p;e=q+b|0;c[q+(b|4)>>2]=m|1;c[q+l>>2]=m;l=c[230]|0;if((l|0)!=0){q=c[233]|0;d=l>>>3;l=d<<1;f=952+(l<<2)|0;k=c[228]|0;h=1<<d;do{if((k&h|0)==0){c[228]=k|h;s=f;t=952+(l+2<<2)|0}else{d=952+(l+2<<2)|0;g=c[d>>2]|0;if(g>>>0>=(c[232]|0)>>>0){s=g;t=d;break}aj();return 0}}while(0);c[t>>2]=q;c[s+12>>2]=q;c[q+8>>2]=s;c[q+12>>2]=f}c[230]=m;c[233]=e;n=i;return n|0}l=c[229]|0;if((l|0)==0){o=b;break}h=(l&-l)-1|0;l=h>>>12&16;k=h>>>(l>>>0);h=k>>>5&8;p=k>>>(h>>>0);k=p>>>2&4;r=p>>>(k>>>0);p=r>>>1&2;d=r>>>(p>>>0);r=d>>>1&1;g=c[1216+((h|l|k|p|r)+(d>>>(r>>>0))<<2)>>2]|0;r=g;d=g;p=(c[g+4>>2]&-8)-b|0;while(1){g=c[r+16>>2]|0;if((g|0)==0){k=c[r+20>>2]|0;if((k|0)==0){break}else{u=k}}else{u=g}g=(c[u+4>>2]&-8)-b|0;k=g>>>0<p>>>0;r=u;d=k?u:d;p=k?g:p}r=d;i=c[232]|0;if(r>>>0<i>>>0){aj();return 0}e=r+b|0;m=e;if(r>>>0>=e>>>0){aj();return 0}e=c[d+24>>2]|0;f=c[d+12>>2]|0;do{if((f|0)==(d|0)){q=d+20|0;g=c[q>>2]|0;if((g|0)==0){k=d+16|0;l=c[k>>2]|0;if((l|0)==0){v=0;break}else{w=l;x=k}}else{w=g;x=q}while(1){q=w+20|0;g=c[q>>2]|0;if((g|0)!=0){w=g;x=q;continue}q=w+16|0;g=c[q>>2]|0;if((g|0)==0){break}else{w=g;x=q}}if(x>>>0<i>>>0){aj();return 0}else{c[x>>2]=0;v=w;break}}else{q=c[d+8>>2]|0;if(q>>>0<i>>>0){aj();return 0}g=q+12|0;if((c[g>>2]|0)!=(d|0)){aj();return 0}k=f+8|0;if((c[k>>2]|0)==(d|0)){c[g>>2]=f;c[k>>2]=q;v=f;break}else{aj();return 0}}}while(0);L990:do{if((e|0)!=0){f=d+28|0;i=1216+(c[f>>2]<<2)|0;do{if((d|0)==(c[i>>2]|0)){c[i>>2]=v;if((v|0)!=0){break}c[229]=c[229]&~(1<<c[f>>2]);break L990}else{if(e>>>0<(c[232]|0)>>>0){aj();return 0}q=e+16|0;if((c[q>>2]|0)==(d|0)){c[q>>2]=v}else{c[e+20>>2]=v}if((v|0)==0){break L990}}}while(0);if(v>>>0<(c[232]|0)>>>0){aj();return 0}c[v+24>>2]=e;f=c[d+16>>2]|0;do{if((f|0)!=0){if(f>>>0<(c[232]|0)>>>0){aj();return 0}else{c[v+16>>2]=f;c[f+24>>2]=v;break}}}while(0);f=c[d+20>>2]|0;if((f|0)==0){break}if(f>>>0<(c[232]|0)>>>0){aj();return 0}else{c[v+20>>2]=f;c[f+24>>2]=v;break}}}while(0);if(p>>>0<16){e=p+b|0;c[d+4>>2]=e|3;f=r+(e+4)|0;c[f>>2]=c[f>>2]|1}else{c[d+4>>2]=b|3;c[r+(b|4)>>2]=p|1;c[r+(p+b)>>2]=p;f=c[230]|0;if((f|0)!=0){e=c[233]|0;i=f>>>3;f=i<<1;q=952+(f<<2)|0;k=c[228]|0;g=1<<i;do{if((k&g|0)==0){c[228]=k|g;y=q;z=952+(f+2<<2)|0}else{i=952+(f+2<<2)|0;l=c[i>>2]|0;if(l>>>0>=(c[232]|0)>>>0){y=l;z=i;break}aj();return 0}}while(0);c[z>>2]=e;c[y+12>>2]=e;c[e+8>>2]=y;c[e+12>>2]=q}c[230]=p;c[233]=m}f=d+8|0;if((f|0)==0){o=b;break}else{n=f}return n|0}else{if(a>>>0>4294967231){o=-1;break}f=a+11|0;g=f&-8;k=c[229]|0;if((k|0)==0){o=g;break}r=-g|0;i=f>>>8;do{if((i|0)==0){A=0}else{if(g>>>0>16777215){A=31;break}f=(i+1048320|0)>>>16&8;l=i<<f;h=(l+520192|0)>>>16&4;j=l<<h;l=(j+245760|0)>>>16&2;B=14-(h|f|l)+(j<<l>>>15)|0;A=g>>>((B+7|0)>>>0)&1|B<<1}}while(0);i=c[1216+(A<<2)>>2]|0;L1038:do{if((i|0)==0){C=0;D=r;E=0}else{if((A|0)==31){F=0}else{F=25-(A>>>1)|0}d=0;m=r;p=i;q=g<<F;e=0;while(1){B=c[p+4>>2]&-8;l=B-g|0;if(l>>>0<m>>>0){if((B|0)==(g|0)){C=p;D=l;E=p;break L1038}else{G=p;H=l}}else{G=d;H=m}l=c[p+20>>2]|0;B=c[p+16+(q>>>31<<2)>>2]|0;j=(l|0)==0|(l|0)==(B|0)?e:l;if((B|0)==0){C=G;D=H;E=j;break}else{d=G;m=H;p=B;q=q<<1;e=j}}}}while(0);if((E|0)==0&(C|0)==0){i=2<<A;r=(i|-i)&k;if((r|0)==0){o=g;break}i=(r&-r)-1|0;r=i>>>12&16;e=i>>>(r>>>0);i=e>>>5&8;q=e>>>(i>>>0);e=q>>>2&4;p=q>>>(e>>>0);q=p>>>1&2;m=p>>>(q>>>0);p=m>>>1&1;I=c[1216+((i|r|e|q|p)+(m>>>(p>>>0))<<2)>>2]|0}else{I=E}if((I|0)==0){J=D;K=C}else{p=I;m=D;q=C;while(1){e=(c[p+4>>2]&-8)-g|0;r=e>>>0<m>>>0;i=r?e:m;e=r?p:q;r=c[p+16>>2]|0;if((r|0)!=0){p=r;m=i;q=e;continue}r=c[p+20>>2]|0;if((r|0)==0){J=i;K=e;break}else{p=r;m=i;q=e}}}if((K|0)==0){o=g;break}if(J>>>0>=((c[230]|0)-g|0)>>>0){o=g;break}q=K;m=c[232]|0;if(q>>>0<m>>>0){aj();return 0}p=q+g|0;k=p;if(q>>>0>=p>>>0){aj();return 0}e=c[K+24>>2]|0;i=c[K+12>>2]|0;do{if((i|0)==(K|0)){r=K+20|0;d=c[r>>2]|0;if((d|0)==0){j=K+16|0;B=c[j>>2]|0;if((B|0)==0){L=0;break}else{M=B;N=j}}else{M=d;N=r}while(1){r=M+20|0;d=c[r>>2]|0;if((d|0)!=0){M=d;N=r;continue}r=M+16|0;d=c[r>>2]|0;if((d|0)==0){break}else{M=d;N=r}}if(N>>>0<m>>>0){aj();return 0}else{c[N>>2]=0;L=M;break}}else{r=c[K+8>>2]|0;if(r>>>0<m>>>0){aj();return 0}d=r+12|0;if((c[d>>2]|0)!=(K|0)){aj();return 0}j=i+8|0;if((c[j>>2]|0)==(K|0)){c[d>>2]=i;c[j>>2]=r;L=i;break}else{aj();return 0}}}while(0);L1088:do{if((e|0)!=0){i=K+28|0;m=1216+(c[i>>2]<<2)|0;do{if((K|0)==(c[m>>2]|0)){c[m>>2]=L;if((L|0)!=0){break}c[229]=c[229]&~(1<<c[i>>2]);break L1088}else{if(e>>>0<(c[232]|0)>>>0){aj();return 0}r=e+16|0;if((c[r>>2]|0)==(K|0)){c[r>>2]=L}else{c[e+20>>2]=L}if((L|0)==0){break L1088}}}while(0);if(L>>>0<(c[232]|0)>>>0){aj();return 0}c[L+24>>2]=e;i=c[K+16>>2]|0;do{if((i|0)!=0){if(i>>>0<(c[232]|0)>>>0){aj();return 0}else{c[L+16>>2]=i;c[i+24>>2]=L;break}}}while(0);i=c[K+20>>2]|0;if((i|0)==0){break}if(i>>>0<(c[232]|0)>>>0){aj();return 0}else{c[L+20>>2]=i;c[i+24>>2]=L;break}}}while(0);do{if(J>>>0<16){e=J+g|0;c[K+4>>2]=e|3;i=q+(e+4)|0;c[i>>2]=c[i>>2]|1}else{c[K+4>>2]=g|3;c[q+(g|4)>>2]=J|1;c[q+(J+g)>>2]=J;i=J>>>3;if(J>>>0<256){e=i<<1;m=952+(e<<2)|0;r=c[228]|0;j=1<<i;do{if((r&j|0)==0){c[228]=r|j;O=m;P=952+(e+2<<2)|0}else{i=952+(e+2<<2)|0;d=c[i>>2]|0;if(d>>>0>=(c[232]|0)>>>0){O=d;P=i;break}aj();return 0}}while(0);c[P>>2]=k;c[O+12>>2]=k;c[q+(g+8)>>2]=O;c[q+(g+12)>>2]=m;break}e=p;j=J>>>8;do{if((j|0)==0){Q=0}else{if(J>>>0>16777215){Q=31;break}r=(j+1048320|0)>>>16&8;i=j<<r;d=(i+520192|0)>>>16&4;B=i<<d;i=(B+245760|0)>>>16&2;l=14-(d|r|i)+(B<<i>>>15)|0;Q=J>>>((l+7|0)>>>0)&1|l<<1}}while(0);j=1216+(Q<<2)|0;c[q+(g+28)>>2]=Q;c[q+(g+20)>>2]=0;c[q+(g+16)>>2]=0;m=c[229]|0;l=1<<Q;if((m&l|0)==0){c[229]=m|l;c[j>>2]=e;c[q+(g+24)>>2]=j;c[q+(g+12)>>2]=e;c[q+(g+8)>>2]=e;break}if((Q|0)==31){R=0}else{R=25-(Q>>>1)|0}l=J<<R;m=c[j>>2]|0;while(1){if((c[m+4>>2]&-8|0)==(J|0)){break}S=m+16+(l>>>31<<2)|0;j=c[S>>2]|0;if((j|0)==0){T=829;break}else{l=l<<1;m=j}}if((T|0)==829){if(S>>>0<(c[232]|0)>>>0){aj();return 0}else{c[S>>2]=e;c[q+(g+24)>>2]=m;c[q+(g+12)>>2]=e;c[q+(g+8)>>2]=e;break}}l=m+8|0;j=c[l>>2]|0;i=c[232]|0;if(m>>>0<i>>>0){aj();return 0}if(j>>>0<i>>>0){aj();return 0}else{c[j+12>>2]=e;c[l>>2]=e;c[q+(g+8)>>2]=j;c[q+(g+12)>>2]=m;c[q+(g+24)>>2]=0;break}}}while(0);q=K+8|0;if((q|0)==0){o=g;break}else{n=q}return n|0}}while(0);K=c[230]|0;if(o>>>0<=K>>>0){S=K-o|0;J=c[233]|0;if(S>>>0>15){R=J;c[233]=R+o;c[230]=S;c[R+(o+4)>>2]=S|1;c[R+K>>2]=S;c[J+4>>2]=o|3}else{c[230]=0;c[233]=0;c[J+4>>2]=K|3;S=J+(K+4)|0;c[S>>2]=c[S>>2]|1}n=J+8|0;return n|0}J=c[231]|0;if(o>>>0<J>>>0){S=J-o|0;c[231]=S;J=c[234]|0;K=J;c[234]=K+o;c[K+(o+4)>>2]=S|1;c[J+4>>2]=o|3;n=J+8|0;return n|0}do{if((c[222]|0)==0){J=ao(30)|0;if((J-1&J|0)==0){c[224]=J;c[223]=J;c[225]=-1;c[226]=-1;c[227]=0;c[339]=0;c[222]=(aC(0)|0)&-16^1431655768;break}else{aj();return 0}}}while(0);J=o+48|0;S=c[224]|0;K=o+47|0;R=S+K|0;Q=-S|0;S=R&Q;if(S>>>0<=o>>>0){n=0;return n|0}O=c[338]|0;do{if((O|0)!=0){P=c[336]|0;L=P+S|0;if(L>>>0<=P>>>0|L>>>0>O>>>0){n=0}else{break}return n|0}}while(0);L1180:do{if((c[339]&4|0)==0){O=c[234]|0;L1182:do{if((O|0)==0){T=859}else{L=O;P=1360;while(1){U=P|0;M=c[U>>2]|0;if(M>>>0<=L>>>0){V=P+4|0;if((M+(c[V>>2]|0)|0)>>>0>L>>>0){break}}M=c[P+8>>2]|0;if((M|0)==0){T=859;break L1182}else{P=M}}if((P|0)==0){T=859;break}L=R-(c[231]|0)&Q;if(L>>>0>=2147483647){W=0;break}m=ay(L|0)|0;e=(m|0)==((c[U>>2]|0)+(c[V>>2]|0)|0);X=e?m:-1;Y=e?L:0;Z=m;_=L;T=868}}while(0);do{if((T|0)==859){O=ay(0)|0;if((O|0)==-1){W=0;break}g=O;L=c[223]|0;m=L-1|0;if((m&g|0)==0){$=S}else{$=S-g+(m+g&-L)|0}L=c[336]|0;g=L+$|0;if(!($>>>0>o>>>0&$>>>0<2147483647)){W=0;break}m=c[338]|0;if((m|0)!=0){if(g>>>0<=L>>>0|g>>>0>m>>>0){W=0;break}}m=ay($|0)|0;g=(m|0)==(O|0);X=g?O:-1;Y=g?$:0;Z=m;_=$;T=868}}while(0);L1202:do{if((T|0)==868){m=-_|0;if((X|0)!=-1){aa=Y;ab=X;T=879;break L1180}do{if((Z|0)!=-1&_>>>0<2147483647&_>>>0<J>>>0){g=c[224]|0;O=K-_+g&-g;if(O>>>0>=2147483647){ac=_;break}if((ay(O|0)|0)==-1){ay(m|0)|0;W=Y;break L1202}else{ac=O+_|0;break}}else{ac=_}}while(0);if((Z|0)==-1){W=Y}else{aa=ac;ab=Z;T=879;break L1180}}}while(0);c[339]=c[339]|4;ad=W;T=876}else{ad=0;T=876}}while(0);do{if((T|0)==876){if(S>>>0>=2147483647){break}W=ay(S|0)|0;Z=ay(0)|0;if(!((Z|0)!=-1&(W|0)!=-1&W>>>0<Z>>>0)){break}ac=Z-W|0;Z=ac>>>0>(o+40|0)>>>0;Y=Z?W:-1;if((Y|0)!=-1){aa=Z?ac:ad;ab=Y;T=879}}}while(0);do{if((T|0)==879){ad=(c[336]|0)+aa|0;c[336]=ad;if(ad>>>0>(c[337]|0)>>>0){c[337]=ad}ad=c[234]|0;L1222:do{if((ad|0)==0){S=c[232]|0;if((S|0)==0|ab>>>0<S>>>0){c[232]=ab}c[340]=ab;c[341]=aa;c[343]=0;c[237]=c[222];c[236]=-1;S=0;do{Y=S<<1;ac=952+(Y<<2)|0;c[952+(Y+3<<2)>>2]=ac;c[952+(Y+2<<2)>>2]=ac;S=S+1|0;}while(S>>>0<32);S=ab+8|0;if((S&7|0)==0){ae=0}else{ae=-S&7}S=aa-40-ae|0;c[234]=ab+ae;c[231]=S;c[ab+(ae+4)>>2]=S|1;c[ab+(aa-36)>>2]=40;c[235]=c[226]}else{S=1360;while(1){af=c[S>>2]|0;ag=S+4|0;ah=c[ag>>2]|0;if((ab|0)==(af+ah|0)){T=891;break}ac=c[S+8>>2]|0;if((ac|0)==0){break}else{S=ac}}do{if((T|0)==891){if((c[S+12>>2]&8|0)!=0){break}ac=ad;if(!(ac>>>0>=af>>>0&ac>>>0<ab>>>0)){break}c[ag>>2]=ah+aa;ac=c[234]|0;Y=(c[231]|0)+aa|0;Z=ac;W=ac+8|0;if((W&7|0)==0){ai=0}else{ai=-W&7}W=Y-ai|0;c[234]=Z+ai;c[231]=W;c[Z+(ai+4)>>2]=W|1;c[Z+(Y+4)>>2]=40;c[235]=c[226];break L1222}}while(0);if(ab>>>0<(c[232]|0)>>>0){c[232]=ab}S=ab+aa|0;Y=1360;while(1){ak=Y|0;if((c[ak>>2]|0)==(S|0)){T=901;break}Z=c[Y+8>>2]|0;if((Z|0)==0){break}else{Y=Z}}do{if((T|0)==901){if((c[Y+12>>2]&8|0)!=0){break}c[ak>>2]=ab;S=Y+4|0;c[S>>2]=(c[S>>2]|0)+aa;S=ab+8|0;if((S&7|0)==0){al=0}else{al=-S&7}S=ab+(aa+8)|0;if((S&7|0)==0){am=0}else{am=-S&7}S=ab+(am+aa)|0;Z=S;W=al+o|0;ac=ab+W|0;_=ac;K=S-(ab+al)-o|0;c[ab+(al+4)>>2]=o|3;do{if((Z|0)==(c[234]|0)){J=(c[231]|0)+K|0;c[231]=J;c[234]=_;c[ab+(W+4)>>2]=J|1}else{if((Z|0)==(c[233]|0)){J=(c[230]|0)+K|0;c[230]=J;c[233]=_;c[ab+(W+4)>>2]=J|1;c[ab+(J+W)>>2]=J;break}J=aa+4|0;X=c[ab+(am+J)>>2]|0;if((X&3|0)==1){$=X&-8;V=X>>>3;L1267:do{if(X>>>0<256){U=c[ab+((am|8)+aa)>>2]|0;Q=c[ab+(aa+12+am)>>2]|0;R=952+(V<<1<<2)|0;do{if((U|0)!=(R|0)){if(U>>>0<(c[232]|0)>>>0){aj();return 0}if((c[U+12>>2]|0)==(Z|0)){break}aj();return 0}}while(0);if((Q|0)==(U|0)){c[228]=c[228]&~(1<<V);break}do{if((Q|0)==(R|0)){an=Q+8|0}else{if(Q>>>0<(c[232]|0)>>>0){aj();return 0}m=Q+8|0;if((c[m>>2]|0)==(Z|0)){an=m;break}aj();return 0}}while(0);c[U+12>>2]=Q;c[an>>2]=U}else{R=S;m=c[ab+((am|24)+aa)>>2]|0;P=c[ab+(aa+12+am)>>2]|0;do{if((P|0)==(R|0)){O=am|16;g=ab+(O+J)|0;L=c[g>>2]|0;if((L|0)==0){e=ab+(O+aa)|0;O=c[e>>2]|0;if((O|0)==0){ap=0;break}else{aq=O;ar=e}}else{aq=L;ar=g}while(1){g=aq+20|0;L=c[g>>2]|0;if((L|0)!=0){aq=L;ar=g;continue}g=aq+16|0;L=c[g>>2]|0;if((L|0)==0){break}else{aq=L;ar=g}}if(ar>>>0<(c[232]|0)>>>0){aj();return 0}else{c[ar>>2]=0;ap=aq;break}}else{g=c[ab+((am|8)+aa)>>2]|0;if(g>>>0<(c[232]|0)>>>0){aj();return 0}L=g+12|0;if((c[L>>2]|0)!=(R|0)){aj();return 0}e=P+8|0;if((c[e>>2]|0)==(R|0)){c[L>>2]=P;c[e>>2]=g;ap=P;break}else{aj();return 0}}}while(0);if((m|0)==0){break}P=ab+(aa+28+am)|0;U=1216+(c[P>>2]<<2)|0;do{if((R|0)==(c[U>>2]|0)){c[U>>2]=ap;if((ap|0)!=0){break}c[229]=c[229]&~(1<<c[P>>2]);break L1267}else{if(m>>>0<(c[232]|0)>>>0){aj();return 0}Q=m+16|0;if((c[Q>>2]|0)==(R|0)){c[Q>>2]=ap}else{c[m+20>>2]=ap}if((ap|0)==0){break L1267}}}while(0);if(ap>>>0<(c[232]|0)>>>0){aj();return 0}c[ap+24>>2]=m;R=am|16;P=c[ab+(R+aa)>>2]|0;do{if((P|0)!=0){if(P>>>0<(c[232]|0)>>>0){aj();return 0}else{c[ap+16>>2]=P;c[P+24>>2]=ap;break}}}while(0);P=c[ab+(R+J)>>2]|0;if((P|0)==0){break}if(P>>>0<(c[232]|0)>>>0){aj();return 0}else{c[ap+20>>2]=P;c[P+24>>2]=ap;break}}}while(0);as=ab+(($|am)+aa)|0;at=$+K|0}else{as=Z;at=K}J=as+4|0;c[J>>2]=c[J>>2]&-2;c[ab+(W+4)>>2]=at|1;c[ab+(at+W)>>2]=at;J=at>>>3;if(at>>>0<256){V=J<<1;X=952+(V<<2)|0;P=c[228]|0;m=1<<J;do{if((P&m|0)==0){c[228]=P|m;au=X;av=952+(V+2<<2)|0}else{J=952+(V+2<<2)|0;U=c[J>>2]|0;if(U>>>0>=(c[232]|0)>>>0){au=U;av=J;break}aj();return 0}}while(0);c[av>>2]=_;c[au+12>>2]=_;c[ab+(W+8)>>2]=au;c[ab+(W+12)>>2]=X;break}V=ac;m=at>>>8;do{if((m|0)==0){aw=0}else{if(at>>>0>16777215){aw=31;break}P=(m+1048320|0)>>>16&8;$=m<<P;J=($+520192|0)>>>16&4;U=$<<J;$=(U+245760|0)>>>16&2;Q=14-(J|P|$)+(U<<$>>>15)|0;aw=at>>>((Q+7|0)>>>0)&1|Q<<1}}while(0);m=1216+(aw<<2)|0;c[ab+(W+28)>>2]=aw;c[ab+(W+20)>>2]=0;c[ab+(W+16)>>2]=0;X=c[229]|0;Q=1<<aw;if((X&Q|0)==0){c[229]=X|Q;c[m>>2]=V;c[ab+(W+24)>>2]=m;c[ab+(W+12)>>2]=V;c[ab+(W+8)>>2]=V;break}if((aw|0)==31){ax=0}else{ax=25-(aw>>>1)|0}Q=at<<ax;X=c[m>>2]|0;while(1){if((c[X+4>>2]&-8|0)==(at|0)){break}aA=X+16+(Q>>>31<<2)|0;m=c[aA>>2]|0;if((m|0)==0){T=974;break}else{Q=Q<<1;X=m}}if((T|0)==974){if(aA>>>0<(c[232]|0)>>>0){aj();return 0}else{c[aA>>2]=V;c[ab+(W+24)>>2]=X;c[ab+(W+12)>>2]=V;c[ab+(W+8)>>2]=V;break}}Q=X+8|0;m=c[Q>>2]|0;$=c[232]|0;if(X>>>0<$>>>0){aj();return 0}if(m>>>0<$>>>0){aj();return 0}else{c[m+12>>2]=V;c[Q>>2]=V;c[ab+(W+8)>>2]=m;c[ab+(W+12)>>2]=X;c[ab+(W+24)>>2]=0;break}}}while(0);n=ab+(al|8)|0;return n|0}}while(0);Y=ad;W=1360;while(1){aB=c[W>>2]|0;if(aB>>>0<=Y>>>0){aD=c[W+4>>2]|0;aE=aB+aD|0;if(aE>>>0>Y>>>0){break}}W=c[W+8>>2]|0}W=aB+(aD-39)|0;if((W&7|0)==0){aF=0}else{aF=-W&7}W=aB+(aD-47+aF)|0;ac=W>>>0<(ad+16|0)>>>0?Y:W;W=ac+8|0;_=ab+8|0;if((_&7|0)==0){aG=0}else{aG=-_&7}_=aa-40-aG|0;c[234]=ab+aG;c[231]=_;c[ab+(aG+4)>>2]=_|1;c[ab+(aa-36)>>2]=40;c[235]=c[226];c[ac+4>>2]=27;c[W>>2]=c[340];c[W+4>>2]=c[341];c[W+8>>2]=c[342];c[W+12>>2]=c[343];c[340]=ab;c[341]=aa;c[343]=0;c[342]=W;W=ac+28|0;c[W>>2]=7;if((ac+32|0)>>>0<aE>>>0){_=W;while(1){W=_+4|0;c[W>>2]=7;if((_+8|0)>>>0<aE>>>0){_=W}else{break}}}if((ac|0)==(Y|0)){break}_=ac-ad|0;W=Y+(_+4)|0;c[W>>2]=c[W>>2]&-2;c[ad+4>>2]=_|1;c[Y+_>>2]=_;W=_>>>3;if(_>>>0<256){K=W<<1;Z=952+(K<<2)|0;S=c[228]|0;m=1<<W;do{if((S&m|0)==0){c[228]=S|m;aH=Z;aI=952+(K+2<<2)|0}else{W=952+(K+2<<2)|0;Q=c[W>>2]|0;if(Q>>>0>=(c[232]|0)>>>0){aH=Q;aI=W;break}aj();return 0}}while(0);c[aI>>2]=ad;c[aH+12>>2]=ad;c[ad+8>>2]=aH;c[ad+12>>2]=Z;break}K=ad;m=_>>>8;do{if((m|0)==0){aJ=0}else{if(_>>>0>16777215){aJ=31;break}S=(m+1048320|0)>>>16&8;Y=m<<S;ac=(Y+520192|0)>>>16&4;W=Y<<ac;Y=(W+245760|0)>>>16&2;Q=14-(ac|S|Y)+(W<<Y>>>15)|0;aJ=_>>>((Q+7|0)>>>0)&1|Q<<1}}while(0);m=1216+(aJ<<2)|0;c[ad+28>>2]=aJ;c[ad+20>>2]=0;c[ad+16>>2]=0;Z=c[229]|0;Q=1<<aJ;if((Z&Q|0)==0){c[229]=Z|Q;c[m>>2]=K;c[ad+24>>2]=m;c[ad+12>>2]=ad;c[ad+8>>2]=ad;break}if((aJ|0)==31){aK=0}else{aK=25-(aJ>>>1)|0}Q=_<<aK;Z=c[m>>2]|0;while(1){if((c[Z+4>>2]&-8|0)==(_|0)){break}aL=Z+16+(Q>>>31<<2)|0;m=c[aL>>2]|0;if((m|0)==0){T=1009;break}else{Q=Q<<1;Z=m}}if((T|0)==1009){if(aL>>>0<(c[232]|0)>>>0){aj();return 0}else{c[aL>>2]=K;c[ad+24>>2]=Z;c[ad+12>>2]=ad;c[ad+8>>2]=ad;break}}Q=Z+8|0;_=c[Q>>2]|0;m=c[232]|0;if(Z>>>0<m>>>0){aj();return 0}if(_>>>0<m>>>0){aj();return 0}else{c[_+12>>2]=K;c[Q>>2]=K;c[ad+8>>2]=_;c[ad+12>>2]=Z;c[ad+24>>2]=0;break}}}while(0);ad=c[231]|0;if(ad>>>0<=o>>>0){break}_=ad-o|0;c[231]=_;ad=c[234]|0;Q=ad;c[234]=Q+o;c[Q+(o+4)>>2]=_|1;c[ad+4>>2]=o|3;n=ad+8|0;return n|0}}while(0);c[(az()|0)>>2]=12;n=0;return n|0}function bf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;if((a|0)==0){return}b=a-8|0;d=b;e=c[232]|0;if(b>>>0<e>>>0){aj()}f=c[a-4>>2]|0;g=f&3;if((g|0)==1){aj()}h=f&-8;i=a+(h-8)|0;j=i;L1439:do{if((f&1|0)==0){k=c[b>>2]|0;if((g|0)==0){return}l=-8-k|0;m=a+l|0;n=m;o=k+h|0;if(m>>>0<e>>>0){aj()}if((n|0)==(c[233]|0)){p=a+(h-4)|0;if((c[p>>2]&3|0)!=3){q=n;r=o;break}c[230]=o;c[p>>2]=c[p>>2]&-2;c[a+(l+4)>>2]=o|1;c[i>>2]=o;return}p=k>>>3;if(k>>>0<256){k=c[a+(l+8)>>2]|0;s=c[a+(l+12)>>2]|0;t=952+(p<<1<<2)|0;do{if((k|0)!=(t|0)){if(k>>>0<e>>>0){aj()}if((c[k+12>>2]|0)==(n|0)){break}aj()}}while(0);if((s|0)==(k|0)){c[228]=c[228]&~(1<<p);q=n;r=o;break}do{if((s|0)==(t|0)){u=s+8|0}else{if(s>>>0<e>>>0){aj()}v=s+8|0;if((c[v>>2]|0)==(n|0)){u=v;break}aj()}}while(0);c[k+12>>2]=s;c[u>>2]=k;q=n;r=o;break}t=m;p=c[a+(l+24)>>2]|0;v=c[a+(l+12)>>2]|0;do{if((v|0)==(t|0)){w=a+(l+20)|0;x=c[w>>2]|0;if((x|0)==0){y=a+(l+16)|0;z=c[y>>2]|0;if((z|0)==0){A=0;break}else{B=z;C=y}}else{B=x;C=w}while(1){w=B+20|0;x=c[w>>2]|0;if((x|0)!=0){B=x;C=w;continue}w=B+16|0;x=c[w>>2]|0;if((x|0)==0){break}else{B=x;C=w}}if(C>>>0<e>>>0){aj()}else{c[C>>2]=0;A=B;break}}else{w=c[a+(l+8)>>2]|0;if(w>>>0<e>>>0){aj()}x=w+12|0;if((c[x>>2]|0)!=(t|0)){aj()}y=v+8|0;if((c[y>>2]|0)==(t|0)){c[x>>2]=v;c[y>>2]=w;A=v;break}else{aj()}}}while(0);if((p|0)==0){q=n;r=o;break}v=a+(l+28)|0;m=1216+(c[v>>2]<<2)|0;do{if((t|0)==(c[m>>2]|0)){c[m>>2]=A;if((A|0)!=0){break}c[229]=c[229]&~(1<<c[v>>2]);q=n;r=o;break L1439}else{if(p>>>0<(c[232]|0)>>>0){aj()}k=p+16|0;if((c[k>>2]|0)==(t|0)){c[k>>2]=A}else{c[p+20>>2]=A}if((A|0)==0){q=n;r=o;break L1439}}}while(0);if(A>>>0<(c[232]|0)>>>0){aj()}c[A+24>>2]=p;t=c[a+(l+16)>>2]|0;do{if((t|0)!=0){if(t>>>0<(c[232]|0)>>>0){aj()}else{c[A+16>>2]=t;c[t+24>>2]=A;break}}}while(0);t=c[a+(l+20)>>2]|0;if((t|0)==0){q=n;r=o;break}if(t>>>0<(c[232]|0)>>>0){aj()}else{c[A+20>>2]=t;c[t+24>>2]=A;q=n;r=o;break}}else{q=d;r=h}}while(0);d=q;if(d>>>0>=i>>>0){aj()}A=a+(h-4)|0;e=c[A>>2]|0;if((e&1|0)==0){aj()}do{if((e&2|0)==0){if((j|0)==(c[234]|0)){B=(c[231]|0)+r|0;c[231]=B;c[234]=q;c[q+4>>2]=B|1;if((q|0)!=(c[233]|0)){return}c[233]=0;c[230]=0;return}if((j|0)==(c[233]|0)){B=(c[230]|0)+r|0;c[230]=B;c[233]=q;c[q+4>>2]=B|1;c[d+B>>2]=B;return}B=(e&-8)+r|0;C=e>>>3;L1542:do{if(e>>>0<256){u=c[a+h>>2]|0;g=c[a+(h|4)>>2]|0;b=952+(C<<1<<2)|0;do{if((u|0)!=(b|0)){if(u>>>0<(c[232]|0)>>>0){aj()}if((c[u+12>>2]|0)==(j|0)){break}aj()}}while(0);if((g|0)==(u|0)){c[228]=c[228]&~(1<<C);break}do{if((g|0)==(b|0)){D=g+8|0}else{if(g>>>0<(c[232]|0)>>>0){aj()}f=g+8|0;if((c[f>>2]|0)==(j|0)){D=f;break}aj()}}while(0);c[u+12>>2]=g;c[D>>2]=u}else{b=i;f=c[a+(h+16)>>2]|0;t=c[a+(h|4)>>2]|0;do{if((t|0)==(b|0)){p=a+(h+12)|0;v=c[p>>2]|0;if((v|0)==0){m=a+(h+8)|0;k=c[m>>2]|0;if((k|0)==0){E=0;break}else{F=k;G=m}}else{F=v;G=p}while(1){p=F+20|0;v=c[p>>2]|0;if((v|0)!=0){F=v;G=p;continue}p=F+16|0;v=c[p>>2]|0;if((v|0)==0){break}else{F=v;G=p}}if(G>>>0<(c[232]|0)>>>0){aj()}else{c[G>>2]=0;E=F;break}}else{p=c[a+h>>2]|0;if(p>>>0<(c[232]|0)>>>0){aj()}v=p+12|0;if((c[v>>2]|0)!=(b|0)){aj()}m=t+8|0;if((c[m>>2]|0)==(b|0)){c[v>>2]=t;c[m>>2]=p;E=t;break}else{aj()}}}while(0);if((f|0)==0){break}t=a+(h+20)|0;u=1216+(c[t>>2]<<2)|0;do{if((b|0)==(c[u>>2]|0)){c[u>>2]=E;if((E|0)!=0){break}c[229]=c[229]&~(1<<c[t>>2]);break L1542}else{if(f>>>0<(c[232]|0)>>>0){aj()}g=f+16|0;if((c[g>>2]|0)==(b|0)){c[g>>2]=E}else{c[f+20>>2]=E}if((E|0)==0){break L1542}}}while(0);if(E>>>0<(c[232]|0)>>>0){aj()}c[E+24>>2]=f;b=c[a+(h+8)>>2]|0;do{if((b|0)!=0){if(b>>>0<(c[232]|0)>>>0){aj()}else{c[E+16>>2]=b;c[b+24>>2]=E;break}}}while(0);b=c[a+(h+12)>>2]|0;if((b|0)==0){break}if(b>>>0<(c[232]|0)>>>0){aj()}else{c[E+20>>2]=b;c[b+24>>2]=E;break}}}while(0);c[q+4>>2]=B|1;c[d+B>>2]=B;if((q|0)!=(c[233]|0)){H=B;break}c[230]=B;return}else{c[A>>2]=e&-2;c[q+4>>2]=r|1;c[d+r>>2]=r;H=r}}while(0);r=H>>>3;if(H>>>0<256){d=r<<1;e=952+(d<<2)|0;A=c[228]|0;E=1<<r;do{if((A&E|0)==0){c[228]=A|E;I=e;J=952+(d+2<<2)|0}else{r=952+(d+2<<2)|0;h=c[r>>2]|0;if(h>>>0>=(c[232]|0)>>>0){I=h;J=r;break}aj()}}while(0);c[J>>2]=q;c[I+12>>2]=q;c[q+8>>2]=I;c[q+12>>2]=e;return}e=q;I=H>>>8;do{if((I|0)==0){K=0}else{if(H>>>0>16777215){K=31;break}J=(I+1048320|0)>>>16&8;d=I<<J;E=(d+520192|0)>>>16&4;A=d<<E;d=(A+245760|0)>>>16&2;r=14-(E|J|d)+(A<<d>>>15)|0;K=H>>>((r+7|0)>>>0)&1|r<<1}}while(0);I=1216+(K<<2)|0;c[q+28>>2]=K;c[q+20>>2]=0;c[q+16>>2]=0;r=c[229]|0;d=1<<K;do{if((r&d|0)==0){c[229]=r|d;c[I>>2]=e;c[q+24>>2]=I;c[q+12>>2]=q;c[q+8>>2]=q}else{if((K|0)==31){L=0}else{L=25-(K>>>1)|0}A=H<<L;J=c[I>>2]|0;while(1){if((c[J+4>>2]&-8|0)==(H|0)){break}M=J+16+(A>>>31<<2)|0;E=c[M>>2]|0;if((E|0)==0){N=1186;break}else{A=A<<1;J=E}}if((N|0)==1186){if(M>>>0<(c[232]|0)>>>0){aj()}else{c[M>>2]=e;c[q+24>>2]=J;c[q+12>>2]=q;c[q+8>>2]=q;break}}A=J+8|0;B=c[A>>2]|0;E=c[232]|0;if(J>>>0<E>>>0){aj()}if(B>>>0<E>>>0){aj()}else{c[B+12>>2]=e;c[A>>2]=e;c[q+8>>2]=B;c[q+12>>2]=J;c[q+24>>2]=0;break}}}while(0);q=(c[236]|0)-1|0;c[236]=q;if((q|0)==0){O=1368}else{return}while(1){q=c[O>>2]|0;if((q|0)==0){break}else{O=q+8|0}}c[236]=-1;return}function bg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;if((a|0)==0){d=be(b)|0;return d|0}if(b>>>0>4294967231){c[(az()|0)>>2]=12;d=0;return d|0}if(b>>>0<11){e=16}else{e=b+11&-8}f=a-8|0;g=a-4|0;h=c[g>>2]|0;i=h&-8;j=i-8|0;k=a+j|0;l=k;m=c[232]|0;if(f>>>0<m>>>0){aj();return 0}n=h&3;if(!((n|0)!=1&(j|0)>-8)){aj();return 0}j=i|4;o=a+(j-8)|0;p=c[o>>2]|0;if((p&1|0)==0){aj();return 0}L1677:do{if((n|0)==0){if(e>>>0<256|i>>>0<(e|4)>>>0){break}if((i-e|0)>>>0>c[224]<<1>>>0|(f|0)==0){break}else{d=a}return d|0}else{do{if(i>>>0<e>>>0){if((l|0)==(c[234]|0)){q=(c[231]|0)+i|0;if(q>>>0<=e>>>0){break L1677}r=q-e|0;c[g>>2]=h&1|e|2;c[a+((e|4)-8)>>2]=r|1;c[234]=a+(e-8);c[231]=r;break}if((l|0)==(c[233]|0)){r=(c[230]|0)+i|0;if(r>>>0<e>>>0){break L1677}q=r-e|0;if(q>>>0>15){c[g>>2]=h&1|e|2;c[a+((e|4)-8)>>2]=q|1;c[a+(r-8)>>2]=q;s=a+(r-4)|0;c[s>>2]=c[s>>2]&-2;t=a+(e-8)|0;u=q}else{c[g>>2]=h&1|r|2;q=a+(r-4)|0;c[q>>2]=c[q>>2]|1;t=0;u=0}c[230]=u;c[233]=t;break}if((p&2|0)!=0){break L1677}q=(p&-8)+i|0;if(q>>>0<e>>>0){break L1677}r=q-e|0;s=p>>>3;L1695:do{if(p>>>0<256){v=c[a+i>>2]|0;w=c[a+j>>2]|0;x=952+(s<<1<<2)|0;do{if((v|0)!=(x|0)){if(v>>>0<m>>>0){aj();return 0}if((c[v+12>>2]|0)==(l|0)){break}aj();return 0}}while(0);if((w|0)==(v|0)){c[228]=c[228]&~(1<<s);break}do{if((w|0)==(x|0)){y=w+8|0}else{if(w>>>0<m>>>0){aj();return 0}z=w+8|0;if((c[z>>2]|0)==(l|0)){y=z;break}aj();return 0}}while(0);c[v+12>>2]=w;c[y>>2]=v}else{x=k;z=c[a+(i+16)>>2]|0;A=c[a+j>>2]|0;do{if((A|0)==(x|0)){B=a+(i+12)|0;C=c[B>>2]|0;if((C|0)==0){D=a+(i+8)|0;E=c[D>>2]|0;if((E|0)==0){F=0;break}else{G=E;H=D}}else{G=C;H=B}while(1){B=G+20|0;C=c[B>>2]|0;if((C|0)!=0){G=C;H=B;continue}B=G+16|0;C=c[B>>2]|0;if((C|0)==0){break}else{G=C;H=B}}if(H>>>0<m>>>0){aj();return 0}else{c[H>>2]=0;F=G;break}}else{B=c[a+i>>2]|0;if(B>>>0<m>>>0){aj();return 0}C=B+12|0;if((c[C>>2]|0)!=(x|0)){aj();return 0}D=A+8|0;if((c[D>>2]|0)==(x|0)){c[C>>2]=A;c[D>>2]=B;F=A;break}else{aj();return 0}}}while(0);if((z|0)==0){break}A=a+(i+20)|0;v=1216+(c[A>>2]<<2)|0;do{if((x|0)==(c[v>>2]|0)){c[v>>2]=F;if((F|0)!=0){break}c[229]=c[229]&~(1<<c[A>>2]);break L1695}else{if(z>>>0<(c[232]|0)>>>0){aj();return 0}w=z+16|0;if((c[w>>2]|0)==(x|0)){c[w>>2]=F}else{c[z+20>>2]=F}if((F|0)==0){break L1695}}}while(0);if(F>>>0<(c[232]|0)>>>0){aj();return 0}c[F+24>>2]=z;x=c[a+(i+8)>>2]|0;do{if((x|0)!=0){if(x>>>0<(c[232]|0)>>>0){aj();return 0}else{c[F+16>>2]=x;c[x+24>>2]=F;break}}}while(0);x=c[a+(i+12)>>2]|0;if((x|0)==0){break}if(x>>>0<(c[232]|0)>>>0){aj();return 0}else{c[F+20>>2]=x;c[x+24>>2]=F;break}}}while(0);if(r>>>0>=16){c[g>>2]=c[g>>2]&1|e|2;c[a+((e|4)-8)>>2]=r|3;s=a+((q|4)-8)|0;c[s>>2]=c[s>>2]|1;bh(a+(e-8)|0,r);break}c[g>>2]=q|c[g>>2]&1|2;s=a+((q|4)-8)|0;c[s>>2]=c[s>>2]|1;d=a;return d|0}else{s=i-e|0;if(s>>>0<=15){break}c[g>>2]=h&1|e|2;c[a+((e|4)-8)>>2]=s|3;c[o>>2]=c[o>>2]|1;bh(a+(e-8)|0,s);d=a;return d|0}}while(0);if((f|0)==0){break}else{d=a}return d|0}}while(0);f=be(b)|0;if((f|0)==0){d=0;return d|0}e=c[g>>2]|0;g=(e&-8)-((e&3|0)==0?8:4)|0;e=g>>>0<b>>>0?g:b;bk(f|0,a|0,e)|0;bf(a);d=f;return d|0}function bh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;d=a;e=d+b|0;f=e;g=c[a+4>>2]|0;L1783:do{if((g&1|0)==0){h=c[a>>2]|0;if((g&3|0)==0){return}i=d+(-h|0)|0;j=i;k=h+b|0;l=c[232]|0;if(i>>>0<l>>>0){aj()}if((j|0)==(c[233]|0)){m=d+(b+4)|0;if((c[m>>2]&3|0)!=3){n=j;o=k;break}c[230]=k;c[m>>2]=c[m>>2]&-2;c[d+(4-h)>>2]=k|1;c[e>>2]=k;return}m=h>>>3;if(h>>>0<256){p=c[d+(8-h)>>2]|0;q=c[d+(12-h)>>2]|0;r=952+(m<<1<<2)|0;do{if((p|0)!=(r|0)){if(p>>>0<l>>>0){aj()}if((c[p+12>>2]|0)==(j|0)){break}aj()}}while(0);if((q|0)==(p|0)){c[228]=c[228]&~(1<<m);n=j;o=k;break}do{if((q|0)==(r|0)){s=q+8|0}else{if(q>>>0<l>>>0){aj()}t=q+8|0;if((c[t>>2]|0)==(j|0)){s=t;break}aj()}}while(0);c[p+12>>2]=q;c[s>>2]=p;n=j;o=k;break}r=i;m=c[d+(24-h)>>2]|0;t=c[d+(12-h)>>2]|0;do{if((t|0)==(r|0)){u=16-h|0;v=d+(u+4)|0;w=c[v>>2]|0;if((w|0)==0){x=d+u|0;u=c[x>>2]|0;if((u|0)==0){y=0;break}else{z=u;A=x}}else{z=w;A=v}while(1){v=z+20|0;w=c[v>>2]|0;if((w|0)!=0){z=w;A=v;continue}v=z+16|0;w=c[v>>2]|0;if((w|0)==0){break}else{z=w;A=v}}if(A>>>0<l>>>0){aj()}else{c[A>>2]=0;y=z;break}}else{v=c[d+(8-h)>>2]|0;if(v>>>0<l>>>0){aj()}w=v+12|0;if((c[w>>2]|0)!=(r|0)){aj()}x=t+8|0;if((c[x>>2]|0)==(r|0)){c[w>>2]=t;c[x>>2]=v;y=t;break}else{aj()}}}while(0);if((m|0)==0){n=j;o=k;break}t=d+(28-h)|0;l=1216+(c[t>>2]<<2)|0;do{if((r|0)==(c[l>>2]|0)){c[l>>2]=y;if((y|0)!=0){break}c[229]=c[229]&~(1<<c[t>>2]);n=j;o=k;break L1783}else{if(m>>>0<(c[232]|0)>>>0){aj()}i=m+16|0;if((c[i>>2]|0)==(r|0)){c[i>>2]=y}else{c[m+20>>2]=y}if((y|0)==0){n=j;o=k;break L1783}}}while(0);if(y>>>0<(c[232]|0)>>>0){aj()}c[y+24>>2]=m;r=16-h|0;t=c[d+r>>2]|0;do{if((t|0)!=0){if(t>>>0<(c[232]|0)>>>0){aj()}else{c[y+16>>2]=t;c[t+24>>2]=y;break}}}while(0);t=c[d+(r+4)>>2]|0;if((t|0)==0){n=j;o=k;break}if(t>>>0<(c[232]|0)>>>0){aj()}else{c[y+20>>2]=t;c[t+24>>2]=y;n=j;o=k;break}}else{n=a;o=b}}while(0);a=c[232]|0;if(e>>>0<a>>>0){aj()}y=d+(b+4)|0;z=c[y>>2]|0;do{if((z&2|0)==0){if((f|0)==(c[234]|0)){A=(c[231]|0)+o|0;c[231]=A;c[234]=n;c[n+4>>2]=A|1;if((n|0)!=(c[233]|0)){return}c[233]=0;c[230]=0;return}if((f|0)==(c[233]|0)){A=(c[230]|0)+o|0;c[230]=A;c[233]=n;c[n+4>>2]=A|1;c[n+A>>2]=A;return}A=(z&-8)+o|0;s=z>>>3;L1883:do{if(z>>>0<256){g=c[d+(b+8)>>2]|0;t=c[d+(b+12)>>2]|0;h=952+(s<<1<<2)|0;do{if((g|0)!=(h|0)){if(g>>>0<a>>>0){aj()}if((c[g+12>>2]|0)==(f|0)){break}aj()}}while(0);if((t|0)==(g|0)){c[228]=c[228]&~(1<<s);break}do{if((t|0)==(h|0)){B=t+8|0}else{if(t>>>0<a>>>0){aj()}m=t+8|0;if((c[m>>2]|0)==(f|0)){B=m;break}aj()}}while(0);c[g+12>>2]=t;c[B>>2]=g}else{h=e;m=c[d+(b+24)>>2]|0;l=c[d+(b+12)>>2]|0;do{if((l|0)==(h|0)){i=d+(b+20)|0;p=c[i>>2]|0;if((p|0)==0){q=d+(b+16)|0;v=c[q>>2]|0;if((v|0)==0){C=0;break}else{D=v;E=q}}else{D=p;E=i}while(1){i=D+20|0;p=c[i>>2]|0;if((p|0)!=0){D=p;E=i;continue}i=D+16|0;p=c[i>>2]|0;if((p|0)==0){break}else{D=p;E=i}}if(E>>>0<a>>>0){aj()}else{c[E>>2]=0;C=D;break}}else{i=c[d+(b+8)>>2]|0;if(i>>>0<a>>>0){aj()}p=i+12|0;if((c[p>>2]|0)!=(h|0)){aj()}q=l+8|0;if((c[q>>2]|0)==(h|0)){c[p>>2]=l;c[q>>2]=i;C=l;break}else{aj()}}}while(0);if((m|0)==0){break}l=d+(b+28)|0;g=1216+(c[l>>2]<<2)|0;do{if((h|0)==(c[g>>2]|0)){c[g>>2]=C;if((C|0)!=0){break}c[229]=c[229]&~(1<<c[l>>2]);break L1883}else{if(m>>>0<(c[232]|0)>>>0){aj()}t=m+16|0;if((c[t>>2]|0)==(h|0)){c[t>>2]=C}else{c[m+20>>2]=C}if((C|0)==0){break L1883}}}while(0);if(C>>>0<(c[232]|0)>>>0){aj()}c[C+24>>2]=m;h=c[d+(b+16)>>2]|0;do{if((h|0)!=0){if(h>>>0<(c[232]|0)>>>0){aj()}else{c[C+16>>2]=h;c[h+24>>2]=C;break}}}while(0);h=c[d+(b+20)>>2]|0;if((h|0)==0){break}if(h>>>0<(c[232]|0)>>>0){aj()}else{c[C+20>>2]=h;c[h+24>>2]=C;break}}}while(0);c[n+4>>2]=A|1;c[n+A>>2]=A;if((n|0)!=(c[233]|0)){F=A;break}c[230]=A;return}else{c[y>>2]=z&-2;c[n+4>>2]=o|1;c[n+o>>2]=o;F=o}}while(0);o=F>>>3;if(F>>>0<256){z=o<<1;y=952+(z<<2)|0;C=c[228]|0;b=1<<o;do{if((C&b|0)==0){c[228]=C|b;G=y;H=952+(z+2<<2)|0}else{o=952+(z+2<<2)|0;d=c[o>>2]|0;if(d>>>0>=(c[232]|0)>>>0){G=d;H=o;break}aj()}}while(0);c[H>>2]=n;c[G+12>>2]=n;c[n+8>>2]=G;c[n+12>>2]=y;return}y=n;G=F>>>8;do{if((G|0)==0){I=0}else{if(F>>>0>16777215){I=31;break}H=(G+1048320|0)>>>16&8;z=G<<H;b=(z+520192|0)>>>16&4;C=z<<b;z=(C+245760|0)>>>16&2;o=14-(b|H|z)+(C<<z>>>15)|0;I=F>>>((o+7|0)>>>0)&1|o<<1}}while(0);G=1216+(I<<2)|0;c[n+28>>2]=I;c[n+20>>2]=0;c[n+16>>2]=0;o=c[229]|0;z=1<<I;if((o&z|0)==0){c[229]=o|z;c[G>>2]=y;c[n+24>>2]=G;c[n+12>>2]=n;c[n+8>>2]=n;return}if((I|0)==31){J=0}else{J=25-(I>>>1)|0}I=F<<J;J=c[G>>2]|0;while(1){if((c[J+4>>2]&-8|0)==(F|0)){break}K=J+16+(I>>>31<<2)|0;G=c[K>>2]|0;if((G|0)==0){L=1452;break}else{I=I<<1;J=G}}if((L|0)==1452){if(K>>>0<(c[232]|0)>>>0){aj()}c[K>>2]=y;c[n+24>>2]=J;c[n+12>>2]=n;c[n+8>>2]=n;return}K=J+8|0;L=c[K>>2]|0;I=c[232]|0;if(J>>>0<I>>>0){aj()}if(L>>>0<I>>>0){aj()}c[L+12>>2]=y;c[K>>2]=y;c[n+8>>2]=L;c[n+12>>2]=J;c[n+24>>2]=0;return}function bi(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0}return c-b|0}function bj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=b+e|0;if((e|0)>=20){d=d&255;e=b&3;g=d|d<<8|d<<16|d<<24;h=f&~3;if(e){e=b+4-e|0;while((b|0)<(e|0)){a[b]=d;b=b+1|0}}while((b|0)<(h|0)){c[b>>2]=g;b=b+4|0}}while((b|0)<(f|0)){a[b]=d;b=b+1|0}}function bk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function bl(a,b){a=a|0;b=b|0;return aE[a&1](b|0)|0}function bm(a){a=a|0;aF[a&1]()}function bn(a,b,c){a=a|0;b=b|0;c=c|0;return aG[a&1](b|0,c|0)|0}function bo(a,b){a=a|0;b=b|0;aH[a&1](b|0)}function bp(a){a=a|0;_(0);return 0}function bq(){_(1)}function br(a,b){a=a|0;b=b|0;_(2);return 0}function bs(a){a=a|0;_(3)}\n // EMSCRIPTEN_END_FUNCS\n var aE=[bp,bp];var aF=[bq,bq];var aG=[br,br];var aH=[bs,bs];return{_strlen:bi,_crn_get_levels:a8,_crn_get_uncompressed_size:bb,_crn_decompress:bc,_crn_get_width:a6,_realloc:bg,_crn_get_bytes_per_block:ba,_memset:bj,_malloc:be,_memcpy:bk,_free:bf,_crn_get_height:a7,_crn_get_dxt_format:a9,runPostSets:aY,stackAlloc:aI,stackSave:aJ,stackRestore:aK,setThrew:aL,setTempRet0:aO,setTempRet1:aP,setTempRet2:aQ,setTempRet3:aR,setTempRet4:aS,setTempRet5:aT,setTempRet6:aU,setTempRet7:aV,setTempRet8:aW,setTempRet9:aX,dynCall_ii:bl,dynCall_v:bm,dynCall_iii:bn,dynCall_vi:bo}\n // EMSCRIPTEN_END_ASM\n })({Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array},{abort:E,assert:A,asmPrintInt:function(a,b){s.print(\"int \"+a+\",\"+b)},asmPrintFloat:function(a,b){s.print(\"float \"+a+\",\"+b)},min:Ca,invoke_ii:function(a,b){try{return s.dynCall_ii(a,b)}catch(c){\"number\"!==typeof c&&\"longjmp\"!==c&&e(c),$.setThrew(1,0)}},invoke_v:function(a){try{s.dynCall_v(a)}catch(b){\"number\"!==\n typeof b&&\"longjmp\"!==b&&e(b),$.setThrew(1,0)}},invoke_iii:function(a,b,c){try{return s.dynCall_iii(a,b,c)}catch(d){\"number\"!==typeof d&&\"longjmp\"!==d&&e(d),$.setThrew(1,0)}},invoke_vi:function(a,b){try{s.dynCall_vi(a,b)}catch(c){\"number\"!==typeof c&&\"longjmp\"!==c&&e(c),$.setThrew(1,0)}},_llvm_lifetime_end:q(),_snprintf:nb,_abort:function(){s.abort()},_fprintf:jc,_printf:function(a,b){return jc(K[Cb>>2],a,b)},_fflush:q(),__reallyNegative:lb,_sysconf:function(a){switch(a){case 30:return 4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 79:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;\n case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;\n case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1E3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return 1}S(R.u);return-1},___setErrNo:S,_fwrite:ic,_send:function(a,b,c){return!Z.ub(a)?\n (S(R.ba),-1):hc(a,b,c)},_write:hc,_exit:function(a){mc(a)},_sprintf:function(a,b,c){return nb(a,j,b,c)},__formatString:mb,__ZSt9terminatev:function(){mc(-1234)},_pwrite:function(a,b,c,d){a=X[a];if(!a)return S(R.ba),-1;try{return ac(a,I,b,c,d)}catch(f){return Jb(f),-1}},_sbrk:nc,___errno_location:function(){return pb},___gxx_personality_v0:q(),_llvm_lifetime_start:q(),_time:function(a){var b=Math.floor(Date.now()/1E3);a&&(K[a>>2]=b);return b},__exit:mc,STACKTOP:x,STACK_MAX:Sa,tempDoublePtr:jb,ABORT:ua,\n NaN:NaN,Infinity:Infinity},N),kb=s._strlen=$._strlen;s._crn_get_levels=$._crn_get_levels;s._crn_get_uncompressed_size=$._crn_get_uncompressed_size;s._crn_decompress=$._crn_decompress;s._crn_get_width=$._crn_get_width;s._realloc=$._realloc;s._crn_get_bytes_per_block=$._crn_get_bytes_per_block;var kc=s._memset=$._memset,Ka=s._malloc=$._malloc,lc=s._memcpy=$._memcpy;s._free=$._free;s._crn_get_height=$._crn_get_height;s._crn_get_dxt_format=$._crn_get_dxt_format;var ib=s.runPostSets=$.runPostSets;\n s.dynCall_ii=$.dynCall_ii;s.dynCall_v=$.dynCall_v;s.dynCall_iii=$.dynCall_iii;s.dynCall_vi=$.dynCall_vi;oa=function(a){return $.stackAlloc(a)};ha=function(){return $.stackSave()};ia=function(a){$.stackRestore(a)};function Ec(a){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+a+\")\";this.status=a}Ec.prototype=Error();var Fc,Gc=m,fb=function Hc(){!s.calledRun&&Ic&&Jc();s.calledRun||(fb=Hc)};\n s.callMain=s.Nd=function(a){function b(){for(var a=0;3>a;a++)d.push(0)}A(0==Q,\"cannot call main when async dependencies remain! (listen on __ATMAIN__)\");A(0==Va.length,\"cannot call main when preRun functions remain to be called\");a=a||[];ba&&Gc!==m&&s.P(\"preload time: \"+(Date.now()-Gc)+\" ms\");Za||(Za=l,Ua(O));var c=a.length+1,d=[L(H(\"/bin/this.program\"),\"i8\",0)];b();for(var f=0;f<c-1;f+=1)d.push(L(H(a[f]),\"i8\",0)),b();d.push(0);d=L(d,\"i32\",0);Fc=x;try{var h=s._main(c,d,0);s.noExitRuntime||Kc(h)}catch(g){g instanceof\n Ec||(\"SimulateInfiniteLoop\"==g?s.noExitRuntime=l:(g&&(\"object\"===typeof g&&g.stack)&&s.P(\"exception thrown: \"+[g,g.stack]),e(g)))}finally{}};\n function Jc(a){function b(){Za||(Za=l,Ua(O));Ua(Wa);s.calledRun=l;s._main&&Ic&&s.callMain(a);if(s.postRun)for(\"function\"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)ab(s.postRun.shift());Ua(Ya)}a=a||s.arguments;Gc===m&&(Gc=Date.now());if(0<Q)s.P(\"run() called, but dependencies remain, so not running\");else{if(s.preRun)for(\"function\"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)$a(s.preRun.shift());Ua(Va);0<Q||(s.setStatus?(s.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){s.setStatus(\"\")},\n 1);ua||b()},1)):b())}}s.run=s.ge=Jc;function Kc(a){ua=l;x=Fc;Ua(Xa);e(new Ec(a))}s.exit=s.Rd=Kc;function E(a){a&&(s.print(a),s.P(a));ua=l;e(\"abort() at \"+Ma())}s.abort=s.abort=E;if(s.preInit)for(\"function\"==typeof s.preInit&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.pop()();var Ic=l;s.noInitialRun&&(Ic=p);Jc();\n\n return Module;\n}", "function instantiateAsync() {\n if (!wasmBinary &&\n typeof WebAssembly.instantiateStreaming === 'function' &&\n !isDataURI(wasmBinaryFile) &&\n typeof fetch === 'function') {\n fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function (response) {\n var result = WebAssembly.instantiateStreaming(response, info);\n return result.then(receiveInstantiatedSource, function(reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err('wasm streaming compile failed: ' + reason);\n err('falling back to ArrayBuffer instantiation');\n instantiateArrayBuffer(receiveInstantiatedSource);\n });\n });\n } else {\n return instantiateArrayBuffer(receiveInstantiatedSource);\n }\n }", "function instantiateAsync() {\n if (!wasmBinary &&\n typeof WebAssembly.instantiateStreaming === 'function' &&\n !isDataURI(wasmBinaryFile) &&\n typeof fetch === 'function') {\n return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function (response) {\n var result = WebAssembly.instantiateStreaming(response, info);\n return result.then(receiveInstantiatedSource, function(reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err('wasm streaming compile failed: ' + reason);\n err('falling back to ArrayBuffer instantiation');\n return instantiateArrayBuffer(receiveInstantiatedSource);\n });\n });\n } else {\n return instantiateArrayBuffer(receiveInstantiatedSource);\n }\n }", "function createWasm() {\n // prepare imports\n var info = {\n 'env': asmLibraryArg,\n 'wasi_snapshot_preview1': asmLibraryArg,\n };\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n /** @param {WebAssembly.Module=} module*/\n function receiveInstance(instance, module) {\n var exports = instance.exports;\n\n Module['asm'] = exports;\n\n wasmMemory = Module['asm']['memory'];\n assert(wasmMemory, \"memory not found in wasm exports\");\n // This assertion doesn't hold when emscripten is run in --post-link\n // mode.\n // TODO(sbc): Read INITIAL_MEMORY out of the wasm file in post-link mode.\n //assert(wasmMemory.buffer.byteLength === 16777216);\n updateGlobalBufferAndViews(wasmMemory.buffer);\n\n wasmTable = Module['asm']['__indirect_function_table'];\n assert(wasmTable, \"table not found in wasm exports\");\n\n removeRunDependency('wasm-instantiate');\n }\n // we can't run yet (except in a pthread, where we have a custom sync instantiator)\n addRunDependency('wasm-instantiate');\n\n // Async compilation can be confusing when an error on the page overwrites Module\n // (for example, if the order of elements is wrong, and the one defining Module is\n // later), so we save Module and check it later.\n var trueModule = Module;\n function receiveInstantiatedSource(output) {\n // 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');\n trueModule = null;\n // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\n // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.\n receiveInstance(output['instance']);\n }\n\n function instantiateArrayBuffer(receiver) {\n return getBinaryPromise().then(function(binary) {\n return WebAssembly.instantiate(binary, info);\n }).then(receiver, function(reason) {\n err('failed to asynchronously prepare wasm: ' + reason);\n\n abort(reason);\n });\n }\n\n // Prefer streaming instantiation if available.\n function instantiateAsync() {\n if (!wasmBinary &&\n typeof WebAssembly.instantiateStreaming === 'function' &&\n !isDataURI(wasmBinaryFile) &&\n typeof fetch === 'function') {\n return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function (response) {\n var result = WebAssembly.instantiateStreaming(response, info);\n return result.then(receiveInstantiatedSource, function(reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err('wasm streaming compile failed: ' + reason);\n err('falling back to ArrayBuffer instantiation');\n return instantiateArrayBuffer(receiveInstantiatedSource);\n });\n });\n } else {\n return instantiateArrayBuffer(receiveInstantiatedSource);\n }\n }\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel\n // to any other async startup actions they are performing.\n if (Module['instantiateWasm']) {\n try {\n var exports = Module['instantiateWasm'](info, receiveInstance);\n return exports;\n } catch(e) {\n err('Module.instantiateWasm callback failed with error: ' + e);\n return false;\n }\n }\n\n instantiateAsync();\n return {}; // no exports yet; we'll fill them in later\n}", "function compileStreamingAndBreak() {\n function call_debugger() {\n debugger;\n }\n\n // Call from wasm to js.\n // TODO(kimanh): Find a way to use the WasmModuleBuilder.\n const moduleHeader = [0x0,0x61,0x73,0x6d];\n const moduleVersion = [0x1,0x0,0x0,0x0];\n const typeSection = [0x1,0xd,0x4, // Type section.\n 0x60,0x0,0x0, // Function type.\n 0x60,0x0,0x0, // Function type.\n 0x60,0x0,0x0, // Function type.\n 0x60,0x0,0x0]; // Function type.\n const importSection = [0x2,0xc,0x1, // Import section.\n 0x3,0x78,0x78,0x78, // Module name.\n 0x4,0x66,0x75,0x6e,0x63, // Field name.\n 0x0, // Import kind.\n 0x0]; // Import index.\n const funcDelaration = [0x3,0x3,0x2, // Function section.\n 0x1, // Function type.\n 0x3]; // Function type.\n const tableSection = [0x4,0x4,0x1, // Table section.\n 0x70,0x0,0x1]; // Funcref, no max, min 1.\n const exportSection = [0x7,0x8,0x1, // Export section.\n 0x4,0x6d,0x61,0x69,0x6e, // Export name.\n 0x0, // Export kind.\n 0x2]; // Export index.\n const elementsSection = [0x9,0x7,0x1, // Element section.\n 0x0, // Active, no index.\n 0x41,0x0,0xb,0x1,0x1]; // i32.const 0, index 1\n const functionBodies = [0xa,0x11,0x2, // Code section.\n 0x4,0x0,0x10,0x0,0xb, // Function body 1.\n 0xa,0x0,0x2,0x40,0x41, // Function body 2.\n 0x0,0x11,0x2,0x0,0xb,0xb]; // Function body 2.\n const names = [0x0,0x19, // Name section.\n 0x4,0x6e,0x61,0x6d,0x65, // Name section name.\n 0x1,0x12,0x2, // 2 function names.\n 0x1,0x9,0x63,0x61,0x6c,0x6c, // Name at index 1.\n 0x5f,0x66,0x75,0x6e,0x63, // Name at index 1.\n 0x2,0x4,0x6d,0x61,0x69,0x6e]; // Name at index 2.\n\n const wasm = Uint8Array.from([\n ...moduleHeader,\n ...moduleVersion,\n ...typeSection,\n ...importSection,\n ...funcDelaration,\n ...tableSection,\n ...exportSection,\n ...elementsSection,\n ...functionBodies,\n ...names]);\n\n let b = new Blob([wasm.buffer], {type: 'application/wasm'});\n let bURL = URL.createObjectURL(b);\n fetch(bURL)\n .then(WebAssembly.compileStreaming)\n .then(module => new WebAssembly.Instance(module, {xxx: {func: call_debugger}}))\n .then(instance => instance.exports.main())\n}", "function createWasm() {\n // prepare imports\n var info = {\n 'env': asmLibraryArg,\n 'wasi_unstable': asmLibraryArg\n };\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n function receiveInstance(instance, module) {\n var exports = instance.exports;\n Module['asm'] = exports;\n removeRunDependency('wasm-instantiate');\n }\n // we can't run yet (except in a pthread, where we have a custom sync instantiator)\n addRunDependency('wasm-instantiate');\n\n\n // Async compilation can be confusing when an error on the page overwrites Module\n // (for example, if the order of elements is wrong, and the one defining Module is\n // later), so we save Module and check it later.\n var trueModule = Module;\n function receiveInstantiatedSource(output) {\n // 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');\n trueModule = null;\n // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\n // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.\n receiveInstance(output['instance']);\n }\n\n\n function instantiateArrayBuffer(receiver) {\n return getBinaryPromise().then(function(binary) {\n return WebAssembly.instantiate(binary, info);\n }).then(receiver, function(reason) {\n err('failed to asynchronously prepare wasm: ' + reason);\n abort(reason);\n });\n }\n\n // Prefer streaming instantiation if available.\n function instantiateAsync() {\n if (!wasmBinary &&\n typeof WebAssembly.instantiateStreaming === 'function' &&\n !isDataURI(wasmBinaryFile) &&\n typeof fetch === 'function') {\n fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function (response) {\n var result = WebAssembly.instantiateStreaming(response, info);\n return result.then(receiveInstantiatedSource, function(reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err('wasm streaming compile failed: ' + reason);\n err('falling back to ArrayBuffer instantiation');\n instantiateArrayBuffer(receiveInstantiatedSource);\n });\n });\n } else {\n return instantiateArrayBuffer(receiveInstantiatedSource);\n }\n }\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel\n // to any other async startup actions they are performing.\n if (Module['instantiateWasm']) {\n try {\n var exports = Module['instantiateWasm'](info, receiveInstance);\n return exports;\n } catch(e) {\n err('Module.instantiateWasm callback failed with error: ' + e);\n return false;\n }\n }\n\n instantiateAsync();\n return {}; // no exports yet; we'll fill them in later\n}", "load() {}", "load() {}", "LoadAsset() {}", "_addHMRClientCode(data) {\n// If we have it, grab supporting code...\n let prependage = fs.readFileSync('./lib/hmr/clientSocket.js'),\n appendage = fs.readFileSync('./lib/hmr/hmr.js')\n\n// Prepend clientSocket.js to bundle.... Append hmr runtime to bundle\n return `${prependage}${data}${appendage}`\n }", "function loadLibrary(deviceId, libraryLocation, locationPath, preload, newDelayedRegistration, newLicenseKey, deviceModelName) {\n function reportLoadSuccess() {\n postMessage([\"library-loaded\"]);\n createContext(newDelayedRegistration, newLicenseKey);\n }\n function start() {\n if (!wasmReady && fileSystemSynced && runtimeLoaded) {\n loadingInProgress = false;\n Module.callMain();\n wasmReady = true;\n reportLoadSuccess();\n if (!newDelayedRegistration) {\n workOnScanQueue();\n workOnParseQueue();\n }\n }\n }\n if (loadingInProgress) {\n return Promise.resolve();\n }\n if (wasmReady) {\n reportLoadSuccess();\n return Promise.resolve();\n }\n loadingInProgress = true;\n var _a = getLibraryLocationURIs(libraryLocation), jsURI = _a.jsURI, wasmURI = _a.wasmURI;\n preloading = preload;\n writableDataPath = preload ? writableDataPathPreload : writableDataPathStandard;\n self.window = self.document = self; // Fix some Emscripten quirks\n self.path = locationPath; // Used by the Scandit SDK Engine library\n self.deviceModelName = deviceModelName; // Used by the Scandit SDK Engine library\n Module = {\n arguments: [deviceId],\n canvas: gpuAccelerationAvailable ? new self.OffscreenCanvas(32, 32) : /* istanbul ignore next */ undefined,\n instantiateWasm: function (importObject, successCallback) {\n var _a;\n // wasmJSVersion is globally defined inside scandit-engine-sdk.min.js\n var wasmJSVersion = (_a = self.wasmJSVersion) !== null && _a !== void 0 ? _a : \"undefined\";\n // istanbul ignore if\n if (wasmJSVersion !== \"5.5.3\") {\n console.error(\"The Scandit SDK Engine library JS file found at \" + jsURI + \" seems invalid: \" +\n (\"expected version doesn't match (received: \" + wasmJSVersion + \", expected: \" + \"5.5.3\" + \"). \") +\n \"Please ensure the correct Scandit SDK Engine file (with correct version) is retrieved.\");\n }\n if (typeof self.WebAssembly.instantiateStreaming === \"function\") {\n instantiateWebAssemblyStreaming(importObject, wasmURI, successCallback);\n }\n else {\n instantiateWebAssembly(importObject, wasmURI, successCallback);\n }\n return {};\n },\n noInitialRun: true,\n preRun: [\n function () {\n return setupFS()\n .catch(function (error) {\n console.debug(\"No IndexedDB support, some data will not be persisted:\", error);\n })\n .then(function () {\n fileSystemSynced = true;\n start();\n });\n },\n ],\n onRuntimeInitialized: function () {\n runtimeLoaded = true;\n start();\n },\n };\n function tryImportScripts() {\n var _a;\n try {\n return (_a = importScripts(jsURI)) !== null && _a !== void 0 ? _a : Promise.resolve();\n }\n catch (error) {\n return Promise.reject(error);\n }\n }\n return retryWithExponentialBackoff(tryImportScripts, 250, 4000, function (error) {\n console.warn(error);\n console.warn(\"Couldn't retrieve Scandit SDK Engine library at \" + jsURI + \", retrying...\");\n }).catch(function (error) {\n console.error(error);\n console.error(\"Couldn't retrieve Scandit SDK Engine library at \" + jsURI + \", did you configure the path for it correctly?\");\n return Promise.resolve(error); // Promise is used only during testing\n });\n }", "function createWasm(env) {\n\t // prepare imports\n\t var info = {\n\t 'env': env\n\t ,\n\t 'global': {\n\t 'NaN': NaN,\n\t 'Infinity': Infinity\n\t },\n\t 'global.Math': Math,\n\t 'asm2wasm': asm2wasmImports\n\t };\n\t // Load the wasm module and create an instance of using native support in the JS engine.\n\t // handle a generated wasm instance, receiving its exports and\n\t // performing other necessary setup\n\t function receiveInstance(instance, module) {\n\t var exports = instance.exports;\n\t Module['asm'] = exports;\n\t removeRunDependency('wasm-instantiate');\n\t }\n\t addRunDependency('wasm-instantiate');\n\n\t // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n\t // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel\n\t // to any other async startup actions they are performing.\n\t if (Module['instantiateWasm']) {\n\t try {\n\t return Module['instantiateWasm'](info, receiveInstance);\n\t } catch(e) {\n\t err('Module.instantiateWasm callback failed with error: ' + e);\n\t return false;\n\t }\n\t }\n\n\t // Async compilation can be confusing when an error on the page overwrites Module\n\t // (for example, if the order of elements is wrong, and the one defining Module is\n\t // later), so we save Module and check it later.\n\t var trueModule = Module;\n\t function receiveInstantiatedSource(output) {\n\t // 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.\n\t // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n\t assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');\n\t trueModule = null;\n\t // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\n\t // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.\n\t receiveInstance(output['instance']);\n\t }\n\t function instantiateArrayBuffer(receiver) {\n\t getBinaryPromise().then(function(binary) {\n\t return WebAssembly.instantiate(binary, info);\n\t }).then(receiver, function(reason) {\n\t err('failed to asynchronously prepare wasm: ' + reason);\n\t abort(reason);\n\t });\n\t }\n\t // Prefer streaming instantiation if available.\n\t if (!Module['wasmBinary'] &&\n\t typeof WebAssembly.instantiateStreaming === 'function' &&\n\t !isDataURI(wasmBinaryFile) &&\n\t typeof fetch === 'function') {\n\t WebAssembly.instantiateStreaming(fetch(wasmBinaryFile, { credentials: 'same-origin' }), info)\n\t .then(receiveInstantiatedSource, function(reason) {\n\t // We expect the most common failure cause to be a bad MIME type for the binary,\n\t // in which case falling back to ArrayBuffer instantiation should work.\n\t err('wasm streaming compile failed: ' + reason);\n\t err('falling back to ArrayBuffer instantiation');\n\t instantiateArrayBuffer(receiveInstantiatedSource);\n\t });\n\t } else {\n\t instantiateArrayBuffer(receiveInstantiatedSource);\n\t }\n\t return {}; // no exports yet; we'll fill them in later\n\t}", "function fetch(filename, weak) {\n\n // Strip path if this file references a bundled definition\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common)\n filename = altname;\n }\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n util.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }", "function fetch(filename, weak) {\n\n // Strip path if this file references a bundled definition\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common)\n filename = altname;\n }\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n util.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }", "static LoadFromMemory() {}", "function load_SBPfile_run (file) {\n// #1 get json string of sbp part file and DIRECT run (not leaving app?; no job history)\n var content = \"\";\n jQuery.get(file, function(data) {\n content += data;\n })\n .done(function() {\n console.log(\"LOADED - \", file );\n //console.log(\"With: \", content );\n fabmo.runSBP(content);\n });\n}", "static setup(){\n ejs.fileLoader = (filePath) => {\n return SourceRepository.fetchSync(filePath);\n };\n }", "_parseFile(requireName, filepath, cache, ifStoreSrc, fakeCode, coreModules) {\n let code, e;\n if (filepath in cache) { return cache[filepath]; }\n const isCore = (coreModules && (Array.from(coreModules).includes(requireName))) || !/[\\\\\\/]/.test(filepath);\n const isBinary = /\\.node$/i.test(filepath);\n const unit = {\n isCore, // built-in nodejs modules\n isBinary, // binary modules, \".node\" extension\n fpath: isCore ? requireName : filepath, // the file path\n mpath: '', // the path of module that contains this file\n mname: '', // the module name\n src: \"\",\n requires: [], // array of dependencies, each element is {node, unit}\n // node is the parded ast tree node\n // unit is another unit\n warnings: [],\n // if set, then this file is the \"main\" file of a node module, as defined by nodejs\n package: undefined,\n };\n cache[filepath] = unit;\n if (isCore || isBinary) { return unit; }\n if (path.extname(filepath).toLowerCase() === \".json\") {\n if (ifStoreSrc) { unit.src = fs.readFileSync(filepath).toString(); }\n return unit;\n }\n\n // determine if parameter filepath itself represents a module, if so, mark the module by setting the\n // package member\n (function() {\n const detail = bna.identify(filepath);\n\n unit.mname = detail.mname;\n unit.mpath = detail.mpath;\n unit._detailPackage = detail.package;\n const mainfiles = [path.join(detail.mpath, \"index.js\"), path.join(detail.mpath, \"index.node\")];\n if (detail.package) {\n detail.package.name = detail.mname; // ensure correct package name\n if (detail.package.main) {\n const main = path.resolve(detail.mpath, detail.package.main);\n mainfiles.push(main);\n // append .js .node variations as well\n if (path.extname(main) === '') { mainfiles.push(...Array.from([`${main}.js`, `${main}.node`] || [])); }\n }\n }\n if (Array.from(mainfiles).includes(unit.fpath)) {\n return unit.package = detail.package || { name: detail.mname, version: 'x' }; // construct default package if no package.json\n }\n })();\n\n // do first pass without parsing location info (makes parsing 3x slower), if bad require is detected,\n // then we do another pass with location info, for user-friendly warnings\n try {\n let src;\n if (fakeCode) {\n src = fakeCode;\n } else { src = fs.readFileSync(filepath).toString().replace(/^#![^\\n]*\\n/, ''); } // remove shell script marker\n\n if (ifStoreSrc) { unit.src = src; }\n code = jsParse(src);\n } catch (error) {\n e = error;\n log((`Ignoring ${filepath}, failed to parse due to: ${e}`));\n return unit;\n }\n // 1st pass, traverse ast tree, resolve all const-string requires if possible\n const dynLocs = []; // store dynamic require locations\n ast.traverse(code, [ast.isRequire], function(node) {\n if (!node.loc) {\n node.loc = { file: filepath, line: '?' };\n } else {\n node.loc.file = filepath;\n node.loc.line = node.loc.start.line;\n }\n const arg = node.arguments[0];\n if (arg && (arg.type === 'Literal')) { // require a string\n let fullpath;\n const modulename = arg.value;\n\n e = undefined;\n try {\n fullpath = resolver.sync(modulename, {\n extensions: ['.js', '.node', '.json'],\n basedir: path.dirname(filepath)\n });\n } catch (error1) {\n e = error1;\n unit.warnings.push({\n node,\n reason: \"resolve\"\n });\n }\n\n if (!e) {\n const runit = bna._parseFile(modulename, fullpath, cache, ifStoreSrc, null, coreModules);\n return unit.requires.push({\n name: modulename,\n node,\n unit: runit\n });\n }\n } else {\n return dynLocs.push(node.loc);\n }\n });\n\n // resolving dynamic require trick: evaluate js once, record all required modules....\n if (dynLocs.length > 0) {\n (() => {\n let dynamicModules = bna.detectDynamicRequires(unit);\n // filter out already required string modules, and nulls\n dynamicModules = (Array.from(dynamicModules).filter((m) => m && !_(unit.requires).find(e => e.name === m)).map((m) => m));\n\n for (let modulename of Array.from(dynamicModules)) {\n // filter out required modules that are already parsed\n var node;\n e = undefined;\n let fullpath = ''; // catch block needs this too\n try {\n fullpath = resolver.sync(modulename, {\n extensions: ['.js', '.node', '.json'],\n basedir: path.dirname(filepath)\n });\n // only if resolved ok\n node = { loc: { file: fullpath, line: '?' } }; //\n const runit = bna._parseFile(modulename, fullpath, cache, ifStoreSrc, null, coreModules);\n unit.requires.push({\n name: modulename,\n node,\n unit: runit\n });\n } catch (error1) {\n e = error1;\n unit.warnings.push({\n node: { loc: { file: filepath, line: '?' } },\n reason: \"dynamicResolveError\",\n error: e\n });\n }\n }\n\n return unit.warnings.push({\n locs: dynLocs,\n modules: dynamicModules,\n reason: \"nonconst\"\n });\n })();\n }\n\n return unit;\n }", "function createWasm() {\n // prepare imports\n var info = {\n env: wasmImports,\n wasi_snapshot_preview1: wasmImports\n };\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n /** @param {WebAssembly.Module=} module*/\n function receiveInstance(instance, module) {\n var exports = instance.exports;\n\n Module[\"asm\"] = exports;\n\n wasmMemory = Module[\"asm\"][\"memory\"];\n updateMemoryViews();\n\n wasmTable = Module[\"asm\"][\"__indirect_function_table\"];\n\n addOnInit(Module[\"asm\"][\"__wasm_call_ctors\"]);\n\n removeRunDependency(\"wasm-instantiate\");\n return exports;\n }\n // wait for the pthread pool (if any)\n addRunDependency(\"wasm-instantiate\");\n\n // Prefer streaming instantiation if available.\n function receiveInstantiationResult(result) {\n // 'result' is a ResultObject object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\n // When the regression is fixed, can restore the above PTHREADS-enabled path.\n receiveInstance(result[\"instance\"]);\n }\n\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to\n // run the instantiation parallel to any other async startup actions they are\n // performing.\n // Also pthreads and wasm workers initialize the wasm instance through this\n // path.\n if (Module[\"instantiateWasm\"]) {\n try {\n return Module[\"instantiateWasm\"](info, receiveInstance);\n } catch (e) {\n err(\"Module.instantiateWasm callback failed with error: \" + e);\n return false;\n }\n }\n\n instantiateAsync(\n wasmBinary,\n wasmBinaryFile,\n info,\n receiveInstantiationResult\n );\n return {}; // no exports yet; we'll fill them in later\n}", "function load_appbin(file) {\n let mrbreader = new FileReader();\n mrbbin = null;\n mrbreader.onload = function() {\n // initialize sequence number\n wrtseq = 0;\n mrbbin = new Uint8Array(mrbreader.result);\n document.getElementById(\"load_status\").innerText += \" loaded.\";\n }\n mrbreader.readAsArrayBuffer(file);\n}", "function createWasm() {\n // prepare imports\n var info = {\n 'env': asmLibraryArg,\n 'wasi_snapshot_preview1': asmLibraryArg,\n };\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n /** @param {WebAssembly.Module=} module*/\n function receiveInstance(instance, module) {\n var exports = instance.exports;\n\n Module['asm'] = exports;\n\n wasmMemory = Module['asm']['memory'];\n updateGlobalBufferAndViews(wasmMemory.buffer);\n\n wasmTable = Module['asm']['__indirect_function_table'];\n\n removeRunDependency('wasm-instantiate');\n }\n // we can't run yet (except in a pthread, where we have a custom sync instantiator)\n addRunDependency('wasm-instantiate');\n\n function receiveInstantiatedSource(output) {\n // 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\n // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.\n receiveInstance(output['instance']);\n }\n\n function instantiateArrayBuffer(receiver) {\n return getBinaryPromise().then(function(binary) {\n return WebAssembly.instantiate(binary, info);\n }).then(receiver, function(reason) {\n err('failed to asynchronously prepare wasm: ' + reason);\n\n abort(reason);\n });\n }\n\n // Prefer streaming instantiation if available.\n\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel\n // to any other async startup actions they are performing.\n if (Module['instantiateWasm']) {\n try {\n var exports = Module['instantiateWasm'](info, receiveInstance);\n return exports;\n } catch(e) {\n err('Module.instantiateWasm callback failed with error: ' + e);\n return false;\n }\n }\n\n var result = instantiateSync(wasmBinaryFile, info);\n receiveInstance(result[0], result[1]);\n return Module['asm']; // exports were assigned here\n}", "function RockMod_RequireLoadMain() {\n var loadMainScript = document.querySelector('script[data-main]');\n if (loadMainScript) {\n var mainFile = loadMainScript.getAttribute('data-main');\n if (Rocket.is.string(mainFile) && mainFile.length > 0) {\n var customPath = (mainFile.substring(0, 2) === '~/') ? Rocket.defaults.rootPath : './';\n RockMod_Require.load(mainFile, false, customPath);\n }\n }\n}", "static LoadFromMemoryAsync() {}", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function createWasm(env) {\n // prepare imports\n var info = {\n 'env': env\n ,\n 'global': {\n 'NaN': NaN,\n 'Infinity': Infinity\n },\n 'global.Math': Math,\n 'asm2wasm': asm2wasmImports\n };\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n function receiveInstance(instance, module) {\n var exports = instance.exports;\n Module['asm'] = exports;\n removeRunDependency('wasm-instantiate');\n }\n addRunDependency('wasm-instantiate');\n\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel\n // to any other async startup actions they are performing.\n if (Module['instantiateWasm']) {\n try {\n return Module['instantiateWasm'](info, receiveInstance);\n } catch(e) {\n err('Module.instantiateWasm callback failed with error: ' + e);\n return false;\n }\n }\n\n // Async compilation can be confusing when an error on the page overwrites Module\n // (for example, if the order of elements is wrong, and the one defining Module is\n // later), so we save Module and check it later.\n var trueModule = Module;\n function receiveInstantiatedSource(output) {\n // 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');\n trueModule = null;\n // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\n // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.\n receiveInstance(output['instance']);\n }\n function instantiateArrayBuffer(receiver) {\n getBinaryPromise().then(function(binary) {\n return WebAssembly.instantiate(binary, info);\n }).then(receiver, function(reason) {\n err('failed to asynchronously prepare wasm: ' + reason);\n abort(reason);\n });\n }\n // Prefer streaming instantiation if available.\n if (!Module['wasmBinary'] &&\n typeof WebAssembly.instantiateStreaming === 'function' &&\n !isDataURI(wasmBinaryFile) &&\n typeof fetch === 'function') {\n WebAssembly.instantiateStreaming(fetch(wasmBinaryFile, { credentials: 'same-origin' }), info)\n .then(receiveInstantiatedSource, function(reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err('wasm streaming compile failed: ' + reason);\n err('falling back to ArrayBuffer instantiation');\n instantiateArrayBuffer(receiveInstantiatedSource);\n });\n } else {\n instantiateArrayBuffer(receiveInstantiatedSource);\n }\n return {}; // no exports yet; we'll fill them in later\n }", "onRuntimeInitialized() {\n window.wasmLoaded = true;\n window.wasmAdapter = Module;\n const event = new Event('wasm_load');\n document.dispatchEvent(event);\n\n const arr = [\n 'NO_CHANGE',\n 'P1',\n 'P2',\n 'SET_CHAR_STATE',\n 'SET_SPRITE_POS',\n 'CHANGE_ORIENTATION',\n 'MOVE',\n 'IDLE',\n 'STOP',\n 'SPOT_ATTACK',\n 'FINISH_SPOT_ATTACK',\n ];\n\n const vec = new Module.StringArray();\n for (let i = 0; i < arr.length; i++) {\n vec.push_back(arr[i]);\n }\n\n const chars = new Module.CharacterInitialConfig();\n chars.set('P1', {\n k: 'assasin',\n speed: 5,\n orientation: 'RIGHT',\n pos: [100, 100],\n });\n chars.set('P2', {\n k: 'knight',\n speed: 5,\n orientation: 'LEFT',\n pos: [200, 200],\n });\n\n\n const vecw = new Module.IntArray();\n const matrix = new Module.TwoDIntArray();\n vec.push_back(1);\n matrix.push_back(vecw);\n\n const initConfig = {\n map: {\n tileW: 33.72222222222222,\n tileH: 33.75,\n matrix,\n },\n chars,\n };\n\n const obj = new Module.GameEnvAdapter(true, vec, initConfig);\n\n window.game_config = {};\n window.js_wasm_adapter = {\n update(arg) {\n window.game_config.update(arg);\n },\n mapEventsKeyDict(name) {\n window.game_config.mapEventsKeyDict(name);\n },\n };\n }", "function createWasm(env) {\r\n // prepare imports\r\n var info = {\r\n 'env': env\r\n ,\r\n 'global': {\r\n 'NaN': NaN,\r\n 'Infinity': Infinity\r\n },\r\n 'global.Math': Math,\r\n 'asm2wasm': asm2wasmImports\r\n };\r\n // Load the wasm module and create an instance of using native support in the JS engine.\r\n // handle a generated wasm instance, receiving its exports and\r\n // performing other necessary setup\r\n function receiveInstance(instance, module) {\r\n var exports = instance.exports;\r\n Module['asm'] = exports;\r\n removeRunDependency('wasm-instantiate');\r\n }\r\n addRunDependency('wasm-instantiate');\r\n\r\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\r\n // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel\r\n // to any other async startup actions they are performing.\r\n if (Module['instantiateWasm']) {\r\n try {\r\n return Module['instantiateWasm'](info, receiveInstance);\r\n } catch(e) {\r\n err('Module.instantiateWasm callback failed with error: ' + e);\r\n return false;\r\n }\r\n }\r\n\r\n // Async compilation can be confusing when an error on the page overwrites Module\r\n // (for example, if the order of elements is wrong, and the one defining Module is\r\n // later), so we save Module and check it later.\r\n var trueModule = Module;\r\n function receiveInstantiatedSource(output) {\r\n // 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.\r\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\r\n assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');\r\n trueModule = null;\r\n // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\r\n // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.\r\n receiveInstance(output['instance']);\r\n }\r\n function instantiateArrayBuffer(receiver) {\r\n getBinaryPromise().then(function(binary) {\r\n return WebAssembly.instantiate(binary, info);\r\n }).then(receiver, function(reason) {\r\n err('failed to asynchronously prepare wasm: ' + reason);\r\n abort(reason);\r\n });\r\n }\r\n // Prefer streaming instantiation if available.\r\n if (!Module['wasmBinary'] &&\r\n typeof WebAssembly.instantiateStreaming === 'function' &&\r\n !isDataURI(wasmBinaryFile) &&\r\n typeof fetch === 'function') {\r\n WebAssembly.instantiateStreaming(fetch(wasmBinaryFile, { credentials: 'same-origin' }), info)\r\n .then(receiveInstantiatedSource, function(reason) {\r\n // We expect the most common failure cause to be a bad MIME type for the binary,\r\n // in which case falling back to ArrayBuffer instantiation should work.\r\n err('wasm streaming compile failed: ' + reason);\r\n err('falling back to ArrayBuffer instantiation');\r\n instantiateArrayBuffer(receiveInstantiatedSource);\r\n });\r\n } else {\r\n instantiateArrayBuffer(receiveInstantiatedSource);\r\n }\r\n return {}; // no exports yet; we'll fill them in later\r\n}", "function fetch(filename, weak) {\n filename = getBundledFileName(filename) || filename;\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n self.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }", "function loadPlugin() {\n this.fs = document.createElement(\"embed\");\n this.fs.style.position = \"absolute\";\n this.fs.style.left = \"-9999px\";\n this.fs.id = \"fs2\";\n this.fs.setAttribute(\"type\", \"application/x-thk-nico-dl\");\n document.documentElement.appendChild(this.fs);\n\n fs2 = document.getElementById(\"fs2\"); \n}", "function useRequest() {\nvar request = Module['memoryInitializerRequest'];\nvar response = request.response;\nif (request.status !== 200 && request.status !== 0) {\nvar data = tryParseAsDataURI(Module['memoryInitializerRequestURL']);\nif (data) {\nresponse = data.buffer;\n} else {\n// If you see this warning, the issue may be that you are using locateFile or memoryInitializerPrefixURL, and defining them in JS. That\n// means that the HTML file doesn't know about them, and when it tries to create the mem init request early, does it to the wrong place.\n// Look in your browser's devtools network console to see what's going on.\nconsole.warn('a problem seems to have happened with Module.memoryInitializerRequest, status: ' + request.status + ', retrying ' + memoryInitializer);\ndoBrowserLoad();\nreturn;\n}\n}\napplyMemoryInitializer(response);\n}", "function load(origin, name, callback) {\n if (name === 'message') {\n return callback(null, { src: 'module.exports = \"magic!\"' })\n }\n\n // default to the built-in module loading function\n wheelbarrow.load(origin, name, callback)\n}", "function createWasm(env) {\n\n // prepare imports\n var info = {\n 'env': env\n ,\n 'global': {\n 'NaN': NaN,\n 'Infinity': Infinity\n },\n 'global.Math': Math,\n 'asm2wasm': asm2wasmImports\n };\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n function receiveInstance(instance, module) {\n var exports = instance.exports;\n Module['asm'] = exports;\n removeRunDependency('wasm-instantiate');\n }\n addRunDependency('wasm-instantiate');\n\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel\n // to any other async startup actions they are performing.\n if (Module['instantiateWasm']) {\n try {\n return Module['instantiateWasm'](info, receiveInstance);\n } catch(e) {\n err('Module.instantiateWasm callback failed with error: ' + e);\n return false;\n }\n }\n\n // Async compilation can be confusing when an error on the page overwrites Module\n // (for example, if the order of elements is wrong, and the one defining Module is\n // later), so we save Module and check it later.\n var trueModule = Module;\n function receiveInstantiatedSource(output) {\n // 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');\n trueModule = null;\n // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\n // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.\n receiveInstance(output['instance']);\n }\n function instantiateArrayBuffer(receiver) {\n getBinaryPromise().then(function(binary) {\n return WebAssembly.instantiate(binary, info);\n }).then(receiver, function(reason) {\n err('failed to asynchronously prepare wasm: ' + reason);\n abort(reason);\n });\n }\n // Prefer streaming instantiation if available.\n if (!Module['wasmBinary'] &&\n typeof WebAssembly.instantiateStreaming === 'function' &&\n !isDataURI(wasmBinaryFile) &&\n typeof fetch === 'function') {\n WebAssembly.instantiateStreaming(fetch(wasmBinaryFile, { credentials: 'same-origin' }), info)\n .then(receiveInstantiatedSource, function(reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err('wasm streaming compile failed: ' + reason);\n err('falling back to ArrayBuffer instantiation');\n instantiateArrayBuffer(receiveInstantiatedSource);\n });\n } else {\n instantiateArrayBuffer(receiveInstantiatedSource);\n }\n return {}; // no exports yet; we'll fill them in later\n}", "_instantiateWasm() {\n const instantiateWasmTask = async () => {\n if (this.wasmInstance) {\n return;\n } else {\n let response = await instantiateWasm();\n this.wasmInstance = response.instance;\n this.wasmByteMemory = response.byteMemory;\n }\n };\n\n return instantiateWasmTask();\n }", "function loadMemoryInitializer(filename) {\n function applyData(data) {\n HEAPU8.set(data, STATIC_BASE);\n }\n // always do this asynchronously, to keep shell and web as similar as possible\n addOnPreRun(function() {\n if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {\n applyData(Module['readBinary'](filename));\n } else {\n Browser.asyncLoad(filename, function(data) {\n applyData(data);\n }, function(data) {\n throw 'could not load memory initializer ' + filename;\n });\n }\n });\n}", "load(file, params) {\n\t\tvar ext = Path.extname(file) || '';\n\t\tvar slotName = _beforeLast(Path.basename(file), '.').toLowerCase();\n\t\tif (ext in Bundler.mime) {\n\t\t\treturn assetsDir => {\n\t\t\t\tif (Fs.statSync(file).size < params.MAX_DATA_URL_SIZE) {\n\t\t\t\t\tvar url = 'data:' + Bundler.mime[ext] + ';base64,' + Fs.readFileSync(file).toString('base64');\n\t\t\t\t} else {\n\t\t\t\t\tvar absFilename = Path.join(assetsDir || this.baseDir, Path.basename(file));\n\t\t\t\t\tFs.mkdirSync(Path.dirname(absFilename), {recursive:true});\n\t\t\t\t\tFs.copyFileSync(file, absFilename);\n\t\t\t\t\tvar assetsPublicFilename = getPublicFilename(absFilename, params.indentation);\n\t\t\t\t\tvar url = params.ASSETS_PUBLIC_BASE + assetsPublicFilename;\n\t\t\t\t}\n\t\t\t\tif (params.PARTIALS_NAMESPACE_ATTR) {\n\t\t\t\t\treturn `<img ${params.PARTIALS_NAMESPACE_ATTR}=\"${slotName}\" src=\"${url}\" />`;\n\t\t\t\t}\n\t\t\t\treturn `<img src=\"${url}\" />`;\n\t\t\t};\n\t\t} else {\n\t\t\tvar contents = Fs.readFileSync(file).toString();\n\t\t\tvar contentsTrimmed = contents.trim();\n\t\t\tif (contentsTrimmed.startsWith('<') && !contentsTrimmed.startsWith('<!DOCTYPE') && !contentsTrimmed.startsWith('<?xml')) {\n\t\t\t\tif (params.PARTIALS_NAMESPACE_ATTR && !params.getAttributeDefinition(contentsTrimmed, params.PARTIALS_NAMESPACE_ATTR)) {\n\t\t\t\t\treturn params.defineAttribute(contentsTrimmed, params.PARTIALS_NAMESPACE_ATTR, slotName);\n\t\t\t\t}\n\t\t\t\treturn contentsTrimmed;\n\t\t\t}\n\t\t}\n\t}", "function LocalLoader() { }", "function init() {\n $.get('https://images.wikia.nocookie.net/common/extensions/wikia/DesignSystem/node_modules/design-system/dist/svg/sprite.svg', function(d) {\n // Initialize icon system\n var $sprite = $(d.rootElement)\n .removeAttr('style')\n .attr({\n 'id': 'dev-wds-sprite',\n 'class': 'wds-hidden-svg',\n });\n // Populate registry\n $.each(prefix, function(t, p) {\n registry[t] = [].slice.call($sprite.children())\n .map(function(e) {\n return e.id;\n }).filter(function(i) {\n var r = new RegExp('^' + p);\n return r.test(i);\n });\n });\n iconset = registry.icon;\n // Restriction to valid assets\n $sprite.children([\n 'symbol[id^=\"wds-avatar-icon\"]',\n 'symbol#wds-player-icon-play'\n ].join(',')).remove();\n // Sprite embedding\n $sprite.prependTo(document.body);\n // Globally expose library\n window.dev.wds = {\n registry: registry,\n iconset: iconset,\n sizemap: sizemap,\n icon: icon,\n badge: badge,\n company: company,\n render: render\n };\n // Dispatch hook\n mw.hook('dev.wds').fire(window.dev.wds);\n });\n }", "function openWAT_v2(opened_file) {\n const watfile_path = opened_file.split(\"/\");\n const full_filename = watfile_path[watfile_path.length - 1]; // file.wat\n const filename = full_filename.substr(0, full_filename.indexOf(\".wat\"));\n\n let unzipper = unzip_wat(opened_file);\n unzipper.on(\"error\", function(err) {\n console.log(\"Caught an error\");\n console.log(err);\n });\n unzipper.on(\"extract\", e => {\n var fileLocation;\n console.log(e);\n if (fs.existsSync(path.join(temp_dest, `${filename}`))) {\n fileLocation = path.join(temp_dest, `${filename}`);\n } else {\n fileLocation = temp_dest;\n }\n console.log(fileLocation);\n let destfile;\n if (fs.existsSync(path.join(fileLocation,\"wat_link.txt\"))) {\n dest_file = getWatLink_v1(fileLocation);\n }else if (fs.existsSync(path.join(fileLocation,\"wat.json\"))) {\n dest_file = path.join(\"files\",getWatLink_v2(fileLocation));\n }\n console.log(dest_file);\n extractLocation= path.join(fileLocation,\"extraction\",\"meta.json\")\n\n let url_to_load = url.format({\n pathname: path.join(fileLocation, `${dest_file}`),\n protocol: \"file:\",\n slashes: true\n });\n if (preferred_viewer == \"external\") {\n electron.shell.openExternal(url_to_load);\n } else {\n mainWindow.loadURL(url.format(url_to_load));\n }\n });\n}", "loadFile(file, module, x, y) {\n var dsp_code;\n var reader = new FileReader();\n var ext = file.name.toString().split('.').pop();\n var filename = file.name.toString().split('.').shift();\n var type;\n if (ext == \"dsp\") {\n type = \"dsp\";\n reader.readAsText(file);\n }\n else if (ext == \"json\") {\n type = \"json\";\n reader.readAsText(file);\n }\n else if (ext == \"jfaust\") {\n type = \"jfaust\";\n reader.readAsText(file);\n }\n else if (ext == \".polydsp\") {\n type = \"poly\";\n reader.readAsText(file);\n }\n else {\n throw new Error(Utilitary.messageRessource.errorObjectNotFaustCompatible);\n }\n reader.onloadend = (e) => {\n dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + reader.result + \"}.process);\";\n if (!module) {\n if (type == \"dsp\") {\n this.compileFaust({ isMidi: false, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n this.compileFaust({ isMidi: true, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n }\n else {\n if (type == \"dsp\") {\n module.isMidi = false;\n module.update(filename, dsp_code);\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n module.isMidi = true;\n module.update(filename, dsp_code);\n }\n }\n };\n }", "async function bundleMain() {\n\tconst result = await esbuild.build({\n\t\tentryPoints: [\"index.js\"],\n\t\tbundle: true,\n\t\tformat: \"iife\",\n\t\twrite: false,\n\t\tabsWorkingDir: workerPath,\n\t\tdefine: {\n\t\t\tglobal: \"globalThis\",\n\t\t},\n\t\tplugins: [\n\t\t\tNodeGlobalsPolyfillPlugin({ buffer: true }),\n\t\t\tNodeModulesPolyfillPlugin(),\n\t\t],\n\t});\n\n\tlet main = result.outputFiles[0].text;\n\n\t// Patch any dynamic imports (converting `require()` calls to `import()` calls).\n\tmain = main.replace(\n\t\t'installChunk(__require(\"./\" + __webpack_require__.u(chunkId))',\n\t\t'promises.push(import(\"./\" + __webpack_require__.u(chunkId)).then((mod) => installChunk(mod.default))'\n\t);\n\t// Export the fetch handler (grabbing it from the global).\n\tmain += \"\\nexport default { fetch : globalThis.__workerFetchHandler };\";\n\n\tawait fs.writeFile(path.resolve(workerPath, \"index.js\"), main);\n}", "function load()\n{\n dashcode.setupParts();\n loadVersionString();\n loadUserAppKey();\n}", "get mainAsset() {}", "function readBundleFromDisk(sessionPath, bundleName, wsConnect) {\n\t \tvar deferred = Q.defer();\n\n\t \tvar bundlePath = path.join(sessionPath, bundleName + '_bndl');\n\n\t \tvar bundle = {};\n\t \tbundle.ssffFiles = [];\n\n\t \tvar allFilePaths = [];\n\n\t\t// add media file path\n\t\tvar mediaFilePath = path.join(bundlePath, bundleName + '.' + wsConnect.dbConfig.mediafileExtension);\n\t\tallFilePaths.push(mediaFilePath);\n\n\t\t// add annotation file path\n\t\tvar annotFilePath = path.join(bundlePath, bundleName + '_annot.json');\n\t\tallFilePaths.push(annotFilePath);\n\n\t\t// add ssff file paths\n\t\tvar ssffFilePaths = [];\n\t\twsConnect.allTrackDefsNeededByEMUwebApp.forEach(function (td) {\n\t\t\tvar ssffFilePath = path.join(bundlePath, bundleName + '.' + td.fileExtension);\n\t\t\tallFilePaths.push(ssffFilePath);\n\t\t\tssffFilePaths.push(ssffFilePath);\n\t\t});\n\n\t\t// read in files using async.map\n\t\tasync.map(allFilePaths, fs.readFile, function (err, results) {\n\t\t\tif (err) {\n\t\t\t\tlog.error('reading bundle components:', err,\n\t\t\t\t\t'; clientID:', wsConnect.connectionID,\n\t\t\t\t\t'; clientIP:', wsConnect._socket.remoteAddress);\n\n\t\t\t\tdeferred.reject();\n\t\t\t} else {\n\t\t\t\tvar fileIdx;\n\n\t\t\t\t// set media file\n\t\t\t\tfileIdx = allFilePaths.indexOf(mediaFilePath);\n\t\t\t\tbundle.mediaFile = {\n\t\t\t\t\tencoding: 'BASE64',\n\t\t\t\t\tdata: results[fileIdx].toString('base64')\n\t\t\t\t};\n\n\t\t\t\t// set annotation file\n\t\t\t\tfileIdx = allFilePaths.indexOf(annotFilePath);\n\t\t\t\tbundle.annotation = JSON.parse(results[fileIdx].toString('utf8'));\n\n\t\t\t\t// set ssffTracks\n\t\t\t\tssffFilePaths.forEach(function (sfp) {\n\t\t\t\t\tfileIdx = allFilePaths.indexOf(sfp);\n\t\t\t\t\t// extract file ext\n\t\t\t\t\tvar fileExt = path.extname(sfp).split('.').pop();\n\t\t\t\t\tbundle.ssffFiles.push({\n\t\t\t\t\t\tfileExtension: fileExt,\n\t\t\t\t\t\tencoding: 'BASE64',\n\t\t\t\t\t\tdata: results[fileIdx].toString('base64')\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tlog.info('Finished reading bundle components. Now returning them.',\n\t\t\t\t\t'; clientID:', wsConnect.connectionID,\n\t\t\t\t\t'; clientIP:', wsConnect._socket.remoteAddress);\n\n\t\t\t\tdeferred.resolve(bundle);\n\t\t\t}\n\t\t});\n\nreturn deferred.promise;\n}", "async loadModule() {\n const { state, actx } = this;\n try {\n await actx.audioWorklet.addModule(`worklet/${state.processor.module}.js`);\n this.setState({ moduleLoaded: true, status: null });\n console.log(`loaded module ${state.processor.module}`);\n } catch (e) {\n this.setState({ moduleLoaded: false });\n console.log(`Failed to load module ${state.processor.module}`);\n }\n }", "function load_present_file_for_code_reporter() {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\",\"javascript/showcase.js\");\n xhr.send(null);\n xhr.onreadystatechange = function(){\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n this_file = xhr.responseText.match(/[^\\r?\\n]+/g);\n } else {\n present_file_loadable = false;\n }\n }\n };\n}", "function init() {\n return {\n loaders: [ new LocalLoader() ],\n fetch: function(dep_name, targetConfig) {\n var output;\n this.loaders.forEach(function(l) {\n if (!output && l.match(dep_name)) {\n output = l.load(dep_name, targetConfig);\n }\n });\n return output;\n }\n };\n}", "async load () {}", "async initialize() {\n const __dirname = dirname(fileURLToPath(import.meta.url));\n const filepath = path.join(__dirname, 'npc.json');\n this.npcObj = JSON.parse(await fs.promises.readFile(filepath, 'utf8'));\n }", "function NSGetModule(comMgr, fileSpec)\n{\n return myAppHandlerModule;\n}", "addTPKLayer(){\n //<editor-fold desc=\"old code to eliminate\">\n /* if (typeof local == 'undefined') {\n\n //todo: maybe based on this url we could decide if taking the tpk from File API or form URL\n var xhrRequest = new XMLHttpRequest();\n var _this = this;\n xhrRequest.open(\"GET\", url, true);\n xhrRequest.responseType = \"blob\";\n xhrRequest.onprogress = function(evt){\n var percent = 0;\n if(/!*evt.hasOwnProperty(\"total\")*!/typeof evt[\"total\"] !== 'undefined'){\n percent = (parseFloat(evt.loaded / evt.total) * 100).toFixed(0);\n }\n else{\n percent = (parseFloat(evt.loaded / evt.totalSize) * 100).toFixed(0);\n }\n\n console.log(\"Get file via url \" + percent + \"%\");\n console.log(\"Begin downloading remote tpk file...\");\n };\n\n xhrRequest.error = function(err){\n console.log(\"ERROR retrieving TPK file: \" + err.toString());\n alert(\"There was a problem retrieve the file.\");\n };\n var __this = _this;\n xhrRequest.onload = function(oEvent) {\n if(this.status === 200) {\n console.log(\"Remote tpk download finished.\" + oEvent);\n __this.zipParser(this.response);\n }\n else{\n alert(\"There was a problem loading the file. \" + this.status + \": \" + this.statusText );\n }\n };\n xhrRequest.send();\n }\n*/\n //</editor-fold>\n if (this.get('ermesCordova').isNative()){\n\n var basemapName = this.get('parcels').get('basemapName');\n var store = cordova.file.dataDirectory;\n var fileName = basemapName;\n this.set(\"loading\", true);\n this.getBaseMapZip (store, fileName).then((binary)=>{\n if (binary!== null) {\n this.zipParser(binary);\n }\n else {\n Ember.debug(\"getBaseMapZip: error loading the zip file\");\n }\n });\n }\n\n }", "function loadExample() {\n\tdocument.getElementById('fileInput').value = '';\n\tlet request = new XMLHttpRequest();\n\trequest.open('GET', './example.mid', true);\n\trequest.responseType = 'arraybuffer';\n\trequest.onerror = (e) => console.error('Unable to load example MIDI.');\n\trequest.onload = () => {\n\t\tlet arraybuffer = request.response;\n\t\tif (arraybuffer) {\n\t\t\tloadData(new Uint8Array(arraybuffer));\n\t\t}\n\t};\n\trequest.send();\n}", "async function load_init_file(filepath) {\n console.log(\"initfile :\", filepath);\n\n const u = new URL(filepath);\n fetch(u).then(res => res.text()).then(text => {\n try {\n execute(text);\n } catch (exception) {\n console.log(\"commands failed\");\n }\n });\n }", "function transferContent(arrayBuffer, wasm_png, wasm) {\n console.log(\"Copying file array buffer into wasm memory ...\");\n wasm_png.allocate(arrayBuffer.byteLength);\n const wasm_buffer = new Uint8Array(wasm.memory.buffer);\n const start = wasm_png.memory_pos();\n const file_buffer = new Uint8Array(arrayBuffer);\n wasm_buffer.set(file_buffer, start);\n const t0 = performance.now();\n for (let i = 0; i < 100; i++) {\n wasm_png.decode_png_me();\n }\n const t1 = performance.now();\n for (let i = 0; i < 100; i++) {\n wasm_png.decode_png_me_bis();\n }\n const t2 = performance.now();\n for (let i = 0; i < 100; i++) {\n wasm_png.decode_png();\n }\n const t3 = performance.now();\n console.log(\"me: \" + (t1 - t0) + \" milliseconds.\");\n console.log(\"me bis: \" + (t2 - t1) + \" milliseconds.\");\n console.log(\"png crate: \" + (t3 - t2) + \" milliseconds.\");\n}", "function jsapi_initializeIMW(id) {\n var new_b64;\n if (navigator.appName.indexOf(\"Microsoft\") != -1) new_b64 = $(id).readAttribute('b64');\n else new_b64 = $$('#'+id+\" embed\")[0].readAttribute('b64');\n getFlashObject(id).initialize(new_b64, 1);\n} // jsapi_initializeIMW()", "function decodeSystemProgram(binary) {\n const chunks = [];\n const annotations = [];\n let entryPointAddress = 0;\n const b = new teamten_ts_utils_1.ByteReader(binary);\n const headerByte = b.read();\n if (headerByte === teamten_ts_utils_1.EOF) {\n return undefined;\n }\n if (headerByte !== FILE_HEADER) {\n return undefined;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"System file header\", b.addr() - 1, b.addr()));\n let filename = b.readString(FILENAME_LENGTH);\n // Make a SystemProgram object with what we have so far.\n const makeSystemProgram = (error) => {\n const programBinary = binary.subarray(0, b.addr());\n return new SystemProgram(programBinary, error, filename, chunks, entryPointAddress, annotations);\n };\n if (filename.length < FILENAME_LENGTH) {\n // Binary is truncated.\n return makeSystemProgram(\"File is truncated at filename\");\n }\n filename = filename.trim();\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Filename \"${filename}\"`, b.addr() - FILENAME_LENGTH, b.addr()));\n while (true) {\n const marker = b.read();\n if (marker === teamten_ts_utils_1.EOF) {\n return makeSystemProgram(\"File is truncated at start of block\");\n }\n if (marker === END_OF_FILE_MARKER) {\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"End of file marker\", b.addr() - 1, b.addr()));\n break;\n }\n if (marker !== DATA_HEADER) {\n // Here if the marker is 0x55, we could guess that it's a high-speed cassette header.\n return makeSystemProgram(\"Unexpected byte \" + z80_base_1.toHexByte(marker) + \" at start of block\");\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Data chunk marker\", b.addr() - 1, b.addr()));\n let length = b.read();\n if (length === teamten_ts_utils_1.EOF) {\n return makeSystemProgram(\"File is truncated at block length\");\n }\n // 0 means 256.\n if (length === 0) {\n length = 256;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Length (${length} byte${length === 1 ? \"\" : \"s\"})`, b.addr() - 1, b.addr()));\n const loadAddress = b.readShort(false);\n if (loadAddress === teamten_ts_utils_1.EOF) {\n return makeSystemProgram(\"File is truncated at load address\");\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Address (0x${z80_base_1.toHexWord(loadAddress)})`, b.addr() - 2, b.addr()));\n const dataStartAddr = b.addr();\n const data = b.readBytes(length);\n if (data.length < length) {\n return makeSystemProgram(\"File is truncated at data\");\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Chunk data`, dataStartAddr, b.addr()));\n const checksum = b.read();\n if (loadAddress === teamten_ts_utils_1.EOF) {\n return makeSystemProgram(\"File is truncated at checksum\");\n }\n const systemChunk = new SystemChunk(loadAddress, data, checksum);\n chunks.push(systemChunk);\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Checksum (0x${z80_base_1.toHexByte(checksum)}, ${systemChunk.isChecksumValid() ? \"\" : \"in\"}valid)`, b.addr() - 1, b.addr()));\n }\n entryPointAddress = b.readShort(false);\n if (entryPointAddress === teamten_ts_utils_1.EOF) {\n entryPointAddress = 0;\n return makeSystemProgram(\"File is truncated at entry point address\");\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Jump address (0x${z80_base_1.toHexWord(entryPointAddress)})`, b.addr() - 2, b.addr()));\n return makeSystemProgram();\n}", "function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n self.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }", "async function load_init_file(filepath) {\n const u = new URL(filepath);\n return await fetch(u).then(res => res.text()).then(text => text);\n}", "compile() {\n // Check if it is already compiled\n if (!this.compiled) {\n // Find the file and read it into memory\n let filePath = path.resolve(__dirname, 'contracts', 'SimpleStorage.sol');\n let fileSource = fs.readFileSync(filePath, 'UTF-8');\n\n // Compile the contract with the contract source and 1 for optimization\n let compiled = solc.compile(fileSource, 1);\n\n // Store the bytecode, as we need it for deployment\n this.bytecode = \"0x\" + compiled.contracts[':simplestorage'].bytecode;\n\n // Store the abi (application binary interface) for js to interface with the contract on the chain\n let contractInterface = compiled.contracts[':simplestorage'].interface; // this is a json object that web3 uses as an interface\n this.abi = JSON.parse(contractInterface);\n this.compiled = true;\n }\n }", "async function ireeLoadProgram(vmfbPathOrBuffer) {\n return _ireeLoadProgram(vmfbPathOrBuffer);\n}", "function loadActivist (prefix, options, rsrc) {\n var config = {};\n var defaultConfig = require('./src/config');\n for (var i in defaultConfig) {\n if (defaultConfig.hasOwnProperty(i) && !options[i]) {\n config[i] = defaultConfig[i];\n } else if (options[i]) {\n config[i] = options[i];\n }\n }\n config.url = prefix + '.js';\n config.frame = prefix + '.html';\n config.offline = prefix + '-offline.html';\n\n rsrc.type = 'text/javascript';\n packager(config, function (data) {\n rsrc.body = data;\n rsrc.headers = {\n 'Cache-Control': 'public, max-age=' + Math.floor(rsrc.maxAge / 1000),\n 'ETag': etag(data)\n };\n });\n}", "function loadContractCode (name) {\n loadScript (\n \"target/test-solc-js/\" + name + \".bin.js\");\n return _;\n}", "function import_resource(filename, isFileURI){\n\tif (typeof(isFileURI) === 'undefined'){\n\t\tisFileURI = false;\n\t}\n\treturn new Promise(function(resolve, reject) {\n\t\tvar path = 'content';\n\t\tif (typeof(filename) === 'string'){\n\t\t\tpath += '/'+filename;\n\t\t}\n\t\telse {\n\t\t\tfor (var i=0; i < filename.length; i++){\n\t\t\t\tpath += '/'+filename[i];\n\t\t\t}\n\t\t}\n\n\t\tpath = isFileURI ? filename : thisaddon.getResourceURI(path).spec;\n\t\tvar xhr = get_xhr();\n\t\txhr.responseType = \"arraybuffer\";\n\t\txhr.onreadystatechange = function(){\n\t\t\tif (xhr.readyState != 4)\n\t\t\t\treturn;\n\n\t\t\tif (xhr.response) {\n\t\t\t\tresolve(ab2ba(xhr.response));\n\t\t\t}\n\t\t};\n\t\txhr.open('get', path, true);\n\t\txhr.send();\n\t\t\n\t\t/*\n\t\tOS.File.read(OS.Path.fromFileURI(thisaddon.getResourceURI(path).spec))\n\t\t.then(function onSuccess(ba) {\n\t\t\t//returns Uint8Array which is compatible with our internal byte array\t\n\t\t\tresolve(ba); \n\t\t});\n\t\t*/\n\t});\n}", "function loadModule(moduleName){var module=modules[moduleName];if(module!==undefined){return module;}// This uses a switch for static require analysis\nswitch(moduleName){case'charset':module=__webpack_require__(229);break;case'encoding':module=__webpack_require__(230);break;case'language':module=__webpack_require__(231);break;case'mediaType':module=__webpack_require__(232);break;default:throw new Error('Cannot find module \\''+moduleName+'\\'');}// Store to prevent invoking require()\nmodules[moduleName]=module;return module;}", "hack() {\n this.hackRequire = true;\n\n const self = this;\n const Module = require('module');\n\n // Ensure existing stores are wired\n this.wireStores();\n\n if (this.rewiredResolve) {\n return;\n }\n\n const _resolveFilename = Module._resolveFilename;\n\n // @todo there needs to be a way to revert resolver\n Module._resolveFilename = function hopperWrapped(request, parent) {\n if (request.indexOf(self.prefixRequire) === 0) {\n const name = request.split('/').pop();\n\n if (self.has(name)) {\n return request;\n }\n }\n\n return _resolveFilename(request, parent);\n };\n\n Module._resolveFilename.original = _resolveFilename;\n\n this.rewiredResolve = true;\n }", "load() {\n\n }", "lateLoad() {\n\n }", "function loadInternalResource(uri) {\n \tlog.info(\"Loading internal resource from \" + extensionAddress + '/' + uri + '.');\n\n \tvar xhr = new XMLHttpRequest();\n \txhr.open(\"get\", extensionAddress + '/' + uri, false);\n \txhr.send();\n\n \treturn xhr.responseText;\n }", "function loadRom(arrayBuffer) {\n\t\tconsole.log(\"loaded!\");\n\t}", "load() {\n if (this.pym !== null) {\n throw new Error('Stream Embed already rendered');\n }\n\n // Setup Pym.\n this.setupPym();\n\n if (this.snackBar) {\n // Attach the snackBar to the pym parent and to the body of the page.\n this.snackBar.attach(window.document.body, this.pym);\n }\n\n // If the user clicks outside the embed, then tell the embed.\n document.addEventListener('click', this.handleClick.bind(this), true);\n\n // Listens to ${name}Storage requests on pym and relay it to\n // ${name}Storage.\n ['local', 'session'].forEach(name => {\n connectStorageToPym(\n createStorage(`${name}Storage`),\n this.pym,\n `${name}Storage`\n );\n });\n\n // Process any queued operations.\n const queued = this.queued;\n this.queued = null;\n queued.forEach(callback => callback());\n }", "_ensureEmoteParserIsLoaded() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._emoteParser === undefined) {\n const obj = yield Utils_1.loadFromWeb(`https://www.${this._baseUrl}/_js/mfccore.js`, (content) => {\n // Massager....Yes this is vulnerable to site breaks, but then\n // so is this entire module.\n // First, pull out only the ParseEmoteInput function\n const startIndex = content.indexOf(\"// js_build_core: MfcJs/ParseEmoteInput/ParseEmoteInput.js\");\n const endIndex = content.indexOf(\"// js_build_core: \", startIndex + 1);\n assert.ok(startIndex !== -1 && endIndex !== -1 && startIndex < endIndex, \"mfccore.js layout has changed, don't know what to do now\");\n content = content.substr(startIndex, endIndex - startIndex);\n // Then massage the function somewhat and prepend some prerequisites\n content = `var document = {cookie: '', domain: '${this._baseUrl}', location: { protocol: 'https:' }};\n var g_hPlatform = {\n \"id\": 01,\n \"domain\": \"${this._baseUrl}\",\n \"name\": \"MyFreeCams\",\n \"code\": \"mfc\",\n \"image_url\": \"https://img.mfcimg.com/\",\n \"performer\": \"model\",\n \"Performer\": \"Model\",\n \"avatar_prefix\": \"avatar\",\n };\n var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;\n function bind(that,f){return f.bind(that);}` + content;\n content = content.replace(/this.createRequestObject\\(\\)/g, \"new XMLHttpRequest()\");\n content = content.replace(/new MfcImageHost\\(\\)/g, \"{host: function(){return '';}}\");\n content = content.replace(/this\\.Reset\\(\\);/g, \"this.Reset();this.oReq = new XMLHttpRequest();\");\n content = content.replace(/MfcClientRes/g, \"undefined\");\n return content;\n });\n // tslint:disable-next-line:no-unsafe-any\n this._emoteParser = new obj.ParseEmoteInput();\n this._emoteParser.setUrl(`https://api.${this._baseUrl}/parseEmote`);\n }\n });\n }", "getSwigTemplateLoader () {\n if (this._swigTemplateLoader == null) {\n /**\n * Create SWIG Template loader\n *\n * @param basepath\n * @param encoding\n * @returns {{}}\n * @private\n */\n this._swigTemplateLoader = function (basepath, encoding) {\n var templateLoader = {};\n var $this = this;\n\n encoding = encoding || 'utf8';\n var templatesBasePath = (basepath) ? path.normalize(basepath) : null;\n\n /**\n * Resolves <var>to</var> to an absolute path or unique identifier. This is used for building correct, normalized, and absolute paths to a given template.\n * @alias resolve\n * @param {string} to Non-absolute identifier or pathname to a file.\n * @param {string} [from] If given, should attempt to find the <var>to</var> path in relation to this given, known path.\n * @return {string}\n */\n templateLoader.resolve = function (to, from) {\n if (templatesBasePath) {\n from = templatesBasePath;\n } else {\n from = (from) ? path.dirname(from) : $this.viewPath;\n }\n\n var fullPath = null;\n if (ModuleView._rootDirDefinitions != null) {\n for (var i = 0; i < ModuleView._rootDirDefinitions.length; i++) {\n var dirDefinition = ModuleView._rootDirDefinitions[i];\n\n var tmpPath = path.resolve(dirDefinition.path, to);\n // console.log('Path: %s, %s, %s', tmpPath, dirDefinition.path, to);\n if (fs.existsSync(tmpPath)) {\n fullPath = tmpPath;\n break;\n }\n }\n }\n\n // Traditional path resolving logic\n if (fullPath == null || !fs.existsSync(fullPath)) {\n fullPath = path.resolve(applicationFacade.basePath, to);\n if (!fs.existsSync(fullPath)) {\n fullPath = path.resolve(from, to);\n\n /*\n if (!fs.existsSync(fullPath)) {\n // Workaroud to define apps path for current file\n if (from != null) {\n var normalFrom = path.normalize(from);\n var appIndex = normalFrom.lastIndexOf(path.sep + 'app' + path.sep);\n if (appIndex != -1) {\n var moduleRootPath = normalFrom.substr(0, appIndex);\n fullPath = path.resolve(moduleRootPath, to);\n }\n }\n }\n */\n }\n }\n\n return fullPath;\n };\n\n /**\n * Loads a single template. Given a unique <var>identifier</var> found by the <var>resolve</var> method this should return the given template.\n * @alias load\n * @param {string} identifier Unique identifier of a template (possibly an absolute path).\n * @param {function} [callback] Asynchronous callback function. If not provided, this method should run synchronously.\n * @return {string} Template source string.\n */\n templateLoader.load = function (identifier, callback) {\n if (!fs || (callback && !fs.readFile) || !fs.readFileSync) {\n throw new Error('Unable to find file ' + identifier + ' because there is no filesystem to read from.');\n }\n\n identifier = templateLoader.resolve(identifier);\n\n if (callback) {\n fs.readFile(identifier, encoding, callback);\n\n return;\n } else {\n // Read file in synchronous mode\n return fs.readFileSync(identifier, encoding);\n }\n };\n\n return templateLoader;\n }.bind(this);\n };\n\n // Returning Template loader based on SWIG\n return this._swigTemplateLoader();\n }", "async function bundleLazyModule(filePath) {\n\tconst result = await esbuild.build({\n\t\tentryPoints: [filePath],\n\t\tbundle: true,\n\t\tformat: \"cjs\",\n\t\twrite: false,\n\t\tabsWorkingDir: workerPath,\n\t\tdefine: {\n\t\t\tglobal: \"globalThis\",\n\t\t},\n\t\tplugins: [NodeModulesPolyfillPlugin()],\n\t});\n\n\tlet content = result.outputFiles[0].text;\n\n\t// Export the fetch handler (grabbing it from the global).\n\tcontent = \"const exports = {};\\n\" + content + \"\\nexport default exports\";\n\n\tawait fs.writeFile(path.resolve(workerPath, filePath), content);\n}", "function compileFile(fileUrl, packData){\n var dfd = q.defer();\n\n fs.readFile(fileUrl, function(err, file){\n if(err){\n dfd.reject(err);\n }else{\n file = _.template(file, {\n SCRIPT_SERVER : \"window.PACK_INFO = \" + JSON.stringify(packData) + \"\"\n });\n \n dfd.resolve(file);\n }\n });\n\n return dfd.promise;\n}", "function LoadLocalFile(file, idDiv, func){\n $(\"#divClaims\").hide();\n if(idDiv == undefined){\n idDiv = 'divCuerpo';\n } else if(idDiv == ''){\n idDiv = 'divCuerpo'; \n }\n getID(idDiv).innerHTML = LoadingViewHTML();\n var url = 'inc/' + file + \".html\";\n var request = new Request(url, {\n \tmethod: 'GET',\n \t// mode: 'cors',\n \tredirect: 'follow',\n \theaders: new Headers({\n \t\t'Content-Type': 'text/plain'\n \t})\n });\n\n \n fetch(request)\n .then( res => { \n return res.text() \n })\n .then( data => {\n getID(idDiv).innerHTML = data;\n LoadComponentMaterialize();\n if(func != undefined)func();\n \n })\n .catch( err => {\n console.log(err);\n })\n}", "function setupCsound() {\n fetch('livecode.orc').then((response) => {\n return response.text().then((txt) => {\n\n cs = new CsoundObj();\n cs.setOption(\"-m0\");\n cs.compileOrc(\n \"sr=48000\\nksmps=32\\n0dbfs=1\\nnchnls=2\\n\" + txt + myCsoundCode)\n cs.start(); \n CSOUND_AUDIO_CONTEXT.resume();\n csoundLoaded = true;\n }); \n });\n}", "static require (filename) {\n\t\treturn require(`./handlers/${filename}`);\n\t}", "function createInstance( p_manifest, rawWebAssembly, init_fn ) {\n var Module = {\n\n instantiateWasm: function (imports, successCallback) {\n console.log('creating wasm');\n\n return rawWebAssembly.then(function(binary) {\n\n console.log('starting WebAssembly.instantiate')\n\n var wasmInstantiate = WebAssembly.instantiate(new Uint8Array(binary), imports).then( function(output) {\n\n console.log('wasm instantiation succeeded');\n Module.testWasmInstantiationSucceeded = 1;\n successCallback(output.instance);\n\n }).catch(function(e) {\n console.log('wasm instantiation failed! ' + e);\n });\n\n });\n },\n\n onRuntimeInitialized: function () {\n\n p_manifest.then(\n function (manifest) {\n console.log('loaded the following manifest')\n console.log(manifest)\n\n // init simulator\n var instance = new Module.simulation();\n\n init_fn(instance)\n });\n\n }\n };\n\n return Module;\n}", "function extCall(){\n\t// external_uri\n\t//var nullElement = new Element();\n\t//$('ext').load(external_uri);\n\t//var myHTMLRequest = new Request.HTML().get(external_uri);\n}", "load() {\r\n\r\n }", "function requestContent(filename) {\n $('main').load(filename);\n}", "function fetch (moduleName, revisionHash, cb) {\n var currentRev = getRevision(moduleName) || '',\n method = currentRev ? 'apply' : 'add',\n callbackId = ++callbackCount,\n callbackName = CALLBACK_PREFIX + callbackId,\n path = ENDPOINT + '?',\n script = document.createElement('script'),\n callback;\n\n window[callbackName] = function (moduleName, revisionHash, moduleSrc) {\n dynoSrc[method](moduleName, revisionHash, moduleSrc, false);\n\n if (cb) {\n cb(getItem(LOCAL_STORAGE_PREFIX + moduleName), moduleSrc);\n }\n };\n\n path += 'id=' + moduleName +\n '&from=' + currentRev +\n '&to=' + revisionHash +\n '&fmt=js' +\n '&callback=' + callbackName;\n\n document.head.appendChild(script);\n script.src = path;\n\n return script;\n}", "function getExtScript(url) {\n var generatedMap = document.getElementById('generatedMap');\n document.getElementsByTagName('body')[0].removeChild(generatedMap);\n\n var js_script = document.createElement('script');\n js_script.type = \"text/javascript\";\n js_script.src = url;\n js_script.async = true;\n js_script.setAttribute(\"id\", \"generatedMap\");\n document.getElementsByTagName('body')[0].appendChild(js_script);\n}", "function RenderAsset(file, defaultVars, addWatchingCode, port) {\n if(!(this instanceof RenderAsset)) { return new RenderAsset(...arguments) }\n this.status = \"fetching_file\", this.file = file, this.minified = false\n\n //Get the accurate file type.\n this.type = mime.getType(file) || \"text/plain\"\n if(file.includes(\".ejs\")) { this.type = \"text/html\" }\n else if(file.includes(\".handlebars\")) { this.type = \"text/html\" }\n else if(file.includes(\".js\")) { this.type = \"application/javascript\" }\n else if(file.includes(\".sass\")) { this.type = \"text/css\" }\n else if(file.includes(\".scss\")) { this.type = \"text/css\" }\n\n //Handle fetching, rendering & minification in an async promise.\n this.promise = new Promise(async (resolve, reject) => {\n try {\n //Fetch file content.\n this.content = await fs.readFile(this.file)\n if(this.file.includes(\"assets/js/\")) { return resolve(this.status = \"rendered\") }\n\n //Add change handler to all HTML.\n if(addWatchingCode && this.type == \"text/html\") {\n this.content = String(this.content) + '<script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/socket.io.js\" integrity=\"sha256-bQmrZe4yPnQrLTY+1gYylfNMBuGfnT/HKsCGX+9Xuqo=\" crossorigin=\"anonymous\"></script>'\n + '<script>io(window.location.protocol + \"//\" + window.location.hostname + \":' + (port || 7931) + '\").on(\"changed\", () => window.location.reload())</script>'\n }\n\n //Convert file types to usable types.\n if(/\\.ejs|\\.handlebars|\\.js|\\.sass|\\.scss/.test(this.file)) {\n this.status = \"converting\"\n this.content = await convert(this.file, this.content)\n }\n this.status = \"rendered\"\n\n //Handle any minification separately.\n if([\"text/html\", \"text/css\", \"application/javascript\", \"image/png\", \"image/jpeg\", \"image/webp\", \"image/svg+xml\", \"image/gif\"].includes(this.type) && typeof this.content !== \"function\") {\n this.content = await minify(this.content, this.type)\n this.minified = true\n }\n\n return resolve()\n }\n catch (e) { reject(e) }\n })\n\n //Create a loader.\n this.load = async vars => {\n //Make sure asset has been rendered.\n if(this.status !== \"rendered\") { await new Promise(resolve => setInterval(() => this.status == \"rendered\" ? resolve() : undefined), 50) }\n\n //Render template.\n var content = this.content\n if(typeof content == \"function\") {\n content = await content(Object.assign({}, defaultVars, vars))\n if(this.type == \"text/html\") { content = await minify(content, \"text/html\") }\n }\n\n return content\n }\n\n return this\n}", "function loadModule(loader, name, options) {\n return new Promise(asyncStartLoadPartwayThrough({\n step: options.address ? 'fetch' : 'locate',\n loader: loader,\n moduleName: name,\n // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091\n moduleMetadata: options && options.metadata || {},\n moduleSource: options.source,\n moduleAddress: options.address\n }));\n }", "function loadModule(loader, name, options) {\n return new Promise(asyncStartLoadPartwayThrough({\n step: options.address ? 'fetch' : 'locate',\n loader: loader,\n moduleName: name,\n // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091\n moduleMetadata: options && options.metadata || {},\n moduleSource: options.source,\n moduleAddress: options.address\n }));\n }" ]
[ "0.5782038", "0.57724607", "0.5752613", "0.5694263", "0.56649077", "0.5659264", "0.5619589", "0.5558347", "0.55414575", "0.5486637", "0.5438503", "0.54004914", "0.53431934", "0.52699643", "0.5253605", "0.5231879", "0.52143633", "0.51908743", "0.51736397", "0.5152874", "0.5152874", "0.512169", "0.51048666", "0.50880164", "0.5004035", "0.49918815", "0.49918815", "0.49888033", "0.49728638", "0.49723658", "0.49595833", "0.4951831", "0.49429253", "0.49394062", "0.4934441", "0.492675", "0.492307", "0.492307", "0.492307", "0.4921444", "0.4920147", "0.4916165", "0.49056438", "0.49048892", "0.49044582", "0.49016812", "0.48989102", "0.488927", "0.48837176", "0.48835742", "0.48776257", "0.4872486", "0.4870244", "0.4863868", "0.48625928", "0.48334324", "0.48210767", "0.4816171", "0.4814607", "0.48072976", "0.47842368", "0.47809792", "0.47789583", "0.47761387", "0.4771777", "0.47633883", "0.47524527", "0.47445604", "0.47292528", "0.47291794", "0.471456", "0.47047314", "0.47027922", "0.4701703", "0.47000113", "0.4690196", "0.46765736", "0.46734378", "0.46681672", "0.46671924", "0.46612087", "0.4658178", "0.46429023", "0.46344855", "0.4633317", "0.46325323", "0.4628216", "0.4627748", "0.46250433", "0.4622117", "0.4613637", "0.46089426", "0.4608771", "0.46027094", "0.45906755", "0.45820764", "0.45816475", "0.45771304", "0.45764142", "0.45764142" ]
0.66014385
0
Route that redirects client to the login form if he hasn't joined the room
function PrivateRoute({ children, ...rest }) { const { room, username } = useSelector((state) => state.connection); return ( <Route {...rest} render={({ match, location }) => room && username ? ( children ) : ( <Redirect to={`/join/${match.params.id}`} /> ) } /> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToRoom(e) {\n\te.preventDefault();\n\n\tvar roomName = $.trim($('#roomName').val());\n\n\tif(!roomName){ return; } \n\n window.location.href = '/covert/room/' + roomName;\n}", "function handleLogin() {\n\t// If the user is logging in for the first time...\n\tif (okta.token.hasTokensInUrl()) {\n\t\tokta.token.parseTokensFromUrl(\n\t\tfunction success(res) {\n\t\t\t// Save the tokens for later use, e.g. if the page gets refreshed:\n\t\t\tokta.tokenManager.add(\"accessToken\", res[0]);\n\t\t\tokta.tokenManager.add(\"idToken\", res[1]);\n\t\t\t// Redirect to this user's dedicated room URL.\n\t\t\twindow.location = getRoomURL();\n\t\t\t}, function error(err) {\n\t\t\talert(\"We weren't able to log you in, something horrible must have happened. Please refresh the page.\");\n\t\t}\n\t\t);\n\t} \n\t// If the user is alrdy logged in...\n\telse {\n\t\tokta.session.get(function(res) {\n\t\t\tif (res.status === \"ACTIVE\") {\n\t\t\t\t// If the user is logged in on the home page, redirect to their room page.\n\t\t\t\tif (!hasQueryString()) \n\t\t\t\t\twindow.location = getRoomURL();\n\t\t\t\telse\n\t\t\t\t\treturn enableVideo();\n\t\t\t}\n\t\t\t// If we get here, the user is not logged in.\n\t\t\t// If there's a querystring in the URL, it means this person is in a\n\t\t\t// \"room\" so we should display our passive login notice. Otherwise,\n\t\t\t// we'll prompt them for login immediately.\n\t\t\tif (hasQueryString()) {\n\t\t\t\tdocument.getElementById(\"login\").style.display = \"block\";\n\t\t\t \tenableVideo();\n\t\t\t} else {\n\t\t\t\tshowLogin();\n\t\t\t}\n\t\t});\n\t}\n}", "function checkLoggedIn(to, from, next) {\n if (auth.clientId()) {\n const user = auth.user()\n\n // If no user object - redirect to Login\n if (!user || !user.userName) {\n next({ name: 'login', params: { redir: to.name } })\n return\n }\n }\n next()\n}", "checkForJoinOrHost() {\n // Grab any needed user info from the state directly because if we pass\n // it through props we'll re-render after logging in when we really\n // don't need to.\n const state = store.getState();\n\n const pathname = this.props.location.pathname;\n const splitPath = pathname.split('/');\n const baseRoute = `/${splitPath[1]}`;\n const inviteRoomId = splitPath.length > 2 ? splitPath[2] : '';\n const isJoinOrHost = baseRoute === Routes.Join || baseRoute === Routes.Host;\n if (!isJoinOrHost) {\n // this is neither a join nor host, abort.\n return;\n }\n\n const isMeetingInvite = baseRoute === Routes.Join && inviteRoomId.length === INVITE_LENGTH;\n const isLoggedIn = getIsUserLoggedIn(state);\n // if it's an invite, obviously just use the invite\n if (isMeetingInvite) {\n // set the invite id separately from the room id\n // we want to store the invite id so we can return to\n // it if we navigate to another page\n // set the room id so it will be ready as soon as the user gets redirected to the lobby\n this.props.setInviteId(inviteRoomId);\n this.props.setRoomId(inviteRoomId);\n }\n // if it's not an invite and we're logged in,\n // set the room Id to the user's personal room\n else if (!isMeetingInvite && isLoggedIn) {\n this.props.setRoomId(getUserRoomId(state));\n }\n // roomId will not be set if this is not an invite and the user is not logged in\n\n if (isLoggedIn) {\n // We're good the route is already to the lobby\n logger.info(`App.checkForPersonalInvite: user \"${getUserId(state)}\" ` +\n `is invited to a meeting in room \"${inviteRoomId}\"`);\n return;\n }\n\n // if we're not logged in but trying to go to\n // either the join or host page, the user must sign in\n this.props.changeRoute(Routes.SignIn);\n }", "function leaveRoom() {\n window.location = routeHome()\n }", "function isLoggedIn(req, res, next) {\n //console.log(\"called islogged\");\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n\n var str = req.path;\n\n var peer_id = req.query.P;\n\n var noob = req.query.N;\n\n var hoob = req.query.H;\n\n if(str == \"/sendOOB/\") req.flash('loginMessage','Login to register device');\n\n if(peer_id != undefined) str = str + '?P=' + peer_id;\n if(noob != undefined) str = str + '&N=' + noob;\n if(hoob != undefined) str = str + '&H=' + hoob;\n req.session.returnTo = str;\n res.redirect('/login');\n}", "function authenticateJoin(username,room){\n if(!Rooms.checkRoom(room)){\n return 'room doesn\\'t exist';\n }\n else if(Rooms.checkPlayerCount(room)>7){\n return 'room full';\n }\n else if(!Rooms.checkRoomStatus(room)){\n return 'game is running , join later';\n }\n else if(Users.checkUsernameExists(username)){\n return 'username already existing';\n }\n return 'clear';\n}", "function requireLogin(req, res, next) {\n var community = req.params.community;\n if (req.session.community == community) {\n next(); // allow the next route to run\n } else {\n // require the user to log in\n res.redirect(\"/\"+community+\"/adminLogin\"); // or render a form, etc.\n }\n}", "function loadEventRoom(id)\n{\n localStorage.setItem(\"roomId\",id);\n if(check_login())\n window.location.replace('event_room.html');\n else\n window.location.replace('unauth_event_room.html');\n}", "function isLoggedIn(req, res, next) {\n\t//console.log(\"called islogged\");\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n\n var str = req.path;\n\n var peer_id = req.query.PeerId;\n\n var noob = req.query.Noob;\n\n var hoob = req.query.Hoob;\n\n if(str == \"/sendOOB/\") req.flash('loginMessage','Login to register device now or click \\\"Deliver OOB\\\" to register later');\n\n if(peer_id != undefined) str = str + '?PeerId=' + peer_id;\n if(noob != undefined) str = str + '&Noob=' + noob;\n if(hoob != undefined) str = str + '&Hoob=' + hoob;\n req.session.returnTo = str;\n res.redirect('/login');\n}", "function checkLoggedIn(req,res,next){\r\n\tif(req.isAuthenticated()){\r\n \t\tres.redirect(\"/writings_in_which\");\r\n\t}\r\n\tnext();\r\n}", "beforeRouteEnter(to, from, next){\n const loggedIn = true;\n if(loggedIn) next();\n else next('*')\n }", "async open(req, res) {\n const db = await Database()\n const pass = req.body.password\n const AdminPass = await db.get(`SELECT * FROM admin`)\n if (AdminPass.adminPassword == pass) {\n res.render('admin')\n adminLogged = true\n } else {\n adminLogged = false\n res.render('parts/passincorrect', { roomId: '/admin' })\n }\n }", "async function check(req, res, next) {\n let room = await dbManager.findRoom(req.params.id);\n let userID = req.cookies.user;\n\n //room is full or does not exists\n if (room == null || (room.connected > 1 && userID != room.uIDs[0] && userID != room.uIDs[1])) {\n res.redirect('/');\n return;\n }\n\n if (userID == null || (userID != room.uIDs[0] && userID != room.uIDs[1]))\n res.locals.playerNumber = null;\n else\n res.locals.playerNumber = userID == room.uIDs[0] ? 0 : 1; \n \n res.locals.room = room;\n\n next();\n}", "isLoggedIn(req,res,next){\n //SI viene parametros y es 1 quiere decir que viene del logueo\n if(req.params.id == 1){\n return next();\n }else{\n return res.redirect('/');\n }\n }", "function authCheck(to, from,next){\n\n if(store.state.isLogged){\n next()\n }else{\n next('/')\n }\n}", "function restrict(req, res, next) {\n // console.log(req.session.username)\n // if (!req.session.username) {\n // res.redirect('/');\n // }\n next()\n}", "function ensureLoggedIn() {\n if ($location.path() === '/polls/new') {\n if (!AuthService.current) {\n console.log('hi');\n console.log($location.path());\n $location.path('/');\n }\n }\n }", "function joinRoom(e, roomAlreadyCreated) {\n e.preventDefault();\n if (roomAlreadyCreated) {\n if (!document.getElementById(\"username_shareableRoom\").value.length < 1) {\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.open();\n var enteredRoomName = document.getElementById(\"roomToJoin\").value;\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n MicroModal.close(\"shareableRoomCreatedModal\");\n // showStartGameButton();\n } else {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid red\";\n setTimeout(function () {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid black\";\n }, 3000);\n }\n } else {\n if (username()) {\n socket.open();\n var enteredRoomName = document.getElementById(\"enteredRoomName\").value;\n userName = document.getElementById(\"userName\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n }\n }\n}", "function requireLogin(req, res, next)\n{\n if(!req.user) res.redirect('/');\n else next();\n}", "function handleJoinRoom(room_name){\n clearErrors();\n socket.emit(\"join_room\", room_name);\n }", "isAut(req,res,next){\n if (req.user.rol < 3){\n return next();\n }\n return res.redirect('/signin');\n }", "function checkLoggedIn(context,redirect) {\n if (!Meteor.userId()) {\n redirect('/')\n }\n}", "function requiresLogin(req,res,next){\n if(!req.session.userId){\n return res.status(401).send(\"Please login to view this page\");\n }\n next()\n}", "function leaveRoom() {\n socketRef.current.emit(\"user clicked leave meeting\", socketRef.current.id);\n props.history.push(\"/\");\n }", "function checkAluminiRouteOwnership(req, res, next) {\n if (req.isAuthenticated()) {\n if(req.user.role == 'alumini'){\n next()\n } else {\n req.flash(\"error\", \"Cant'access\")\n res.redirect(\"/student\")\n }\n } else {\n req.flash(\"error\", \"Please login\")\n res.redirect(\"/login\")\n }\n}", "render () {\r\n const { authenticated } = this.state;\r\n return (\r\n <Router history={history}>\r\n <div>\r\n <Switch>\r\n <Route exact path=\"/\" render={() => (\r\n authenticated ? (<Redirect to=\"/rooms\"/> ) : ( <HomepageLayout />)\r\n )}\r\n />\r\n <Route exact path=\"/register\" render={() => (<Register history={history}/>)}/>\r\n <Route exact path=\"/login\" render={() => (<Login history={history} isAuthenticated={this.isAuthenticated} />)} />\r\n <Route exact path=\"/rooms\" component={Rooms} />\r\n <Route exact path=\"/rooms/:id\" component={Tasks} />\r\n <Route exact path=\"/tasks/:id\" component={Description} />\r\n <Route component={NoMatch} />\r\n </Switch>\r\n </div>\r\n </Router>\r\n );\r\n}", "async function requiresLogin(req, res, next) {\n if (!req.session.userID) {\n return res.redirect('/welcome');\n }\n return next();\n}", "function postLoginRoute(req, res) {\n\tlet query = 'SELECT email FROM users WHERE email =?';\n\tdb.query(query, [ req.body.email ], (error, dbEmail, fields) => {\n\t\tif (req.body.email !== dbEmail[0].email) {\n\t\t\tres.redirect('/');\n\t\t} else {\n\t\t\tlet query = 'SELECT password FROM users WHERE email =?';\n\t\t\tdb.query(query, [ req.body.email ], (error, dbPassword, fields) => {\n\t\t\t\tif (req.body.password !== dbPassword[0].password) {\n\t\t\t\t\tres.redirect('/');\n\t\t\t\t} else {\n\t\t\t\t\treq.session.email = req.body.email;\n\t\t\t\t\tres.redirect('/tickets');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}", "function joinRoom(event){\n \tvar x = $(event.target).text();\n if(x == roomIn){\n\n } else {\n socketio.emit(\"join_room\", {roomName:x, password:\"\"});\n }\n }", "function checknotau(req,res, next){\n if(req.isAuthenticated()){\n return res.redirect('/')\n }\n next()\n}", "checkLoginAuth (to, from, next) {\n if (to.meta && to.meta.ignoreAuth) {\n next()\n } else {\n next()\n // 做一些权限校验,不通过跳转到登录页\n // if ($auth.checkSession()) {\n // next()\n // } else {\n // next({\n // path: '/login'\n // })\n // }\n }\n }", "function requiresLogin(req, res, next) {\n if (isLoggedIn(req)) {\n return next()\n } else {\n return backHome(res)\n }\n}", "function requireLogin(req, res, next) {\n console.log(\"This route requries login!\");\n if (req.session && req.session.userId) {\n return next();\n } else {\n var err = new Error('You must be authorized to view this page.');\n err.status = 401;\n return next(err);\n }\n }", "async getRoomPass(req, res) {\n const db = await Database()\n const pass = req.body.password\n const AdminRoomId = req.params.room\n const AdminPass = await db.get(`SELECT * FROM admin`)\n if (AdminPass.adminPassword == pass) {\n const RoomPassRequestByAdmin = await db.get(\n `SELECT pass FROM rooms WHERE id = ${AdminRoomId}`\n )\n if (RoomPassRequestByAdmin == undefined) {\n res.render('parts/alert-message', {\n message: `A sala ${AdminRoomId} não existe no Banco de Dados`,\n redirect: '/admin'\n })\n } else {\n res.render('parts/alert-message', {\n message: `Senha da sala ${AdminRoomId} é: ${RoomPassRequestByAdmin.pass}`,\n redirect: '/admin'\n })\n }\n } else {\n adminLogged = false\n res.render('parts/passincorrect', { roomId: '/admin' })\n }\n }", "checkLogado(){\n if(!this.props.userLogin.comandaBlueCliente){\n this.props.history.push(\"/login\");\n }\n }", "function leaveRoom() {\n const leaveRoom = confirm('Are you sure you want to leave the chatroom?');\n if (leaveRoom) {\n window.location = '../index.html';\n }\n}", "function loginRequired(req, res, next) {\n if (!req.user) res.redirect('/auth/login');\n\n return next();\n}", "async viewRoomsTable(req, res) {\n const db = await Database()\n const pass = req.body.password\n const adminPassword = await db.get('SELECT * FROM admin')\n if (adminPassword.adminPassword == pass) {\n const rooms = await db.all('SELECT * FROM rooms')\n res.render('table', { dataTable: rooms, tableType: 'rooms' })\n } else {\n adminLogged = false\n res.render('parts/passincorrect', { roomId: '/admin' })\n }\n }", "function ensureLogin(req, res, next) {\n if (!req.session.user) {\n res.redirect(\"/log-in\");\n } else {\n next();\n }\n }", "function loginRequired(req, res, next) {\n if (!req.user) {\n return res.redirect('/auth/login');\n }\n return next();\n}", "function homeRoute(request, response){\n //if url == \"/\" && GET\n console.log(\"weee3eeeeeeeeeesdfgaaauifyueeeeeerrreeeeeeeeee still reading stuff\");\n //if url == \"/\" && POST\n //redirect to /:username\n}", "function redirectToLogin() {\n // Pass the original route to the login component\n redirect('/account/login')\n }", "function checkNotLogin(req, res, next) {\n if (req.session.user) {\n req.flash('error', 'Already Logged In');\n return res.redirect('/timeline');\n }\n next();\n}", "function redirectIfLoggedIn (req, res, next) {\n if (req.user) return res.redirect('/Schedule');\n return next(); //this is only really useful if the if statement doesnt execute\n}", "loginHandle(){\n const {history} = this.props;\n if(Meteor.userId()){\n history.push(\"/posts/\")\n } else{\n history.push(\"/login/\")\n }\n\n\n }", "function checkifLoggedIn(){\n $.get(\"/isloggedin\", function(data, status){\n if(data == \"false\"){\n //alert(\"not logged in, returning to lobby\");\n window.location.href = \"/lobby\";\n }\n });\n}", "function joinDemo()\n{\n\tuserName = document.getElementById(\"txtUserName\").value;\n\tvLocation = document.getElementById(\"DDLocation\").value;\n\tvSubscribe = document.getElementById(\"DDChat\").value;\n\tif(userName == \"\" || userName == \"null\" || userName == null || userName == \"undefined\" || userName == undefined)\n\t{\n\t\talert(\"Please Enter Username.\")\n\t\treturn;\n\t}\n\twindow.location.href = \"/home.html\";\n}", "function joinedRoom( room ) {\n}", "async viewRoomQuestions(req, res) {\n const db = await Database()\n const roomId = req.params.room\n const pass = req.body.password\n const adminPassword = await db.get('SELECT * FROM admin')\n const roomExist = await db.get(`SELECT id FROM rooms WHERE id = ${roomId}`)\n if (adminPassword.adminPassword == pass) {\n if (roomExist == undefined) {\n res.render('parts/alert-message', {\n message: `A sala ${roomId} não existe no Banco de Dados`,\n redirect: '/admin'\n })\n } else {\n const questions = await db.all(\n `SELECT * FROM questions WHERE room = ${roomId}`\n )\n res.render('table', { dataTable: questions, tableType: 'questions' })\n }\n }\n }", "function ensureNotAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n req.flash('error_msg', 'You are already logged in. If you want to switch users, click Logout to continue.');\n res.redirect('/chat');\n } else {\n return next();\n }\n}", "isADM(req,res,next){\n if (req.user.rol ===1){\n return next();\n }\n return res.redirect('/signin');\n }", "async function isAlreadyLogedin(req, res, next) {\n if (req.isAuthenticated()) {\n return res.redirect(\"/\")\n }\n next()\n}", "function login_required(req, res, next) {\n if (!req.user) {\n return res.redirect('/login');\n }\n\n return next();\n}", "function requireAuthenticated(to, from, next) {\n var authenticated = _store__WEBPACK_IMPORTED_MODULE_25__[\"default\"].getters[\"auth/authenticated\"];\n var user = _store__WEBPACK_IMPORTED_MODULE_25__[\"default\"].getters[\"auth/user\"];\n if (to.name !== 'Login' && !authenticated || !user) next({\n path: '/login'\n });else {\n next();\n }\n}", "function loginRequired(req, res, next) {\n if (!req.user) return res.redirect('/auth/login');\n\n return next();\n}", "function login(req, h){\n if(req.state.user){\n return h.redirect('/')\n }\n return h.view('login',{\n title: 'login',\n user: req.state.user\n })\n}", "function findRoom(req, res, next) {\n if (req.query.Name == null) res.redirect(\"/rooms\");\n else {\n room\n .findOne({ Name: req.query.Name })\n .populate({\n path: \"Detail\",\n populate: {\n path: \"Reserve\",\n match: {\n $or: [\n { DateIn: { $gt: req.query.from, $lt: req.query.to } },\n { DateOut: { $gt: req.query.from, $lt: req.query.to } }\n ]\n }\n }\n })\n .exec(function(err, Room) {\n if (err) console.error(err);\n var counter = 0;\n for (var i = 0; i < Room.Detail.length; i++) {\n if (Room.Detail[i].Reserve.length == 0) {\n counter++;\n req.session.ReserveInfo = Room.Detail[i];\n req.session.RoomInfo = Room;\n break;\n }\n }\n if (counter == 0) {\n console.log(\"No room left\");\n res.redirect(\"/rooms/\" + req.query.Name, {\n info: { message: \"No Room Left\" }\n });\n } else {\n return next();\n }\n });\n }\n}", "function joinUserRoom(name) {\r\n divHome.hide();\r\n divRoom.show();\r\n socket.emit(\"joinRoom\", name);\r\n currentRoom = name;\r\n}", "login(e){\n e.preventDefault();\n MeetupActions.loadSession(this.state.username, this.state.password);\n return false;\n }", "joinRoom(userName) {\n this.sendEvent(\"auth\", { room_route: this.roomRoute, user_name: userName })\n }", "function restrict(req, res, next) {\n if (req.session.user) {\n next();\n } else {\n res.redirect('/LoginGateway');\n }\n}", "function isLoggedIn() {\n if (!store.getters.isAuthenticated) {\n this.$router.push(\"/\");\n return;\n }\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated() && req.user.username.charAt(0) == 'L') {\n return next();\n }\n req.flash(\"error\", \"Please login first\")\n res.redirect(\"/login\");\n}", "_loginRedirect() {\n if (!this.isLoading && !this.hasUser) {\n this.props.history.push('/login');\n }\n }", "function joinRoom(id)\n{\n console.log('Request joinRoom: ' + id);\n if (inRoom == false)\n {\n _warpclient.joinRoom(id);\n } else {\n console.warn('Already in another room: ' + roomId);\n }\n}", "function isLogedIn(req, res, next){\n\tif(req.user){\n\t\tnext();\n\t} else{\n\t\tres.redirect('/login');\n\t}\n\n}", "function isLoggedIn(req,res,next){\n //si esta autenticado q continue con la ruta\n if(req.isAuthenticated()){\n return next()\n }\n //sino retorne al home\n return res.redirect('/')\n }", "function _joinRoom() {\n roomId = rooms[0].id;\n // Join the room\n socketInstance.post('/room/' + roomId + '/onlineUsers', { id: myChatId });\n }", "function joinRoom(room)\r\n{\r\n //TODO erase... Name must be known previously\r\n var name = '';\r\n while(name == '')\r\n {\r\n name = prompt(\"Wie heißt du?\");\r\n }\r\n\r\n socket.emit('requestRoom', room, name);\r\n document.getElementById(\"chooseRoom\").classList.add('hidden');\r\n \r\n //TODO: maybe show loading icon...\r\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/#/');\n }", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/signup');\n }", "function home(req, res) {\n if (!req.session.nameID) {\n res.render('name');\n } else {\n res.redirect('succes');\n }\n}", "function isLoggedIn(req,res,next){\n if(req.isAuthenticated()) return next()\n res.redirect('/')\n}", "function checkLogin(req, res, next) {\n if (!req.session.user) {\n req.flash('error', 'Not Logged In');\n return res.redirect('/timeline/login');\n }\n next();\n}", "function checkAuthorised() {\n var loggedIn = isLoggedIn();\n $q.when(loggedIn, function (res) {\n if (res.data === false) {\n state.go('home');\n }\n });\n }", "function isLoggedIn(req, res, next) { //Pull this out into a function!!\n if (req.isAuthenticated()) return next();\n\n res.redirect('/');\n }", "function isLoggedIn(req,res,next){\n if (req.isAuthenticated() && req.user.username == 'Admin') {\n return next();\n } else {\n \n res.render('login');\n }\n}", "enterRoom(room) {\n console.warn(\"Cannot enter room different room from InBrowserBot\")\n }", "async function requiresLogout(req, res, next) {\n if (req.session.userID) {\n return res.redirect('/dashboard');\n }\n return next();\n}", "function isLoggedIn() {\n return ($location.url() != '/home' && $location.url() != '/login' && $location.url() != '/register');\n }", "function isLoggedIn(req, res, next) {\n if (req.user) return next();\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next();\r\n }\r\n res.redirect('/');\r\n }", "function hasSesion(req, res, next)\n {\n if (req.user) return res.redirect('/dashboard');\n next();\n }", "function guest(req, res, next){\n if(!req.isAuthenticated()){ // this isAuthenticate is provided from passport\n return next()\n\n }\n return res.redirect('/')\n}", "function renderRoom(req, res) {\n res.render('pages/room', {connectedUsers: connectedUsers});\n}", "function handleLogin() {\r\n if ((!assetEmpty(email) && !assetEmpty(password))\r\n && assertEquals(email, registeredState.email)\r\n && assertEquals(password, registeredState.password)\r\n ) {\r\n setPassword('');\r\n global.nameLogin = registeredState.name;\r\n navigation.replace('BottomStack');\r\n } else {\r\n Alert.alert(\r\n 'Não foi possível entrar:',\r\n 'E-mail/senha incorretos!'\r\n );\r\n }\r\n }", "function clientLoginInterface(req, res) {\n if (req.session != null\n && req.session.hasOwnProperty('shared-key')\n /* TODO: && req.session['shared-key'] is valid */) {\n res.redirect('/clients/');\n return;\n }\n \n res.sendfile('resources/client-login.html');\n}", "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next();\r\n } else {\r\n res.redirect('/user/entervault');\r\n }\r\n}", "function getLoginRoute(req, res) {\n\tres.render('authentication/login', {\n\t\temail : req.session.email,\n\t\tpageId : 'login',\n\t\ttitle : 'Tickets | Login'\n\t});\n}", "function requireAuth(to, from, next) {\n\t/*\n\t\tDetermines where we should send the user.\n\t*/\n function proceed() {\n\t\t/*\n\t\t\tIf the user has been loaded determine where we should\n\t\t\tsend the user.\n\t\t*/\n if (store.getters.getUserLoadStatus == 2) {\n next();\n } else if (store.getters.getUserLoadStatus == 3) {\n //user is not logged in\n console.log('you are not logged in');\n }\n }\n\n proceed();\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n }", "async deleteRoom(req, res) {\n const db = await Database()\n const AdminRoomId = req.params.room\n const pass = req.body.password\n const adminPassword = await db.get(`SELECT * FROM admin`)\n const roomExist = await db.get(\n `SELECT id FROM rooms WHERE id = ${AdminRoomId}`\n )\n if (adminPassword.adminPassword == pass) {\n if (roomExist == undefined) {\n res.render('parts/alert-message', {\n message: `A sala ${AdminRoomId} não existe no Banco de Dados`,\n redirect: '/admin'\n })\n } else {\n await db.run(`DELETE FROM rooms WHERE id = ${AdminRoomId}`)\n await db.run(`DELETE FROM questions WHERE room = ${AdminRoomId}`)\n res.render('parts/alert-message', {\n message: `A sala ${AdminRoomId} foi excluída`,\n redirect: '/admin'\n })\n }\n } else {\n adminLogged = false\n res.render('parts/passincorrect', { roomId: '/admin' })\n }\n }", "function checkLogIn() {\n if (localStorage.getItem('token') === null) {\n window.location.href = './login.html';\n }\n}", "joinRoom({state}, { roomId }) {\n return state.currentUser.joinRoom({ roomId });\n }", "function checkNotAuth(req, res, next) {\n // If authenticated, redirect to Home page\n if (req.isAuthenticated()) {\n return res.redirect('/');\n }\n // If not authenticated, proceed to requested route\n next();\n}", "function forwardAuthenticated(req, res, next) {\n if (!req.isAuthenticated()) {\n return next()\n }\n res.redirect('/tournaments/myTournaments')\n}", "function isLoggedIn(req,res,next)\r\n {\r\n if(req.isAuthenticated()){\r\n return next();\r\n }\r\n res.redirect('/');\r\n }", "redirect() {\n if( Meteor.user() && Meteor.user().profile.isDriver) {\n window.location.replace(FlowRouter.path('Make Offers'));\n }\n if (Meteor.user() && (! Meteor.user().profile.isDriver)) {\n window.location.replace(FlowRouter.path('Request Pickup'));\n }\n return !!Meteor.userId();\n }", "render() {\n return (\n <Router> \n <Route exact path=\"/\" render = {\n (props) => {\n if (!this.state.nick) {\n return (\n <Login \n onNickChange = {this.onNickChange} \n onNickSubmit = {this.onSubmitLogin}\n />\n )\n } else {\n //create chatroom & past socket.id to window.location.pathname as unique identificator\n //copy result of address bar and send your friend for invite him to chatroom\n return <Redirect to={`/${socket.id}`} />;\n }\n }\n }/>\n \n <Route path=\"/:id\" render = {\n (props) => {\n if (!this.state.nick) {\n return (\n <Login \n onNickChange = {this.onNickChange} \n onNickSubmit = {this.onNickSubmit}\n />\n )\n } \n return (\n <div className = \"video-chat\">\n <Chat \n onTextChange = {this.onTextChange} \n onMessageSubmit = {this.onMessageSubmit} \n state = {this.state} \n renderChat = {this.renderChat} \n users = {this.state.users} \n renderOnline = {this.renderOnline}\n /> \n </div>\n )\n } \n }/>\n </Router>\n );\n }" ]
[ "0.65786815", "0.64098537", "0.6391505", "0.63437563", "0.6274434", "0.6257958", "0.62422395", "0.620749", "0.6186719", "0.61631435", "0.6143711", "0.61312336", "0.6017081", "0.5992875", "0.59639394", "0.5940613", "0.5927464", "0.59123605", "0.590499", "0.5872567", "0.5854928", "0.58351165", "0.58347154", "0.58302504", "0.58255476", "0.58129805", "0.5812142", "0.581014", "0.57976454", "0.5793796", "0.57898355", "0.5788727", "0.5788328", "0.57701325", "0.57689226", "0.57684034", "0.5765395", "0.57576966", "0.57540536", "0.574583", "0.57414806", "0.5735297", "0.5733829", "0.57329005", "0.57187635", "0.57084835", "0.5706923", "0.5704433", "0.57000923", "0.569975", "0.56947076", "0.5691636", "0.5690591", "0.5684021", "0.5683662", "0.5683279", "0.56767845", "0.5675254", "0.56750953", "0.5664841", "0.56647336", "0.566305", "0.565047", "0.56482655", "0.5643891", "0.5642809", "0.5640818", "0.56298435", "0.56232256", "0.5622494", "0.56178355", "0.56147414", "0.5609078", "0.56083095", "0.5607279", "0.5601517", "0.56013757", "0.5599248", "0.5597696", "0.5596392", "0.55919677", "0.5590958", "0.55890185", "0.558665", "0.55862266", "0.5582867", "0.55809665", "0.5579603", "0.5578585", "0.5571814", "0.55639553", "0.55592984", "0.55582875", "0.5556106", "0.5552375", "0.55490786", "0.5545321", "0.5541437", "0.553922", "0.5538237" ]
0.5736804
41
Even if the view is not a CollectionView ensureRendered() to provide similar behavior to a model
function onSetCollection(collection) { // Undefined to force conditional render var options = this.getObjectOptions(collection) || undefined; if (this.shouldRender(options && options.render)) { // Ensure that something is there if we are going to render the collection. this.ensureRendered(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleRendered_() {\n\t\tthis.isRendered_ = true;\n\t}", "view() {\n // console.log('Render called');\n return this._view.renderView();\n }", "function handleRender() {\n\t view._isRendered = true;\n\t triggerDOMRefresh();\n\t }", "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "onBeforeRender()\n {\n this.model.set('available', this.model.available());\n }", "function handleRender(view) {\n view._isRendered = true;\n triggerDOMRefresh(view);\n }", "function handleRender(view){\r\n view._isRendered = true;\r\n triggerDOMRefresh(view);\r\n }", "beforeRender() { }", "_renderItems() {\n this.views.forEach(function(view) {\n view.remove();\n });\n this.views = [];\n this.$listBody.empty();\n\n this.model.collection.each(item => {\n this._addItem(item, item.collection, {\n animate: false,\n });\n });\n }", "_firstRendered() { }", "onBeforeRendering() {}", "willRender() {\n console.log('willRender ejecutado!');\n }", "function renderView() {\n return require([contentViewUrl, topBarViewUrl, collectionUrl], function (contentView, topBarView, contentCollection) {\n var collection;\n\n App.filtersObject.filter = filter;\n\n collection = new contentCollection({\n viewType : 'list',\n page : page,\n reset : true,\n count : count,\n filter : filter,\n parrentContentId: parrentContentId,\n contentType : contentType,\n showMore : false\n });\n\n collection.bind('reset', _.bind(createViews, self));\n\n custom.setCurrentVT('list');\n\n function createViews() {\n var topbarView;\n var contentview;\n\n collection.unbind('reset');\n\n topbarView = new topBarView({\n actionType: 'Content',\n collection: collection\n });\n\n contentview = new contentView({\n collection: collection,\n startTime : startTime,\n filter : filter\n });\n\n eventsBinder.subscribeTopBarEvents(topbarView, contentview);\n eventsBinder.subscribeCollectionEvents(collection, contentview);\n\n collection.trigger('fetchFinished', {\n totalRecords: collection.totalRecords,\n currentPage : collection.currentPage,\n pageSize : collection.pageSize\n });\n\n context.changeView(contentview);\n context.changeTopBarView(topbarView);\n }\n });\n }", "updateView() {\n this.render()\n }", "initialize(options={}) {\n const collection = this.model.collection;\n\n this.ItemView = options.ItemView || this.defaultItemView;\n this.views = [];\n this.animateItems = !!options.animateItems;\n\n this.once('rendered', () => {\n this.listenTo(collection, 'add', this._addItem);\n this.listenTo(collection, 'remove', this._removeItem);\n this.listenTo(collection, 'reset', this._renderItems);\n });\n }", "itemModeForceRender() {\n if (this.item) {\n this.forceRender();\n }\n }", "render() {\n\t return this._visibleView === null ? null : this._visibleView.render();\n\t }", "onBeforeRender () {\n\n }", "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 }", "get isCollection() {\n return this.isSetView;\n }", "function onViewRendered(domEl) {\n setDOMElement(domEl);\n // from the ViewMixinEventDelegator\n if (this.delegateEvents) {\n this.delegateEvents();\n }\n\n if (this.viewDidMount) {\n this.viewDidMount();\n }\n }", "willRender() {\n this.startReloading();\n }", "postRender()\n {\n super.postRender();\n }", "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "shouldRender(newProps) {\n return true;\n }", "redrawViewComponent(createdView) {\n const containerElements = document.getElementsByClassName(`${ROW_DETAIL_CONTAINER_PREFIX}${createdView[this.datasetIdPropName]}`);\n if (containerElements && containerElements.length) {\n this.renderViewModel(createdView.dataContext);\n }\n }", "onRender()\n {\n // Empty regions.\n this.getRegion('regionRunJobCollection').empty();\n this.getRegion('regionResourceCollection').empty();\n\n if (this.getRegion('regionRunJobCollection').el === undefined || this.getRegion('regionResourceCollection').el === undefined) {\n this.getRegion('regionRunJobCollection').el = '#region-main_workflowrun_individual_runjobs'\n this.getRegion('regionResourceCollection').el = '#region-main_workflowrun_individual_resources'\n }\n\n // Create Resource collection view.\n this._layoutViewResources = new LayoutViewModel();\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__RESOURCE_SHOWLAYOUTVIEW, {layoutView: this._layoutViewResources});\n this.showChildView('regionResourceCollection', this._layoutViewResources);\n this._viewResourceCollection = new ViewResourceCollection({collection: this._resources,\n template: _.template($('#template-main_workflowrun_individual_resources_collection').text()),\n childView: ViewResourceCollectionItem});\n this._layoutViewResources.showCollection(this._viewResourceCollection);\n\n // Create RunJob collection view.\n this._layoutViewRunJobs = new LayoutViewModel();\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__RUNJOB_SHOWLAYOUTVIEW, {layoutView: this._layoutViewRunJobs});\n this.showChildView('regionRunJobCollection', this._layoutViewRunJobs);\n this._viewRunJobCollection = new ViewRunJobCollection({collection: this._runJobs,\n template: _.template($('#template-main_runjob_collection_notitle').text()),\n childView: ViewRunJobCollectionItem});\n this._layoutViewRunJobs.showCollection(this._viewRunJobCollection);\n\n // Show Resources on default.\n this._showResources();\n }", "constructor() {\n super();\n this.itemview = {};\n\n this.views = {};\n this.listenTo(this.collection, 'reset', this.onReset);\n this.listenTo(this.collection, 'add', this.addItem);\n this.listenTo(this.collection, 'remove', this.removeItem);\n }", "onRender () {\n\n }", "shouldRender({person}) {\n // Here we check that the person is defined.\n return person;\n }", "_render(model) {\n\t\tthis._coordinator.newEvent({\n\t\t\tsource: this.constructor.name,\n\t\t\ttype: 'render',\n\t\t\tdata: {\n\t\t\t\toriginX: this._originX,\n\t\t\t\toriginY: this._originY,\n\t\t\t\twidth: this._width,\n\t\t\t\theight: this._height\n\t\t\t}\n\t\t});\n\t}", "function actuallyRender() {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * The `_viewRender` method is broken out to abstract away from having\n\t\t\t\t\t * too much code in `actuallyRender`.\n\t\t\t\t\t */\n\t\t\t\t\troot._render().done(function () {\n\t\t\t\t\t\tvar promises;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * If there are no children to worry about, complete the render\n\t\t\t\t\t\t * instantly.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (!_.keys(root.views).length) {\n\t\t\t\t\t\t\treturn resolve();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Create a list of promises to wait on until rendering is done.\n\t\t\t\t\t\t * Since this method will run on all children as well, its sufficient\n\t\t\t\t\t\t * for a full hierarchical.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tpromises = _.map(root.views, function (view) {\n\t\t\t\t\t\t\tvar insert = _.isArray(view);\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * If items are being inserted, they will be in a non-zero length\n\t\t\t\t\t\t\t * Array.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (insert && view.length) {\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Mark each subview's manager so they don't attempt to attach by\n\t\t\t\t\t\t\t\t * themselves. Return a single promise representing the entire\n\t\t\t\t\t\t\t\t * render.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\treturn root.when(_.map(view, function (subView) {\n\t\t\t\t\t\t\t\t\tsubView.__manager__.insertedViaFragment = true;\n\t\t\t\t\t\t\t\t\treturn subView.render().__manager__.renderDeferred;\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Only return the fetch deferred, resolve the main deferred after\n\t\t\t\t\t\t\t * the element has been attached to it's parent.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\treturn !insert ? view.render().__manager__.renderDeferred : view;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Once all nested Views have been rendered, resolve this View's\n\t\t\t\t\t\t * deferred.\n\t\t\t\t\t\t */\n\t\t\t\t\t\troot.when(promises).done(resolve);\n\t\t\t\t\t});\n\t\t\t\t}", "afterRender() { }", "afterRender() { }", "_didRender(_props, _changedProps, _prevProps) { }", "onRender() {\n super.onRender();\n this.clearList();\n this.renderList();\n }", "synchronizeViewFromModel() {\n }", "async _renderView() {\n return this._super(...arguments).then(() => {\n this.$('.o_calendar_mini').toggleClass('d-none', true);\n this._renderOtherCalendar();\n });\n }", "function viewRenderComplete() {\n $container.trigger(topologyConstants.events.viewRenderComplete, {}); // Private Event\n }", "onRender()/*: void*/ {\n this.render();\n }", "didRender() {\n console.log('didRender ejecutado!');\n }", "render(clientPlace) {\n \n let viewNames = Object.keys(this.viewStore);\n \n function hasAMatchingPlace(place, placeArr) {\n return placeArr.some((p) => p.matches(place));\n }\n \n // let matchingViewNames = viewNames.filter((viewName) => hasAMatchingPlace(clientPlace, this.viewStore[viewName].places));\n let matchingViewNames = viewNames.filter((viewName) => true); // TEMP\n \n // For matching Part Views, call sysRender()\n \n matchingViewNames.forEach((viewName) => this.view[viewName].sysRender());\n }", "function actuallyRender() {\n\n // The `_viewRender` method is broken out to abstract away from having\n // too much code in `actuallyRender`.\n root._render().done(function() {\n // If there are no children to worry about, complete the render\n // instantly.\n if (!_.keys(root.views).length) {\n return resolve();\n }\n\n // Create a list of promises to wait on until rendering is done.\n // Since this method will run on all children as well, its sufficient\n // for a full hierarchical.\n var promises = _.map(root.views, function(view) {\n var insert = _.isArray(view);\n\n // If items are being inserted, they will be in a non-zero length\n // Array.\n if (insert && view.length) {\n // Mark each subview's manager so they don't attempt to attach by\n // themselves. Return a single promise representing the entire\n // render.\n return root.when(_.map(view, function(subView) {\n subView.__manager__.insertedViaFragment = true;\n return subView.render().__manager__.renderDeferred;\n }));\n }\n\n // Only return the fetch deferred, resolve the main deferred after\n // the element has been attached to it's parent.\n return !insert ? view.render().__manager__.renderDeferred : view;\n });\n\n // Once all nested Views have been rendered, resolve this View's\n // deferred.\n root.when(promises).done(resolve);\n });\n }", "static rendered () {}", "static rendered () {}", "render() {\n RB.CollectionView.prototype.render.call(this);\n\n this._$scrollContainer.scroll(this.checkFetchNext.bind(this));\n\n return this;\n }", "shouldRerender () {\n return false\n }", "_shouldRender(props, changedProps, old) {\n return props.active;\n }", "function tryRender(view,options,callback){try{view.render(options,callback);}catch(err){callback(err);}}", "onAfterRendering() {}", "requestView(){\t\t\n\t\tthis.trigger('requestView');\n\t}", "sysRender() {\n \n let rendered = this.render();\n \n // If render() returns a String, then insert that as innerHTML in the\n // Part View node. Otherwise, do something else (TODO)\n \n if (typeof rendered === 'string') {\n this.domNode.innerHTML = rendered;\n } else if (false) { // TODO: test for jQuery return, DOM Node object, etc.\n // WHAT? \n }\n }", "unrender() {\n this.rendered = false;\n }", "function TView(){}", "_render() {\n\t\tthis.tracker.replaceSelectedMeasures();\n }", "_triggerChange(viewChanged) {\n\t const registry = storage.getRegistry(this._instance);\n\t const events = registry.events;\n\t // Render blocks first, it might change error or route\n\t const blocks = this.render();\n\t // Create item\n\t const item = {\n\t viewChanged,\n\t error: this.error(),\n\t route: this.partialRoute,\n\t blocks,\n\t };\n\t events.fire('render', item);\n\t }", "function actuallyRender() {\n var options = root.getAllOptions();\n var manager = root.__manager__;\n var parent = manager.parent;\n var rentManager = parent && parent.__manager__;\n\n // The `_viewRender` method is broken out to abstract away from having\n // too much code in `processRender`.\n root._render(LayoutManager._viewRender, options).done(function() {\n // If there are no children to worry about, complete the render\n // instantly.\n if (!_.keys(root.views).length) {\n return resolve();\n }\n\n // Create a list of promises to wait on until rendering is done.\n // Since this method will run on all children as well, its sufficient\n // for a full hierarchical. \n var promises = _.map(root.views, function(view) {\n var insert = _.isArray(view);\n\n // If items are being inserted, they will be in a non-zero length\n // Array.\n if (insert && view.length) {\n // Schedule each view to be rendered in order and return a promise\n // representing the result of the final rendering.\n return _.reduce(view.slice(1), function(prevRender, view) {\n return prevRender.then(function() {\n return view.render();\n });\n // The first view should be rendered immediately, and the resulting\n // promise used to initialize the reduction.\n }, view[0].render());\n }\n\n // Only return the fetch deferred, resolve the main deferred after\n // the element has been attached to it's parent.\n return !insert ? view.render() : view;\n });\n\n // Once all nested Views have been rendered, resolve this View's\n // deferred.\n options.when(promises).done(function() {\n resolve();\n });\n });\n }", "function createViewModule() {\n\n var LIST_VIEW = 'LIST_VIEW';\n var GRID_VIEW = 'GRID_VIEW';\n var RATING_CHANGE = 'RATING_CHANGE';\n\n\n /**\n * An object representing a DOM element that will render the given ImageModel object.\n */\n var ImageRenderer = function(imageModel) {\n var self = this;\n \n // Constants\n this.unavailablePath = 'unavailable.svg';\n this.unavailableName = '(image not available)';\n this.unavailableCaption = '(click to add caption)';\n \n // Save the incoming image model\n this.imageModel = imageModel;\n this.currentView = GRID_VIEW;\n \n // Register as a listener to the image model\n this.modelDidChangeListenerFunction = function(imageModel, eventTime) {\n self.setImageModel(imageModel);\n };\n \n // Clone the template\n var imageTemplate = document.getElementById('image-item-template').content;\n this.imageOuterDiv = document.createElement('div'); \n this.imageOuterDiv.appendChild(document.importNode(imageTemplate, true));\n \n this.imageDiv = this.imageOuterDiv.querySelector('.ft-item');\n \n this.imageContainer = this.imageDiv.querySelector('.ft-item-image-container');\n this.metadataContainer = this.imageDiv.querySelector('.ft-item-metadata-container');\n \n this.imageField = this.imageDiv.querySelector('.ft-item-image');\n this.captionField = this.imageDiv.querySelector('.ft-item-caption');\n this.nameField = this.imageDiv.querySelector('.ft-item-name');\n this.dateField = this.imageDiv.querySelector('.ft-item-date');\n \n // Add a RatingsView instance to it\n this.ratingsInstance = new RatingsView(this.imageModel);\n this.imageDiv.querySelector('.ft-item-metadata-container').appendChild(this.ratingsInstance.getElement());\n \n // Add an event listener to the image to catch load errors\n this.imageField.addEventListener('error', function(event) {\n event.stopPropagation();\n event.preventDefault();\n \n // base64-encoded version of unavailable.svg\n // Using this in case unavailable.svg goes missing, otherwise we get stuck in an infinite loop\n this.src = \"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNS4wLjIsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyODBweCINCgkgaGVpZ2h0PSIyODBweCIgdmlld0JveD0iMCAwIDI4MCAyODAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI4MCAyODAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGcgaWQ9IkxheWVyXzJfMl8iPg0KCTxyZWN0IGZpbGw9IiNGRkZGRkYiIHdpZHRoPSIyODAiIGhlaWdodD0iMjgwIi8+DQo8L2c+DQo8ZyBpZD0iTGF5ZXJfMSI+DQoJPGcgaWQ9IkxheWVyXzJfMV8iPg0KCQk8ZyBpZD0iTGF5ZXJfMiIgZGlzcGxheT0ibm9uZSI+DQoJCQkNCgkJCQk8Y2lyY2xlIGRpc3BsYXk9ImlubGluZSIgZmlsbD0iI0RERERERCIgc3Ryb2tlPSIjQkZCRkJGIiBzdHJva2Utd2lkdGg9IjE0IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIGN4PSIxMTcuMzk4IiBjeT0iOTYuMDU5IiByPSI1My43OTciLz4NCgkJCQ0KCQkJCTxsaW5lIGRpc3BsYXk9ImlubGluZSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQkZCRkJGIiBzdHJva2Utd2lkdGg9IjE0IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHgxPSIxNTUuODAxIiB5MT0iMTMzLjcyIiB4Mj0iMjI2LjQ2NiIgeTI9IjIwNC4zODciLz4NCgkJCTxnIGRpc3BsYXk9ImlubGluZSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAgICAiPg0KCQkJCTxwYXRoIGZpbGw9IiM3RjdGN0YiIGQ9Ik0yMzEuOTkzLDIwNi43ODRjMC0yMy4zOTcsMzMuMTYxLTI1LjIzOSwzMy4xNjEtNDQuNzcxYzAtOS4yMTEtNy4xODQtMTcuMTM0LTIxLjU1NS0xNy4xMzQNCgkJCQkJYy0xNC4wMDIsMC0yMi42NjIsNS44OTYtMjkuNDc5LDE1LjEwOGwtOS4yMTItOS45NDljOC44NDQtMTEuNjA3LDIyLjQ3OC0xOC43OTIsMzkuOTc5LTE4Ljc5Mg0KCQkJCQljMjIuNDc3LDAsMzYuMTA5LDEyLjcxMiwzNi4xMDksMjguNTU4YzAsMjcuODE3LTM1LjU1OSwzMC4yMTMtMzUuNTU5LDQ4LjI3YzAsMi45NDcsMS42NTgsNi42MzMsNC43OTEsOC44NDRsLTExLjIzOCw0Ljk3NQ0KCQkJCQlDMjM0LjAyLDIxNy42NTQsMjMxLjk5MywyMTIuNDk1LDIzMS45OTMsMjA2Ljc4NHogTTIzMi43MywyNDcuNjg2YzAtNS41MjYsNC42MDQtMTAuMTM0LDEwLjEzMy0xMC4xMzQNCgkJCQkJYzUuNTI3LDAsMTAuMTMzLDQuNjA2LDEwLjEzMywxMC4xMzRjMCw1LjUyNi00LjYwNSwxMC4xMzMtMTAuMTMzLDEwLjEzM0MyMzcuMzM1LDI1Ny44MTgsMjMyLjczLDI1My4yMTIsMjMyLjczLDI0Ny42ODZ6Ii8+DQoJCQk8L2c+DQoJCTwvZz4NCgkJPGNpcmNsZSBmaWxsPSIjREREREREIiBzdHJva2U9IiNCRkJGQkYiIHN0cm9rZS13aWR0aD0iMTQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgY3g9IjExNS41OTciIGN5PSI5Ni40NjciIHI9IjUwLjUyMiIvPg0KCQkNCgkJCTxsaW5lIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0JGQkZCRiIgc3Ryb2tlLXdpZHRoPSIxNCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiB4MT0iMTUwLjU2MSIgeTE9IjEzMS40MzMiIHgyPSIyMTYuODg3IiB5Mj0iMTk3Ljc1NyIvPg0KCTwvZz4NCgk8ZyBpZD0iTGF5ZXJfMyI+DQoJCTxnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgICAgIj4NCgkJCTxwYXRoIGZpbGw9IiNCRkJGQkYiIGQ9Ik0yMDYuMTkzLDkzLjE1M2MwLTE3LjY4NiwyNS4wNjUtMTkuMDc4LDI1LjA2NS0zMy44MzljMC02Ljk2My01LjQzMi0xMi45NTEtMTYuMjk0LTEyLjk1MQ0KCQkJCWMtMTAuNTg0LDAtMTcuMTI4LDQuNDU3LTIyLjI3OSwxMS40MTlsLTYuOTYzLTcuNTJjNi42ODUtOC43NzQsMTYuOTg4LTE0LjIwNCwzMC4yMTktMTQuMjA0DQoJCQkJYzE2Ljk4OCwwLDI3LjI5NSw5LjYwOSwyNy4yOTUsMjEuNTg1YzAsMjEuMDI4LTI2Ljg3OSwyMi44MzctMjYuODc5LDM2LjQ4NWMwLDIuMjI5LDEuMjU0LDUuMDE0LDMuNjIzLDYuNjg1bC04LjQ5NCwzLjc2DQoJCQkJQzIwNy43MjUsMTAxLjM2OCwyMDYuMTkzLDk3LjQ3LDIwNi4xOTMsOTMuMTUzeiBNMjA2Ljc1MSwxMjQuMDY3YzAtNC4xNzcsMy40NzktNy42NTgsNy42NTgtNy42NTgNCgkJCQljNC4xNzcsMCw3LjY1OSwzLjQ4MSw3LjY1OSw3LjY1OGMwLDQuMTc5LTMuNDgyLDcuNjYtNy42NTksNy42NkMyMTAuMjMsMTMxLjcyOCwyMDYuNzUxLDEyOC4yNDYsMjA2Ljc1MSwxMjQuMDY3eiIvPg0KCQk8L2c+DQoJPC9nPg0KCTxnPg0KCQk8Zz4NCgkJCTxwb2x5bGluZSBmaWxsPSJub25lIiBzdHJva2U9IiNEREREREQiIHN0cm9rZS13aWR0aD0iMTQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRzPSIyNzMsMjU1IDI3MywyNzMgMjU1LDI3MyAJCQkiLz4NCgkJCQ0KCQkJCTxsaW5lIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0RERERERCIgc3Ryb2tlLXdpZHRoPSIxNCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2UtZGFzaGFycmF5PSI0MC41ODgyLDI3LjA1ODgiIHgxPSIyMjcuOTQxIiB5MT0iMjczIiB4Mj0iMzguNTI5IiB5Mj0iMjczIi8+DQoJCQk8cG9seWxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjREREREREIiBzdHJva2Utd2lkdGg9IjE0IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50cz0iMjUsMjczIDcsMjczIDcsMjU1IAkJCSIvPg0KCQkJDQoJCQkJPGxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjREREREREIiBzdHJva2Utd2lkdGg9IjE0IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1kYXNoYXJyYXk9IjQwLjU4ODIsMjcuMDU4OCIgeDE9IjciIHkxPSIyMjcuOTQxIiB4Mj0iNyIgeTI9IjM4LjUyOSIvPg0KCQkJPHBvbHlsaW5lIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0RERERERCIgc3Ryb2tlLXdpZHRoPSIxNCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBwb2ludHM9IjcsMjUgNyw3IDI1LDcgCQkJIi8+DQoJCQkNCgkJCQk8bGluZSBmaWxsPSJub25lIiBzdHJva2U9IiNEREREREQiIHN0cm9rZS13aWR0aD0iMTQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLWRhc2hhcnJheT0iNDAuNTg4MiwyNy4wNTg4IiB4MT0iNTIuMDU5IiB5MT0iNyIgeDI9IjI0MS40NzEiIHkyPSI3Ii8+DQoJCQk8cG9seWxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjREREREREIiBzdHJva2Utd2lkdGg9IjE0IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50cz0iMjU1LDcgMjczLDcgMjczLDI1IAkJCSIvPg0KCQkJDQoJCQkJPGxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjREREREREIiBzdHJva2Utd2lkdGg9IjE0IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1kYXNoYXJyYXk9IjQwLjU4ODIsMjcuMDU4OCIgeDE9IjI3MyIgeTE9IjUyLjA1OSIgeDI9IjI3MyIgeTI9IjI0MS40NzEiLz4NCgkJPC9nPg0KCTwvZz4NCgk8dGV4dCB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDI3LjQ5MDIgMjQzKSIgZmlsbD0iIzdGN0Y3RiIgZm9udC1mYW1pbHk9IidQcm94aW1hTm92YS1SZWd1bGFyJyIgZm9udC1zaXplPSIzMiI+cGhvdG8gbm90IGZvdW5kPC90ZXh0Pg0KPC9nPg0KPC9zdmc+DQo=\";\n \n// try {\n// this.src = self.unavailablePath;\n// }\n// catch (err) {\n// this.src = \"\";\n// }\n });\n \n // Add an event listener to the image to allow users to click it to zoom in\n this.imageContainer.addEventListener('click', function(event) {\n var lightbox = new Lightbox();\n lightbox.showImage(self.imageField.src);\n });\n \n // Add event listeners to activate the edit caption fields\n this.editCaptionContainer = this.imageDiv.querySelector('.ft-item-caption-input-container');\n this.editCaptionInputField = this.imageDiv.querySelector('.ft-item-caption-input');\n this.editCaptionSaveButton = this.imageDiv.querySelector('.ft-item-caption-save-btn');\n this.editCaptionCancelButton = this.imageDiv.querySelector('.ft-item-caption-cancel-btn');\n \n this.captionField.addEventListener('click', function(event) {\n // Toggle the two fields\n self.captionField.classList.add('nodisplay');\n self.editCaptionContainer.classList.remove('nodisplay');\n \n // Fill in the text box with whatever was previously there\n if (self.captionField.innerText != self.unavailableCaption) {\n self.editCaptionInputField.value = self.captionField.innerText;\n }\n else {\n self.editCaptionInputField.value = \"\";\n }\n \n // Focus the text box\n self.editCaptionInputField.focus();\n \n // Allow users to save by pressing Enter and cancel by pressing Escape\n self.editCaptionInputField.addEventListener('keypress', function(event) {\n if (event.keyCode == 13) {\n self.editCaptionSaveButton.dispatchEvent(new Event('click'));\n }\n else if (event.keyCode == 27) {\n self.editCaptionCancelButton.dispatchEvent(new Event('click'));\n }\n });\n \n // Add event listeners to activate the Save and Cancel buttons\n self.editCaptionSaveButton.addEventListener('click', function(event) {\n self.imageModel.setCaption(self.editCaptionInputField.value.trim());\n \n self.captionField.classList.remove('nodisplay');\n self.editCaptionContainer.classList.add('nodisplay');\n });\n self.editCaptionCancelButton.addEventListener('click', function(event) {\n self.captionField.classList.remove('nodisplay');\n self.editCaptionContainer.classList.add('nodisplay');\n });\n });\n \n this.setImageModel(imageModel);\n };\n\n _.extend(ImageRenderer.prototype, {\n \t_formatDate: function(date) {\n var hours = date.getHours();\n var minutes = date.getMinutes();\n var AMPM = (hours < 12 ? \"AM\" : \"PM\");\n hours = hours % 12;\n hours = (hours === 0 ? 12 : hours);\n minutes = (minutes < 10 ? \"0\" : \"\") + minutes;\n \n return date.toDateString() + \", \" + hours + \":\" + minutes + \" \" + AMPM;\n },\n \n /**\n * Returns an element representing the ImageModel, which can be attached to the DOM\n * to display the ImageModel.\n */\n getElement: function() {\n return this.imageOuterDiv;\n },\n\n /**\n * Returns the ImageModel represented by this ImageRenderer.\n */\n getImageModel: function() {\n return this.imageModel;\n },\n\n /**\n * Sets the ImageModel represented by this ImageRenderer, changing the element and its\n * contents as necessary.\n */\n setImageModel: function(imageModel) {\n // Unregister from the old model \n this.imageModel.removeListener(this.modelDidChangeListenerFunction);\n \n // Save the new ImageModel and update our rendering\n this.imageModel = imageModel;\n \n var imagePath = imageModel.getPath() || this.unavailablePath;\n var captionText = imageModel.getCaption();\n captionText = (captionText.length === 0 ? this.unavailableCaption : captionText);\n \n this.imageField.src = imagePath;\n this.captionField.innerText = captionText;\n this.nameField.innerText = imagePath; // (imagePath.search(/^images\\//) === -1 ? (imagePath || unavailableName) : imagePath.split('/').slice(1).join('/'));\n this.dateField.innerText = this._formatDate(imageModel.getModificationDate());\n this.ratingsInstance.setModel(this.imageModel);\n// this.ratingsInstance.setRating(imageModel.getRating());\n \n // Reregister the new model\n this.imageModel.addListener(this.modelDidChangeListenerFunction);\n },\n\n /**\n * Changes the rendering of the ImageModel to either list or grid view.\n * @param viewType A string, either LIST_VIEW or GRID_VIEW\n */\n setToView: function(viewType) {\n this.currentView = viewType;\n \n if (viewType == LIST_VIEW) {\n this.imageDiv.classList.add('ft-item-list-view');\n this.imageContainer.classList.add('ft-item-image-container-list-view');\n this.metadataContainer.classList.add('ft-item-metadata-container-list-view')\n }\n else if (viewType = GRID_VIEW) {\n this.imageDiv.classList.remove('ft-item-list-view');\n this.imageContainer.classList.remove('ft-item-image-container-list-view');\n this.metadataContainer.classList.remove('ft-item-metadata-container-list-view')\n }\n },\n\n /**\n * Returns a string of either LIST_VIEW or GRID_VIEW indicating which view type it is\n * currently rendering.\n */\n getCurrentView: function() {\n \t return this.currentView;\n }\n });\n\n\n /**\n * A factory is an object that creates other objects. In this case, this object will create\n * objects that fulfill the ImageRenderer class's contract defined above.\n */\n var ImageRendererFactory = function() {\n };\n\n _.extend(ImageRendererFactory.prototype, {\n\n /**\n * Creates a new ImageRenderer object for the given ImageModel\n */\n createImageRenderer: function(imageModel) {\n return new ImageRenderer(imageModel);\n }\n });\n\n\n /**\n * An object representing a DOM element that will render an ImageCollectionModel.\n * Multiple such objects can be created and added to the DOM (i.e., you shouldn't\n * assume there is only one ImageCollectionView that will ever be created).\n */\n var ImageCollectionView = function() {\n var self = this;\n this.currentView = GRID_VIEW;\n \n // Clone the template\n var collectionTemplate = document.getElementById('image-collection-template').content;\n this.collectionOuterDiv = document.createElement('div');\n this.collectionOuterDiv.appendChild(document.importNode(collectionTemplate, true));\n \n this.collectionDiv = this.collectionOuterDiv.querySelector('.ft-container');\n \n this.emptyMessageDiv = this.collectionOuterDiv.querySelector('.ft-empty-container');\n \n // Keep a reference to the ImageCollectionModel\n this.imageCollectionModel = undefined;\n \n // Keep a reference to an ImageRendererFactory\n this.imageRendererFactory = new ImageRendererFactory();\n \n // Keep a collection of ImageRenderers\n this.imageRendererDivPairs = [];\n \n // Define the listener function for model changes\n this.modelDidChangeListenerFunction = function(eventType, imageModelCollection, imageModel, eventDate) {\n if (eventType == 'IMAGE_ADDED_TO_COLLECTION_EVENT') {\n self._renderModelToView(imageModel);\n }\n else if (eventType == 'IMAGE_REMOVED_FROM_COLLECTION_EVENT') {\n self._unrenderModelFromView(imageModel);\n }\n else if (eventType == 'IMAGE_META_DATA_CHANGED_EVENT') {\n //self._refreshUpdatedModel(imageModel);\n }\n };\n \n // Define the listener function for view changes\n this.viewDidChangeListenerFunction = function(toolbar, eventType, eventDate) {\n if (eventType == LIST_VIEW || eventType == GRID_VIEW) {\n self.setToView(eventType);\n }\n else if (eventType = RATING_CHANGE) {\n self._filterByRating(toolbar.getCurrentRatingFilter());\n }\n };\n };\n\n _.extend(ImageCollectionView.prototype, {\n _checkInit: function() {\n if (!(this.imageCollectionModel && this.imageRendererFactory)) {\n throw new Error(\"ImageCollectionView has not been initialized yet.\");\n }\n },\n \n /**\n * Renders a given ImageModel to the view and adds an ImageRenderer object\n * to the internal collection\n */\n _renderModelToView: function(imageModel) {\n this._checkInit();\n \n var self = this;\n \n // Create the container to hold the ImageRenderer\n var container = document.createElement('div');\n container.className = \"ft-icv-item-container ft-icv-item-container-new\";\n \n // Copy the delete overlay into the container\n var deleteTemplate = document.getElementById('image-item-delete-overlay-template').content;\n container.appendChild(document.importNode(deleteTemplate, true));\n \n // Add event listeners to activate the delete buttons\n var deleteMessage = container.querySelector('.ft-item-delete-overlay-content-message');\n var deleteHoverIcon = container.querySelector('.ft-item-delete-icon');\n var deleteOverlay = container.querySelector('.ft-item-delete-overlay');\n var deleteRemoveButton = deleteOverlay.querySelector('.btn-danger');\n var deleteCancelButton = deleteOverlay.querySelector('.btn-light');\n \n container.addEventListener('mouseover', function(event) {\n deleteHoverIcon.classList.remove('nodisplay');\n });\n container.addEventListener('mouseout', function(event) {\n deleteHoverIcon.classList.add('nodisplay');\n });\n \n deleteHoverIcon.addEventListener('mousemove', function(event) {\n deleteHoverIcon.classList.remove('nodisplay');\n });\n deleteHoverIcon.addEventListener('click', function(event) {\n deleteOverlay.classList.remove('nodisplay');\n });\n \n deleteRemoveButton.addEventListener('click', function(event) {\n deleteRemoveButton.disabled = true;\n deleteCancelButton.disabled = true;\n deleteMessage.innerHTML = 'Removing&hellip;';\n \n self.getImageCollectionModel().removeImageModel(imageModel);\n });\n \n deleteCancelButton.addEventListener('click', function(event) {\n deleteOverlay.classList.add('ft-item-delete-hidden');\n });\n \n deleteOverlay.addEventListener('webkitAnimationEnd', function(event) {\n if (deleteOverlay.classList.contains('ft-item-delete-hidden')) {\n deleteOverlay.classList.add('nodisplay');\n deleteOverlay.classList.remove('ft-item-delete-hidden');\n }\n });\n deleteOverlay.addEventListener('animationend', function(event) {\n if (deleteOverlay.classList.contains('ft-item-delete-hidden')) {\n deleteOverlay.classList.add('nodisplay');\n deleteOverlay.classList.remove('ft-item-delete-hidden');\n }\n });\n \n // Create an ImageRenderer for the ImageModel\n var renderer = this.imageRendererFactory.createImageRenderer(imageModel);\n \n // Append the ImageRenderer element to the container\n container.appendChild(renderer.getElement());\n \n // Add the container to the DOM\n this.emptyMessageDiv.classList.add('nodisplay');\n var divOnDom = this.collectionDiv.appendChild(container);\n \n renderer.setToView(this.currentView);\n divOnDom.classList.remove('nodisplay');\n setTimeout(function() {\n divOnDom.classList.remove('ft-icv-item-container-new');\n }, 750);\n// divOnDom.scrollIntoView(true);\n \n this.imageRendererDivPairs.push({imageRenderer: renderer, divOnDom: divOnDom});\n },\n \n /**\n * Removes a given ImageModel from the view and removes the corresponding\n * ImageRenderer object(s) from the internal collection\n */\n _unrenderModelFromView: function(imageModel) {\n this._checkInit();\n \n var self = this;\n \n var pair;\n var findImageModelPredicate = function(pair) {\n return pair.imageRenderer.getImageModel() == imageModel;\n };\n while (pair = _.find(this.imageRendererDivPairs, findImageModelPredicate)) {\n var divToRemove = pair.divOnDom;\n \n // Add the .ft-icv-item-container-deleted class to animate out\n // the deletion before removing it from the DOM\n divToRemove.classList.add('ft-icv-item-container-deleted');\n \n setTimeout(function() {\n self.collectionDiv.removeChild(divToRemove);\n }, 500);\n \n var index = this.imageRendererDivPairs.indexOf(pair);\n if (index !== -1) {\n this.imageRendererDivPairs.splice(index, 1);\n }\n }\n \n setTimeout(function() {\n if (self.imageRendererDivPairs.length === 0) {\n self.emptyMessageDiv.classList.remove('nodisplay');\n }\n }, 500);\n },\n \n /**\n * Convenience functions to re-render an ImageCollectionModel \n */\n _rerenderAll: function() {\n this._checkInit();\n this._unrenderAll();\n \n var self = this;\n \n _.each(this.imageCollectionModel.getImageModels(), function(imageModel) {\n self._renderModelToView(imageModel);\n });\n },\n \n _unrenderAll: function() {\n while (this.imageRendererDivPairs.length > 0) {\n this._unrenderModelFromView(this.imageRendererDivPairs[0].imageRenderer.getImageModel());\n }\n },\n \n /**\n * Shows / hides all the currently-rendered DIVs based on the rating\n */\n _filterByRating: function(rating) {\n _.each(this.imageRendererDivPairs, function(pair) {\n if (pair.imageRenderer.getImageModel().getRating() >= rating) {\n pair.divOnDom.classList.remove('nodisplay');\n }\n else {\n pair.divOnDom.classList.add('nodisplay');\n }\n })\n },\n \n /**\n * Attaches the view to a toolbar for view updating the view mode and filter\n */\n attachToToolbar: function(toolbar) {\n toolbar.addListener(this.viewDidChangeListenerFunction);\n \n this.setToView(toolbar.getCurrentView());\n },\n \n /**\n * Detaches the view from a toolbar\n */\n detachFromToolbar: function(toolbar) {\n toolbar.removeListener(this.viewDidChangeListenerFunction);\n },\n \n /**\n * Returns an element that can be attached to the DOM to display the ImageCollectionModel\n * this object represents.\n */\n getElement: function() {\n return this.collectionOuterDiv;\n },\n\n /**\n * Gets the current ImageRendererFactory being used to create new ImageRenderer objects.\n */\n getImageRendererFactory: function() {\n return this.imageRendererFactory;\n },\n \n /**\n * Sets the ImageRendererFactory to use to render ImageModels. When a *new* factory is provided,\n * the ImageCollectionView should redo its entire presentation, replacing all of the old\n * ImageRenderer objects with new ImageRenderer objects produced by the factory.\n */\n setImageRendererFactory: function(imageRendererFactory) {\n // Set the new image renderer factory\n this.imageRendererFactory = imageRendererFactory;\n \n // Remove and regenerate all the images if we have a model\n if (this.imageCollectionModel) {\n this._rerenderAll();\n }\n },\n\n /**\n * Returns the ImageCollectionModel represented by this view.\n */\n getImageCollectionModel: function() {\n return this.imageCollectionModel;\n },\n\n /**\n * Sets the ImageCollectionModel to be represented by this view. When setting the ImageCollectionModel,\n * you should properly register/unregister listeners with the model, so you will be notified of\n * any changes to the given model.\n */\n setImageCollectionModel: function(imageCollectionModel) {\n // Unregister with the old model\n if (this.imageCollectionModel) {\n this.imageCollectionModel.removeListener(this.modelDidChangeListenerFunction);\n }\n \n // Set the new ImageCollectionModel\n this.imageCollectionModel = imageCollectionModel;\n \n // Register as a listener to the new model\n this.imageCollectionModel.addListener(this.modelDidChangeListenerFunction);\n \n // Rerender all the images\n this._rerenderAll();\n },\n\n /**\n * Changes the presentation of the images to either grid view or list view.\n * @param viewType A string of either LIST_VIEW or GRID_VIEW.\n */\n setToView: function(viewType) {\n this._checkInit();\n \n if (viewType != LIST_VIEW && viewType != GRID_VIEW) {\n throw new Error(\"Invalid viewType to ImageCollectionView.setToView: \" + viewType);\n }\n \n this.currentView = viewType;\n \n // Change the container view\n if (viewType == LIST_VIEW) {\n this.collectionDiv.classList.add('ft-container-list-view');\n }\n else if (viewType == GRID_VIEW) {\n this.collectionDiv.classList.remove('ft-container-list-view');\n }\n \n // Notify all the ImageRenderers to update their views\n _.each(this.imageRendererDivPairs, function(pair) {\n pair.imageRenderer.setToView(viewType);\n });\n },\n\n /**\n * Returns a string of either LIST_VIEW or GRID_VIEW indicating which view type is currently\n * being rendered.\n */\n getCurrentView: function() {\n return this.curentView;\n }\n });\n\n\n /**\n * An object representing a DOM element that will render the toolbar to the screen.\n */\n var Toolbar = function() {\n var self = this;\n this.listeners = [];\n \n \t// Clone the template\n var toolbarTemplate = document.getElementById('toolbar-template').content;\n this.toolbarDiv = document.importNode(toolbarTemplate, true);\n \n // Attach an event listener to the ratings clear button\n var ratingsClearButton = this.toolbarDiv.querySelector('.ft-nav-options-filter-clear-btn');\n ratingsClearButton.addEventListener('click', function(event) {\n self.setRatingFilter(0);\n });\n \n // Add a live RatingsView to track the filter\n var models = createModelModule();\n this.ratingsModel = new models.RatingsModel();\n this.ratingsModel.addListener(function(ratingsModel, eventTime) {\n if (ratingsModel.getRating() === 0) {\n ratingsClearButton.classList.add('hidden');\n }\n else { \n ratingsClearButton.classList.remove('hidden');\n }\n \n self._notify(self, RATING_CHANGE);\n });\n this.ratingsInstance = new RatingsView(this.ratingsModel, true);\n // true to disable the caption ^~~~\n \n // Attach the RatingsView to the div\n this.toolbarDiv.querySelector('.ft-nav-options-items-rating').appendChild(this.ratingsInstance.getElement());\n \n // Manage the view\n this.gridViewSelectButton = this.toolbarDiv.querySelectorAll('.ft-nav-options-view')[0];\n this.gridViewSelectButton.addEventListener('click', function(event) {\n self.setToView(GRID_VIEW);\n });\n this.listViewSelectButton = this.toolbarDiv.querySelectorAll('.ft-nav-options-view')[1];\n this.listViewSelectButton.addEventListener('click', function(event) {\n self.setToView(LIST_VIEW);\n });\n \n this.currentView = GRID_VIEW;\n this.setToView(this.currentView);\n };\n\n _.extend(Toolbar.prototype, {\n _notify: function(toolbar, eventType, eventDate) {\n _.each(this.listeners, function(listener) {\n listener(toolbar, eventType, eventDate || Date.now());\n });\n },\n \n /**\n * Returns an element representing the toolbar, which can be attached to the DOM.\n */\n getElement: function() {\n return this.toolbarDiv;\n },\n\n /**\n * Registers the given listener to be notified when the toolbar changes from one\n * view type to another.\n * @param listener_fn A function with signature (toolbar, eventType, eventDate), where\n * toolbar is a reference to this object, eventType is a string of\n * either, LIST_VIEW, GRID_VIEW, or RATING_CHANGE representing how\n * the toolbar has changed (specifically, the user has switched to\n * a list view, grid view, or changed the star rating filter).\n * eventDate is a Date object representing when the event occurred.\n */\n addListener: function(listener_fn) {\n if (!_.isFunction(listener_fn)) {\n throw new Error(\"Invalid arguments to Toolbar.addListener: \" + JSON.stringify(arguments));\n }\n \n this.listeners.push(listener_fn);\n },\n\n /**\n * Removes the given listener from the toolbar.\n */\n removeListener: function(listener_fn) {\n if (!_.isFunction(listener_fn)) {\n throw new Error(\"Invalid arguments to Toolbar.removeListener: \" + JSON.stringify(arguments));\n }\n \n var index = this.listeners.indexOf(listener_fn);\n \n if (index !== -1) {\n this.listeners.splice(index, 1);\n }\n },\n\n /**\n * Sets the toolbar to either grid view or list view.\n * @param viewType A string of either LIST_VIEW or GRID_VIEW representing the desired view.\n */\n setToView: function(viewType) {\n if (viewType != LIST_VIEW && viewType != GRID_VIEW) {\n throw new Error(\"Invalid viewType to Toolbar.setToView: \" + viewType);\n }\n \n this.currentView = viewType;\n \n if (viewType == LIST_VIEW) {\n this.gridViewSelectButton.classList.remove('ft-nav-options-view-selected');\n this.listViewSelectButton.classList.add('ft-nav-options-view-selected');\n }\n else if (viewType == GRID_VIEW) {\n this.gridViewSelectButton.classList.add('ft-nav-options-view-selected');\n this.listViewSelectButton.classList.remove('ft-nav-options-view-selected');\n }\n \n this._notify(this, viewType);\n },\n\n /**\n * Returns the current view selected in the toolbar, a string that is\n * either LIST_VIEW or GRID_VIEW.\n */\n getCurrentView: function() {\n return this.currentView;\n },\n\n /**\n * Returns the current rating filter. A number in the range [0,5], where 0 indicates no\n * filtering should take place.\n */\n getCurrentRatingFilter: function() {\n \t return this.ratingsInstance.getRating();\n },\n\n /**\n * Sets the rating filter.\n * @param rating An integer in the range [0,5], where 0 indicates no filtering should take place.\n */\n setRatingFilter: function(rating) {\n this.ratingsInstance.setRating(rating);\n \n this._notify(this, RATING_CHANGE);\n }\n });\n\n\n /**\n * An object that will allow the user to choose images to display.\n * @constructor\n */\n var FileChooser = function() {\n this.listeners = [];\n this._init();\n };\n\n _.extend(FileChooser.prototype, {\n _notify: function(fileChooser, files, eventDate) {\n _.each(this.listeners, function(listener_fn) {\n listener_fn(fileChooser, files, eventDate);\n });\n },\n \n // This code partially derived from: http://www.html5rocks.com/en/tutorials/file/dndfiles/\n _init: function() {\n var self = this;\n \n // Clone the file chooser template\n this.fileChooserDiv = document.createElement('div');\n var fileChooserTemplate = document.getElementById('file-chooser');\n this.fileChooserDiv.appendChild(document.importNode(fileChooserTemplate.content, true));\n \n // Attach an event listener to update our listeners when users select files\n var fileChooserInput = this.fileChooserDiv.querySelector('.ft-file-input');\n fileChooserInput.addEventListener('change', function(evt) {\n var files = evt.target.files;\n var eventDate = Date.now();\n self._notify(self, files, eventDate);\n \n // Clear .value, otherwise onchange won't fire if users select the same file\n // multiple times in a row\n fileChooserInput.value = null;\n \n// _.each(\n// self.listeners,\n// function(listener_fn) {\n// listener_fn(self, files, eventDate);\n// }\n// );\n });\n \n // Attach event listeners for when users drag/drop files\n var fileChooserContainer = this.fileChooserDiv.querySelector('.ft-file-input-container');\n fileChooserContainer.addEventListener('dragover', function(event) {\n event.stopPropagation();\n event.preventDefault();\n event.dataTransfer.dropEffect = 'copy';\n \n this.classList.add('ft-file-input-container-dragging')\n });\n fileChooserContainer.addEventListener('dragleave', function(event) {\n this.classList.remove('ft-file-input-container-dragging');\n });\n fileChooserContainer.addEventListener('drop', function(event) {\n event.stopPropagation();\n event.preventDefault();\n \n this.classList.remove('ft-file-input-container-dragging');\n \n self._notify(self, event.dataTransfer.files, Date.now());\n });\n },\n\n /**\n * Returns an element that can be added to the DOM to display the file chooser.\n */\n getElement: function() {\n return this.fileChooserDiv;\n },\n\n /**\n * Adds a listener to be notified when a new set of files have been chosen.\n * @param listener_fn A function with signature (fileChooser, fileList, eventDate), where\n * fileChooser is a reference to this object, fileList is a list of files\n * as returned by the File API, and eventDate is when the files were chosen.\n */\n addListener: function(listener_fn) {\n if (!_.isFunction(listener_fn)) {\n throw new Error(\"Invalid arguments to FileChooser.addListener: \" + JSON.stringify(arguments));\n }\n\n this.listeners.push(listener_fn);\n },\n\n /**\n * Removes the given listener from this object.\n * @param listener_fn\n */\n removeListener: function(listener_fn) {\n if (!_.isFunction(listener_fn)) {\n throw new Error(\"Invalid arguments to FileChooser.removeListener: \" + JSON.stringify(arguments));\n }\n this.listeners = _.without(this.listeners, listener_fn);\n }\n });\n \n \n /**\n * An object which manages a ratings view.\n * @constructor\n */\n var RatingsView = function(imageModel, disableCaption) {\n this.model = imageModel;\n this.disableCaption = disableCaption;\n var self = this;\n \n this.userDidInitiateChange = false;\n \n // Add listener to the model to update the views\n this.modelDidUpdateListenerFunction = function(imageModel, eventTime) {\n self.updateStars(imageModel.getRating(), true);\n };\n this.model.addListener(this.modelDidUpdateListenerFunction);\n \n // Clone the template\n var ratingsTemplate = document.getElementById('ratings-template').content;\n this.ratingsDiv = document.importNode(ratingsTemplate, true);\n \n this.starsDiv = this.ratingsDiv.querySelectorAll('div')[0];\n this.captionDiv = this.ratingsDiv.querySelectorAll('div')[1];\n \n // Function to return the star index of a click event in the view\n this.starIndexOfClickEvent = function(event) {\n var starIndex = -1;\n for (var i = 4; i >= 0; i--) {\n if (event.clientX > this.starsDiv.children[i].getBoundingClientRect().left) {\n starIndex = i;\n break;\n }\n }\n \n return starIndex;\n };\n \n // Add an event listener to handle the mouseover\n this.lastUpdateTime = 0;\n this.starsDiv.addEventListener('mousemove', function(event) {\n // this = starsDiv\n var starIndex = self.starIndexOfClickEvent(event);\n self.updateStars(starIndex + 1);\n \n if (!self.disableCaption) {\n self.captionDiv.classList.remove('hidden');\n \n // .lastUpdateTime enforces that the \"rating updated\" message should stay on the\n // screen for at least 1 second as long as the user stays on the same star.\n // Also works around a bug in Chrome for Windows where mousemove fires on mouse clicks\n if (Date.now() - self.lastUpdateTime >= 100) {\n if (starIndex === -1) {\n self.captionDiv.innerText = \"Click to clear rating\";\n }\n else {\n self.captionDiv.innerText = \"Click to rate \"\n + (starIndex + 1)\n + ((starIndex + 1) === 1 ? \" star\" : \" stars\");\n }\n }\n }\n });\n \n // Add an event to clear the view when the user mouseouts\n this.starsDiv.addEventListener('mouseout', function(event) {\n self.lastUpdateTime = 0;\n self.updateStars(self.model.getRating());\n \n if (!self.disableCaption) {\n self.captionDiv.classList.add('hidden');\n }\n });\n \n // Add an event to change the rating on click\n this.starsDiv.addEventListener('click', function(event) {\n var starIndex = self.starIndexOfClickEvent(event);\n \n self.userDidInitiateChange = true;\n self.lastUpdateTime = Date.now();\n self.model.setRating(starIndex + 1);\n });\n \n // Update the stars view\n this.updateStars(self.model.getRating());\n };\n \n _.extend(RatingsView.prototype, {\n updateStars: function(starCount, showUpdatedMessage) {\n for (var i = 0; i < 5; i++) {\n this.starsDiv.children[i].src\n = (i < starCount\n ? \"star-filled.svg\"\n : \"star-empty.svg\");\n }\n \n if (!this.disableCaption) {\n if (showUpdatedMessage && this.userDidInitiateChange) {\n this.captionDiv.classList.remove('hidden');\n this.captionDiv.classList.add('caption-success');\n this.captionDiv.innerText = \"Rating updated\";\n }\n else if (Date.now() - this.lastUpdateTime >= 100) {\n this.captionDiv.classList.remove('caption-success');\n }\n this.userDidInitiateChange = false;\n }\n },\n \n setRating: function(starCount) {\n this.model.setRating(starCount);\n },\n \n getRating: function() {\n return this.model.getRating()\n },\n \n getElement: function() {\n return this.ratingsDiv;\n },\n \n getModel: function() {\n return this.model;\n },\n \n setModel: function(newImageModel) {\n this.model.removeListener(this.modelDidUpdateListenerFunction);\n \n this.model = newImageModel;\n this.model.addListener(this.modelDidUpdateListenerFunction);\n }\n });\n \n \n /**\n * A lightbox view for modally displaying an image.\n * @constructor \n */\n var Lightbox = function() {\n // Clone the template\n this.lightboxTemplate = document.getElementById('lightbox-template').content;\n };\n \n _.extend(Lightbox.prototype, {\n /**\n * Show a lightbox on attachToDiv (or document.body if undefined) with\n * the image at imagePath\n */\n showImage: function(imagePath, attachToDiv) {\n var lightboxDiv = document.createElement('div');\n lightboxDiv.appendChild(document.importNode(this.lightboxTemplate, true));\n \n var image = lightboxDiv.querySelector('.lightbox-content');\n image.src = imagePath;\n \n// var closeButton = lightboxDiv.querySelector('.lightbox-close-hint');\n// closeButton.addEventListener('click', function(event) {\n// document.body.removeChild(document.querySelector('.lightbox'));\n// });\n \n // Add an event listener to allow users to click anywhere to close the lightbox\n var lightboxOnDom = document.body.appendChild(lightboxDiv);\n \n lightboxOnDom.addEventListener('click', function(event) {\n this.classList.add('lightbox-hidden');\n \n this.addEventListener('webkitAnimationEnd', function(event) {\n document.body.removeChild(this);\n });\n this.addEventListener('animationend', function(event) {\n document.body.removeChild(this);\n });\n });\n }\n });\n \n\n // Return an object containing all of our classes and constants\n return {\n ImageRenderer: ImageRenderer,\n ImageRendererFactory: ImageRendererFactory,\n ImageCollectionView: ImageCollectionView,\n Toolbar: Toolbar,\n FileChooser: FileChooser,\n \n RatingsView: RatingsView,\n Lightbox: Lightbox,\n\n LIST_VIEW: LIST_VIEW,\n GRID_VIEW: GRID_VIEW,\n RATING_CHANGE: RATING_CHANGE\n };\n}", "render () {\n throw new Error('render function must be override!')\n }", "render() {\n // Subclasses should override\n }", "rendered() {\n\t\t\t\tthis.hasStorePropsChanged_ = false;\n\t\t\t\tthis.hasOwnPropsChanged_ = false;\n\t\t\t}", "render(...args) {\n if (this._render) {\n this.__notify(EV.BEFORE_RENDER);\n this._render(...args);\n this.__notify(EV.RENDERED);\n }\n\n this.rendered = true;\n }", "_triggerLoaded() {\n\t if (this._alreadyLoaded) {\n\t // Do not trigger event twice\n\t this._triggerUpdated();\n\t return;\n\t }\n\t this._alreadyLoaded = true;\n\t const registry = storage.getRegistry(this._instance);\n\t const events = registry.events;\n\t events.fire('view-loaded', this);\n\t // Trigger onLoad event for child view\n\t if (this.onLoad !== null) {\n\t const onLoad = this.onLoad;\n\t this.onLoad = null;\n\t onLoad();\n\t }\n\t }", "function TView() {}", "function TView() {}", "function TView() {}", "render() {\n this.refresh();\n }", "function checkView(hostView,component){var hostTView=hostView[TVIEW];var oldView=enterView(hostView,hostView[HOST_NODE]);var templateFn=hostTView.template;var viewQuery=hostTView.viewQuery;try{namespaceHTML();createViewQuery(viewQuery,hostView,component);templateFn(getRenderFlags(hostView),component);refreshDescendantViews(hostView);updateViewQuery(viewQuery,hostView,component);}finally{leaveView(oldView);}}", "function actuallyRender() {\n var options = root._options();\n var manager = root.__manager__;\n var parent = manager.parent;\n var rentManager = parent && parent.__manager__;\n\n // The `_viewRender` method is broken out to abstract away from having\n // too much code in `processRender`.\n root._render(LayoutManager._viewRender, options).done(function() {\n // If there are no children to worry about, complete the render\n // instantly.\n if (!_.keys(root.views).length) {\n return resolve();\n }\n\n // Create a list of promises to wait on until rendering is done.\n // Since this method will run on all children as well, its sufficient\n // for a full hierarchical. \n var promises = _.map(root.views, function(view) {\n var append = _.isArray(view);\n\n // If items are being inserted, they will be in a non-zero length\n // Array.\n if (append && view.length) {\n // Only need to wait for the first View to complete, the rest\n // will be synchronous, by virtue of having the template cached.\n return view[0].render().pipe(function() {\n // Map over all the View's to be inserted and call render on\n // them all. Once they have all resolved, resolve the other\n // deferred.\n return options.when(_.map(view.slice(1), function(insertView) {\n return insertView.render();\n }));\n });\n }\n\n // Only return the fetch deferred, resolve the main deferred after\n // the element has been attached to it's parent.\n return !append ? view.render() : view;\n });\n\n // Once all nested Views have been rendered, resolve this View's\n // deferred.\n options.when(promises).done(function() {\n resolve();\n });\n });\n }", "render() {\n ParentView.prototype.render.call(this);\n\n this._reviewViews = this.model.get('reviews').map(review => {\n const $reviewEl = this.$(`#review${review.id}`);\n\n const view = new RB.ReviewRequestPage.ReviewView({\n el: $reviewEl,\n model: review,\n entryModel: this.model,\n $bannerFloatContainer: $reviewEl,\n $bannerParent: $reviewEl.children('.banners'),\n bannerNoFloatContainerClass: 'collapsed',\n });\n view.render();\n\n this.setupReviewView(view);\n\n return view;\n });\n\n if (this.model.get('pendingStatusUpdates')) {\n this.model.watchUpdates(this.CHECK_UPDATES_MS);\n }\n\n return this;\n }", "render(){return renderNotImplemented;}", "render() {\n return this.renderContent()\n }", "needsRender (dt) {\n return true\n }", "function LView(){}", "onBecameVisible() {\n\n // Start rendering if needed\n if (!this.isRendering) {\n this.isRendering = true\n this.render()\n }\n\n }", "render() {\n this._userEvent('beforeRender');\n const html = this.template.render({data: this.viewData}, (data) => {\n return this.wrapTemplate(data);\n });\n if (!this.wrapper) {\n this.wrapper = this._createWrapper();\n }\n this.updateNode(this.wrapper, html);\n this.resize();\n this._userEvent('afterRender');\n }", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "_requestRender() { this._invalidateProperties(); }", "render() {\n if (!this.initialized) this.init();\n }", "onViewParsed() {\n\n }", "didRender() {\n super.didRender(...arguments);\n\n if (!get(this, 'isDestroyed') && !get(this, 'isDestroying')) {\n this._syncScroll();\n }\n }", "onRender()\n {\n var disabledDelete = this.model.get('origin') !== null;\n $(this.ui.buttonDelete).attr('disabled', disabledDelete); \n var disabledDownload = this.model.get('download') === null;\n $(this.ui.buttonDownload).attr('disabled', disabledDownload); \n var disableView = this.model.get('viewer_url') === null || disabledDownload;\n $(this.ui.buttonView).attr('disabled', disableView);\n }", "function isRendered(control) {\n\t\t\treturn ko.unwrap(control.rendered);\n\t\t}", "didRender(){\n this._super(...arguments);\n\n // call setEditImages\n this.setEditImages();\n }", "render() {\n // always reinit on render\n this.init();\n }", "render() {\n // always reinit on render\n this.init();\n }", "function lateRender() {\n\t\tsetTimeout( function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\t\t\trenderView();\n\t\t\t\t\t}\n\t\t\t\t}, 0);\n\t}", "isMultiView() {\n return !contains(this.queryDataModel.originalData.type, 'single-view');\n }", "renderList (ViewClass, options) {\n const View = (ViewClass || ListItem)\n\n this.list = this.renderCollection( // CollectionView\n this.collection,\n View,\n this.queryByHook('list-container'),\n options || {}\n )\n\n this.listenTo(App.state.searchbox, 'onrow', (data) => {\n const row = data.row\n const hit = data.hit\n if (hit) {\n row.show = true\n } else {\n row.show = false\n row.selected = false\n }\n })\n\n //this.listenToAndRun(App.state.searchbox, 'change:search', this.search)\n //this.listenTo(App.state.searchbox, 'change:rowsViews', this.search)\n\n // set row views when fetch is complete\n this.listenToAndRun(this.collection, 'sync', function () {\n SearchboxActions.resetRowsViews(this.list.views)\n })\n }", "_onRenderedDataChange() {\n if (!this._renderedRange) {\n return;\n }\n this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end);\n if (!this._differ) {\n this._differ = this._differs.find(this._renderedItems).create(this.cdkVirtualForTrackBy);\n }\n this._needsUpdate = true;\n }", "render() { return super.render(); }", "renderAllViewComponents() {\n this._views.forEach((view) => {\n if (view && view.dataContext) {\n this.renderViewModel(view.dataContext);\n }\n });\n }", "_afterRender () {\n this.adjust();\n }", "get View() {}" ]
[ "0.65954155", "0.65325737", "0.6409883", "0.6398221", "0.6382312", "0.6382312", "0.6371436", "0.62967384", "0.62914705", "0.6161445", "0.6116898", "0.6092733", "0.60922515", "0.6086017", "0.60699826", "0.60437137", "0.603137", "0.60267735", "0.60247856", "0.6021356", "0.5968712", "0.59176344", "0.5914876", "0.5876342", "0.58661675", "0.5862889", "0.5856266", "0.5840442", "0.58394873", "0.5824733", "0.58064455", "0.58046025", "0.5768476", "0.5734215", "0.5723399", "0.5723399", "0.5722232", "0.57145697", "0.5714077", "0.57104635", "0.5694502", "0.5689401", "0.56691253", "0.56679636", "0.56648964", "0.56535536", "0.56535536", "0.56318235", "0.56022483", "0.5599949", "0.55975276", "0.55972385", "0.55612314", "0.55519044", "0.55501795", "0.5548218", "0.5544704", "0.55224943", "0.5512882", "0.550998", "0.5508781", "0.5505843", "0.5495741", "0.5492604", "0.5489508", "0.54837626", "0.54837626", "0.54837626", "0.5483482", "0.54829067", "0.5476779", "0.54703164", "0.5463558", "0.54575133", "0.5450895", "0.54448813", "0.5441572", "0.544081", "0.5437887", "0.5437887", "0.5437887", "0.5437887", "0.5437887", "0.5432793", "0.5431021", "0.5414887", "0.5413795", "0.5406541", "0.5406268", "0.54006827", "0.5395472", "0.5395472", "0.53910595", "0.5389411", "0.53892714", "0.53809845", "0.5377565", "0.5374086", "0.53730243", "0.5365215" ]
0.59581727
21
Add a hasmany relationship for this model. When retrieving models of the current type, N model objects of the specified type may be retrieved.
addHasMany( child, options ) { if( options == undefined ) { options = {}; } this._hasMany.push( { child, options } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static hasMany( model, options ) {\n\t\tif( this.name == \"Model\" ) {\n\t\t\tthrow \"Cannot invoke method directly on Model class\";\n\t\t}\n\n\t\tcache.relationships( this.name ).addHasMany( model, options );\n\t}", "static associate(models) {\n this.hasMany(models.Image, {\n foreignKey: \"imageableId\",\n onDelete: \"CASCADE\",\n hooks: true,\n scope: {\n imageableType: \"product\",\n },\n });\n\n this.hasMany(models.Arrival, {\n foreignKey: \"productId\",\n onDelete: \"CASCADE\",\n hooks: true,\n });\n\n this.belongsTo(models.Category, {\n foreignKey: \"categoryId\",\n });\n\n this.belongsToMany(models.Bill, {\n through: \"BillProducts\",\n });\n\n this.belongsToMany(models.Cart, {\n through: \"CartProducts\",\n });\n\n this.belongsToMany(models.Wishlist, {\n through: \"WishlistProducts\",\n });\n }", "static associate(models) {\n // define association here\n ProductCategory.hasMany(models.Product)\n ProductCategory.hasMany(models.ProductCategory, {\n foreignKey: 'parentId',\n })\n }", "static associate(models) {\n // define association here\n models.producto.belongsToMany(models.lista_producto, {through: this, foreignKey: 'productoId'})\n models.lista_producto.belongsToMany(models.producto, {through: this, foreignKey: 'listaId'})\n }", "static associate(models) {\n // define association here\n // N:M\n models.Pedido.belongsToMany(models.Producto, {\n through: {\n model: \"PedidoProductos\",\n },\n foreignKey: \"pedidoId\"\n })\n // N:1\n models.Pedido.belongsTo(models.Cliente, {\n foreignKey: 'clienteId'\n });\n }", "static associate(models) {\n this.hasMany(Order);\n }", "static associate(models) {\n Bonus.belongsToMany(models.order, { through: 'orderBonuses', timestamps: false })\n Bonus.belongsToMany(models.discount, { through: 'bonusDiscounts', timestamps: false })\n }", "static associate(models) {\n Producto.hasMany(models.Opinion);\n Producto.belongsToMany(models.CategoriaProducto, {\n through: models.Categoria,\n as: 'Categorias'\n })\n }", "static associate(models) {\n // define association here\n // this.hasMany(models.StepIngredient);\n this.belongsTo(models.Recipe);\n }", "static associate(models) {\n GameType.belongsTo(models.Game);\n GameType.hasMany(models.Match, {\n as: \"matches\",\n foreignKey: \"GameTypeId\",\n });\n }", "function HasMany(model, related, foreignKey, localKey) {\n var _this = _super.call(this, model) /* istanbul ignore next */ || this;\n _this.related = _this.model.relation(related);\n _this.foreignKey = foreignKey;\n _this.localKey = localKey;\n return _this;\n }", "static associate(models) {\n models.Pizza.belongsTo(models.OrderItems);\n }", "static associate(models) {\n // define association here\n Item.belongsTo(models.Category, {\n foreignKey: \"category_id\",\n constraints: true,\n foreignKeyConstraint: true,\n });\n Item.hasMany(models.Item_Option, {\n foreignKey: \"item_id\",\n onDelete: \"CASCADE\",\n hooks: true,\n });\n\n Item.belongsToMany(models.Order, { through: \"Order_Item\", uniqueKey: \"item_id\" });\n }", "static associate(models) {\n Shopping_cart.hasMany(models.Line_item);\n // define association here\n }", "static associate(models) {\n // define association here\n Orders.belongsTo(models.Users);\n Orders.belongsTo(models.Order_statuses);\n Orders.belongsToMany(models.Products, { through: 'Order_has_product' });\n\n }", "static associate(models) {\n models.attraction.belongsTo(models.themePark)\n models.attraction.hasMany(models.attractionFavorites)\n models.attraction.belongsToMany(models.creative, {through: \"projectWork\"})\n }", "static associate(models) {\n // define association here\n Product.hasMany(models.Cart)\n }", "static associate(models) {\n\t\t\tMenu_Item.belongsTo(models.Menu, { foreignKey: 'menu_id' });\n\t\t\tMenu_Item.hasMany(models.Order_Item, { foreignKey: 'menu_item_id' });\n\t\t}", "static associate(models) {\n Menu.hasMany(models.Menu_Ingredient, {foreignKey: 'menu_id'})\n }", "static associate(models) {\n\t\t\tthis.hasMany(models.Item, {foreignKey: 'datasetKey'});\n }", "static associate(models) {\n // define association here\n Lecture.belongsToMany(models.User, { through: models.Class });\n Lecture.hasMany(models.Class);\n }", "static associate(models) {\n // define association here\n models.spell.belongsToMany(models.spellbook, { through: \"spellbooks_spells\" })\n }", "static associate(models) {\n // define association here\n CartItem.belongsToMany(models.Commande, {\n through: models.OrderItem,\n foreignKey: 'cartItemId',\n otherKey: 'commandeId'\n })\n }", "static associate(models) {\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n as: 'servicos',\n }),\n this.hasMany(models.Arquivo, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Pagamento\n this.hasOne(models.Pagamento, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Servico\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n as: 'services',\n }),\n // Associação com Reserva\n this.hasOne(models.Reserva, {\n foreignKey: 'idReserva',\n as: 'reservas',\n });\n // Associação com Membros\n this.hasOne(models.Membro, {\n foreignKey: 'idMembro',\n as: 'membros',\n });\n }", "static associate(models) {\n // define association here\n\n // M:N 관계\n models.users.belongsToMany(models.groups, {foreignKey:\"user_id\", through: models.usersmngroups}) \n models.users.belongsToMany(models.groups, {as:\"group_id\", foreignKey:\"user_id\", through: models.applicants}) \n models.users.belongsToMany(models.trophies, {foreignKey:\"user_id\", through: models.usersmntrophies}) \n }", "static associate(models) {\n this.hasMany(models.portfolio);\n this.belongsToMany(models.stack, { through: \"user_stack\" });\n this.hasMany(models.project, {\n as: \"myProject\",\n });\n this.belongsToMany(models.project, {\n as: \"attendProject\",\n through: \"attendUser\",\n });\n }", "static associate(models) {\n // define association here\n models.Product.hasMany(models.ProductSubImage, {\n foreignKey: 'productId',\n });\n models.Product.hasMany(models.ProductDescription, {\n foreignKey: 'productId',\n });\n models.Product.hasMany(models.Auction, {\n foreignKey: 'productId',\n });\n }", "static associate(models) {\n // define association here\n Nanny.belongsTo(models.Parent);\n Nanny.belongsTo(models.Agency);\n Nanny.belongsToMany(models.Child, { through: models.NannyChild });\n Nanny.belongsTo(models.Parent, {\n sourceKey: \"id\",\n foreignKey: \"ParentId\",\n });\n Nanny.belongsTo(models.Agency, {\n sourceKey: \"id\",\n foreignKey: \"AgencyId\",\n });\n }", "static associate(models) {\n mangas.belongsToMany(models.users, { through: 'models.favorite' });\n }", "static associate(models) {\n models.post.belongsToMany(models.user, {through: 'userPost'})\n }", "static associate(models) {\n // define association here\n // Doctor.hasOne(models.Doctor_Type, {foreignKey: 'type_id', foreignKeyConstraint: true })\n Doctor.belongsToMany(models.Hospital, {through : \"Work_Places\"})\n Doctor.belongsToMany(models.Skill, {through : \"Specialties\"})\n Doctor.belongsToMany(models.Diseases, {through : \"Disease_Specialties\"})\n Doctor.belongsToMany(models.Practice_time, {through : \"Docktor_Practice_Times\"})\n }", "static associate(models) {\n this.belongsTo(models.account_types, {\n foreignKey: 'type'\n });\n this.belongsTo(models.Clients, {\n foreignKey: 'client_id'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_ori'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_des'\n });\n }", "static associate(models) {\n this.belongsTo(models.Items, {\n foreignKey: \"item_id\",\n });\n this.belongsTo(models.Sales, {\n foreignKey: \"sales_id\",\n });\n this.hasMany(models.Sales, {\n foreignKey: \"sales_items_id\",\n })\n }", "static associate(models) {\n // define association here\n models.exercise.belongsToMany(models.user, {through: 'userExercises'})\n models.exercise.hasMany(models.comment)\n models.exercise.belongsToMany(models.workout, {through: 'exerciseWorkouts'})\n }", "static associate (models) {\n // define association here\n Group.belongsTo(models.User)\n Group.hasMany(models.Course, { onDelete: 'CASCADE', hooks: true })\n Group.belongsToMany(models.User, {\n through: models.Follow,\n foreignKey: 'GroupId',\n as: 'followers'\n })\n }", "static associate(models) {\n this.hasMany(models.token);\n this.hasMany(models.purchase);\n this.belongsToMany(models.category, { through: models.categoryUser });\n }", "static associate(models) {\n models.Languages.belongsToMany(models.Catalogue, {\n through: 'CatalogueLanguages',\n as: 'catalogues',\n foreignKey: 'languageId',\n });\n }", "static associate(models) {\n Grupos.hasMany(models.Herois, {\n foreignKey: 'grupo_id'\n })\n }", "static associate(models) {\n // define association here\n User.hasMany(models.Order)\n }", "static associate(models) {\n this.belongsTo(models.customer);\n this.hasMany(models.itemRental);\n this.hasMany(models.additive);\n }", "static associate(models) {\n // define association here\n Customer.belongsToMany(models.Product , {\n through : models.Order,\n foreignKey: \"CustomerId\"\n })\n\n Customer.hasMany(models.Order, { foreignKey : \"CustomerId\"})\n }", "static associate(models) {\n this.belongsTo(IllustrationType);\n }", "static associate(models) {\n Request_Type.hasMany(models.Request, {foreignKey: \"requestTypeId\"})\n }", "static associate(models) {\n // define association here\n Commande.belongsTo(models.User)\n Commande.belongsTo(models.UserAdresse)\n Commande.belongsTo(models.Plan)\n Commande.belongsToMany(models.CartItem, {\n through: models.OrderItem,\n foreignKey: 'commandeId',\n otherKey: 'cartItemId'\n })\n Commande.hasOne(models.Facture)\n Commande.hasMany(models.Contrat)\n Commande.hasMany(models.Livraison)\n Commande.belongsToMany(models.CompteParrainage,\n {\n through: models.OrderParrain\n })\n\n }", "static associate(models) {\n // define association here\n this.hasMany(models.Friendship, { foreignKey: \"user_1\" });\n this.hasMany(models.Friendship, { foreignKey: \"user_2\" });\n this.hasMany(models.Post, { foreignKey: \"userId\" });\n this.hasMany(models.Likes, { foreignKey: \"userId\" });\n this.belongsToMany(models.Chat, {\n through: \"ChatUser\",\n foreignKey: \"userId\",\n });\n this.hasMany(models.ChatUser, { foreignKey: \"userId\" });\n this.hasMany(models.Message, { foreignKey: \"fromUserId\" });\n this.hasMany(models.LastReadMessage, { foreignKey: \"chatId\" });\n }", "static associate (models) {\n this.belongsTo(models.UserType, { foreignKey: 'userTypeId' })\n\n this.hasMany(models.Order, { foreignKey: 'playerId' })\n this.hasMany(models.News, { foreignKey: 'userId' })\n this.hasMany(models.Stock, { foreignKey: 'playerId' })\n this.hasMany(models.PlayerCompetition, { foreignKey: 'playerId', as: 'playercompetition' })\n this.hasMany(models.Evaluation, { foreignKey: 'managerId' })\n\n this.hasMany(models.Order, { foreignKey: 'playerId' })\n this.hasMany(models.News, { foreignKey: 'userId' })\n this.hasMany(models.Stock, { foreignKey: 'playerId' })\n this.hasMany(models.PlayerCompetition, { foreignKey: 'playerId' })\n\n this.hasMany(models.Competition, { foreignKey: 'managerId', as: 'competitions' })\n }", "static associate(models) {\n\t\t\tthis.belongsToMany(models.Order , {\n\t\t\t\tthrough: models.OrderProduct , foreignKey: 'ProductId' , otherKey: 'OrderId'\n\t\t\t});\n\t\t}", "static associate(models) {\n // define association here\n User.belongsToMany(models.Menu, { through: `MenuToppings` })\n User.belongsToMany(models.Topping, { through: `MenuToppings` })\n }", "static associate(models) {\n // define association here\n // User.belongsToMany(models.Fight, {\n // through: 'Rooms',\n // as: 'fights',\n // foreignKey: 'UserId',\n // otherKey: 'FightId'\n // })\n User.hasMany(models.UserRoomFight);\n User.belongsToMany(models.RoomFight, { through: 'UserRoomFight' });\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate(models) {\n // define association here\n models.etablissements.hasMany(models.espacevert)\n }", "static associate(models) {\n // define association here\n Shop.hasMany(models.Order, {\n foreignKey: \"shop_Id\",\n })\n }", "static associate(models) {\n // The same subcategory can belong to many categories\n this.belongsTo(models.category, {\n onDelete: \"CASCADE\",\n onUpdate: \"CASCADE\",\n });\n\n // The same subcategory can belong to many products\n this.belongsToMany(models.product, {\n through: \"product_subcategory\",\n onDelete: \"RESTRICT\",\n onUpdate: \"CASCADE\",\n });\n }", "get hasMany() {\n\t\treturn this._hasMany;\n\t}", "addRelation(relation) {\n this.relations.push(relation);\n }", "static associate(models) {\n // define association here\n User.belongsToMany(models.Produk, { through: models.Cart });\n User.hasMany(models.Cart);\n User.hasMany(models.Komisi);\n User.hasMany(models.TransaksiKomisi);\n User.hasMany(models.Alamat);\n }", "static associate(models) {\n // define association here\n this.hasMany(models['Orders'], { foreignKey: 'owner', sourceKey: 'id', });\n }", "static associate(models) {\n this.hasMany(models['Brand'], { foreignKey: 'supplier_id' });\n }", "static associate(models) {\n // define association here\n this.belongsToMany(models.Game, { through: 'GameUsers' });\n }", "static associate(models) {\n Compra.belongsToMany(models.Produto, { through: 'Compra_Produto', onDelete: 'cascade' });\n models.Produto.belongsToMany(Compra, { through: 'Compra_Produto', onDelete: 'cascade' });\n }", "static associate(models) {\n cd.belongsTo(models.list);\n // define association here\n }", "static associate(models) {\n // define association here\n Product.belongsTo(models.Category, { as: 'category', foreignKey: 'categoryId' });\n Product.belongsTo(models.User, { as: 'user', foreignKey: 'userId' });\n Product.belongsToMany(models.Cart, { as: 'cart', foreignKey: 'productId', through: models.ProductCart })\n Product.hasMany(models.Wishlist, { as: 'wishlist', foreignKey: 'productId' })\n }", "static associate(models) {\n // define association here\n this.hasMany(models.Tags , { foreignKey:'tag_id', as:'tags' });\n\n }", "static associate(models) {\n // define association here\n Sentiment.belongsTo(models.News)\n }", "static associate(models) {\n // define association here\n models.Account.belongsToMany(models.Team, {\n foreignKey: \"accountId\",\n through: \"account_team\",\n as: \"teams\",\n });\n\n models.Account.belongsToMany(models.Meeting, {\n foreignKey: \"accountId\",\n through: \"meeting_account\",\n as: \"meetings\",\n });\n }", "static associate(models) {\n // define association here\n User.belongsToMany(models.Badge, { through: \"Achievement\" });\n User.hasMany(models.Achievement, { foreignKey: \"UserId\" });\n User.hasMany(models.Target, { foreignKey: \"UserId\" });\n User.hasMany(models.Transaction, { foreignKey: \"UserId\" });\n }", "static associate(models) {\n // define association here\n UserInfo.hasMany(models.PostItem,{\n onDelete: 'cascade'\n });\n UserInfo.hasMany(models.LikePostItem,{\n onDelete: 'cascade'\n });\n UserInfo.hasMany(models.ViewPostItem,{\n onDelete: 'cascade'\n });\n UserInfo.hasMany(models.Reply,{\n onDelete: 'cascade'\n });\n UserInfo.hasMany(models.ChatHistory,{\n onDelete: 'cascade'\n });\n\n UserInfo.belongsToMany(models.ChatRoom,{\n through : 'UserChatRoom',\n foreignKey : \"user_id\",\n onDelete: 'cascade'\n });\n }", "static associate(models) {\n // define association here\n room.hasMany(models.scene);\n }", "static associate(models) {\n this.belongsToMany(models.Cart, {\n foreignKey: \"cartId\",\n through: {\n model: \"bridgeToppings\",\n as: \"bridge\",\n },\n onDelete: \"CASCADE\",\n onUpdate: \"CASCADE\",\n as: \"toppings\",\n });\n this.belongsToMany(models.History, {\n foreignKey: \"cartId\",\n through: {\n model: \"bridgeToppings\",\n as: \"bridge\",\n },\n onDelete: \"CASCADE\",\n onUpdate: \"CASCADE\",\n as: \"toppingOnHistory\",\n });\n }", "function addRelationType(type) {\r\n relationTypes.push(type);\r\n setOutcomePaths();\r\n update();\r\n }", "static associate(models) {\n // define association here\n EBook.belongsToMany(models.Account, { through: 'borrow_log' });\n EBook.hasMany(models.borrow_log, { foreignKey: 'EBookId' });\n }", "static associate(models) {\n group.belongsToMany(models.tag, {\n through: \"groupTag\",\n foreignKey: \"groupId\",\n });\n group.belongsTo(models.user, { as: \"owner\", foreignKey: \"userId\" });\n group.belongsToMany(models.user, {\n through: \"groupMember\",\n foreignKey: \"groupId\",\n as: \"member\",\n });\n group.hasMany(models.groupComment);\n }", "static associate(models) {\n // define association here\n animalList.belongsTo(models.User);\n animalList.hasMany(models.Comment);\n }", "static associate(models) {\n // define association here\n User.hasMany(models.FavoriteBreed, {\n foreignKey: 'userId',\n })\n }", "static associate(models) {\n // define association here\n Group.belongsToMany(models.Role,{through:\"GroupRole\"})\n Group.belongsToMany(models.User,{through:\"UserGroup\"})\n Group.belongsToMany(models.Hospital,{through:\"HospitalGroup\"})\n Group.hasMany(models.Group,{foreignKey:\"parentGroupId\"})\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Album, { foreignKey: \"album\" });\n this.belongsTo(models.Artist, { foreignKey: \"artist\" });\n this.belongsToMany(models.Playlist, { through: \"playlist_songs\" });\n }", "static associate(models) {\n // define association here\n Order.belongsTo(models.Provider, {\n foreignKey: \"provider_id\",\n constraints: true,\n foreignKeyConstraint: true,\n });\n Order.belongsTo(models.Driver, {\n foreignKey: \"driver_id\",\n constraints: true,\n foreignKeyConstraint: true,\n });\n Order.belongsTo(models.Client, {\n foreignKey: \"client_id\",\n constraints: true,\n foreignKeyConstraint: true,\n });\n Order.belongsToMany(models.Item, { through: \"Order_Item\", uniqueKey: \"order_id\" });\n }", "static associate(models) {\n // define association here\n Location.hasMany(models.Event)\n }", "static associate(models) {\n Chapter.belongsTo(models.Manga, { foreignKey: 'manga_id', as: 'manga' });\n Chapter.belongsToMany(models.Team, { through: 'ChapterTeam', foreignKey: 'chapter_id', as: 'teams' });\n }", "static associate(models) {\n // define association here\n this.OwnTeams = this.hasMany(models.Team, {\n foreignKey: 'ownerId',\n as: 'ownTeams'\n });\n\n this.Members = this.hasMany(models.Member, {\n foreignKey: 'userId',\n as: 'members'\n });\n }", "static associate(models) {\n // define association here\n\n Role.hasMany(models.User, {\n as: 'users'\n });\n }", "static associate(models) {\n Ad.belongsToMany(models.Realtor, {through: models.RealtorAd})\n Ad.hasMany(models.RealtorAd);\n }", "addManyToCache(entities, options) {\n this.createAndDispatch(EntityOp.ADD_MANY, entities, options);\n }", "static associate( models ) {\n // define association here\n }", "static associate(models) {\n // define association here\n // models.garagedream.belongsToMany(models.car, {through: 'dreamcars'});\n // models.garagedream.hasMany(models.car, {through: 'allcars'});\n models.garagedream.belongsTo(models.user); //user can also have a dream garage\n }", "static associate(models) {\n // define association here\n models.inboundFavorite.belongsTo(models.outboundFavorite, {onDelete: \"CASCADE\"})\n //models.inboundFavorite.belongsToMany(models.user, {through: \"userInboundFavorite\"});\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Category, { foreignKey: \"categoryId\" });\n this.belongsTo(models.Item, { foreignKey: \"itemId\" });\n }", "static associate(models) {\n // define association here\n Penyakit.belongsToMany(models.Pasien, {through: 'PenyakitPasien'})\n Penyakit.hasMany(models.PenyakitPasien)\n }", "static associate(models) {\n Cast.belongsToMany(models.Movie, { through: \"MovieCast\" });\n }", "static associate(models) {\n // define association here\n Hero.belongsToMany(models.Ability, {\n through: \"heroes_to_abilities\",\n foreignKey: \"heroId\"\n })\n }", "static associate(models) {\n models.comment.belongsToMany(models.users, { through: 'likes', foreignKey: 'commentId', sourceKey: 'id' });\n\n models.comment.belongsTo(models.users, { foreignKey: 'userId', sourceKey: 'id', onDelete: 'cascade' });\n models.comment.belongsTo(models.items, { foreignKey: 'itemId', sourceKey: 'id', onDelete: 'cascade' });\n // define association here\n }", "static associate(models) {\n storeType.belongsTo(models.storeCategory);\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }" ]
[ "0.64406514", "0.6031205", "0.60205275", "0.5890146", "0.5872715", "0.5841686", "0.58242255", "0.5790629", "0.5781117", "0.571162", "0.57099396", "0.5707088", "0.56772", "0.56446433", "0.56115854", "0.56012547", "0.5599025", "0.55988836", "0.55861855", "0.5582766", "0.55755216", "0.5573886", "0.5569922", "0.55667514", "0.55631727", "0.5562746", "0.5558488", "0.5550773", "0.55451596", "0.55374247", "0.5533461", "0.5530247", "0.5522929", "0.55227655", "0.5520646", "0.5516955", "0.55123395", "0.5508846", "0.5504056", "0.5503166", "0.5501463", "0.55011743", "0.5499642", "0.5496343", "0.54935616", "0.5486312", "0.5483641", "0.5481865", "0.54770374", "0.5471733", "0.5471733", "0.5471733", "0.54600906", "0.5451425", "0.5451352", "0.5449337", "0.5440907", "0.54331404", "0.54309446", "0.5428829", "0.5421873", "0.54157907", "0.5415631", "0.5415522", "0.5414651", "0.5413129", "0.5409571", "0.54032683", "0.5403174", "0.5402945", "0.5399766", "0.53982043", "0.53946483", "0.5391261", "0.5388814", "0.5387103", "0.5383385", "0.53792244", "0.5375782", "0.53695697", "0.53694594", "0.5366838", "0.53651947", "0.5358876", "0.53564703", "0.5350203", "0.5349962", "0.53464365", "0.53423333", "0.53423333", "0.53423333", "0.53416497", "0.5340125", "0.5339601", "0.5338901", "0.5337813", "0.53318715", "0.53314215", "0.53314215", "0.53314215" ]
0.6211596
1
Add a hasone relationship for this model. When retrieving models of the current type, a model object of the specified type may be retrieved.
addHasOne( sibling, options ) { if( options == undefined ) { options = {}; } this._hasOne.push( { sibling, options } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get hasOne() {\n\t\treturn this._hasOne;\n\t}", "static associate(models) {\n // define association here\n this.belongsTo(models.Content_Types, {\n foreignKey: 'id_Content_Type'\n });\n\n this.hasOne(models.Contents, {\n foreignKey: 'id_Content_Rating'\n });\n }", "static hasOne( model, options ) {\n\t\tif( this.name == \"Model\" ) {\n\t\t\tthrow \"Cannot invoke method directly on Model class\";\n\t\t}\n\n\t}", "function AddOneToOneTypes(metadataStore) {\n var DT = breeze.DataType;\n\n metadataStore.addEntityType(new breeze.EntityType({\n shortName: \"Parent\",\n dataProperties: {\n id: { dataType: DT.Int32, isPartOfKey: true, isNullable: false },\n name: {}\n },\n navigationProperties: {\n child: {\n entityTypeName: \"Child\",\n associationName: \"Parent_Child\"\n }\n }\n }));\n\n metadataStore.addEntityType(new breeze.EntityType({\n shortName: \"Child\",\n dataProperties: {\n id: { dataType: DT.Int32, isPartOfKey: true, isNullable: false },\n name: {},\n parentId: { dataType: DT.Int32 }\n },\n navigationProperties: {\n parent: {\n entityTypeName: \"Parent\",\n associationName: \"Parent_Child\",\n foreignKeyNames: [\"parentId\"] \n }\n }\n }));\n }", "static associate(models) {\n this.hasOne(models.User, { as: 'user', sourceKey: 'user_id', foreignKey: 'id' });\n }", "static associate(models) {\n models.Identification_association.hasOne(models.AssociationPage);\n models.Identification_association.belongsTo(models.Representant_legale,{\n foreignKey: 'RepresentantLegaleId'\n });\n }", "static associate(models) {\n CreditNote.hasOne(models.client, { foreignKey: 'id', sourceKey: 'clientId' })\n CreditNote.hasOne(models.billingPeriod, { foreignKey: 'id', sourceKey: 'periodId' })\n CreditNote.hasOne(models.account, { foreignKey: 'id', sourceKey: 'accountId' })\n CreditNote.hasOne(models.paymentReceipt, { foreignKey: 'id', sourceKey: 'paymentReceiptId' })\n CreditNote.hasOne(models.paymentOrder, { foreignKey: 'id', sourceKey: 'paymentOrderId' })\n CreditNote.hasOne(models.user, { foreignKey: 'id', sourceKey: 'userId' })\n }", "static associate(models) {\n models.Admin.hasOne(models.User, {\n foreignKey: 'userable_id',\n constraints: false,\n scope: {\n userable: 'Admin'\n },\n as: 'userable',\n });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Tournament);\n this.belongsTo(models.Person);\n this.hasOne(models.Team,{as: 'Speaker1'});\n this.hasOne(models.Team,{as: 'Speaker2'});\n }", "static associate(models) {\n // define association here\n Data_Peminjaman.belongsTo(models.User);\n Data_Peminjaman.hasOne(models.Data_Pengembalian, { onDelete: \"CASCADE\" });\n Data_Peminjaman.hasOne(models.Detail_Peminjaman, { onDelete: \"CASCADE\" });\n }", "static associate(models) {\n User.hasOne(models.Cart)\n }", "static associate(models) {\n this.belongsTo(IllustrationType);\n }", "static associate(models) {\n // define association here\n models.user.hasMany(models.sOsOrder)\n models.user.hasMany(models.mealOrder)\n models.user.hasOne(models.address)\n }", "function singleLinked(Type) {\n return function(target, options) { // testhint options:none\n if (!target.prototype || !(target.prototype instanceof this.sequelize.Model)) {\n throw new Error(this.name + '.' + Utils.lowercaseFirst(Type.toString()) + ' called with something that\\'s not a subclass of Sequelize.Model');\n }\n\n const source = this;\n\n // Since this is a mixin, we'll need a unique letiable name for hooks (since Model will override our hooks option)\n options = options || {};\n options.hooks = options.hooks === undefined ? false : Boolean(options.hooks);\n options.useHooks = options.hooks;\n\n // the id is in the foreign table\n const association = new Type(source, target, _.extend(options, source.options));\n source.associations[association.associationAccessor] = association;\n\n association.injectAttributes();\n association.mixin(source.prototype);\n\n return association;\n };\n}", "static associate(models) {\n // define association here\n User.hasOne(models.Salary, {\n foreignKey: 'employee_id',\n }),\n User.hasOne(models.JobTitle, {\n foreignKey: 'employee_id',\n }),\n User.belongsTo(models.Department, {\n foreignKey: 'department_id',\n })\n }", "static belongsTo( model, options ) {\n\t\tif( this.name == \"Model\" ) {\n\t\t\tthrow \"Cannot invoke method directly on Model class\";\n\t\t}\n\n\t\tcache.relationships( this.name ).addBelongsTo( model, options );\n\t}", "static associate(model) {\n this.hasOne(model.Ride, {\n foreignKey: 'ride_id',\n as: 'ride_id',\n type: Sequelize.UUID,\n })\n this.hasOne(model.User, {\n foreignKey: 'user_id',\n as: 'participant_id',\n type: Sequelize.UUID,\n })\n }", "static associate(models) {\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n as: 'servicos',\n }),\n this.hasMany(models.Arquivo, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Pagamento\n this.hasOne(models.Pagamento, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Servico\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n as: 'services',\n }),\n // Associação com Reserva\n this.hasOne(models.Reserva, {\n foreignKey: 'idReserva',\n as: 'reservas',\n });\n // Associação com Membros\n this.hasOne(models.Membro, {\n foreignKey: 'idMembro',\n as: 'membros',\n });\n }", "static associate (models) {\n Observador.belongsTo(models.Estacion)\n Observador.hasOne(models.Estacion, { as: 'Jefe', constraints: false })\n Observador.belongsTo(models.User)\n }", "function includePolymorphicHasOne(callback) {\n var sourceIds = [];\n //Map for Indexing objects by their id for faster retrieval\n var objIdMap = {};\n for (var i = 0; i < objs.length; i++) {\n var obj = objs[i];\n // one-to-one: foreign key reference is modelTo -> modelFrom.\n // use modelFrom.keyFrom in where filter later\n var sourceId = obj[relation.keyFrom];\n if (sourceId) {\n sourceIds.push(sourceId);\n objIdMap[sourceId.toString()] = obj;\n }\n // sourceId can be null. but cache empty data as result\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = null;\n }\n filter.where[relation.keyTo] = {\n inq: uniq(sourceIds),\n };\n relation.applyScope(null, filter);\n relation.modelTo.find(filter, options, targetFetchHandler);\n /**\n * Process fetched related objects\n * @param err\n * @param {Array<Model>} targets\n * @returns {*}\n */\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var tasks = [];\n //simultaneously process subIncludes\n if (subInclude && targets) {\n tasks.push(function subIncludesTask(next) {\n relation.modelTo.include(targets, subInclude, options, next);\n });\n }\n //process each target object\n tasks.push(targetLinkingTask);\n function targetLinkingTask(next) {\n async.each(targets, linkOneToOne, next);\n function linkOneToOne(target, next) {\n var sourceId = target[relation.keyTo];\n if (!sourceId) return next();\n var obj = objIdMap[sourceId.toString()];\n if (!obj) return next();\n obj.__cachedRelations[relationName] = target;\n processTargetObj(obj, next);\n }\n }\n\n execTasksWithInterLeave(tasks, callback);\n }\n }", "static associate(models) {\n // define association here\n // this.hasMany(models.StepIngredient);\n this.belongsTo(models.Recipe);\n }", "function OneToOne(typeFunctionOrTarget, inverseSideOrOptions, options) {\n // normalize parameters\n var inverseSideProperty;\n if (typeof inverseSideOrOptions === \"object\") {\n options = inverseSideOrOptions;\n }\n else {\n inverseSideProperty = inverseSideOrOptions;\n }\n return function (object, propertyName) {\n if (!options)\n options = {};\n // now try to determine it its lazy relation\n var isLazy = options && options.lazy === true ? true : false;\n if (!isLazy && Reflect && Reflect.getMetadata) { // automatic determination\n var reflectedType = Reflect.getMetadata(\"design:type\", object, propertyName);\n if (reflectedType && typeof reflectedType.name === \"string\" && reflectedType.name.toLowerCase() === \"promise\")\n isLazy = true;\n }\n __1.getMetadataArgsStorage().relations.push({\n target: object.constructor,\n propertyName: propertyName,\n // propertyType: reflectedType,\n isLazy: isLazy,\n relationType: \"one-to-one\",\n type: typeFunctionOrTarget,\n inverseSideProperty: inverseSideProperty,\n options: options\n });\n };\n}", "static associate(models) {\n // define association here\n Schedule.hasOne(models.Event);\n }", "static associate(models) {\n models.Pizza.belongsTo(models.OrderItems);\n }", "static associate(models) {\n // define association here\n models.mealOrder.belongsTo(models.user)\n\n }", "static associate (models) {\n // define association here\n Post.belongsTo(models.Users, { foreignKey: 'userId', as: 'author' })\n Post.hasOne(models.PostImage, { foreignKey: 'postId', as: 'picture' })\n }", "static associate(models) {\n treelocation.belongsTo(models.treetype);\n }", "profile() {\n return this.hasOne('App/Models/Profile')\n }", "createAssociation(type, model, options) {\n // type == 'hasMany || 'belongsTo'\n // model == some sequelize model\n // option == {foreignKey, sourceKey}\n console.log(type, model, options);\n try {\n this.model[type](model, options);\n } catch (e) {\n console.log(e);\n }\n }", "addOneIfEmpty() {\n if (this.childrenCount === 0) {\n this.addOne()\n this.initRemove()\n }\n }", "static associate(models) {\n Developer.hasOne(models.Requirement,{\n foreignKey: \"developer\",\n });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.deal);\n }", "static associate(models) {\n pegawais.hasOne(models.meetings,{\n foreignKey:'id_pegawais'\n })\n pegawais.hasMany(models.userakses,{\n foreignKey:'id_pegawais'\n })\n }", "static associate(models) {\n this.belongsTo(models.User, { foreignKey: 'user_id', as: 'user' });\n this.belongsTo(models.User, { foreignKey: 'follower_id', as: 'follower' });\n\n }", "static associate(models) {\n // this.hasOne(models.billingCycle, { foreignKey: \"session_id\" });\n }", "static associate(models) {\n trx_agent_delivery_status.hasOne(models.mst_delivery_status, {\n foreignKey: \"id\",\n sourceKey: \"delivery_status_id\",\n });\n trx_agent_delivery_status.belongsTo(models.trx_agent_po, {\n foreignKey: \"po_id\",\n sourceKey: \"id\",\n });\n trx_agent_delivery_status.hasOne(models.mst_user, {\n foreignKey: \"id\",\n sourceKey: \"created_by\",\n as: \"creator\",\n });\n trx_agent_delivery_status.hasOne(models.mst_user, {\n foreignKey: \"id\",\n sourceKey: \"updated_by\",\n as: \"updater\",\n });\n }", "static associate(models) {\n this.lectures = this.hasMany(models.Lecture, { foreignKey: 'lectureId' });\n this.module = this.belongsTo(models.Module, { foreignKey: 'id' });\n this.quiz = this.hasOne(models.Quiz, { foreignKey: 'lectureGroupId' });\n }", "static associate(models) {\n // define association here\n // Doctor.hasOne(models.Doctor_Type, {foreignKey: 'type_id', foreignKeyConstraint: true })\n Doctor.belongsToMany(models.Hospital, {through : \"Work_Places\"})\n Doctor.belongsToMany(models.Skill, {through : \"Specialties\"})\n Doctor.belongsToMany(models.Diseases, {through : \"Disease_Specialties\"})\n Doctor.belongsToMany(models.Practice_time, {through : \"Docktor_Practice_Times\"})\n }", "addToRelationship(type, id, relationshipPath, newLinkage) {\n let model = this.getModel(this.constructor.getModelName(type));\n let update = {\n $addToSet: {\n [relationshipPath]: { $each: newLinkage.value.map(it => it.id)}\n }\n };\n let options = {runValidators: true};\n\n return Q.ninvoke(model, \"findOneAndUpdate\", {\"_id\": id}, update, options)\n .catch(util.errorHandler);\n }", "static associate(models) {\n this.hasMany(models.MedicalRecord);\n this.belongsTo(models.Member, {\n foreignKey: 'member_id',\n });\n }", "relateUser() {\n return this.belongsTo(User);\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.User, {\n foreignKey: 'user_id',\n as: 'user'\n })\n }", "static associate(models) {\n // trx_agent_sales_detail.hasOne(models.mst_goods, {\n // foreignKey: \"id\",\n // sourceKey: \"goods_id\",\n // });\n // trx_agent_sales_detail.hasOne(models.mst_raw_goods, {\n // foreignKey: \"id\",\n // sourceKey: \"sug_goods_id\",\n // });\n trx_agent_sales_detail.belongsTo(models.trx_agent_stock, {\n foreignKey: \"agent_stock_id\",\n sourceKey: \"id\",\n });\n trx_agent_sales_detail.belongsTo(models.trx_agent_sales, {\n foreignKey: \"sales_id\",\n sourceKey: \"id\",\n });\n trx_agent_sales_detail.hasOne(models.mst_user, {\n foreignKey: \"id\",\n sourceKey: \"created_by\",\n as: \"creator\",\n });\n }", "static associate(models) {\n this.belongsTo(models.MentorProgram, {\n foreignKey: \"programId\",\n });\n }", "static associate(models) {\n Ingredients.belongsTo(models.Meal, { foreignKey: \"mealId\" });\n }", "static associate(models) {\n // define association here\n models.Nuddge.belongsTo(models.User, {as: 'user', foreignKey: 'user_id'})\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Cocktail, {foreignKey: 'cocktailId'});\n }", "static associate(models) {\n // define association here\n TodoList.belongsTo(models.User)\n }", "static associate(models){\n this.belongsTo(models.User, {foreignKey: \"address\"});\n }", "static associate(models) {\n // define association here\n models.Lead.belongsTo(models.User, {foreignKey: \"userId\"});\n }", "get relations () {\n return {\n 'artist': {\n type: ' hasOne',\n fk : 'artist_id'\n }\n }\n }", "static associate(models) {\n lead.belongsTo(models.contact);\n lead.belongsTo(models.user);\n lead.hasMany(models.report);\n lead.belongsTo(models.salesCyclePhase);\n lead.hasMany(models.action);\n }", "static associate(models) {\n // define association here\n models.cardio.belongsTo(models.user)\n }", "static associate(models) {\n // define association here\n Alamat.belongsTo(models.User);\n }", "push(model) {\n // Prepare for work.\n this._assertLoaded();\n this._assertValidFriend(model);\n\n // Additionally assert the included model is not already present in\n // this relation.\n if (this._value.indexOf(model) >= 0) throw new ModelStateError(\n `${ model } already in relation`\n );\n\n // Resolve the remote side of the new friend model.\n const modelRemoteSide = this._findRemoteSideOn(model);\n // If nessesary, remove the model from the instance of this relation\n // it's currently present in.\n if (modelRemoteSide) modelRemoteSide._maybeRemoveFromRemoteSide();\n\n // Set up the foreign key attribute link.\n setupForeignKeyBetween(\n model, this.host, this.sourceAttribute, this.destinationAttribute\n );\n\n // Update the relationship here.\n this._value.push(model);\n this._resort();\n\n // Update the remote side if there is one loaded.\n if (modelRemoteSide) modelRemoteSide._setAsSideEffect(this.host);\n\n this._maybeJoinSession(model);\n }", "static associate(models) {\n \n this.belongsTo(models.Pedido, {\n foreignKey: \"idPedido\",\n as: 'Pedido'\n });\n }", "static associate(models) {\n ServiceCall.belongsTo(models.nojsUserModel, {\n foreignKey: \"nojs_id\",\n as: \"nojs\",\n });\n }", "static associate(models) {\n // define association here\n expert_listing.belongsTo(models.expert, { foreignKey: 'idexpert' })\n expert_listing.belongsTo(models.topic, { foreignKey: 'idTopic' })\n expert_listing.belongsTo(models.customer, { foreignKey: 'idCustomer' })\n expert_listing.belongsTo(models.category, { foreignKey: 'idcategory' })\n expert_listing.hasOne(models.listing_index, { foreignKey: 'idlisting' })\n }", "function addReference( collection, model ){\n\t model.collection || ( model.collection = collection );\n\t onAll( model, collection._onModelEvent, collection );\n\t return model;\n\t}", "static associate(models) {\n this.belongsTo(models.customer);\n this.hasMany(models.itemRental);\n this.hasMany(models.additive);\n }", "static associate(models) {\n // define association here\n UserService.belongsTo(models.User, {\n foreignKey: 'user_id'\n });\n UserService.belongsTo(models.Service, {\n foreignKey: 'service_id'\n })\n UserService.belongsTo(models.Hairstylist, {\n foreignKey: 'hairstylist_id'\n })\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Tipo_tarjeta,{\n foreignKey:'tipo_id'\n })\n this.belongsTo(models.Cliente,{\n foreignKey: 'cliente_id'\n });\n }", "addBelongsTo( parent, options ) {\n\t\tif( options == undefined ) {\n\t\t\toptions = {};\n\t\t}\n\t\tthis._belongsTo.push( { parent, options } );\n\t}", "static associate(models) {\n // define association here\n Driver.hasOne(models.Car, {\n foreignKey: 'driverId',\n })\n Driver.hasMany(models.Ride, {\n foreignKey: 'driverId',\n })\n Driver.hasMany(models.Feedback, {\n foreignKey: 'driverId',\n })\n }", "static associate(models) {\n // define association here\n //ONE TO MANY (A USER CAN HAVE MANY REACTIONS) BUT (REACTION ONLY BELONG TO ONE USER)\n this.belongsTo(models.Message, {foreignKey:'messageId'})\n this.belongsTo(models.User , {foreignKey:'userId'})\n }", "static associate(models) {\n // define association here\n PresenceList.belongsTo(models.Appointment);\n }", "addModel(modelObj) {\n if (!(modelObj instanceof StoreModel)) {\n throw thorin.error('STORE.GCLOUD', `Model is not of type StoreModel`);\n }\n if (this[models][modelObj.code]) {\n throw thorin.error('STORE.GCLOUD', `Model ${modelObj.code} is already registered`);\n }\n this[models] = modelObj;\n modelObj.store = this;\n return this;\n }", "static associate(models) {\n // define association here\n Todo.belongsTo(models.User, {\n foreignKey: 'user_id'\n })\n }", "static associate({ User }) {\n // define association here\n // by default it will get UserId, but we want lower case for convention so we pass an option\n // this.belongsTo(User)\n // to pass as an include in app.js [getting users with their post]\n this.belongsTo(User, { foreignKey: 'user_id', as: 'user'})\n }", "static associate(models) {\n lesson.hasOne(models.video,{foreignKey: 'lessonId'});\n lesson.hasMany(models.document,{foreignKey: 'lessonId'})\n lesson.belongsTo(models.chapter, {foreignKey: 'chapterId'});}", "static associate(models) {\n // define association here\n BookingSchedule.belongsTo(models.Patient, {foreignKey: 'PatientId'})\n BookingSchedule.belongsTo(models.DoctorSchedule, {foreignKey: 'DoctorScheduleId'})\n BookingSchedule.hasOne(models.MedicationHistory, {foreignKey: 'BookingScheduleId'})\n }", "create() {\n const model = internal(this).model;\n internal(model).entities.add(this);\n return this;\n }", "static associate(models) {\n // define association here\n Todo.belongsTo(models.User, {\n foreignKey: \"user_id\"\n })\n }", "static associate(models) {\n GameType.belongsTo(models.Game);\n GameType.hasMany(models.Match, {\n as: \"matches\",\n foreignKey: \"GameTypeId\",\n });\n }", "static associate(models) {\n Document.belongsTo(models.User);\n Document.belongsTo(models.Signalement);\n Document.belongsTo(models.Ref_Doc_Type);\n }", "static associate(models) {\n // define association here\n const { Recording, Prize } = models\n Recording.belongsTo(Prize)\n }", "static associate(models) {\n this.belongsTo(models.account_types, {\n foreignKey: 'type'\n });\n this.belongsTo(models.Clients, {\n foreignKey: 'client_id'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_ori'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_des'\n });\n }", "static associate(models) {\n // define association here\n GoalSetting.belongsTo(models.User)\n }", "static associate({ User }) {\n this.belongsTo(User, { foreignKey: 'userId' });\n }", "static associate(models) {\n // define association here\n Nanny.belongsTo(models.Parent);\n Nanny.belongsTo(models.Agency);\n Nanny.belongsToMany(models.Child, { through: models.NannyChild });\n Nanny.belongsTo(models.Parent, {\n sourceKey: \"id\",\n foreignKey: \"ParentId\",\n });\n Nanny.belongsTo(models.Agency, {\n sourceKey: \"id\",\n foreignKey: \"AgencyId\",\n });\n }", "static associate({User}) {\n // define association here\n this.belongsTo(User, { foreignKey: \"userId\" })\n }", "static associate(models) {\n goal.belongsTo(models.user, {\n foreignKey: { \n name: 'user_id', \n allowNull: false \n },\n onDelete: 'CASCADE',\n })\n }", "static associate(models) {\n this.belongsTo(models.Data, {\n foreignKey: \"dataId\",\n });\n }", "static associate (models) {\n // define association here\n Experience.belongsTo(models.UserDetails, {\n as: 'user',\n foreignKey: 'userId'\n })\n }", "static associate(models) {\n Resposible_people.belongsTo(models.Responsible_type, {\n foreignKey: \"responsible_type_id\",\n });\n Resposible_people.belongsTo(models.Transition, {\n foreignKey: \"transition_id\",\n });\n }", "static associate(models) {\n Requirements_Modules.belongsTo(models.Requirements, {\n foreignKey: 'requirementId'\n });\n Requirements_Modules.belongsTo(models.Modules, {\n foreignKey: 'moduleId'\n });\n }", "static associate(models) {\n this.user = this.belongsTo(models.User, {\n foreignKey: 'user_id',\n });\n this.bid_order = this.belongsTo(models.Order, {\n foreignKey: 'bid_order_id',\n });\n this.ask_order = this.belongsTo(models.Order, {\n foreignKey: 'ask_order_id',\n });\n }", "static associate(models) {\n // define association here\n Compensation.hasOne(models.client, { foreignKey: 'id', sourceKey: 'clientId' })\n Compensation.hasOne(models.billingPeriod, { foreignKey: 'id', sourceKey: 'periodId' })\n Compensation.hasOne(models.account, { foreignKey: 'id', sourceKey: 'accountId' })\n Compensation.hasOne(models.accountingImputation, { foreignKey: 'id', sourceKey: 'accountingImputationId' })\n Compensation.hasOne(models.user, { foreignKey: 'id', sourceKey: 'userId' })\n }", "static associate({ Pmm }) {\n this.belongsTo(Pmm);\n }", "static associate(models) {\n this.belongsTo(models.users)\n }", "static associate(models) {\n // define association here\n Commande.belongsTo(models.User)\n Commande.belongsTo(models.UserAdresse)\n Commande.belongsTo(models.Plan)\n Commande.belongsToMany(models.CartItem, {\n through: models.OrderItem,\n foreignKey: 'commandeId',\n otherKey: 'cartItemId'\n })\n Commande.hasOne(models.Facture)\n Commande.hasMany(models.Contrat)\n Commande.hasMany(models.Livraison)\n Commande.belongsToMany(models.CompteParrainage,\n {\n through: models.OrderParrain\n })\n\n }", "findOrCreateOne(model, options = {}) {\n return model\n .findOne({\n where: options.where,\n transaction: options.transaction,\n include: options.include || model.__associations || [{ all: true }]\n })\n .then(m => {\n if (m) {\n return new Promise(resolve => resolve([m, false]));\n }\n\n return model\n .create(options.defaults, {\n transaction: options.transaction,\n include: options.include || model.__associations || [{ all: true }]\n })\n .then(m => {\n return new Promise(resolve => resolve([m, true]));\n });\n });\n }", "static associate(models) {\n // define association here\n models.invite.belongsTo(models.user);\n models.invite.belongsTo(models.project);\n }", "static associate(models) {\n // This creates a connection between (User Table \"avatar_id\" (FOREIGN KEY))\n // and (File Table \"id\" (PRIMARY KEY))\n this.belongsTo(models.MeetappFile, {\n foreignKey: 'avatar_id',\n as: 'avatar',\n });\n // This would add userId to the File table.\n // this.hasOne(models.File, { foreignKey: 'avatar_id' });\n // This would add userId to multiple defined tables\n // this.hasMany(...)\n }", "static associate(models) {\n Stop.hasOne(models.Watcher, { foreignKey: 'stopId', as: 'watcher' })\n Stop.hasMany(models.Answer, { foreignKey: 'stopId', as: 'answers' })\n }", "static associate({ Post }) {\n // define association here\n //this.hasMany(Post, { as: \"posts\", foreignKey: \"postTypeId\" });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Orders, { foreignKey: 'order_id', as: 'Orders' })\n this.belongsTo(models.OrderStatus, { foreignKey: 'orderstatus_id', as: 'OrderStatus' })\n }", "static associate(models) {\n // define association here\n Place.belongsTo(models.Itinerary, {\n foreignKey: \"ItineraryId\",\n });\n }", "static associate(models) {\n // define association here\n Profile.belongsTo(models.User, { foreignKey: 'userId' });\n }", "function addRelationType(type) {\r\n relationTypes.push(type);\r\n setOutcomePaths();\r\n update();\r\n }" ]
[ "0.59265685", "0.58053607", "0.5784279", "0.5708834", "0.56848305", "0.5558938", "0.5505939", "0.54947686", "0.54885024", "0.5469731", "0.54409283", "0.5385433", "0.53846145", "0.5376806", "0.536041", "0.53412306", "0.5332535", "0.5324282", "0.5307066", "0.5305832", "0.5288752", "0.5228817", "0.5212788", "0.5129157", "0.5117533", "0.5114245", "0.5099003", "0.50907046", "0.5088736", "0.50819343", "0.5077267", "0.50699", "0.50677603", "0.50615644", "0.5055112", "0.50534856", "0.50465786", "0.503855", "0.5038451", "0.50318176", "0.5018949", "0.50031406", "0.49966234", "0.49942678", "0.4975933", "0.4969005", "0.4962556", "0.49581224", "0.49561954", "0.49541473", "0.49418405", "0.49329844", "0.4928858", "0.4927364", "0.49263167", "0.49193713", "0.4919363", "0.49187118", "0.49173406", "0.4917323", "0.49140805", "0.49137145", "0.49131173", "0.49069363", "0.49056238", "0.4900488", "0.4899274", "0.4895817", "0.48949265", "0.4893235", "0.48912674", "0.48895857", "0.48851466", "0.48785043", "0.48760635", "0.48757213", "0.4874438", "0.48718455", "0.48716617", "0.48677456", "0.48642826", "0.48620048", "0.48592064", "0.48515698", "0.4848669", "0.4845903", "0.48381215", "0.4832968", "0.48157394", "0.4809542", "0.48088714", "0.48051536", "0.48048002", "0.48045215", "0.48030183", "0.48020282", "0.47980908", "0.47925222", "0.4789124", "0.4788978" ]
0.6116382
0
Get a list of the hasone relationships for this model
get hasOne() { return this._hasOne; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRelated() {}", "get relatesTo() {\n\t\treturn this.__relatesTo;\n\t}", "function includePolymorphicHasOne(callback) {\n var sourceIds = [];\n //Map for Indexing objects by their id for faster retrieval\n var objIdMap = {};\n for (var i = 0; i < objs.length; i++) {\n var obj = objs[i];\n // one-to-one: foreign key reference is modelTo -> modelFrom.\n // use modelFrom.keyFrom in where filter later\n var sourceId = obj[relation.keyFrom];\n if (sourceId) {\n sourceIds.push(sourceId);\n objIdMap[sourceId.toString()] = obj;\n }\n // sourceId can be null. but cache empty data as result\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = null;\n }\n filter.where[relation.keyTo] = {\n inq: uniq(sourceIds),\n };\n relation.applyScope(null, filter);\n relation.modelTo.find(filter, options, targetFetchHandler);\n /**\n * Process fetched related objects\n * @param err\n * @param {Array<Model>} targets\n * @returns {*}\n */\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var tasks = [];\n //simultaneously process subIncludes\n if (subInclude && targets) {\n tasks.push(function subIncludesTask(next) {\n relation.modelTo.include(targets, subInclude, options, next);\n });\n }\n //process each target object\n tasks.push(targetLinkingTask);\n function targetLinkingTask(next) {\n async.each(targets, linkOneToOne, next);\n function linkOneToOne(target, next) {\n var sourceId = target[relation.keyTo];\n if (!sourceId) return next();\n var obj = objIdMap[sourceId.toString()];\n if (!obj) return next();\n obj.__cachedRelations[relationName] = target;\n processTargetObj(obj, next);\n }\n }\n\n execTasksWithInterLeave(tasks, callback);\n }\n }", "get relations () {\n return {\n 'artist': {\n type: ' hasOne',\n fk : 'artist_id'\n }\n }\n }", "get hasMany() {\n\t\treturn this._hasMany;\n\t}", "static get belongsToOneRelationFields() {\n return [\n {\n field: {\n field: 'uploader',\n type: 'Identity',\n joinField: 'uploaderId',\n model: Identity\n },\n join: 'uploaderId'\n }\n ];\n }", "function includeOneToOne(callback) {\n var targetIds = [];\n var objTargetIdMap = {};\n for (var i = 0; i < objs.length; i++) {\n var obj = objs[i];\n if (relation.type === 'belongsTo') {\n if (obj[relation.keyFrom] === null ||\n obj[relation.keyFrom] === undefined) {\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = null;\n continue;\n }\n }\n var targetId = obj[relation.keyFrom];\n if (targetId) {\n targetIds.push(targetId);\n var targetIdStr = targetId.toString();\n objTargetIdMap[targetIdStr] = objTargetIdMap[targetIdStr] || [];\n objTargetIdMap[targetIdStr].push(obj);\n }\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = null;\n }\n filter.where[relation.keyTo] = {\n inq: uniq(targetIds),\n };\n relation.applyScope(null, filter);\n relation.modelTo.find(filter, options, targetFetchHandler);\n /**\n * Process fetched related objects\n * @param err\n * @param {Array<Model>} targets\n * @returns {*}\n */\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var tasks = [];\n //simultaneously process subIncludes\n if (subInclude && targets) {\n tasks.push(function subIncludesTask(next) {\n relation.modelTo.include(targets, subInclude, options, next);\n });\n }\n //process each target object\n tasks.push(targetLinkingTask);\n function targetLinkingTask(next) {\n async.each(targets, linkOneToMany, next);\n function linkOneToMany(target, next) {\n var targetId = target[relation.keyTo];\n var objList = objTargetIdMap[targetId.toString()];\n async.each(objList, function(obj, next) {\n if (!obj) return next();\n obj.__cachedRelations[relationName] = target;\n processTargetObj(obj, next);\n }, next);\n }\n }\n\n execTasksWithInterLeave(tasks, callback);\n }\n }", "get belongsTo() {\n\t\treturn this._belongsTo;\n\t}", "get related () {\n\t\treturn this._related;\n\t}", "get relationship() {\n\t\treturn this.__relationship;\n\t}", "static associate(models) {\n models.Pizza.belongsTo(models.OrderItems);\n }", "static associate(models) {\n CreditNote.hasOne(models.client, { foreignKey: 'id', sourceKey: 'clientId' })\n CreditNote.hasOne(models.billingPeriod, { foreignKey: 'id', sourceKey: 'periodId' })\n CreditNote.hasOne(models.account, { foreignKey: 'id', sourceKey: 'accountId' })\n CreditNote.hasOne(models.paymentReceipt, { foreignKey: 'id', sourceKey: 'paymentReceiptId' })\n CreditNote.hasOne(models.paymentOrder, { foreignKey: 'id', sourceKey: 'paymentOrderId' })\n CreditNote.hasOne(models.user, { foreignKey: 'id', sourceKey: 'userId' })\n }", "static associate(models) {\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n as: 'servicos',\n }),\n this.hasMany(models.Arquivo, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Pagamento\n this.hasOne(models.Pagamento, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Servico\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n as: 'services',\n }),\n // Associação com Reserva\n this.hasOne(models.Reserva, {\n foreignKey: 'idReserva',\n as: 'reservas',\n });\n // Associação com Membros\n this.hasOne(models.Membro, {\n foreignKey: 'idMembro',\n as: 'membros',\n });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Tournament);\n this.belongsTo(models.Person);\n this.hasOne(models.Team,{as: 'Speaker1'});\n this.hasOne(models.Team,{as: 'Speaker2'});\n }", "getRelationshipNames(type) {\n let model = this.getModel(\n this.constructor.getModelName(type, this.inflector.singular)\n );\n return util.getReferencePaths(model);\n }", "function findHasMany(model, relationshipName) {\n const relationship = model.relationshipFor(relationshipName);\n return model.hasMany(relationship.key).hasManyRelationship.fetchLink();\n}", "static associate(models) {\n mangas.belongsToMany(models.users, { through: 'models.favorite' });\n }", "get workflowAssociations() {\r\n return new SharePointQueryableCollection(this, \"workflowAssociations\");\r\n }", "async getUserRelations() {\n const teamWithUsers = await this._client.helix.teams.getTeamById(this.id);\n return teamWithUsers.userRelations;\n }", "static get relationMappings() {\n\t\treturn {\n\t\t\tbrand: {\n\t\t\t\trelation: Model.BelongsToOneRelation,\n\t\t\t\tmodelClass: getModelFile('brand'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'promotion_code.id',\n\t\t\t\t\tto: 'brand.id'\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "static associate(models) {\n cd.belongsTo(models.list);\n // define association here\n }", "relateUser() {\n return this.belongsTo(User);\n }", "static associate(models) {\n // define association here\n Data_Peminjaman.belongsTo(models.User);\n Data_Peminjaman.hasOne(models.Data_Pengembalian, { onDelete: \"CASCADE\" });\n Data_Peminjaman.hasOne(models.Detail_Peminjaman, { onDelete: \"CASCADE\" });\n }", "function includeHasManySimple(callback) {\n //Map for Indexing objects by their id for faster retrieval\n var objIdMap2 = includeUtils.buildOneToOneIdentityMapWithOrigKeys(objs, relation.keyFrom);\n\n filter.where[relation.keyTo] = {\n inq: uniq(objIdMap2.getKeys()),\n };\n\n relation.applyScope(null, filter);\n relation.modelTo.find(filter, options, targetFetchHandler);\n\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var targetsIdMap = includeUtils.buildOneToManyIdentityMapWithOrigKeys(targets, relation.keyTo);\n includeUtils.join(objIdMap2, targetsIdMap, function(obj1, valueToMergeIn) {\n defineCachedRelations(obj1);\n obj1.__cachedRelations[relationName] = valueToMergeIn;\n processTargetObj(obj1, function() {});\n });\n callback(err, objs);\n }\n }", "get relatedFields() {\r\n return new SharePointQueryable(this, \"getRelatedFields\");\r\n }", "static associate(models) {\n // define association here\n PresenceList.belongsTo(models.Appointment);\n }", "static associate(models) {\n // define association here\n models.user.hasMany(models.sOsOrder)\n models.user.hasMany(models.mealOrder)\n models.user.hasOne(models.address)\n }", "getRelatedRecords(record) {\n return [];\n }", "getRelatedRecords(record) {\n return [];\n }", "static associate(models) {\n // define association here\n Commande.belongsTo(models.User)\n Commande.belongsTo(models.UserAdresse)\n Commande.belongsTo(models.Plan)\n Commande.belongsToMany(models.CartItem, {\n through: models.OrderItem,\n foreignKey: 'commandeId',\n otherKey: 'cartItemId'\n })\n Commande.hasOne(models.Facture)\n Commande.hasMany(models.Contrat)\n Commande.hasMany(models.Livraison)\n Commande.belongsToMany(models.CompteParrainage,\n {\n through: models.OrderParrain\n })\n\n }", "static associate(models) {\n this.belongsTo(models.User, { foreignKey: 'user_id', as: 'user' });\n this.belongsTo(models.User, { foreignKey: 'follower_id', as: 'follower' });\n\n }", "static get relationMappings() {\n return {\n categories: {\n relation: Model.HasManyRelation,\n // The related model.\n modelClass: Categories,\n join: {\n from: 'Service.id',\n to: 'Categories.service_id'\n }\n },\n branch: {\n relation: Model.BelongsToOneRelation,\n // The related model.\n modelClass: Branch,\n join: {\n from: 'Service.branch_id',\n to: 'Branch.id'\n }\n }\n }\n }", "static associate(models) {\n // define association here\n animalList.belongsTo(models.User);\n animalList.hasMany(models.Comment);\n }", "static associate(models) {\n // define association here\n Nanny.belongsTo(models.Parent);\n Nanny.belongsTo(models.Agency);\n Nanny.belongsToMany(models.Child, { through: models.NannyChild });\n Nanny.belongsTo(models.Parent, {\n sourceKey: \"id\",\n foreignKey: \"ParentId\",\n });\n Nanny.belongsTo(models.Agency, {\n sourceKey: \"id\",\n foreignKey: \"AgencyId\",\n });\n }", "static associate(models) {\n // define association here\n Ronda.hasMany(models.Partida,{foreignKey:'IdRonda',as:'partidas'})\n Ronda.belongsTo(models.Torneo,{foreignKey:'IdTorneo',as:'torneos'})\n }", "function includeHasMany(callback) {\n var sourceIds = [];\n //Map for Indexing objects by their id for faster retrieval\n var objIdMap = {};\n for (var i = 0; i < objs.length; i++) {\n var obj = objs[i];\n // one-to-many: foreign key reference is modelTo -> modelFrom.\n // use modelFrom.keyFrom in where filter later\n var sourceId = obj[relation.keyFrom];\n if (sourceId) {\n sourceIds.push(sourceId);\n objIdMap[sourceId.toString()] = obj;\n }\n // sourceId can be null. but cache empty data as result\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = [];\n }\n filter.where[relation.keyTo] = {\n inq: uniq(sourceIds),\n };\n relation.applyScope(null, filter);\n options.partitionBy = relation.keyTo;\n relation.modelTo.find(filter, options, targetFetchHandler);\n /**\n * Process fetched related objects\n * @param err\n * @param {Array<Model>} targets\n * @returns {*}\n */\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var tasks = [];\n //simultaneously process subIncludes\n if (subInclude && targets) {\n tasks.push(function subIncludesTask(next) {\n relation.modelTo.include(targets, subInclude, options, next);\n });\n }\n //process each target object\n tasks.push(targetLinkingTask);\n function targetLinkingTask(next) {\n if (targets.length === 0) {\n return async.each(objs, function(obj, next) {\n processTargetObj(obj, next);\n }, next);\n }\n\n async.each(targets, linkManyToOne, next);\n function linkManyToOne(target, next) {\n //fix for bug in hasMany with referencesMany\n var targetIds = [].concat(target[relation.keyTo]);\n async.each(targetIds, function(targetId, next) {\n var obj = objIdMap[targetId.toString()];\n if (!obj) return next();\n obj.__cachedRelations[relationName].push(target);\n processTargetObj(obj, next);\n }, function(err, processedTargets) {\n if (err) {\n return next(err);\n }\n\n var objsWithEmptyRelation = objs.filter(function(obj) {\n return obj.__cachedRelations[relationName].length === 0;\n });\n async.each(objsWithEmptyRelation, function(obj, next) {\n processTargetObj(obj, next);\n }, function(err) {\n next(err, processedTargets);\n });\n });\n }\n }\n\n execTasksWithInterLeave(tasks, callback);\n }\n }", "static associate(models) {\n Ingredients.belongsTo(models.Meal, { foreignKey: \"mealId\" });\n }", "static associate(models) {\n comments.belongsTo(models.users, {\n foreignKey: 'usersId',\n onDelete: \"CASCADE\",\n\n })\n comments.hasMany(models.comments, {as:'Children', foreignKey:'commentsId', onDelete:'CASCADE'})\n comments.belongsTo(models.posts, {\n foreignKey: 'postsId',\n onDelete: \"CASCADE\"\n })\n }", "static get relationMappings() {\n return {\n users: {\n relation: Model.HasManyRelation,\n modelClass: User,\n join: {\n from: \"likes.like_id\",\n to: \"users.like_id\",\n },\n },\n\n posts: {\n relation: Model.HasManyRelation,\n modelClass: Post,\n join: {\n from: \"likes.like_id\",\n to: \"posts.like_id\",\n },\n },\n };\n }", "static associate(models) {\n lead.belongsTo(models.contact);\n lead.belongsTo(models.user);\n lead.hasMany(models.report);\n lead.belongsTo(models.salesCyclePhase);\n lead.hasMany(models.action);\n }", "get relatedItems() {\r\n return RelatedItemManagerImpl.FromUrl(this.toUrl());\r\n }", "findOwners() {\n return this._getRelationship('owner', 'from');\n }", "all() {\n return this._models\n }", "static associate(models) {\n Ad.belongsToMany(models.Realtor, {through: models.RealtorAd})\n Ad.hasMany(models.RealtorAd);\n }", "static with(...relationships) {\n\t\tlet joins = [true];\n\t\trelationships.map(rel => {\n\t\t\tlet join = {};\n\t\t\tlet relationship = this;\n\t\t\trelationship = new relationship();\n\t\t\tjoin = relationship[rel](this);\n\t\t\tif(Array.isArray(join)) joins = _.merge(joins, join);\n\t\t\telse joins.push(join);\n\t\t\treturn join;\n\t\t})\n\t\tif(joins[0] !== true) joins.splice(0,0,true);\n\t\treturn adapter(this).queryBuilder({\n\t\t\tjoins,\n\t\t\twith: true,\n\t\t\tmodel: this\n\t\t})\n\t}", "static associate(models) {\n models.Identification_association.hasOne(models.AssociationPage);\n models.Identification_association.belongsTo(models.Representant_legale,{\n foreignKey: 'RepresentantLegaleId'\n });\n }", "static associate(models) {\n pegawais.hasOne(models.meetings,{\n foreignKey:'id_pegawais'\n })\n pegawais.hasMany(models.userakses,{\n foreignKey:'id_pegawais'\n })\n }", "static associate(models) {\n Resposible_people.belongsTo(models.Responsible_type, {\n foreignKey: \"responsible_type_id\",\n });\n Resposible_people.belongsTo(models.Transition, {\n foreignKey: \"transition_id\",\n });\n }", "static associate(models) {\n // define association here\n // this.hasMany(models.StepIngredient);\n this.belongsTo(models.Recipe);\n }", "static associate(models) {\n // define association here\n TodoList.belongsTo(models.User)\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Content_Types, {\n foreignKey: 'id_Content_Type'\n });\n\n this.hasOne(models.Contents, {\n foreignKey: 'id_Content_Rating'\n });\n }", "static associate(models) {\n // define association here\n models.mealOrder.belongsTo(models.user)\n\n }", "favorites () {\n return this.hasMany('App/Models/Favorite')\n }", "static associate(models) {\n this.belongsTo(models.customer);\n this.hasMany(models.itemRental);\n this.hasMany(models.additive);\n }", "static associate (models) {\n Observador.belongsTo(models.Estacion)\n Observador.hasOne(models.Estacion, { as: 'Jefe', constraints: false })\n Observador.belongsTo(models.User)\n }", "static get relationMappings() {\n\t\treturn {\n\t\t\tstores: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\t// The related model. This can be either a Model subclass constructor or an\n\t\t\t\t// absolute file path to a module that exports one. We use the file path version\n\t\t\t\t// here to prevent require loops.\n\t\t\t\tmodelClass: getModelFile('store'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tto: 'store.brand_id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tmanagers: {\n\t\t\t\trelation: Model.ManyToManyRelation,\n\t\t\t\tmodelClass: getModelFile('member'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tthrough: {\n\t\t\t\t\t\tfrom: 'brand_manager.brand_id',\n\t\t\t\t\t\tto: 'brand_manager.member_id'\n\t\t\t\t\t},\n\t\t\t\t\tto: 'member.id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tcreator: {\n\t\t\t\trelation: Model.BelongsToOneRelation,\n\t\t\t\tmodelClass: getModelFile('member'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.creator_id',\n\t\t\t\t\tto: 'member.id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tfoods: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\tmodelClass: getModelFile('food'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tto: 'food.brand_id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tpromotionCodes: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\tmodelClass: getModelFile('promotion_code'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tto: 'promotion_code.brand_id'\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "static associate(models) {\n models.Trip.hasMany(models.Comment, { as: 'comments', foreignKey: 'tripId'})\n }", "static associate(models) {\n // define association here\n UserDonations.belongsTo(models.Users)\n UserDonations.belongsTo(models.Campaigns)\n\n }", "static exposeRelations() {\n const me = this;\n\n if (me.hasOwnProperty('relationsExposed')) return;\n\n if (me.relationConfig) {\n me.relationsExposed = true;\n me.relations = [];\n\n me.relationConfig.forEach((relation) => {\n me.relations.push(relation);\n\n let name = relation.relationName;\n\n // getter and setter for related object\n if (!Reflect.ownKeys(me.prototype).includes(name)) {\n Object.defineProperty(me.prototype, name, {\n enumerable: true,\n get: function() {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n return this.getForeign(name);\n },\n set: function(value) {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n this.setForeign(name, value, relation);\n }\n });\n }\n });\n }\n }", "static associate(models) {\n this.hasOne(models.User, { as: 'user', sourceKey: 'user_id', foreignKey: 'id' });\n }", "static get relationMappings() {\n // Import models here to prevent require loops.\n const Sticker = require('./Sticker');\n\n return {\n stickers: {\n relation: BaseModel.HasManyRelation,\n // The related model. This can be either a Model\n // subclass constructor or an absolute file path\n // to a module that exports one.\n modelClass: Sticker,\n join: {\n from: StickerGroup.tableName + '.id',\n to: Sticker.tableName + '.stickerGroupId'\n }\n }\n };\n }", "static associate(models) {\n // define association here\n models.inboundFavorite.belongsTo(models.outboundFavorite, {onDelete: \"CASCADE\"})\n //models.inboundFavorite.belongsToMany(models.user, {through: \"userInboundFavorite\"});\n }", "static associate(models) {\n Finance.belongsToMany(models.User, { through: 'FinanceDetail'})\n }", "static get relationMappings() {\n return {\n todos: {\n relation: Model.HasManyRelation,\n modelClass: Todo,\n join: {\n from: \"t_author_todos.todo_id\",\n to: \"t_todos.id\"\n }\n }\n };\n }", "function attachRelationships( model, obj ) {\n\tlet r = cache.relationships( model.name );\n\n\n}", "static associate(models) {\n Movie.belongsTo(models.Genre,{\n as:\"genres\",\n foreignKey:\"genre_id\"\n })\n Movie.hasOne(models.Actor,{\n foreignKey:\"favorite_movie_id\"\n })\n Movie.belongsToMany(models.Actor,{\n through:\"actor_movie\",\n as:\"actors\",\n foreignKey:\"movie_id\"\n })\n }", "static associate(models) {\n this.lectures = this.hasMany(models.Lecture, { foreignKey: 'lectureId' });\n this.module = this.belongsTo(models.Module, { foreignKey: 'id' });\n this.quiz = this.hasOne(models.Quiz, { foreignKey: 'lectureGroupId' });\n }", "static associate(models) {\n Obra.hasMany(models.AvanceObra, { foreignKey: 'idObra' })\n Obra.belongsTo(models.Cliente);\n Obra.belongsToMany(models.Trabajadores, { through: models.Obra_Trabajadores, as: \"trabajadores\",\n foreignKey: \"obraId\", });\n }", "static associate(models) {\n Empresa.hasMany(models.freelancer)\n Empresa.hasMany(models.usuario)\n }", "static associate(models) {\n // define association here\n ListenList.belongsTo(models.user, { foreignKey: { name: 'userId' } });\n }", "static associate(models) {\n Pessoas.hasMany(models.Turmas, {\n foreignKey: 'docente_id'\n })\n Pessoas.hasMany(models.Matriculas, {\n foreignKey: 'estudante_id',\n scope: {status: 'confirmado'},\n as: 'aulasMatriculadas'\n })\n }", "function includeHasManyThrough(callback) {\n var sourceIds = [];\n //Map for Indexing objects by their id for faster retrieval\n var objIdMap = {};\n for (var i = 0; i < objs.length; i++) {\n var obj = objs[i];\n // one-to-many: foreign key reference is modelTo -> modelFrom.\n // use modelFrom.keyFrom in where filter later\n var sourceId = obj[relation.keyFrom];\n if (sourceId) {\n sourceIds.push(sourceId);\n objIdMap[sourceId.toString()] = obj;\n }\n // sourceId can be null. but cache empty data as result\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = [];\n }\n //default filters are not applicable on through model. should be applied\n //on modelTo later in 2nd DB call.\n var throughFilter = {\n where: {},\n };\n throughFilter.where[relation.keyTo] = {\n inq: uniq(sourceIds),\n };\n if (polymorphic) {\n //handle polymorphic hasMany (reverse) in which case we need to filter\n //by discriminator to filter other types\n throughFilter.where[polymorphic.discriminator] =\n relation.modelFrom.definition.name;\n }\n /**\n * 1st DB Call of 2 step process. Get through model objects first\n */\n relation.modelThrough.find(throughFilter, options, throughFetchHandler);\n /**\n * Handle the results of Through model objects and fetch the modelTo items\n * @param err\n * @param {Array<Model>} throughObjs\n * @returns {*}\n */\n function throughFetchHandler(err, throughObjs) {\n if (err) {\n return callback(err);\n }\n // start preparing for 2nd DB call.\n var targetIds = [];\n var targetObjsMap = {};\n for (var i = 0; i < throughObjs.length; i++) {\n var throughObj = throughObjs[i];\n var targetId = throughObj[relation.keyThrough];\n if (targetId) {\n //save targetIds for 2nd DB Call\n targetIds.push(targetId);\n var sourceObj = objIdMap[throughObj[relation.keyTo]];\n var targetIdStr = targetId.toString();\n //Since targetId can be duplicates, multiple source objs are put\n //into buckets.\n var objList = targetObjsMap[targetIdStr] =\n targetObjsMap[targetIdStr] || [];\n objList.push(sourceObj);\n }\n }\n //Polymorphic relation does not have idKey of modelTo. Find it manually\n var modelToIdName = idName(relation.modelTo);\n filter.where[modelToIdName] = {\n inq: uniq(targetIds),\n };\n\n //make sure that the modelToIdName is included if fields are specified\n if (Array.isArray(fields) && fields.indexOf(modelToIdName) === -1) {\n fields.push(modelToIdName);\n } else if (isPlainObject(fields) && !fields[modelToIdName]) {\n fields[modelToIdName] = true;\n }\n\n /**\n * 2nd DB Call of 2 step process. Get modelTo (target) objects\n */\n relation.modelTo.find(filter, options, targetsFetchHandler);\n function targetsFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var tasks = [];\n //simultaneously process subIncludes. Call it first as it is an async\n //process.\n if (subInclude && targets) {\n tasks.push(function subIncludesTask(next) {\n relation.modelTo.include(targets, subInclude, options, next);\n });\n }\n //process & link each target with object\n tasks.push(targetLinkingTask);\n function targetLinkingTask(next) {\n async.each(targets, linkManyToMany, next);\n function linkManyToMany(target, next) {\n var targetId = target[modelToIdName];\n var objList = targetObjsMap[targetId.toString()];\n async.each(objList, function(obj, next) {\n if (!obj) return next();\n obj.__cachedRelations[relationName].push(target);\n processTargetObj(obj, next);\n }, next);\n }\n }\n\n execTasksWithInterLeave(tasks, callback);\n }\n }\n }", "static associate(models) {\n // define association here\n GoalSetting.belongsTo(models.User)\n }", "static associate(models) {\n goal.belongsTo(models.user, {\n foreignKey: { \n name: 'user_id', \n allowNull: false \n },\n onDelete: 'CASCADE',\n })\n }", "static associate(models) {\n // define association here\n models.producto.belongsToMany(models.lista_producto, {through: this, foreignKey: 'productoId'})\n models.lista_producto.belongsToMany(models.producto, {through: this, foreignKey: 'listaId'})\n }", "static getAll() {\n return this.this_model().find();\n }", "static associate (models) {\n // define association here\n models.Stream.belongsTo(models.Streamer)\n models.Stream.belongsTo(models.Game)\n\n models.Stream.hasMany(models.Viewer)\n models.Stream.hasMany(models.Follower)\n }", "get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }", "static exposeRelations() {\n const me = this;\n if (me.hasOwnProperty('relationsExposed')) return;\n\n if (me.relationConfig) {\n me.relationsExposed = true;\n me.relations = [];\n me.relationConfig.forEach(relation => {\n me.relations.push(relation);\n const name = relation.relationName; // getter and setter for related object\n\n if (!Reflect.ownKeys(me.prototype).includes(name)) {\n Object.defineProperty(me.prototype, name, {\n enumerable: true,\n get: function () {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n return this.getForeign(name);\n },\n set: function (value) {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n this.setForeign(name, value, relation);\n }\n });\n }\n });\n }\n }", "static associate(models) {\n // define association here\n // models.garagedream.belongsToMany(models.car, {through: 'dreamcars'});\n // models.garagedream.hasMany(models.car, {through: 'allcars'});\n models.garagedream.belongsTo(models.user); //user can also have a dream garage\n }", "static associate(models) {\n this.belongsTo(models.User)\n this.belongsTo(models.Tenant)\n this.belongsTo(models.Group)\n }", "static associate(models) {\n // define association here\n // Doctor.hasOne(models.Doctor_Type, {foreignKey: 'type_id', foreignKeyConstraint: true })\n Doctor.belongsToMany(models.Hospital, {through : \"Work_Places\"})\n Doctor.belongsToMany(models.Skill, {through : \"Specialties\"})\n Doctor.belongsToMany(models.Diseases, {through : \"Disease_Specialties\"})\n Doctor.belongsToMany(models.Practice_time, {through : \"Docktor_Practice_Times\"})\n }", "static associate(models) {\n // define association here\n Paket.belongsToMany(models.User, { through: \"Subscribe\", foreignKey: \"paketId\" })\n Paket.belongsToMany(models.Materi, { through: \"PaketMateri\", foreignKey: \"paketId\" })\n //\n Paket.hasOne(models.Payment, {foreignKey: \"paketId\"})\n }", "static associate(models) {\n Friends.belongsTo(models.User, {foreignKey: 'userid',targetKey:'id'}),\n Friends.belongsTo(models.User, {foreignKey: 'friendid',targetKey:'id'})\n }", "static associate(models) {\n models.Admin.hasOne(models.User, {\n foreignKey: 'userable_id',\n constraints: false,\n scope: {\n userable: 'Admin'\n },\n as: 'userable',\n });\n }", "static associate(models) {\n models.post.belongsToMany(models.user, {through: 'userPost'})\n }", "static associate(models) {\n // define association here\n // Follower.hasMany(models.User, {\n // foreignKey: [\"followeeid\", \"followerid\"],\n // });\n }", "static associate(models) {\n this.belongsTo(models.account_types, {\n foreignKey: 'type'\n });\n this.belongsTo(models.Clients, {\n foreignKey: 'client_id'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_ori'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_des'\n });\n }", "function includePolymorphicBelongsTo(callback) {\n var targetIdsByType = {};\n //Map for Indexing objects by their type and targetId for faster retrieval\n var targetObjMapByType = {};\n for (var i = 0; i < objs.length; i++) {\n var obj = objs[i];\n var discriminator = polymorphic.discriminator;\n var modelType = obj[discriminator];\n if (modelType) {\n targetIdsByType[modelType] = targetIdsByType[modelType] || [];\n targetObjMapByType[modelType] = targetObjMapByType[modelType] || {};\n var targetIds = targetIdsByType[modelType];\n var targetObjsMap = targetObjMapByType[modelType];\n var targetId = obj[relation.keyFrom];\n if (targetId) {\n targetIds.push(targetId);\n var targetIdStr = targetId.toString();\n targetObjsMap[targetIdStr] = targetObjsMap[targetIdStr] || [];\n //Is belongsTo. Multiple objects can have the same\n //targetId and therefore map value is an array\n targetObjsMap[targetIdStr].push(obj);\n }\n }\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = null;\n }\n async.each(Object.keys(targetIdsByType), processPolymorphicType,\n callback);\n /**\n * Process Polymorphic objects of each type (modelType)\n * @param {String} modelType\n * @param callback\n */\n function processPolymorphicType(modelType, callback) {\n var typeFilter = {where: {}};\n utils.mergeQuery(typeFilter, filter);\n var targetIds = targetIdsByType[modelType];\n typeFilter.where[relation.keyTo] = {\n inq: uniq(targetIds),\n };\n var Model = lookupModel(relation.modelFrom.dataSource.modelBuilder.\n models, modelType);\n if (!Model) {\n callback(new Error(g.f('Discriminator type %s specified but no model exists with such name',\n modelType)));\n return;\n }\n relation.applyScope(null, typeFilter);\n Model.find(typeFilter, options, targetFetchHandler);\n /**\n * Process fetched related objects\n * @param err\n * @param {Array<Model>} targets\n * @returns {*}\n */\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var tasks = [];\n\n //simultaneously process subIncludes\n if (subInclude && targets) {\n tasks.push(function subIncludesTask(next) {\n Model.include(targets, subInclude, options, next);\n });\n }\n //process each target object\n tasks.push(targetLinkingTask);\n function targetLinkingTask(next) {\n var targetObjsMap = targetObjMapByType[modelType];\n async.each(targets, linkOneToMany, next);\n function linkOneToMany(target, next) {\n var objList = targetObjsMap[target[relation.keyTo].toString()];\n async.each(objList, function(obj, next) {\n if (!obj) return next();\n obj.__cachedRelations[relationName] = target;\n processTargetObj(obj, next);\n }, next);\n }\n }\n\n execTasksWithInterLeave(tasks, callback);\n }\n }\n }", "static associate(models) {\n // define association here\n UserService.belongsTo(models.User, {\n foreignKey: 'user_id'\n });\n UserService.belongsTo(models.Service, {\n foreignKey: 'service_id'\n })\n UserService.belongsTo(models.Hairstylist, {\n foreignKey: 'hairstylist_id'\n })\n }", "profile() {\n return this.hasOne('App/Models/Profile')\n }", "static associate(models) {\n this.hasMany(models.MedicalRecord);\n this.belongsTo(models.Member, {\n foreignKey: 'member_id',\n });\n }", "initRelations() {\n const me = this,\n relations = me.constructor.relations;\n\n if (!relations) return;\n\n // TODO: feels strange to have to look at the store for relation config but didn't figure out anything better.\n // TODO: because other option would be to store it on each model instance, not better...\n\n me.stores.forEach((store) => {\n if (!store.modelRelations) store.initRelations();\n\n // TODO: not at all tested for multiple stores, can't imagine it works as is\n const relatedRecords = [];\n\n store.modelRelations &&\n store.modelRelations.forEach((config) => {\n relatedRecords.push({ related: me.initRelation(config), config });\n });\n store.updateRecordRelationCache(me, relatedRecords);\n });\n }", "static associate(models) {\n // define association here\n Entreprise.belongsTo(models.Client)\n Entreprise.belongsToMany(models.Paper, {through: models.PaperAdvancement})\n }", "static associate(models) {\n this.belongsTo(models.users)\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.deal);\n }", "static associate(models) {\n users.hasOne(models.roles)\n users.belongsToMany(models.customers, {through: models.customers_users})\n }", "getRelationKeys() {\n return [this.relation.throughForeignKeyColumnName];\n }", "static associate(models) {\n models.Post.belongsTo(models.User, {\n foreignKey: \"UserId\"\n })// le modèle Post peut avoir plusieur user\n models.Post.hasMany(models.Likes,{ onDelete: 'cascade' }) // le modèle Post peut avoir plusieur like\n models.Post.hasMany(models.Commentary, { onDelete: 'cascade' }) // le modèle Post peut avoir plusieur commentaires\n }", "static associate(models) {\n // define association here\n //ONE TO MANY (A USER CAN HAVE MANY REACTIONS) BUT (REACTION ONLY BELONG TO ONE USER)\n this.belongsTo(models.Message, {foreignKey:'messageId'})\n this.belongsTo(models.User , {foreignKey:'userId'})\n }" ]
[ "0.68987685", "0.61487544", "0.6027363", "0.58761775", "0.58463377", "0.5805136", "0.5754584", "0.5703502", "0.553503", "0.53726923", "0.5371594", "0.53639746", "0.53346974", "0.53336334", "0.53199184", "0.5313706", "0.5261409", "0.5260003", "0.5255058", "0.5251571", "0.5249412", "0.5242953", "0.52381176", "0.52295434", "0.5227541", "0.5203998", "0.52009207", "0.5196216", "0.5196216", "0.51885706", "0.5159957", "0.51581055", "0.5138379", "0.5129198", "0.51283616", "0.51229817", "0.5122821", "0.5121259", "0.512022", "0.5114837", "0.5107706", "0.51035374", "0.50992674", "0.5097905", "0.5091524", "0.50901014", "0.50828713", "0.50813633", "0.5067623", "0.50497186", "0.5048147", "0.50374025", "0.50371534", "0.50308335", "0.50136864", "0.5002793", "0.4996133", "0.4989718", "0.49755424", "0.49722058", "0.49721235", "0.49706858", "0.49594954", "0.49550912", "0.49545333", "0.49495968", "0.49345943", "0.49283302", "0.4919302", "0.49164003", "0.49121818", "0.49060807", "0.49035144", "0.48966122", "0.48887438", "0.4888287", "0.4888112", "0.4887911", "0.48801178", "0.48778322", "0.48765886", "0.48755172", "0.48617154", "0.48590964", "0.48563212", "0.48555943", "0.4854534", "0.4854292", "0.485022", "0.48497444", "0.48489025", "0.48439568", "0.48418343", "0.48416713", "0.48412776", "0.4834335", "0.48270077", "0.48225954", "0.48223656", "0.48208007" ]
0.60700727
2
Get a list of hasmany relationships for this model
get hasMany() { return this._hasMany; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRelated() {}", "get relatesTo() {\n\t\treturn this.__relatesTo;\n\t}", "async getUserRelations() {\n const teamWithUsers = await this._client.helix.teams.getTeamById(this.id);\n return teamWithUsers.userRelations;\n }", "static exposeRelations() {\n const me = this;\n\n if (me.hasOwnProperty('relationsExposed')) return;\n\n if (me.relationConfig) {\n me.relationsExposed = true;\n me.relations = [];\n\n me.relationConfig.forEach((relation) => {\n me.relations.push(relation);\n\n let name = relation.relationName;\n\n // getter and setter for related object\n if (!Reflect.ownKeys(me.prototype).includes(name)) {\n Object.defineProperty(me.prototype, name, {\n enumerable: true,\n get: function() {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n return this.getForeign(name);\n },\n set: function(value) {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n this.setForeign(name, value, relation);\n }\n });\n }\n });\n }\n }", "function findHasMany(model, relationshipName) {\n const relationship = model.relationshipFor(relationshipName);\n return model.hasMany(relationship.key).hasManyRelationship.fetchLink();\n}", "get relatedItems() {\r\n return RelatedItemManagerImpl.FromUrl(this.toUrl());\r\n }", "static exposeRelations() {\n const me = this;\n if (me.hasOwnProperty('relationsExposed')) return;\n\n if (me.relationConfig) {\n me.relationsExposed = true;\n me.relations = [];\n me.relationConfig.forEach(relation => {\n me.relations.push(relation);\n const name = relation.relationName; // getter and setter for related object\n\n if (!Reflect.ownKeys(me.prototype).includes(name)) {\n Object.defineProperty(me.prototype, name, {\n enumerable: true,\n get: function () {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n return this.getForeign(name);\n },\n set: function (value) {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n this.setForeign(name, value, relation);\n }\n });\n }\n });\n }\n }", "get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }", "get workflowAssociations() {\r\n return new SharePointQueryableCollection(this, \"workflowAssociations\");\r\n }", "static get relationMappings() {\n return {\n users: {\n relation: Model.HasManyRelation,\n modelClass: User,\n join: {\n from: \"likes.like_id\",\n to: \"users.like_id\",\n },\n },\n\n posts: {\n relation: Model.HasManyRelation,\n modelClass: Post,\n join: {\n from: \"likes.like_id\",\n to: \"posts.like_id\",\n },\n },\n };\n }", "static get relationMappings() {\n return {\n todos: {\n relation: Model.HasManyRelation,\n modelClass: Todo,\n join: {\n from: \"t_author_todos.todo_id\",\n to: \"t_todos.id\"\n }\n }\n };\n }", "static associate(models) {\n // define association here\n models.producto.belongsToMany(models.lista_producto, {through: this, foreignKey: 'productoId'})\n models.lista_producto.belongsToMany(models.producto, {through: this, foreignKey: 'listaId'})\n }", "get relatedFields() {\r\n return new SharePointQueryable(this, \"getRelatedFields\");\r\n }", "static get relationMappings() {\n\t\treturn {\n\t\t\tstores: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\t// The related model. This can be either a Model subclass constructor or an\n\t\t\t\t// absolute file path to a module that exports one. We use the file path version\n\t\t\t\t// here to prevent require loops.\n\t\t\t\tmodelClass: getModelFile('store'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tto: 'store.brand_id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tmanagers: {\n\t\t\t\trelation: Model.ManyToManyRelation,\n\t\t\t\tmodelClass: getModelFile('member'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tthrough: {\n\t\t\t\t\t\tfrom: 'brand_manager.brand_id',\n\t\t\t\t\t\tto: 'brand_manager.member_id'\n\t\t\t\t\t},\n\t\t\t\t\tto: 'member.id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tcreator: {\n\t\t\t\trelation: Model.BelongsToOneRelation,\n\t\t\t\tmodelClass: getModelFile('member'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.creator_id',\n\t\t\t\t\tto: 'member.id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tfoods: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\tmodelClass: getModelFile('food'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tto: 'food.brand_id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tpromotionCodes: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\tmodelClass: getModelFile('promotion_code'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tto: 'promotion_code.brand_id'\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "static get relationMappings() {\n return {\n categories: {\n relation: Model.HasManyRelation,\n // The related model.\n modelClass: Categories,\n join: {\n from: 'Service.id',\n to: 'Categories.service_id'\n }\n },\n branch: {\n relation: Model.BelongsToOneRelation,\n // The related model.\n modelClass: Branch,\n join: {\n from: 'Service.branch_id',\n to: 'Branch.id'\n }\n }\n }\n }", "static hasMany( model, options ) {\n\t\tif( this.name == \"Model\" ) {\n\t\t\tthrow \"Cannot invoke method directly on Model class\";\n\t\t}\n\n\t\tcache.relationships( this.name ).addHasMany( model, options );\n\t}", "function getRelations(d, i) {\n var links = []\n var linksCount = 0\n for (i in relations) {\n if (nodeHash[d.class] === relations[i].target) {\n links[linksCount] = relations[i]\n linksCount++\n }\n }\n return links\n }", "static associate(models) {\n Ad.belongsToMany(models.Realtor, {through: models.RealtorAd})\n Ad.hasMany(models.RealtorAd);\n }", "serializeHasMany(snapshot, json, relationship) {\n DS.JSONSerializer.prototype.serializeHasMany.call(this, snapshot, json, relationship);\n }", "function includeReferencesMany(callback) {\n var modelToIdName = idName(relation.modelTo);\n var allTargetIds = [];\n //Map for Indexing objects by their id for faster retrieval\n var targetObjsMap = {};\n for (var i = 0; i < objs.length; i++) {\n var obj = objs[i];\n // one-to-many: foreign key reference is modelTo -> modelFrom.\n // use modelFrom.keyFrom in where filter later\n var targetIds = obj[relation.keyFrom];\n if (targetIds) {\n if (typeof targetIds === 'string') {\n // For relational DBs, the array is stored as stringified json\n // Please note obj is a plain object at this point\n targetIds = JSON.parse(targetIds);\n }\n //referencesMany has multiple targetIds per obj. We need to concat\n // them into allTargetIds before DB Call\n allTargetIds = allTargetIds.concat(targetIds);\n for (var j = 0; j < targetIds.length; j++) {\n var targetId = targetIds[j];\n var targetIdStr = targetId.toString();\n var objList = targetObjsMap[targetIdStr] =\n targetObjsMap[targetIdStr] || [];\n objList.push(obj);\n }\n }\n // sourceId can be null. but cache empty data as result\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = [];\n }\n filter.where[relation.keyTo] = {\n inq: uniq(allTargetIds),\n };\n relation.applyScope(null, filter);\n /**\n * Make the DB Call, fetch all target objects\n */\n relation.modelTo.find(filter, options, targetFetchHandler);\n /**\n * Handle the fetched target objects\n * @param err\n * @param {Array<Model>}targets\n * @returns {*}\n */\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var tasks = [];\n //simultaneously process subIncludes\n if (subInclude && targets) {\n tasks.push(function subIncludesTask(next) {\n relation.modelTo.include(targets, subInclude, options, next);\n });\n }\n targets = utils.sortObjectsByIds(modelToIdName, allTargetIds, targets);\n //process each target object\n tasks.push(targetLinkingTask);\n function targetLinkingTask(next) {\n async.each(targets, linkManyToMany, next);\n function linkManyToMany(target, next) {\n var objList = targetObjsMap[target[relation.keyTo].toString()];\n async.each(objList, function(obj, next) {\n if (!obj) return next();\n obj.__cachedRelations[relationName].push(target);\n processTargetObj(obj, next);\n }, next);\n }\n }\n\n execTasksWithInterLeave(tasks, callback);\n }\n }", "static get relationMappings() {\n return {\n products: {\n relation: Model.ManyToManyRelation,\n modelClass: Product,\n join: {\n from: 'shops.id',\n // ManyToMany relation needs the `through` object to describe the join table.\n through: {\n from: 'shops_products.shopId',\n to: 'shops_products.productId'\n },\n to: 'products.id'\n }\n }\n };\n }", "getRelationKeys() {\n return [this.relation.throughForeignKeyColumnName];\n }", "static associate(models) {\n models.attraction.belongsTo(models.themePark)\n models.attraction.hasMany(models.attractionFavorites)\n models.attraction.belongsToMany(models.creative, {through: \"projectWork\"})\n }", "getRelationshipNames(type) {\n let model = this.getModel(\n this.constructor.getModelName(type, this.inflector.singular)\n );\n return util.getReferencePaths(model);\n }", "function includeHasMany(callback) {\n var sourceIds = [];\n //Map for Indexing objects by their id for faster retrieval\n var objIdMap = {};\n for (var i = 0; i < objs.length; i++) {\n var obj = objs[i];\n // one-to-many: foreign key reference is modelTo -> modelFrom.\n // use modelFrom.keyFrom in where filter later\n var sourceId = obj[relation.keyFrom];\n if (sourceId) {\n sourceIds.push(sourceId);\n objIdMap[sourceId.toString()] = obj;\n }\n // sourceId can be null. but cache empty data as result\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = [];\n }\n filter.where[relation.keyTo] = {\n inq: uniq(sourceIds),\n };\n relation.applyScope(null, filter);\n options.partitionBy = relation.keyTo;\n relation.modelTo.find(filter, options, targetFetchHandler);\n /**\n * Process fetched related objects\n * @param err\n * @param {Array<Model>} targets\n * @returns {*}\n */\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var tasks = [];\n //simultaneously process subIncludes\n if (subInclude && targets) {\n tasks.push(function subIncludesTask(next) {\n relation.modelTo.include(targets, subInclude, options, next);\n });\n }\n //process each target object\n tasks.push(targetLinkingTask);\n function targetLinkingTask(next) {\n if (targets.length === 0) {\n return async.each(objs, function(obj, next) {\n processTargetObj(obj, next);\n }, next);\n }\n\n async.each(targets, linkManyToOne, next);\n function linkManyToOne(target, next) {\n //fix for bug in hasMany with referencesMany\n var targetIds = [].concat(target[relation.keyTo]);\n async.each(targetIds, function(targetId, next) {\n var obj = objIdMap[targetId.toString()];\n if (!obj) return next();\n obj.__cachedRelations[relationName].push(target);\n processTargetObj(obj, next);\n }, function(err, processedTargets) {\n if (err) {\n return next(err);\n }\n\n var objsWithEmptyRelation = objs.filter(function(obj) {\n return obj.__cachedRelations[relationName].length === 0;\n });\n async.each(objsWithEmptyRelation, function(obj, next) {\n processTargetObj(obj, next);\n }, function(err) {\n next(err, processedTargets);\n });\n });\n }\n }\n\n execTasksWithInterLeave(tasks, callback);\n }\n }", "static with(...relationships) {\n\t\tlet joins = [true];\n\t\trelationships.map(rel => {\n\t\t\tlet join = {};\n\t\t\tlet relationship = this;\n\t\t\trelationship = new relationship();\n\t\t\tjoin = relationship[rel](this);\n\t\t\tif(Array.isArray(join)) joins = _.merge(joins, join);\n\t\t\telse joins.push(join);\n\t\t\treturn join;\n\t\t})\n\t\tif(joins[0] !== true) joins.splice(0,0,true);\n\t\treturn adapter(this).queryBuilder({\n\t\t\tjoins,\n\t\t\twith: true,\n\t\t\tmodel: this\n\t\t})\n\t}", "static get relationMappings() {\n // Import models here to prevent require loops.\n const Sticker = require('./Sticker');\n\n return {\n stickers: {\n relation: BaseModel.HasManyRelation,\n // The related model. This can be either a Model\n // subclass constructor or an absolute file path\n // to a module that exports one.\n modelClass: Sticker,\n join: {\n from: StickerGroup.tableName + '.id',\n to: Sticker.tableName + '.stickerGroupId'\n }\n }\n };\n }", "loadRelations(results) {\n const relationsArray = [];\n for (const relation of this.relations) {\n let loader;\n switch (relation.type) {\n case RelationTypes.HasOne:\n loader = new HasOne(this.db, this.connector, this, relation);\n relationsArray.push(loader.fetch(results));\n break;\n case RelationTypes.HasMany:\n loader = new HasMany(this.db, this.connector, this, relation);\n relationsArray.push(loader.fetch(results));\n break;\n case RelationTypes.HasManyMultiEntry:\n loader = new HasManyMulti(this.db, this.connector, this, relation);\n relationsArray.push(loader.fetch(results));\n break;\n case RelationTypes.HasManyThroughMultiEntry:\n loader = new HasManyThroughMulti(this.db, this.connector, this, relation);\n relationsArray.push(loader.fetch(results));\n break;\n default:\n throw new Error(`Unknown relation ${relation.type}`);\n }\n }\n return relationsArray.concat(this.loadCustomRelations(results));\n }", "static associate(models) {\n models.post.belongsToMany(models.user, {through: 'userPost'})\n }", "static associate(models) {\n mangas.belongsToMany(models.users, { through: 'models.favorite' });\n }", "_generateSerializedHasMany(snapshot, relationship) {\n var hasMany = snapshot.hasMany(relationship.key);\n var manyArray = Ember.A(hasMany);\n var ret = new Array(manyArray.length);\n\n for (var i = 0; i < manyArray.length; i++) {\n var embeddedSnapshot = manyArray[i];\n var embeddedJson = embeddedSnapshot.serialize({ includeId: true });\n this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, embeddedJson);\n ret[i] = embeddedJson;\n }\n\n return ret;\n }", "getRelatedRecords(record) {\n return [];\n }", "getRelatedRecords(record) {\n return [];\n }", "static associate(models) {\n Bonus.belongsToMany(models.order, { through: 'orderBonuses', timestamps: false })\n Bonus.belongsToMany(models.discount, { through: 'bonusDiscounts', timestamps: false })\n }", "function HasMany(model, related, foreignKey, localKey) {\n var _this = _super.call(this, model) /* istanbul ignore next */ || this;\n _this.related = _this.model.relation(related);\n _this.foreignKey = foreignKey;\n _this.localKey = localKey;\n return _this;\n }", "static associate(models) {\n this.hasMany(models.portfolio);\n this.belongsToMany(models.stack, { through: \"user_stack\" });\n this.hasMany(models.project, {\n as: \"myProject\",\n });\n this.belongsToMany(models.project, {\n as: \"attendProject\",\n through: \"attendUser\",\n });\n }", "static associate(models) {\n\n Produtos.belongsTo(models.Usuarios, { \n through: 'Usuarios',\n as: 'usuarios',\n foreignKey: 'usuarios_id'})\n\n Produtos.belongsToMany(models.Pedidos, { \n through: \"PedidosProdutos\",\n as: 'pedido',\n foreignKey: 'pedidos_id'})\n \n}", "static associate(models) {\n cd.belongsTo(models.list);\n // define association here\n }", "static associate(models) {\n // define association here\n models.Account.belongsToMany(models.Team, {\n foreignKey: \"accountId\",\n through: \"account_team\",\n as: \"teams\",\n });\n\n models.Account.belongsToMany(models.Meeting, {\n foreignKey: \"accountId\",\n through: \"meeting_account\",\n as: \"meetings\",\n });\n }", "async listRelations(topicId) {\n return await this.db.find({ nodeType: 'relation', $or: [{ sourceId: topicId }, { targetId: topicId }]});\n }", "static associate(models) {\n // define association here\n // N:M\n models.Pedido.belongsToMany(models.Producto, {\n through: {\n model: \"PedidoProductos\",\n },\n foreignKey: \"pedidoId\"\n })\n // N:1\n models.Pedido.belongsTo(models.Cliente, {\n foreignKey: 'clienteId'\n });\n }", "get belongsTo() {\n\t\treturn this._belongsTo;\n\t}", "getChildren () {\n const doc = this.getDocument()\n const id = this.id\n const schema = this.getSchema()\n let result = []\n for (let p of schema) {\n const name = p.name\n if (p.isText()) {\n let annos = doc.getAnnotations([id, name])\n forEach(annos, a => result.push(a))\n } else if (p.isReference() && p.isOwned()) {\n let val = this[name]\n if (val) {\n if (p.isArray()) {\n result = result.concat(val.map(id => doc.get(id)))\n } else {\n result.push(doc.get(val))\n }\n }\n }\n }\n return result\n }", "static get relationMappings() {\n return {\n weapons: {\n relation: Model.ManyToManyRelation,\n modelClass: __dirname + '/Weapon',\n join: {\n from: 'property.id',\n // Join table is weapon_property\n through: {\n from: 'weapon_property.property_id',\n to: 'weapon_property.weapon_id'\n },\n to: 'weapon.id'\n }\n }\n };\n }", "static associate(models) {\n // define association here\n animalList.belongsTo(models.User);\n animalList.hasMany(models.Comment);\n }", "initRelations() {\n const me = this,\n relations = me.constructor.relations;\n\n if (!relations) return;\n\n // TODO: feels strange to have to look at the store for relation config but didn't figure out anything better.\n // TODO: because other option would be to store it on each model instance, not better...\n\n me.stores.forEach((store) => {\n if (!store.modelRelations) store.initRelations();\n\n // TODO: not at all tested for multiple stores, can't imagine it works as is\n const relatedRecords = [];\n\n store.modelRelations &&\n store.modelRelations.forEach((config) => {\n relatedRecords.push({ related: me.initRelation(config), config });\n });\n store.updateRecordRelationCache(me, relatedRecords);\n });\n }", "static associate(models) {\n // define association here\n models.exercise.belongsToMany(models.user, {through: 'userExercises'})\n models.exercise.hasMany(models.comment)\n models.exercise.belongsToMany(models.workout, {through: 'exerciseWorkouts'})\n }", "static associate(models) {\n // define association here\n Commande.belongsTo(models.User)\n Commande.belongsTo(models.UserAdresse)\n Commande.belongsTo(models.Plan)\n Commande.belongsToMany(models.CartItem, {\n through: models.OrderItem,\n foreignKey: 'commandeId',\n otherKey: 'cartItemId'\n })\n Commande.hasOne(models.Facture)\n Commande.hasMany(models.Contrat)\n Commande.hasMany(models.Livraison)\n Commande.belongsToMany(models.CompteParrainage,\n {\n through: models.OrderParrain\n })\n\n }", "getAssociateReferences() {\n\t\treturn this.associatedReferences;\n\t}", "static associate(models) {\n // define association here\n ProductCategory.hasMany(models.Product)\n ProductCategory.hasMany(models.ProductCategory, {\n foreignKey: 'parentId',\n })\n }", "static associate(models) {\n models.Pizza.belongsTo(models.OrderItems);\n }", "static associate(models) {\n // define association here\n Group.belongsToMany(models.Role,{through:\"GroupRole\"})\n Group.belongsToMany(models.User,{through:\"UserGroup\"})\n Group.belongsToMany(models.Hospital,{through:\"HospitalGroup\"})\n Group.hasMany(models.Group,{foreignKey:\"parentGroupId\"})\n }", "static associate (models) {\n // define association here\n Group.belongsTo(models.User)\n Group.hasMany(models.Course, { onDelete: 'CASCADE', hooks: true })\n Group.belongsToMany(models.User, {\n through: models.Follow,\n foreignKey: 'GroupId',\n as: 'followers'\n })\n }", "get related () {\n\t\treturn this._related;\n\t}", "static associate(models) {\n comments.belongsTo(models.users, {\n foreignKey: 'usersId',\n onDelete: \"CASCADE\",\n\n })\n comments.hasMany(models.comments, {as:'Children', foreignKey:'commentsId', onDelete:'CASCADE'})\n comments.belongsTo(models.posts, {\n foreignKey: 'postsId',\n onDelete: \"CASCADE\"\n })\n }", "function listDatabaseRelations(cb) {\n\tBase.Base.prototype._query(databaseRelationsQuery, cb);\n}", "static relations() {\n return [\"acl\", \"advcl\", \"advmod\", \"amod\", \"appos\", \"aux\", \"auxpass\", \"case\", \"cc\", \"ccomp\", \"compound\", \"conj\", \"cop\", \"csubj\", \"csubjpass\", \"dep\", \"det\", \"discourse\", \"dislocated\", \"dobj\", \"expl\", \"foreign\", \"goeswith\", \"iobj\", \"list\", \"mark\", \"mwe\", \"name\", \"neg\", \"nmod\", \"nsubj\", \"nsubjpass\", \"nummod\", \"parataxis\", \"punct\", \"remnant\", \"reparandum\", \"root\", \"vocative\", \"xcomp\"]\n }", "static associate(models) {\n // define association here\n // models.garagedream.belongsToMany(models.car, {through: 'dreamcars'});\n // models.garagedream.hasMany(models.car, {through: 'allcars'});\n models.garagedream.belongsTo(models.user); //user can also have a dream garage\n }", "all() {\n return this._models\n }", "static associate(models) {\n this.hasMany(models.Image, {\n foreignKey: \"imageableId\",\n onDelete: \"CASCADE\",\n hooks: true,\n scope: {\n imageableType: \"product\",\n },\n });\n\n this.hasMany(models.Arrival, {\n foreignKey: \"productId\",\n onDelete: \"CASCADE\",\n hooks: true,\n });\n\n this.belongsTo(models.Category, {\n foreignKey: \"categoryId\",\n });\n\n this.belongsToMany(models.Bill, {\n through: \"BillProducts\",\n });\n\n this.belongsToMany(models.Cart, {\n through: \"CartProducts\",\n });\n\n this.belongsToMany(models.Wishlist, {\n through: \"WishlistProducts\",\n });\n }", "static associate(models) {\n // define association here\n models.spell.belongsToMany(models.spellbook, { through: \"spellbooks_spells\" })\n }", "static associate(models) {\n Patient.belongsToMany(models.Doctor, { through: models.Schedule });\n Patient.hasMany(models.Schedule);\n }", "get relations () {\n return {\n 'artist': {\n type: ' hasOne',\n fk : 'artist_id'\n }\n }\n }", "function includeHasManyThrough(callback) {\n var sourceIds = [];\n //Map for Indexing objects by their id for faster retrieval\n var objIdMap = {};\n for (var i = 0; i < objs.length; i++) {\n var obj = objs[i];\n // one-to-many: foreign key reference is modelTo -> modelFrom.\n // use modelFrom.keyFrom in where filter later\n var sourceId = obj[relation.keyFrom];\n if (sourceId) {\n sourceIds.push(sourceId);\n objIdMap[sourceId.toString()] = obj;\n }\n // sourceId can be null. but cache empty data as result\n defineCachedRelations(obj);\n obj.__cachedRelations[relationName] = [];\n }\n //default filters are not applicable on through model. should be applied\n //on modelTo later in 2nd DB call.\n var throughFilter = {\n where: {},\n };\n throughFilter.where[relation.keyTo] = {\n inq: uniq(sourceIds),\n };\n if (polymorphic) {\n //handle polymorphic hasMany (reverse) in which case we need to filter\n //by discriminator to filter other types\n throughFilter.where[polymorphic.discriminator] =\n relation.modelFrom.definition.name;\n }\n /**\n * 1st DB Call of 2 step process. Get through model objects first\n */\n relation.modelThrough.find(throughFilter, options, throughFetchHandler);\n /**\n * Handle the results of Through model objects and fetch the modelTo items\n * @param err\n * @param {Array<Model>} throughObjs\n * @returns {*}\n */\n function throughFetchHandler(err, throughObjs) {\n if (err) {\n return callback(err);\n }\n // start preparing for 2nd DB call.\n var targetIds = [];\n var targetObjsMap = {};\n for (var i = 0; i < throughObjs.length; i++) {\n var throughObj = throughObjs[i];\n var targetId = throughObj[relation.keyThrough];\n if (targetId) {\n //save targetIds for 2nd DB Call\n targetIds.push(targetId);\n var sourceObj = objIdMap[throughObj[relation.keyTo]];\n var targetIdStr = targetId.toString();\n //Since targetId can be duplicates, multiple source objs are put\n //into buckets.\n var objList = targetObjsMap[targetIdStr] =\n targetObjsMap[targetIdStr] || [];\n objList.push(sourceObj);\n }\n }\n //Polymorphic relation does not have idKey of modelTo. Find it manually\n var modelToIdName = idName(relation.modelTo);\n filter.where[modelToIdName] = {\n inq: uniq(targetIds),\n };\n\n //make sure that the modelToIdName is included if fields are specified\n if (Array.isArray(fields) && fields.indexOf(modelToIdName) === -1) {\n fields.push(modelToIdName);\n } else if (isPlainObject(fields) && !fields[modelToIdName]) {\n fields[modelToIdName] = true;\n }\n\n /**\n * 2nd DB Call of 2 step process. Get modelTo (target) objects\n */\n relation.modelTo.find(filter, options, targetsFetchHandler);\n function targetsFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var tasks = [];\n //simultaneously process subIncludes. Call it first as it is an async\n //process.\n if (subInclude && targets) {\n tasks.push(function subIncludesTask(next) {\n relation.modelTo.include(targets, subInclude, options, next);\n });\n }\n //process & link each target with object\n tasks.push(targetLinkingTask);\n function targetLinkingTask(next) {\n async.each(targets, linkManyToMany, next);\n function linkManyToMany(target, next) {\n var targetId = target[modelToIdName];\n var objList = targetObjsMap[targetId.toString()];\n async.each(objList, function(obj, next) {\n if (!obj) return next();\n obj.__cachedRelations[relationName].push(target);\n processTargetObj(obj, next);\n }, next);\n }\n }\n\n execTasksWithInterLeave(tasks, callback);\n }\n }\n }", "static associate(models) {\n Producto.hasMany(models.Opinion);\n Producto.belongsToMany(models.CategoriaProducto, {\n through: models.Categoria,\n as: 'Categorias'\n })\n }", "function relatedItemsFor (model, attribute, item, included) {\n let relationName = _.findKey(model.attributes, attribute)\n let relationMap = _.get(item.relationships, [relationName, 'data'], false)\n if (!relationMap) {\n return []\n }\n\n if (_.isArray(relationMap)) {\n return _.flatten(_.map(relationMap, function (relationMapItem) {\n return _.filter(included, (includedItem) => {\n return isRelatedItemFor(attribute, includedItem, relationMapItem)\n })\n }))\n } else {\n return _.filter(included, (includedItem) => {\n return isRelatedItemFor(attribute, includedItem, relationMap)\n })\n }\n}", "static associate(models) {\n // define association here\n Lecture.belongsToMany(models.User, { through: models.Class });\n Lecture.hasMany(models.Class);\n }", "static associate(models) {\n // define association here\n Nanny.belongsTo(models.Parent);\n Nanny.belongsTo(models.Agency);\n Nanny.belongsToMany(models.Child, { through: models.NannyChild });\n Nanny.belongsTo(models.Parent, {\n sourceKey: \"id\",\n foreignKey: \"ParentId\",\n });\n Nanny.belongsTo(models.Agency, {\n sourceKey: \"id\",\n foreignKey: \"AgencyId\",\n });\n }", "initRelations() {\n const me = this,\n relations = me.constructor.relations;\n if (!relations) return; // TODO: feels strange to have to look at the store for relation config but didn't figure out anything better.\n // TODO: because other option would be to store it on each model instance, not better...\n\n me.stores.forEach(store => {\n if (!store.modelRelations) store.initRelations(); // TODO: not at all tested for multiple stores, can't imagine it works as is\n\n const relatedRecords = [];\n store.modelRelations && store.modelRelations.forEach(config => {\n relatedRecords.push({\n related: me.initRelation(config),\n config\n });\n });\n store.updateRecordRelationCache(me, relatedRecords);\n });\n }", "static associate(models) {\n this.hasMany(models.token);\n this.hasMany(models.purchase);\n this.belongsToMany(models.category, { through: models.categoryUser });\n }", "static associate(models) {\n // define association here\n CartItem.belongsToMany(models.Commande, {\n through: models.OrderItem,\n foreignKey: 'cartItemId',\n otherKey: 'commandeId'\n })\n }", "list() {\n return Array.from(internal(this).idToEntity.values());\n }", "static associate(models) {\n // define association here\n EBook.belongsToMany(models.Account, { through: 'borrow_log' });\n EBook.hasMany(models.borrow_log, { foreignKey: 'EBookId' });\n }", "static associate(models) {\n // define association here\n Customer.belongsToMany(models.Product , {\n through : models.Order,\n foreignKey: \"CustomerId\"\n })\n\n Customer.hasMany(models.Order, { foreignKey : \"CustomerId\"})\n }", "static associate(models) {\n // define association here\n User.belongsToMany(models.Menu, { through: `MenuToppings` })\n User.belongsToMany(models.Topping, { through: `MenuToppings` })\n }", "static associate(models) {\n // define association here\n Entreprise.belongsTo(models.Client)\n Entreprise.belongsToMany(models.Paper, {through: models.PaperAdvancement})\n }", "static associate(models) {\n models.Languages.belongsToMany(models.Catalogue, {\n through: 'CatalogueLanguages',\n as: 'catalogues',\n foreignKey: 'languageId',\n });\n }", "favorites () {\n return this.hasMany('App/Models/Favorite')\n }", "toJSON() {\n var props = this.$obj;\n let res = super.toJSON();\n return JSON.parse(JSON.stringify({\n ...res,\n hasMany: props.hasMany_,\n }));\n }", "static associate(models) {\n Room.belongsTo(models.Hotel);\n Room.belongsToMany(models.Reservation, {\n through: 'RoomReservation',\n as: 'Reservations',\n });\n }", "static associate(models) {\n models.Trip.hasMany(models.Comment, { as: 'comments', foreignKey: 'tripId'})\n }", "static associate(models) {\n this.belongsToMany(models.Cart, {\n foreignKey: \"cartId\",\n through: {\n model: \"bridgeToppings\",\n as: \"bridge\",\n },\n onDelete: \"CASCADE\",\n onUpdate: \"CASCADE\",\n as: \"toppings\",\n });\n this.belongsToMany(models.History, {\n foreignKey: \"cartId\",\n through: {\n model: \"bridgeToppings\",\n as: \"bridge\",\n },\n onDelete: \"CASCADE\",\n onUpdate: \"CASCADE\",\n as: \"toppingOnHistory\",\n });\n }", "modules() {\n return this.hasMany('App/Models/Module');\n }", "static associate(models) {\n // define association here\n models.inboundFavorite.belongsTo(models.outboundFavorite, {onDelete: \"CASCADE\"})\n //models.inboundFavorite.belongsToMany(models.user, {through: \"userInboundFavorite\"});\n }", "static associate(models) {\n models.themePark.hasMany(models.attraction)\n models.themePark.hasMany(models.themeParkFavorites)\n }", "static associate(models) {\n // define association here\n User.belongsToMany(models.Badge, { through: \"Achievement\" });\n User.hasMany(models.Achievement, { foreignKey: \"UserId\" });\n User.hasMany(models.Target, { foreignKey: \"UserId\" });\n User.hasMany(models.Transaction, { foreignKey: \"UserId\" });\n }", "static associate(models) {\n Obra.hasMany(models.AvanceObra, { foreignKey: 'idObra' })\n Obra.belongsTo(models.Cliente);\n Obra.belongsToMany(models.Trabajadores, { through: models.Obra_Trabajadores, as: \"trabajadores\",\n foreignKey: \"obraId\", });\n }", "static businesses() {\r\n return this.hasMany(Student);\r\n }", "static associate(models) {\n Compra.belongsToMany(models.Produto, { through: 'Compra_Produto', onDelete: 'cascade' });\n models.Produto.belongsToMany(Compra, { through: 'Compra_Produto', onDelete: 'cascade' });\n }", "static associate(models) {\n // define association here\n\n // M:N 관계\n models.users.belongsToMany(models.groups, {foreignKey:\"user_id\", through: models.usersmngroups}) \n models.users.belongsToMany(models.groups, {as:\"group_id\", foreignKey:\"user_id\", through: models.applicants}) \n models.users.belongsToMany(models.trophies, {foreignKey:\"user_id\", through: models.usersmntrophies}) \n }", "static associate(models) {\n // define association here\n Orders.belongsTo(models.Users);\n Orders.belongsTo(models.Order_statuses);\n Orders.belongsToMany(models.Products, { through: 'Order_has_product' });\n\n }", "static associate(models) {\n this.hasMany(Order);\n }", "posts() {\n return this.hasMany('App/Models/Post')\n }", "static associate(models) {\n // define association here\n // User.belongsToMany(models.Fight, {\n // through: 'Rooms',\n // as: 'fights',\n // foreignKey: 'UserId',\n // otherKey: 'FightId'\n // })\n User.hasMany(models.UserRoomFight);\n User.belongsToMany(models.RoomFight, { through: 'UserRoomFight' });\n }", "static associate(models) {\n // define association here\n\n Role.hasMany(models.User, {\n as: 'users'\n });\n }", "static associate(models) {\n group.belongsToMany(models.tag, {\n through: \"groupTag\",\n foreignKey: \"groupId\",\n });\n group.belongsTo(models.user, { as: \"owner\", foreignKey: \"userId\" });\n group.belongsToMany(models.user, {\n through: \"groupMember\",\n foreignKey: \"groupId\",\n as: \"member\",\n });\n group.hasMany(models.groupComment);\n }", "static associate(models) {\n // define association here\n this.belongsToMany(models.Game, { through: 'GameUsers' });\n }", "static associate(models) {\n Finance.belongsToMany(models.User, { through: 'FinanceDetail'})\n }", "static associate(models) {\n Pessoas.hasMany(models.Turmas, {\n foreignKey: 'docente_id'\n })\n Pessoas.hasMany(models.Matriculas, {\n foreignKey: 'estudante_id',\n scope: {status: 'confirmado'},\n as: 'aulasMatriculadas'\n })\n }", "function includeHasManySimple(callback) {\n //Map for Indexing objects by their id for faster retrieval\n var objIdMap2 = includeUtils.buildOneToOneIdentityMapWithOrigKeys(objs, relation.keyFrom);\n\n filter.where[relation.keyTo] = {\n inq: uniq(objIdMap2.getKeys()),\n };\n\n relation.applyScope(null, filter);\n relation.modelTo.find(filter, options, targetFetchHandler);\n\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var targetsIdMap = includeUtils.buildOneToManyIdentityMapWithOrigKeys(targets, relation.keyTo);\n includeUtils.join(objIdMap2, targetsIdMap, function(obj1, valueToMergeIn) {\n defineCachedRelations(obj1);\n obj1.__cachedRelations[relationName] = valueToMergeIn;\n processTargetObj(obj1, function() {});\n });\n callback(err, objs);\n }\n }" ]
[ "0.6878659", "0.63323647", "0.62736666", "0.5938625", "0.59321356", "0.5886438", "0.5825853", "0.5759898", "0.5756541", "0.5724223", "0.5704923", "0.5517365", "0.5509743", "0.55063987", "0.54997", "0.54328436", "0.5431783", "0.5417359", "0.5339411", "0.5327363", "0.53154194", "0.53116935", "0.53046614", "0.5301971", "0.5300294", "0.52986485", "0.5297109", "0.5292884", "0.5289146", "0.527836", "0.52751213", "0.5268306", "0.5268306", "0.525922", "0.52411866", "0.5230358", "0.5226859", "0.52258223", "0.5213546", "0.51914704", "0.51855963", "0.516824", "0.5164432", "0.5160537", "0.51433945", "0.5142368", "0.51417077", "0.51405525", "0.5138562", "0.51338524", "0.5124036", "0.5120853", "0.51113486", "0.50976944", "0.50928676", "0.50870675", "0.5086166", "0.50740653", "0.50725704", "0.5071073", "0.50684804", "0.5063833", "0.50612193", "0.50562793", "0.50532925", "0.5052716", "0.5050306", "0.50464225", "0.50385046", "0.50371206", "0.5034472", "0.5031588", "0.5029675", "0.50251347", "0.5025099", "0.5020548", "0.5017576", "0.50164336", "0.5011397", "0.50113094", "0.5009143", "0.5005787", "0.50048137", "0.5001681", "0.49971607", "0.4993922", "0.49903265", "0.49831542", "0.49754682", "0.4974226", "0.49630448", "0.4962755", "0.49586242", "0.49429873", "0.4942927", "0.49376923", "0.49300665", "0.4929196", "0.49265024", "0.49202695" ]
0.65229684
1
Add a belongsto relationship for this model. When retrieving models of the current type, a parent object of the specified type may be retrieved.
addBelongsTo( parent, options ) { if( options == undefined ) { options = {}; } this._belongsTo.push( { parent, options } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static belongsTo( model, options ) {\n\t\tif( this.name == \"Model\" ) {\n\t\t\tthrow \"Cannot invoke method directly on Model class\";\n\t\t}\n\n\t\tcache.relationships( this.name ).addBelongsTo( model, options );\n\t}", "static associate(models) {\n // define association here\n ProductCategory.hasMany(models.Product)\n ProductCategory.hasMany(models.ProductCategory, {\n foreignKey: 'parentId',\n })\n }", "get belongsTo() {\n\t\treturn this._belongsTo;\n\t}", "static associate(models) {\n Pets.belongsTo(models.PetParents, { foreignKey: \"parent\" }); \n }", "static associate(models) {\n models.Pizza.belongsTo(models.OrderItems);\n }", "static associate(models) {\n // define association here\n models.mealOrder.belongsTo(models.user)\n\n }", "static associate(models) {\n // define association here\n models.cardio.belongsTo(models.user)\n }", "relateUser() {\n return this.belongsTo(User);\n }", "static associate(models) {\n this.belongsTo(IllustrationType);\n }", "static associate(models) {\n // define association here\n Nanny.belongsTo(models.Parent);\n Nanny.belongsTo(models.Agency);\n Nanny.belongsToMany(models.Child, { through: models.NannyChild });\n Nanny.belongsTo(models.Parent, {\n sourceKey: \"id\",\n foreignKey: \"ParentId\",\n });\n Nanny.belongsTo(models.Agency, {\n sourceKey: \"id\",\n foreignKey: \"AgencyId\",\n });\n }", "static associate(models) {\n \n this.belongsTo(models.Pedido, {\n foreignKey: \"idPedido\",\n as: 'Pedido'\n });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Tipo_tarjeta,{\n foreignKey:'tipo_id'\n })\n this.belongsTo(models.Cliente,{\n foreignKey: 'cliente_id'\n });\n }", "static associate(models) {\n // define association here\n // this.hasMany(models.StepIngredient);\n this.belongsTo(models.Recipe);\n }", "static associate(models) {\n // define association here\n TodoList.belongsTo(models.User)\n }", "static associate(models) {\n // define association here\n Todo.belongsTo(models.User, {\n foreignKey: 'user_id'\n })\n }", "static associate(models) {\n // define association here\n Todo.belongsTo(models.User, {\n foreignKey: \"user_id\"\n })\n }", "static associate({\n User,\n Image,\n Location,\n Quantity,\n Category,\n Price,\n PostType,\n }) {\n // define association here\n this.belongsTo(Price, {\n as: \"price\",\n foreignKey: \"priceId\",\n });\n this.hasMany(Image, {\n as: \"images\",\n foreignKey: \"id\",\n });\n this.belongsTo(Location, { as: \"location\", foreignKey: \"locationId\" });\n this.belongsTo(Quantity, { as: \"quantity\", foreignKey: \"quantityId\" });\n this.belongsTo(Category, { as: \"category\", foreignKey: \"categoryId\" });\n this.belongsTo(PostType, { as: \"postType\", foreignKey: \"postTypeId\" });\n this.belongsTo(User, { as: \"user\", foreignKey: \"userId\" });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Cocktail, {foreignKey: 'cocktailId'});\n }", "static associate(models) {\n Contas.hasMany(models.Transacoes, {\n foreignKey: 'idConta'\n }) \n //Contas.belongsTo(models.Transacoes)\n }", "static associate(models) {\n Quadros.belongsTo(models.Caixas, {\n foreignKey: 'caixa'\n });\n }", "static associate(models) {\n this.belongsTo(models.User, { foreignKey: 'user_id', as: 'user' });\n this.belongsTo(models.User, { foreignKey: 'follower_id', as: 'follower' });\n\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Category, { foreignKey: \"categoryId\" });\n this.belongsTo(models.Item, { foreignKey: \"itemId\" });\n }", "static associate(models) {\n this.belongsTo(models.User)\n this.belongsTo(models.Tenant)\n this.belongsTo(models.Group)\n }", "static associate(models) {\n // define association here\n Commande.belongsTo(models.User)\n Commande.belongsTo(models.UserAdresse)\n Commande.belongsTo(models.Plan)\n Commande.belongsToMany(models.CartItem, {\n through: models.OrderItem,\n foreignKey: 'commandeId',\n otherKey: 'cartItemId'\n })\n Commande.hasOne(models.Facture)\n Commande.hasMany(models.Contrat)\n Commande.hasMany(models.Livraison)\n Commande.belongsToMany(models.CompteParrainage,\n {\n through: models.OrderParrain\n })\n\n }", "static associate(models) {\n storeType.belongsTo(models.storeCategory);\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Persona, {\n as: 'persona',\n foreignKey: 'cedulaP',\n onDelete: 'CASCADE'\n });\n\n this.belongsTo(models.Persona, {\n as: 'doctorP',\n foreignKey: 'doctor',\n onDelete: 'CASCADE'\n });\n /*this.belongsTo(models.Informe, {\n as: 'informe',\n foreignKey: 'informeP',\n onDelete: 'CASCADE'\n });*/\n\n }", "static associate(models) {\n Agendamento.belongsTo(models.Usuario, { foreignKey: 'id_usuario' })\n Agendamento.belongsTo(models.TipoAgendamento, { foreignKey: 'id_tipoAgendamento' })\n }", "static associate(models) {\n comments.belongsTo(models.users, {\n foreignKey: 'usersId',\n onDelete: \"CASCADE\",\n\n })\n comments.hasMany(models.comments, {as:'Children', foreignKey:'commentsId', onDelete:'CASCADE'})\n comments.belongsTo(models.posts, {\n foreignKey: 'postsId',\n onDelete: \"CASCADE\"\n })\n }", "static associate(models) {\n // define association here\n Task.belongsTo(models.User, {foreignKey: 'UserId'})\n }", "static associate(models) {\n // define association here\n models.Lead.belongsTo(models.User, {foreignKey: \"userId\"});\n }", "static associate({User}) {\n // define association here\n this.belongsTo(User, { foreignKey: \"userId\" })\n }", "static associate(models) {\n goal.belongsTo(models.user, {\n foreignKey: { \n name: 'user_id', \n allowNull: false \n },\n onDelete: 'CASCADE',\n })\n }", "static associate({ User }) {\n this.belongsTo(User, { foreignKey: 'userId' });\n }", "static associate(models) {\n // define association here\n Meeting.belongsTo(models.User, {\n foreignKey: 'userId'\n })\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Task, {\n foreignKey: \"taskId\",\n });\n this.belongsTo(models.TaskLabel, {\n foreignKey: \"labelId\",\n });\n this.hasMany(models.Grade, {\n foreignKey: \"belongsToId\",\n });\n }", "static associate(models) {\n\t\t\t// define association here\n\t\t\tCart.belongsTo(models.User, { as: \"cartedBy\", foreignKey: \"userId\" });\n\t\t\tCart.belongsTo(models.Item, { as: \"item\", foreignKey: \"itemId\" });\n\t\t}", "static associate(models) {\n // define association here\n models.producto.belongsToMany(models.lista_producto, {through: this, foreignKey: 'productoId'})\n models.lista_producto.belongsToMany(models.producto, {through: this, foreignKey: 'listaId'})\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Content_Types, {\n foreignKey: 'id_Content_Type'\n });\n\n this.hasOne(models.Contents, {\n foreignKey: 'id_Content_Rating'\n });\n }", "static associate({ Pmm }) {\n this.belongsTo(Pmm);\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.User, { foreignKey: 'userId' });\n this.belongsTo(models.Question, { foreignKey: 'questionId' });\n }", "static associate(models) {\n // define association here\n Book.belongsTo(models.User)\n }", "static associate(models) {\n Ingredients.belongsTo(models.Meal, { foreignKey: \"mealId\" });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.content, {\n foreignKey: 'contentid'\n });\n this.belongsTo(models.group, {\n foreignKey: 'groupid'\n })\n }", "static associate(models) {\n treelocation.belongsTo(models.treetype);\n }", "createAssociation(type, model, options) {\n // type == 'hasMany || 'belongsTo'\n // model == some sequelize model\n // option == {foreignKey, sourceKey}\n console.log(type, model, options);\n try {\n this.model[type](model, options);\n } catch (e) {\n console.log(e);\n }\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.User, {\n foreignKey: 'user_id',\n as: 'user'\n })\n }", "static associate(models) {\n Orders.belongsTo(models.User);\n }", "static associate(models) {\n // define association here\n models.ride.belongsTo(models.location, {foreignKey: 'pickupId', as: 'pickupLocation'})\n models.ride.belongsTo(models.location, {foreignKey: 'dropoffId', as: 'dropoffLocation'})\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.User, {\n foreignKey: \"tenant_id\",\n onDelete: \"CASCADE\",\n });\n this.belongsTo(models.Property, {\n foreignKey: \"property_id\",\n onDelete: \"CASCADE\",\n });\n this.hasMany(models.Application, {\n foreignKey: \"renthistories_id\",\n });\n this.hasMany(models.Ref_request, {\n foreignKey: \"renthistories_id\",\n });\n }", "static associate(models) {\n // define association here\n Customer.belongsTo(models.User, {\n foreignKey: 'userid',\n as: 'user',\n });\n\n Customer.hasMany(models.Consumer, {\n foreignKey: 'userid',\n as: 'consumers',\n });\n\n Customer.hasMany(models.Grower, {\n foreignKey: 'userid',\n as: 'growers',\n });\n }", "static associate(models) {\n // define association here\n models.Book.belongsTo(models.Subcategory, {foreignKey: 'subcategoryId', sourceKey: 'subcategoryId'})\n }", "static associate(models) {\n // define association here\n PatientMedicine.belongsTo(models.Patient)\n PatientMedicine.belongsTo(models.Medicine)\n }", "static associate(models) {\n \n this.hasMany(models.Actividad, {\n as: \"actividades\",\n foreignKey: \"clienteId\"\n });\n\n this.belongsTo(models.Clasificacion, {\n as: \"clasificacion\",\n foreignKey: \"clasificacionId\"\n });\n\n this.belongsTo(models.TipoCredito, {\n as: \"tipoCredito\",\n foreignKey: \"tipoCreditoId\"\n });\n\n this.belongsTo(models.Proyecto, {\n as: \"proyecto\",\n foreignKey: \"proyectoId\"\n });\n\n }", "static associate(models) {\n // define association here\n GoalSetting.belongsTo(models.User)\n }", "static associate(models) {\n this.belongsTo(models.Perfil, { foreignKey: { name: 'COD_PERFIL' } })\n this.hasMany(models.Entrega, { foreignKey: { name: 'COD_USUARIO' } })\n this.belongsToMany(models.Tcc, { through: 'TB_ALUNO_TCC' })\n this.belongsTo(models.Curso, { foreignKey: { name: 'COD_CURSO' } })\n this.hasMany(models.Tcc, { foreignKey: { name: 'COD_PROFESSOR_ORIENTADOR', allowNull: false } })\n }", "static associate(models) {\n // define association here\n Profiles.belongsTo(models.Users, { foreignKey: 'user_id', targetKey: 'id' })\n }", "static associate(models) {\n // define association here\n // Doctor.hasOne(models.Doctor_Type, {foreignKey: 'type_id', foreignKeyConstraint: true })\n Doctor.belongsToMany(models.Hospital, {through : \"Work_Places\"})\n Doctor.belongsToMany(models.Skill, {through : \"Specialties\"})\n Doctor.belongsToMany(models.Diseases, {through : \"Disease_Specialties\"})\n Doctor.belongsToMany(models.Practice_time, {through : \"Docktor_Practice_Times\"})\n }", "static associate(models) {\n this.belongsTo(models.users)\n }", "static associate(models) {\n // define association here\n models.Comments.belongsTo(models.Users, {\n foreignKey: \"fk_userId\",\n as: \"comments\",\n });\n models.Comments.belongsTo(models.Contents, {\n foreignKey: \"fk_contentId\",\n as: \"commentsContent\",\n });\n }", "static associate(models) {\n this.belongsTo(models.MentorProgram, {\n foreignKey: \"programId\",\n });\n }", "static associate(models) {\n Resposible_people.belongsTo(models.Responsible_type, {\n foreignKey: \"responsible_type_id\",\n });\n Resposible_people.belongsTo(models.Transition, {\n foreignKey: \"transition_id\",\n });\n }", "static associate(models) {\n this.belongsTo(models.customer);\n this.hasMany(models.itemRental);\n this.hasMany(models.additive);\n }", "static associate(models) {\n Task.belongsTo(models.User, {foreignKey: 'UserId'})\n }", "static associate(models) {\n cd.belongsTo(models.list);\n // define association here\n }", "static associate(models) {\n // define association here\n Category.belongsTo(models.Provider, {\n foreignKey: \"provider_id\",\n constraints: true,\n foreignKeyConstraint: true,\n });\n Category.hasMany(models.Item, {\n foreignKey: \"category_id\",\n onDelete: \"CASCADE\",\n hooks: true,\n });\n }", "static associate(models) {\n this.belongsTo(models.account_types, {\n foreignKey: 'type'\n });\n this.belongsTo(models.Clients, {\n foreignKey: 'client_id'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_ori'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_des'\n });\n }", "static associate(models) {\n // define association here\n Place.belongsTo(models.Itinerary, {\n foreignKey: \"ItineraryId\",\n });\n }", "static associate(models) {\n\n Produtos.belongsTo(models.Usuarios, { \n through: 'Usuarios',\n as: 'usuarios',\n foreignKey: 'usuarios_id'})\n\n Produtos.belongsToMany(models.Pedidos, { \n through: \"PedidosProdutos\",\n as: 'pedido',\n foreignKey: 'pedidos_id'})\n \n}", "static associate(models) {\n // define association here\n // models.ecosystem_media_blogs.belongsTo(models.User, {\n // foreignKey: \"createdby\",\n // });\n // ecosystem_media_blogs.belongsTo(models.ecosystem_media_category, {\n // as: \"Category\",\n // constraints: false,\n // });\n }", "static associate(models) {\n this.belongsTo(models.Usuario, { foreignKey: 'usuarioId', as: 'usuario'});\n this.belongsTo(models.Articulo, { foreignKey: 'articuloId', as: 'articulo'});\n }", "static associate(models) {\n Taxas.hasMany(models.Operacoes, {\n foreignKey: \"taxaId\",\n });\n }", "static associate(models) {\n models.Identification_association.hasOne(models.AssociationPage);\n models.Identification_association.belongsTo(models.Representant_legale,{\n foreignKey: 'RepresentantLegaleId'\n });\n }", "static associate(models) {\n // define association here\n Mensaje.belongsTo(models.Profesor,{\n foreignKey:\"idSender\"\n })\n \n }", "static associate(models) {\n models.comment.belongsToMany(models.users, { through: 'likes', foreignKey: 'commentId', sourceKey: 'id' });\n\n models.comment.belongsTo(models.users, { foreignKey: 'userId', sourceKey: 'id', onDelete: 'cascade' });\n models.comment.belongsTo(models.items, { foreignKey: 'itemId', sourceKey: 'id', onDelete: 'cascade' });\n // define association here\n }", "static associate(models) {\n // define association here\n Course_Content.belongsTo(models.Course);\n }", "static associate(models) {\n // define association here\n JobRecord.belongsTo(models.User)\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.deal);\n }", "static associate(models) {\n // define association here\n models.trips.belongsTo(models.User, {\n foreignKey: {\n allowNull: false\n }\n })\n /*\n ,\n models.trips.belongsTo(models.User, {\n foreignKey: {\n allowNull: false\n }\n })\n */\n }", "static associate(models) {\n // define association here\n // Todo belongs to users table one to many relationship\n Todos.belongsTo(models.Users, {\n foreignKey: 'userId',\n onDelete: 'CASCADE',\n });\n\n Todos.hasMany(models.TodoItems, {\n foreignKey: 'todoId',\n as: 'todoItems',\n });\n }", "static associate(models) {\n Work_Order.belongsTo(models.Work_Type, { foreignKey: \"workTypeId\" })\n Work_Order.belongsTo(models.Work_Status, { foreignKey: \"workStatusId\"})\n Work_Order.belongsTo(models.Customer, { foreignKey: \"customerId\"})\n }", "static associate(models) {\n\t\t\t// define association here\n\t\t\tthis.belongsTo(models.Conversation, {\n\t\t\t\tforeignKey: \"conversationId\",\n\t\t\t\tas: \"conversation\",\n\t\t\t})\n\n\t\t\tthis.belongsTo(models.User, {\n\t\t\t\tforeignKey: \"senderId\",\n\t\t\t\tas: \"sender\",\n\t\t\t})\n\t\t}", "static associate(models) {\n // define association here\n this.hasMany(models['Orders'], { foreignKey: 'owner', sourceKey: 'id', });\n }", "static associate(models) {\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n as: 'servicos',\n }),\n this.hasMany(models.Arquivo, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Pagamento\n this.hasOne(models.Pagamento, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Servico\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n as: 'services',\n }),\n // Associação com Reserva\n this.hasOne(models.Reserva, {\n foreignKey: 'idReserva',\n as: 'reservas',\n });\n // Associação com Membros\n this.hasOne(models.Membro, {\n foreignKey: 'idMembro',\n as: 'membros',\n });\n }", "static associate (models) {\n // define association here\n Group.belongsTo(models.User)\n Group.hasMany(models.Course, { onDelete: 'CASCADE', hooks: true })\n Group.belongsToMany(models.User, {\n through: models.Follow,\n foreignKey: 'GroupId',\n as: 'followers'\n })\n }", "static associate(models) {\n this.belongsTo(models.Course, { foreignKey: \"courseId\" });\n }", "static associate(models) {\n // define association here\n Data_Peminjaman.belongsTo(models.User);\n Data_Peminjaman.hasOne(models.Data_Pengembalian, { onDelete: \"CASCADE\" });\n Data_Peminjaman.hasOne(models.Detail_Peminjaman, { onDelete: \"CASCADE\" });\n }", "static associate(models) {\n models.attraction.belongsTo(models.themePark)\n models.attraction.hasMany(models.attractionFavorites)\n models.attraction.belongsToMany(models.creative, {through: \"projectWork\"})\n }", "static associate(models) {\n // define association here\n // N:M\n models.Pedido.belongsToMany(models.Producto, {\n through: {\n model: \"PedidoProductos\",\n },\n foreignKey: \"pedidoId\"\n })\n // N:1\n models.Pedido.belongsTo(models.Cliente, {\n foreignKey: 'clienteId'\n });\n }", "static associate(models) {\n // define association here\n Bairro.belongsTo(models.Cidade, { foreignKey: 'cidadeId' });\n Bairro.hasMany(models.Faculdade, { foreignKey: 'bairroId' });\n }", "static associate(models) {\n // define association here\n Cart.belongsTo(models.Transaction)\n Cart.belongsTo(models.Ticket)\n }", "static associate(models) {\n // define association here\n models.trails.belongsTo(models.users)\n }", "static associate(models) {\n Question.hasMany(models.QuestionOption, {foreignKey:'questionId',\n as: 'options'\n });\n Question.belongsTo(models.Category, {\n foreignKey: \"categoryId\",\n allowNull: false,\n as: 'category'\n });\n Question.hasMany(models.Language, {\n foreignKey: 'questionId',\n as: \"languages\"\n });\n }", "static associate(models) {\n models.topic.belongsTo(models.user, { foreignKey: 'userId'})\n models.topic.hasMany(models.reply, { foreignKey: 'topicId' });\n }", "static associate(models) {\n this.belongsTo(models.GroupUsUser);\n }", "static associate(models){\n this.belongsTo(models.User, {foreignKey: \"address\"});\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.courses, {foreignKey: 'courseId', targetKey: 'id'})\n }", "static associate(models) {\n // define association here\n patients.belongsTo(models.users, {\n as: 'users',\n foreignKey: 'user_id'\n })\n }", "static associate(models) {\n this.channelId = this.belongsTo(models.Order, {\n foreignKey: 'id',\n onDelete: 'CASCADE'\n });\n }", "static associate(models) {\n \n // Route.belongsTo(db.Velouser, { foreignKey: 'userId'});\n // db.Velouser.hasMany(db.Route, { foreignKey: 'userId'});\n }", "static associate(models) {\n this.belongsTo(models.Data, {\n foreignKey: \"dataId\",\n });\n }" ]
[ "0.6219698", "0.61491764", "0.61391664", "0.59458405", "0.5839886", "0.5798191", "0.56869906", "0.56379896", "0.5633153", "0.56187236", "0.5594757", "0.5588937", "0.5585499", "0.5581669", "0.5564453", "0.55341905", "0.5518197", "0.5509216", "0.55029976", "0.55013824", "0.5489336", "0.54832363", "0.5476032", "0.5462338", "0.5440769", "0.5439608", "0.5434931", "0.5433859", "0.54324645", "0.5419102", "0.5416315", "0.5409762", "0.5409523", "0.5407392", "0.5401616", "0.5401589", "0.53989244", "0.53980136", "0.5396027", "0.5392893", "0.53890544", "0.5372055", "0.53714496", "0.5359425", "0.5354284", "0.53507084", "0.53440946", "0.53332686", "0.5328237", "0.5323196", "0.53204864", "0.5317731", "0.5316814", "0.5315226", "0.5306539", "0.529898", "0.52982366", "0.5296836", "0.5290434", "0.5289947", "0.5288625", "0.5286209", "0.52811414", "0.5280037", "0.52794373", "0.5277149", "0.52766293", "0.5276361", "0.5276268", "0.5275136", "0.52647316", "0.5263072", "0.52624995", "0.5261791", "0.526091", "0.5253947", "0.5253548", "0.52514297", "0.52486575", "0.5247962", "0.52471733", "0.52471304", "0.5244306", "0.5243174", "0.52387875", "0.5233958", "0.5232192", "0.52302945", "0.5224607", "0.52195984", "0.52149814", "0.5212605", "0.5207915", "0.52035755", "0.52017146", "0.51982987", "0.51976985", "0.51969564", "0.51958084", "0.51957816" ]
0.63986987
0
Get a list of belongsto relationships for this model
get belongsTo() { return this._belongsTo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get relatesTo() {\n\t\treturn this.__relatesTo;\n\t}", "getRelated() {}", "getRelationshipNames(type) {\n let model = this.getModel(\n this.constructor.getModelName(type, this.inflector.singular)\n );\n return util.getReferencePaths(model);\n }", "static associate(models) {\n comments.belongsTo(models.users, {\n foreignKey: 'usersId',\n onDelete: \"CASCADE\",\n\n })\n comments.hasMany(models.comments, {as:'Children', foreignKey:'commentsId', onDelete:'CASCADE'})\n comments.belongsTo(models.posts, {\n foreignKey: 'postsId',\n onDelete: \"CASCADE\"\n })\n }", "static associate(models) {\n cd.belongsTo(models.list);\n // define association here\n }", "async getUserRelations() {\n const teamWithUsers = await this._client.helix.teams.getTeamById(this.id);\n return teamWithUsers.userRelations;\n }", "static associate(models) {\n // define association here\n models.producto.belongsToMany(models.lista_producto, {through: this, foreignKey: 'productoId'})\n models.lista_producto.belongsToMany(models.producto, {through: this, foreignKey: 'listaId'})\n }", "static associate(models) {\n models.Pizza.belongsTo(models.OrderItems);\n }", "static get relationMappings() {\n return {\n categories: {\n relation: Model.HasManyRelation,\n // The related model.\n modelClass: Categories,\n join: {\n from: 'Service.id',\n to: 'Categories.service_id'\n }\n },\n branch: {\n relation: Model.BelongsToOneRelation,\n // The related model.\n modelClass: Branch,\n join: {\n from: 'Service.branch_id',\n to: 'Branch.id'\n }\n }\n }\n }", "static associate(models) {\n\n Produtos.belongsTo(models.Usuarios, { \n through: 'Usuarios',\n as: 'usuarios',\n foreignKey: 'usuarios_id'})\n\n Produtos.belongsToMany(models.Pedidos, { \n through: \"PedidosProdutos\",\n as: 'pedido',\n foreignKey: 'pedidos_id'})\n \n}", "static associate(models) {\n models.attraction.belongsTo(models.themePark)\n models.attraction.hasMany(models.attractionFavorites)\n models.attraction.belongsToMany(models.creative, {through: \"projectWork\"})\n }", "get hasMany() {\n\t\treturn this._hasMany;\n\t}", "static associate(models) {\n // define association here\n ProductCategory.hasMany(models.Product)\n ProductCategory.hasMany(models.ProductCategory, {\n foreignKey: 'parentId',\n })\n }", "static get relationMappings() {\n return {\n users: {\n relation: Model.HasManyRelation,\n modelClass: User,\n join: {\n from: \"likes.like_id\",\n to: \"users.like_id\",\n },\n },\n\n posts: {\n relation: Model.HasManyRelation,\n modelClass: Post,\n join: {\n from: \"likes.like_id\",\n to: \"posts.like_id\",\n },\n },\n };\n }", "static get relationMappings() {\n // Import models here to prevent require loops.\n const Sticker = require('./Sticker');\n\n return {\n stickers: {\n relation: BaseModel.HasManyRelation,\n // The related model. This can be either a Model\n // subclass constructor or an absolute file path\n // to a module that exports one.\n modelClass: Sticker,\n join: {\n from: StickerGroup.tableName + '.id',\n to: Sticker.tableName + '.stickerGroupId'\n }\n }\n };\n }", "static get relationMappings() {\n return {\n todos: {\n relation: Model.HasManyRelation,\n modelClass: Todo,\n join: {\n from: \"t_author_todos.todo_id\",\n to: \"t_todos.id\"\n }\n }\n };\n }", "static associate(models) {\n this.belongsTo(models.User)\n this.belongsTo(models.Tenant)\n this.belongsTo(models.Group)\n }", "static associate(models) {\n // define association here\n Nanny.belongsTo(models.Parent);\n Nanny.belongsTo(models.Agency);\n Nanny.belongsToMany(models.Child, { through: models.NannyChild });\n Nanny.belongsTo(models.Parent, {\n sourceKey: \"id\",\n foreignKey: \"ParentId\",\n });\n Nanny.belongsTo(models.Agency, {\n sourceKey: \"id\",\n foreignKey: \"AgencyId\",\n });\n }", "get workflowAssociations() {\r\n return new SharePointQueryableCollection(this, \"workflowAssociations\");\r\n }", "static associate(models) {\n // define association here\n Commande.belongsTo(models.User)\n Commande.belongsTo(models.UserAdresse)\n Commande.belongsTo(models.Plan)\n Commande.belongsToMany(models.CartItem, {\n through: models.OrderItem,\n foreignKey: 'commandeId',\n otherKey: 'cartItemId'\n })\n Commande.hasOne(models.Facture)\n Commande.hasMany(models.Contrat)\n Commande.hasMany(models.Livraison)\n Commande.belongsToMany(models.CompteParrainage,\n {\n through: models.OrderParrain\n })\n\n }", "static associate(models) {\n // define association here\n animalList.belongsTo(models.User);\n animalList.hasMany(models.Comment);\n }", "getRelationKeys() {\n return [this.relation.throughForeignKeyColumnName];\n }", "static get relationMappings() {\n\t\treturn {\n\t\t\tstores: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\t// The related model. This can be either a Model subclass constructor or an\n\t\t\t\t// absolute file path to a module that exports one. We use the file path version\n\t\t\t\t// here to prevent require loops.\n\t\t\t\tmodelClass: getModelFile('store'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tto: 'store.brand_id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tmanagers: {\n\t\t\t\trelation: Model.ManyToManyRelation,\n\t\t\t\tmodelClass: getModelFile('member'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tthrough: {\n\t\t\t\t\t\tfrom: 'brand_manager.brand_id',\n\t\t\t\t\t\tto: 'brand_manager.member_id'\n\t\t\t\t\t},\n\t\t\t\t\tto: 'member.id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tcreator: {\n\t\t\t\trelation: Model.BelongsToOneRelation,\n\t\t\t\tmodelClass: getModelFile('member'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.creator_id',\n\t\t\t\t\tto: 'member.id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tfoods: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\tmodelClass: getModelFile('food'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tto: 'food.brand_id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tpromotionCodes: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\tmodelClass: getModelFile('promotion_code'),\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: 'brand.id',\n\t\t\t\t\tto: 'promotion_code.brand_id'\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "static associate(models) {\n // define association here\n // N:M\n models.Pedido.belongsToMany(models.Producto, {\n through: {\n model: \"PedidoProductos\",\n },\n foreignKey: \"pedidoId\"\n })\n // N:1\n models.Pedido.belongsTo(models.Cliente, {\n foreignKey: 'clienteId'\n });\n }", "static associate(models) {\n this.belongsTo(models.customer);\n this.hasMany(models.itemRental);\n this.hasMany(models.additive);\n }", "static associate(models) {\n // define association here\n UserDonations.belongsTo(models.Users)\n UserDonations.belongsTo(models.Campaigns)\n\n }", "static associate(models) {\n this.hasMany(models.token);\n this.hasMany(models.purchase);\n this.belongsToMany(models.category, { through: models.categoryUser });\n }", "static associate(models) {\n // define association here\n restSpace.hasMany(models.photos);\n restSpace.hasMany(models.reviews);\n // restSpace.belongsTo(models.user);\n restSpace.belongsToMany(models.user, {\n through: \"favoriteRestaurants\",\n foreignKey: \"restSpaceId\",\n });\n restSpace.belongsToMany(models.category, {\n through: \"restCategories\",\n foreignKey: \"restSpaceId\",\n });\n }", "static associate(models) {\n this.belongsTo(models.Perfil, { foreignKey: { name: 'COD_PERFIL' } })\n this.hasMany(models.Entrega, { foreignKey: { name: 'COD_USUARIO' } })\n this.belongsToMany(models.Tcc, { through: 'TB_ALUNO_TCC' })\n this.belongsTo(models.Curso, { foreignKey: { name: 'COD_CURSO' } })\n this.hasMany(models.Tcc, { foreignKey: { name: 'COD_PROFESSOR_ORIENTADOR', allowNull: false } })\n }", "function findHasMany(model, relationshipName) {\n const relationship = model.relationshipFor(relationshipName);\n return model.hasMany(relationship.key).hasManyRelationship.fetchLink();\n}", "static associate(models) {\n Pets.belongsTo(models.PetParents, { foreignKey: \"parent\" }); \n }", "static associate(models) {\n models.post.belongsToMany(models.user, {through: 'userPost'})\n }", "static associate(models) {\n Producto.hasMany(models.Opinion);\n Producto.belongsToMany(models.CategoriaProducto, {\n through: models.Categoria,\n as: 'Categorias'\n })\n }", "get relatedItems() {\r\n return RelatedItemManagerImpl.FromUrl(this.toUrl());\r\n }", "static associate(models) {\n mangas.belongsToMany(models.users, { through: 'models.favorite' });\n }", "static associate(models) {\n Ad.belongsToMany(models.Realtor, {through: models.RealtorAd})\n Ad.hasMany(models.RealtorAd);\n }", "static associate (models) {\n // define association here\n Group.belongsTo(models.User)\n Group.hasMany(models.Course, { onDelete: 'CASCADE', hooks: true })\n Group.belongsToMany(models.User, {\n through: models.Follow,\n foreignKey: 'GroupId',\n as: 'followers'\n })\n }", "relateUser() {\n return this.belongsTo(User);\n }", "static associate(models) {\n this.hasMany(models.portfolio);\n this.belongsToMany(models.stack, { through: \"user_stack\" });\n this.hasMany(models.project, {\n as: \"myProject\",\n });\n this.belongsToMany(models.project, {\n as: \"attendProject\",\n through: \"attendUser\",\n });\n }", "static associate(models) {\n Obra.hasMany(models.AvanceObra, { foreignKey: 'idObra' })\n Obra.belongsTo(models.Cliente);\n Obra.belongsToMany(models.Trabajadores, { through: models.Obra_Trabajadores, as: \"trabajadores\",\n foreignKey: \"obraId\", });\n }", "static associate(models) {\n this.belongsTo(models.User, { foreignKey: 'user_id', as: 'user' });\n this.belongsTo(models.User, { foreignKey: 'follower_id', as: 'follower' });\n\n }", "static associate(models) {\n // define association here\n // this.hasMany(models.StepIngredient);\n this.belongsTo(models.Recipe);\n }", "static associate(models) {\n Denuncias.belongsToMany(models.Curso, {\n through: models.Denuncia_curso,\n foreignKey: 'id_denuncia'\n })\n Denuncias.belongsTo(models.Usuario_pcd, {\n foreignKey: 'id_usuario_pcd'\n }) \n }", "static exposeRelations() {\n const me = this;\n\n if (me.hasOwnProperty('relationsExposed')) return;\n\n if (me.relationConfig) {\n me.relationsExposed = true;\n me.relations = [];\n\n me.relationConfig.forEach((relation) => {\n me.relations.push(relation);\n\n let name = relation.relationName;\n\n // getter and setter for related object\n if (!Reflect.ownKeys(me.prototype).includes(name)) {\n Object.defineProperty(me.prototype, name, {\n enumerable: true,\n get: function() {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n return this.getForeign(name);\n },\n set: function(value) {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n this.setForeign(name, value, relation);\n }\n });\n }\n });\n }\n }", "static associate(models) {\n Patient.belongsToMany(models.Doctor, { through: models.Schedule });\n Patient.hasMany(models.Schedule);\n }", "static associate(models) {\n // define association here\n Entreprise.belongsTo(models.Client)\n Entreprise.belongsToMany(models.Paper, {through: models.PaperAdvancement})\n }", "static associate(models) {\n // define association here\n // models.garagedream.belongsToMany(models.car, {through: 'dreamcars'});\n // models.garagedream.hasMany(models.car, {through: 'allcars'});\n models.garagedream.belongsTo(models.user); //user can also have a dream garage\n }", "static associate(models) {\n avaliacoes.belongsTo(models.itens)\n }", "static associate(models) {\n Agendamento.belongsTo(models.Usuario, { foreignKey: 'id_usuario' })\n Agendamento.belongsTo(models.TipoAgendamento, { foreignKey: 'id_tipoAgendamento' })\n }", "static associate(models) {\n // define association here\n Destination.belongsTo(models.User, { foreignKey: 'authorId' })\n Destination.belongsTo(models.Category, { foreignKey: 'categoryId' })\n Destination.belongsToMany(models.User, { through: 'Wishlist', foreignKey: 'DestinationId' })\n }", "static associate(models) {\n Resposible_people.belongsTo(models.Responsible_type, {\n foreignKey: \"responsible_type_id\",\n });\n Resposible_people.belongsTo(models.Transition, {\n foreignKey: \"transition_id\",\n });\n }", "get relations () {\n return {\n 'artist': {\n type: ' hasOne',\n fk : 'artist_id'\n }\n }\n }", "findOwners() {\n return this._getRelationship('owner', 'from');\n }", "static associate(models) {\n //belongsTo\n Products.belongsTo(models.Brand);\n //belongsTo\n Products.belongsTo(models.Category);\n //belongsTo\n Products.belongsTo(models.Gender);\n }", "static associate(models) {\n models.Trip.hasMany(models.Comment, { as: 'comments', foreignKey: 'tripId'})\n }", "static associate (models) {\n Planta.belongsTo(models.Plantacao, {\n foreignKey: 'plantacao_id'\n })\n Planta.belongsToMany(models.Doenca, {\n through: models.DoencaPlanta,\n as: 'doencas',\n foreignKey: 'planta_id',\n otherKey: 'doenca_id'\n })\n Planta.belongsToMany(models.Plantacao, {\n through: models.PlantacaoPlanta,\n as: 'plantacoes',\n foreignKey: 'planta_id',\n otherKey: 'plantacao_id'\n })\n }", "static associate(models) {\n group.belongsToMany(models.tag, {\n through: \"groupTag\",\n foreignKey: \"groupId\",\n });\n group.belongsTo(models.user, { as: \"owner\", foreignKey: \"userId\" });\n group.belongsToMany(models.user, {\n through: \"groupMember\",\n foreignKey: \"groupId\",\n as: \"member\",\n });\n group.hasMany(models.groupComment);\n }", "static associate(models) {\n // define association here\n TodoList.belongsTo(models.User)\n }", "static associate(models) {\n Compra.belongsToMany(models.Produto, { through: 'Compra_Produto', onDelete: 'cascade' });\n models.Produto.belongsToMany(Compra, { through: 'Compra_Produto', onDelete: 'cascade' });\n }", "static associate(models) {\n \n this.hasMany(models.Actividad, {\n as: \"actividades\",\n foreignKey: \"clienteId\"\n });\n\n this.belongsTo(models.Clasificacion, {\n as: \"clasificacion\",\n foreignKey: \"clasificacionId\"\n });\n\n this.belongsTo(models.TipoCredito, {\n as: \"tipoCredito\",\n foreignKey: \"tipoCreditoId\"\n });\n\n this.belongsTo(models.Proyecto, {\n as: \"proyecto\",\n foreignKey: \"proyectoId\"\n });\n\n }", "static associate(models) {\n this.belongsTo(models.account_types, {\n foreignKey: 'type'\n });\n this.belongsTo(models.Clients, {\n foreignKey: 'client_id'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_ori'\n });\n this.hasMany(models.transactions, {\n foreignKey: 'account_des'\n });\n }", "static associate(models) {\n Contas.hasMany(models.Transacoes, {\n foreignKey: 'idConta'\n }) \n //Contas.belongsTo(models.Transacoes)\n }", "get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }", "static associate(models) {\n Turmas.belongsTo(models.Cursos, {\n foreignKey: 'id_cursos'\n })\n Turmas.hasMany(models.Materias, {\n foreignKey: 'id_turmas'\n })\n Turmas.belongsTo(models.Alunos, {\n foreignKey: 'id_turmas'\n })\n }", "static associate(models) {\n models.comment.belongsToMany(models.users, { through: 'likes', foreignKey: 'commentId', sourceKey: 'id' });\n\n models.comment.belongsTo(models.users, { foreignKey: 'userId', sourceKey: 'id', onDelete: 'cascade' });\n models.comment.belongsTo(models.items, { foreignKey: 'itemId', sourceKey: 'id', onDelete: 'cascade' });\n // define association here\n }", "static associate(models) {\n // define association here\n models.exercise.belongsToMany(models.user, {through: 'userExercises'})\n models.exercise.hasMany(models.comment)\n models.exercise.belongsToMany(models.workout, {through: 'exerciseWorkouts'})\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.User, {\n foreignKey: \"tenant_id\",\n onDelete: \"CASCADE\",\n });\n this.belongsTo(models.Property, {\n foreignKey: \"property_id\",\n onDelete: \"CASCADE\",\n });\n this.hasMany(models.Application, {\n foreignKey: \"renthistories_id\",\n });\n this.hasMany(models.Ref_request, {\n foreignKey: \"renthistories_id\",\n });\n }", "static associate(models) {\n // define association here\n Group.belongsToMany(models.Role,{through:\"GroupRole\"})\n Group.belongsToMany(models.User,{through:\"UserGroup\"})\n Group.belongsToMany(models.Hospital,{through:\"HospitalGroup\"})\n Group.hasMany(models.Group,{foreignKey:\"parentGroupId\"})\n }", "static associate(models) {\n // define association here\n models.mealOrder.belongsTo(models.user)\n\n }", "static associate(models) {\n this.belongsTo(models.Usuario, { foreignKey: 'usuarioId', as: 'usuario'});\n this.belongsTo(models.Articulo, { foreignKey: 'articuloId', as: 'articulo'});\n }", "static associate(models) {\n this.belongsTo(models.Role, { foreignKey: \"roleId\" });\n this.hasMany(models.Students, { as: \"student\", foreignKey: \"user_id\" });\n this.hasMany(models.Teachers, { as: \"teacher\", foreignKey: \"user_id\" });\n }", "static associate(models) {\n models.topic.belongsTo(models.user, { foreignKey: 'userId'})\n models.topic.hasMany(models.reply, { foreignKey: 'topicId' });\n }", "static associate(models) {\n // define association here\n Customer.belongsTo(models.User, {\n foreignKey: 'userid',\n as: 'user',\n });\n\n Customer.hasMany(models.Consumer, {\n foreignKey: 'userid',\n as: 'consumers',\n });\n\n Customer.hasMany(models.Grower, {\n foreignKey: 'userid',\n as: 'growers',\n });\n }", "static exposeRelations() {\n const me = this;\n if (me.hasOwnProperty('relationsExposed')) return;\n\n if (me.relationConfig) {\n me.relationsExposed = true;\n me.relations = [];\n me.relationConfig.forEach(relation => {\n me.relations.push(relation);\n const name = relation.relationName; // getter and setter for related object\n\n if (!Reflect.ownKeys(me.prototype).includes(name)) {\n Object.defineProperty(me.prototype, name, {\n enumerable: true,\n get: function () {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n return this.getForeign(name);\n },\n set: function (value) {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n this.setForeign(name, value, relation);\n }\n });\n }\n });\n }\n }", "static associate(models) {\n Pessoas.hasMany(models.Turmas, {\n foreignKey: 'docente_id'\n })\n Pessoas.hasMany(models.Matriculas, {\n foreignKey: 'estudante_id',\n scope: {status: 'confirmado'},\n as: 'aulasMatriculadas'\n })\n }", "static associate(models) {\n Ingredients.belongsTo(models.Meal, { foreignKey: \"mealId\" });\n }", "static associate(models) {\n Friends.belongsTo(models.User, {foreignKey: 'userid',targetKey:'id'}),\n Friends.belongsTo(models.User, {foreignKey: 'friendid',targetKey:'id'})\n }", "static associate(models) {\n Question.hasMany(models.QuestionOption, {foreignKey:'questionId',\n as: 'options'\n });\n Question.belongsTo(models.Category, {\n foreignKey: \"categoryId\",\n allowNull: false,\n as: 'category'\n });\n Question.hasMany(models.Language, {\n foreignKey: 'questionId',\n as: \"languages\"\n });\n }", "static associate(models) {\n // define association here\n Comment.belongsTo(models.User, {foreignKey: 'userId'})\n Comment.belongsTo(models.Post, {foreignKey: 'postId'})\n Comment.hasMany(models.Liking, {foreignKey: 'id'})\n }", "static associate(models) {\n // define association here\n models.inboundFavorite.belongsTo(models.outboundFavorite, {onDelete: \"CASCADE\"})\n //models.inboundFavorite.belongsToMany(models.user, {through: \"userInboundFavorite\"});\n }", "static associate(models) {\n // define association here\n Ronda.hasMany(models.Partida,{foreignKey:'IdRonda',as:'partidas'})\n Ronda.belongsTo(models.Torneo,{foreignKey:'IdTorneo',as:'torneos'})\n }", "static associate(models) {\n Veiculos.belongsTo(models.User);\n Veiculos.hasMany(models.Manutencoes);\n }", "static associate(models) {\n // define association here\n\n // M:N 관계\n models.users.belongsToMany(models.groups, {foreignKey:\"user_id\", through: models.usersmngroups}) \n models.users.belongsToMany(models.groups, {as:\"group_id\", foreignKey:\"user_id\", through: models.applicants}) \n models.users.belongsToMany(models.trophies, {foreignKey:\"user_id\", through: models.usersmntrophies}) \n }", "static associate(models) {\n // define association here\n PatientMedicine.belongsTo(models.Patient)\n PatientMedicine.belongsTo(models.Medicine)\n }", "static associate(models) {\n this.belongsTo(models.users)\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Album, { foreignKey: \"album\" });\n this.belongsTo(models.Artist, { foreignKey: \"artist\" });\n this.belongsToMany(models.Playlist, { through: \"playlist_songs\" });\n }", "static associate(models) {\n Course.belongsTo(models.Category, {\n as: 'category',\n foreignKey: 'id_cat'\n });\n Course.belongsTo(models.User, {\n as: 'author',\n foreignKey: 'author_id'\n });\n Course.belongsToMany(models.User, {\n through: 'FollowedCourses',\n as: 'followers'\n });\n Course.hasMany(models.Article, {\n as: 'exercices',\n foreignKey: 'id_course'\n })\n // define association here\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.content, {\n foreignKey: 'contentid'\n });\n this.belongsTo(models.group, {\n foreignKey: 'groupid'\n })\n }", "static associate(models) {\n models.themePark.hasMany(models.attraction)\n models.themePark.hasMany(models.themeParkFavorites)\n }", "static associate(models) {\n this.hasMany(models.Image, {\n foreignKey: \"imageableId\",\n onDelete: \"CASCADE\",\n hooks: true,\n scope: {\n imageableType: \"product\",\n },\n });\n\n this.hasMany(models.Arrival, {\n foreignKey: \"productId\",\n onDelete: \"CASCADE\",\n hooks: true,\n });\n\n this.belongsTo(models.Category, {\n foreignKey: \"categoryId\",\n });\n\n this.belongsToMany(models.Bill, {\n through: \"BillProducts\",\n });\n\n this.belongsToMany(models.Cart, {\n through: \"CartProducts\",\n });\n\n this.belongsToMany(models.Wishlist, {\n through: \"WishlistProducts\",\n });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Task, {\n foreignKey: \"taskId\",\n });\n this.belongsTo(models.TaskLabel, {\n foreignKey: \"labelId\",\n });\n this.hasMany(models.Grade, {\n foreignKey: \"belongsToId\",\n });\n }", "static associate(models) {\n Account.belongsTo(models.Customer)\n }", "static associate(models) {\n // define association here\n Task.belongsTo(models.Teacher, { foreignKey: 'TeacherId'})\n Task.belongsToMany(models.Student, { through: models.StudentTask, foreignKey: 'TaskId'})\n }", "static associate(models) {\n // define association here\n CartItem.belongsToMany(models.Commande, {\n through: models.OrderItem,\n foreignKey: 'cartItemId',\n otherKey: 'commandeId'\n })\n }", "static associate(models) {\n Orders.belongsTo(models.User);\n }", "static associate(models) {\n User.hasMany(models.Comment)\n User.hasMany(models.Story)\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Persona, {\n as: 'persona',\n foreignKey: 'cedulaP',\n onDelete: 'CASCADE'\n });\n\n this.belongsTo(models.Persona, {\n as: 'doctorP',\n foreignKey: 'doctor',\n onDelete: 'CASCADE'\n });\n /*this.belongsTo(models.Informe, {\n as: 'informe',\n foreignKey: 'informeP',\n onDelete: 'CASCADE'\n });*/\n\n }", "static associate(models) {\n // define association here\n this.hasMany(models['Orders'], { foreignKey: 'owner', sourceKey: 'id', });\n }", "static associate(models) {\n Caixas.belongsTo(models.Apiarios, {\n foreignKey: 'apiario'\n });\n\n Caixas.belongsTo(models.Colmeias, {\n foreignKey: 'colmeia'\n });\n\n Caixas.hasMany(models.Quadros, {\n foreignKey: 'caixa'\n });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Tipo_tarjeta,{\n foreignKey:'tipo_id'\n })\n this.belongsTo(models.Cliente,{\n foreignKey: 'cliente_id'\n });\n }" ]
[ "0.65083855", "0.64711404", "0.57460123", "0.5628265", "0.56105375", "0.5574629", "0.55522084", "0.55414104", "0.55407417", "0.55378604", "0.5523495", "0.5494089", "0.54740804", "0.545909", "0.54529953", "0.544155", "0.54403824", "0.54116136", "0.5399285", "0.5381972", "0.53479415", "0.53420544", "0.53131837", "0.531053", "0.53045213", "0.5294354", "0.5292406", "0.52671856", "0.52669907", "0.52590656", "0.52580386", "0.52565676", "0.5242195", "0.5237877", "0.523151", "0.5227111", "0.52225965", "0.52219504", "0.52051425", "0.520192", "0.52003276", "0.5199413", "0.5198836", "0.51914895", "0.5191263", "0.5177939", "0.51763403", "0.517499", "0.51739883", "0.51731455", "0.51701254", "0.5169399", "0.5168265", "0.5162196", "0.51621", "0.51613694", "0.5160905", "0.51508355", "0.5150687", "0.5146643", "0.51412535", "0.513686", "0.513167", "0.5123664", "0.51211715", "0.511714", "0.5116502", "0.5108482", "0.5089604", "0.5086941", "0.5086503", "0.5081646", "0.50816", "0.5080903", "0.5077544", "0.5075899", "0.50725335", "0.5065138", "0.5064755", "0.5057758", "0.5055598", "0.50505686", "0.504613", "0.5044785", "0.50380397", "0.50375", "0.5037026", "0.503576", "0.50353146", "0.50352734", "0.50279045", "0.5020062", "0.50164443", "0.50163054", "0.5008531", "0.50074905", "0.5005357", "0.5005207", "0.49994966", "0.4999362" ]
0.6446438
2
Given a Model object of the type associated with this Relationships object, attach all of the defined relationships for this type to the object as accessor properties. Resolves to a Promise object.
attach( obj, fields ) { let belongs = this.belongsTo.map( ( element, index, array ) => { let belongs = element.parent; let options = element.options; let key = 'key' in options ? options['key'] : namer.toForeignKeyID( belongs.name ); let lazy = 'lazy' in options ? options['lazy'] : true; let member = 'member' in options ? options['member'] : namer.toMemberName( belongs.name ); if( lazy ) { Object.defineProperty( obj, member, { get: function () { return belongs.find( obj[key], { lazy: true } ) // Replace the property with a resolved promise containing the result .then( ( parent ) => { Object.defineProperty( obj, member, Promise.resolve( parent ) ); return parent; } ); } } ); return Promise.resolve(); } else { return belongs.find( obj[key], { lazy: true } ) .then( ( parent ) => { Object.defineProperty( obj, member, { get: function() { return parent; } } ); } ); } } ); let hasMany = this.hasMany.map( ( element, index, array ) => { let belongs = element.child; let options = element.options; let key = 'key' in options ? options['key'] : namer.toForeignKeyID( this.model ); let lazy = 'lazy' in options ? options['lazy'] : true; let member = 'member' in options ? options['member'] : namer.plural( namer.toMemberName( hasMany.name ) ); if( lazy ) { Object.defineProperty( obj, member, { get: function () { return hasMany.where( { [key]: obj[fields] }, { lazy: true } ) // Replace the property with a resolved promise containing the result .then( ( children ) => { Object.defineProperty( obj, namer.plural( namer.toMemberName( has.name ) ), Promise.resolve( children ) ); return children; } ); } } ); return Promise.resolve(); } else { return belongs.where( obj[key], { lazy: true } ) .then( ( children ) => { Object.defineProperty( obj, member, { get: function() { return children; } } ); } ); } } ); let hasOne = this.hasOne.map( ( element, index, array ) => { let belongs = element.sibling; let options = element.options; let key = 'key' in options ? options['key'] : namer.toForeignKeyID( hasOne.name ); let lazy = 'lazy' in options ? options['lazy'] : true; let member = 'member' in options ? options['member'] : namer.toMemberName( hasOne.name ); if( lazy ) { Object.defineProperty( obj, member, { get: function () { return belongs.find( obj[key], { lazy: true } ) // Replace the property with a resolved promise containing the result .then( ( sibling ) => { Object.defineProperty( obj, member, Promise.resolve( sibling ) ); return sibling; } ); } } ); return Promise.resolve(); } else { return belongs.find( obj[key], { lazy: true } ) .then( ( sibling ) => { Object.defineProperty( obj, member, { get: function() { return sibling; } } ); } ); } } ); return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachRelationships( model, obj ) {\n\tlet r = cache.relationships( model.name );\n\n\n}", "static exposeRelations() {\n const me = this;\n\n if (me.hasOwnProperty('relationsExposed')) return;\n\n if (me.relationConfig) {\n me.relationsExposed = true;\n me.relations = [];\n\n me.relationConfig.forEach((relation) => {\n me.relations.push(relation);\n\n let name = relation.relationName;\n\n // getter and setter for related object\n if (!Reflect.ownKeys(me.prototype).includes(name)) {\n Object.defineProperty(me.prototype, name, {\n enumerable: true,\n get: function() {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n return this.getForeign(name);\n },\n set: function(value) {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n this.setForeign(name, value, relation);\n }\n });\n }\n });\n }\n }", "static exposeRelations() {\n const me = this;\n if (me.hasOwnProperty('relationsExposed')) return;\n\n if (me.relationConfig) {\n me.relationsExposed = true;\n me.relations = [];\n me.relationConfig.forEach(relation => {\n me.relations.push(relation);\n const name = relation.relationName; // getter and setter for related object\n\n if (!Reflect.ownKeys(me.prototype).includes(name)) {\n Object.defineProperty(me.prototype, name, {\n enumerable: true,\n get: function () {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n return this.getForeign(name);\n },\n set: function (value) {\n // noinspection JSPotentiallyInvalidUsageOfClassThis\n this.setForeign(name, value, relation);\n }\n });\n }\n });\n }\n }", "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n // Array of this user's Contacts.\n Contact.belongsTo(models.User, {\n foreignKey: 'user_id'\n });\n Contact.belongsTo(models.User, {\n foreignKey: 'contact_id'\n });\n }", "static associate(models) {\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n as: 'servicos',\n }),\n this.hasMany(models.Arquivo, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Pagamento\n this.hasOne(models.Pagamento, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n }),\n // Associação com Servico\n this.hasMany(models.Servico, {\n foreignKey: 'idSolicitacao',\n targetKey: 'idSolicitacao',\n as: 'services',\n }),\n // Associação com Reserva\n this.hasOne(models.Reserva, {\n foreignKey: 'idReserva',\n as: 'reservas',\n });\n // Associação com Membros\n this.hasOne(models.Membro, {\n foreignKey: 'idMembro',\n as: 'membros',\n });\n }", "get() {\n // The value here has already been loaded, return it synchronously.\n if (this.loaded) return [...this._value];\n\n // The value here hasn't been loaded yet, query the model list and\n // resolve asynchronously.\n return new Promise(resolve => {\n this.host._session.query(this.friendM).where({\n [this.sourceAttribute]: this.host[this.destinationAttribute]\n }).order(this.orderComponents, false).all().then(models => {\n // Respect ephemeral models that need to be included in this\n // relation.\n const {ephemeralRelations} = this.host._relationalSet;\n models = [\n ...models, \n ...ephemeralRelations.filter(({sourceAttribute}) => (\n sourceAttribute == this.sourceAttribute\n )).map(({oneSideModel}) => oneSideModel)\n ];\n\n // Since we now know the state of all involved one-sides, we\n // can load those.\n models.forEach(model => {\n const remoteSideToInit = this._findRemoteSideOn(\n model, true\n );\n\n // If we found a remote side, initialize it.\n if (remoteSideToInit) remoteSideToInit._setAsSideEffect(\n this.host, true\n );\n });\n\n // Assign the value here and return a write-locked copy.\n this._value = models;\n this._resort(); // XXX: conditionally\n resolve([...models]);\n });\n });\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Content_Types, {\n foreignKey: 'id_Content_Type'\n });\n\n this.hasOne(models.Contents, {\n foreignKey: 'id_Content_Rating'\n });\n }", "async relate(req, schema, objectOrArray, withRelationships) {\n\n if (withRelationships === false) {\n // Relationships explicitly deactivated for this call\n return;\n }\n\n const objects = _.isArray(objectOrArray) ? objectOrArray : [ objectOrArray ];\n\n if (!objects.length) {\n // Don't waste effort\n return;\n }\n\n // build an array of relationships of interest, found at any level\n // in the schema, even those nested in array schemas. Add\n // an _arrays property to each one which contains the names\n // of the array fields leading to this relationship, if any, so\n // we know where to store the results. Also set a\n // _dotPath property which can be used to identify relevant\n // relationships when the withRelationships option is present\n\n let relationships = [];\n\n function findRelationships(schema, arrays) {\n // Shallow clone of each relationship to allow\n // for independent _dotPath and _arrays properties\n // for different requests\n const _relationships = _.filter(schema, function (field) {\n return !!self.fieldTypes[field.type].relate;\n }).map(relationship => ({ ...relationship }));\n _.each(_relationships, function (relationship) {\n if (!arrays.length) {\n relationship._dotPath = relationship.name;\n } else {\n relationship._dotPath = arrays.join('.') + '.' + relationship.name;\n }\n // If we have more than one object we're not interested in relationships\n // with the ifOnlyOne restriction right now.\n if (objects.length > 1 && relationship.ifOnlyOne) {\n return;\n }\n relationship._arrays = _.clone(arrays);\n });\n relationships = relationships.concat(_relationships);\n _.each(schema, function (field) {\n if (field.type === 'array' || field.type === 'object') {\n findRelationships(field.schema, arrays.concat(field.name));\n }\n });\n }\n\n findRelationships(schema, []);\n\n // The withRelationships option allows restriction of relationships. Set to false\n // it blocks all relationships. Set to an array, it allows the relationships named within.\n // Dot notation can be used to specify relationships in array properties,\n // or relationships reached via other relationships.\n //\n // By default, all configured relationships will take place, but withRelationships: false\n // will be passed when fetching the objects on the other end of the relationship,\n // so that infinite recursion never takes place.\n\n const withRelationshipsNext = {};\n // Explicit withRelationships option passed to us\n if (Array.isArray(withRelationships)) {\n relationships = _.filter(relationships, function (relationship) {\n const dotPath = relationship._dotPath;\n let winner;\n _.each(withRelationships, function (withRelationshipName) {\n if (withRelationshipName === dotPath) {\n winner = true;\n return;\n }\n if (withRelationshipName.substr(0, dotPath.length + 1) === dotPath + '.') {\n if (!withRelationshipsNext[dotPath]) {\n withRelationshipsNext[dotPath] = [];\n }\n withRelationshipsNext[dotPath].push(withRelationshipName.substr(dotPath.length + 1));\n winner = true;\n }\n });\n return winner;\n });\n } else {\n // No explicit withRelationships option for us, so we do all the relationships\n // we're configured to do, and pass on the withRelationships options we\n // have configured for those\n _.each(relationships, function (relationship) {\n if (relationship.withRelationships) {\n withRelationshipsNext[relationship._dotPath] = relationship.withRelationships;\n }\n });\n }\n\n for (const relationship of relationships) {\n const arrays = relationship._arrays;\n\n const _objects = findObjectsInArrays(objects, arrays);\n\n if (!relationship.name.match(/^_/)) {\n throw Error('Relationships should always be given names beginning with an underscore (_). Otherwise we would waste space in your database storing the results statically. There would also be a conflict with the array field withRelationships syntax. Relationship name is: ' + relationship._dotPath);\n }\n if (Array.isArray(relationship.withType)) {\n // Polymorphic join\n for (const type of relationship.withType) {\n const manager = self.apos.doc.getManager(type);\n if (!manager) {\n throw Error('I cannot find the instance type ' + type);\n }\n const find = manager.find;\n\n const options = {\n find: find,\n builders: { relationships: withRelationshipsNext[relationship._dotPath] || false }\n };\n const subname = relationship.name + ':' + type;\n const _relationship = _.assign({}, relationship, {\n name: subname,\n withType: type\n });\n\n // Allow options to the get() method to be\n // specified in the relationship configuration\n if (_relationship.builders) {\n _.extend(options.builders, _relationship.builders);\n }\n if (_relationship.buildersByType && _relationship.buildersByType[type]) {\n _.extend(options.builders, _relationship.buildersByType[type]);\n }\n await self.apos.util.recursionGuard(req, `${_relationship.type}:${_relationship.withType}`, () => {\n // Allow options to the getter to be specified in the schema,\n return self.fieldTypes[_relationship.type].relate(req, _relationship, _objects, options);\n });\n _.each(_objects, function (object) {\n if (object[subname]) {\n if (Array.isArray(object[subname])) {\n object[relationship.name] = (object[relationship.name] || []).concat(object[subname]);\n } else {\n object[relationship.name] = object[subname];\n }\n }\n });\n }\n if (relationship.idsStorage) {\n _.each(_objects, function (object) {\n if (object[relationship.name]) {\n const locale = `${req.locale}:${req.mode}`;\n object[relationship.name] = self.apos.util.orderById(object[relationship.idsStorage].map(id => `${id}:${locale}`), object[relationship.name]);\n }\n });\n }\n }\n\n const manager = self.apos.doc.getManager(relationship.withType);\n if (!manager) {\n throw Error('I cannot find the instance type ' + relationship.withType);\n }\n\n // If it has a getter, use it, otherwise supply one\n const find = manager.find;\n\n const options = {\n find: find,\n builders: { relationships: withRelationshipsNext[relationship._dotPath] || false }\n };\n\n // Allow options to the get() method to be\n // specified in the relationship configuration\n if (relationship.builders) {\n _.extend(options.builders, relationship.builders);\n }\n\n // Allow options to the getter to be specified in the schema\n await self.apos.util.recursionGuard(req, `${relationship.type}:${relationship.withType}`, () => {\n return self.fieldTypes[relationship.type].relate(req, relationship, _objects, options);\n });\n }\n\n function findObjectsInArrays(objects, arrays) {\n if (!arrays) {\n return [];\n }\n if (!arrays.length) {\n return objects;\n }\n const array = arrays[0];\n let _objects = [];\n _.each(objects, function (object) {\n _objects = _objects.concat(object[array] || []);\n });\n return findObjectsInArrays(_objects, arrays.slice(1));\n }\n }", "static associate(models) {\n this.hasMany(Order);\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.User, {\n foreignKey: \"tenant_id\",\n onDelete: \"CASCADE\",\n });\n this.belongsTo(models.Property, {\n foreignKey: \"property_id\",\n onDelete: \"CASCADE\",\n });\n this.hasMany(models.Application, {\n foreignKey: \"renthistories_id\",\n });\n this.hasMany(models.Ref_request, {\n foreignKey: \"renthistories_id\",\n });\n }", "static associate(models) {\n this.belongsTo(models.customer);\n this.hasMany(models.itemRental);\n this.hasMany(models.additive);\n }", "static associate (models) {\n this.belongsTo(models.UserType, { foreignKey: 'userTypeId' })\n\n this.hasMany(models.Order, { foreignKey: 'playerId' })\n this.hasMany(models.News, { foreignKey: 'userId' })\n this.hasMany(models.Stock, { foreignKey: 'playerId' })\n this.hasMany(models.PlayerCompetition, { foreignKey: 'playerId', as: 'playercompetition' })\n this.hasMany(models.Evaluation, { foreignKey: 'managerId' })\n\n this.hasMany(models.Order, { foreignKey: 'playerId' })\n this.hasMany(models.News, { foreignKey: 'userId' })\n this.hasMany(models.Stock, { foreignKey: 'playerId' })\n this.hasMany(models.PlayerCompetition, { foreignKey: 'playerId' })\n\n this.hasMany(models.Competition, { foreignKey: 'managerId', as: 'competitions' })\n }", "static associate(models) {\n lead.belongsTo(models.contact);\n lead.belongsTo(models.user);\n lead.hasMany(models.report);\n lead.belongsTo(models.salesCyclePhase);\n lead.hasMany(models.action);\n }", "static associate(models) {\n this.user = this.belongsTo(models.User, {\n foreignKey: 'user_id',\n });\n this.bid_order = this.belongsTo(models.Order, {\n foreignKey: 'bid_order_id',\n });\n this.ask_order = this.belongsTo(models.Order, {\n foreignKey: 'ask_order_id',\n });\n }", "static associate(models) {\n // define association here\n User.hasMany(models.Order)\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "async modelize () {\n\t\tthis.fetchedModels = [];\n\t\tif (!this.fetchedDocuments) { return; }\n\t\tawait Promise.all(this.fetchedDocuments.map(\n\t\t\tasync document => {\n\t\t\t\tconst model = new this.modelClass(document);\n\t\t\t\tthis.fetchedModels.push(model);\n\t\t\t}\n\t\t));\n\t}", "static associate(models) {\n this.belongsTo(models.User, { foreignKey: 'user_id', as: 'user' });\n this.belongsTo(models.User, { foreignKey: 'follower_id', as: 'follower' });\n\n }", "initRelations() {\n const me = this,\n relations = me.constructor.relations;\n\n if (!relations) return;\n\n // TODO: feels strange to have to look at the store for relation config but didn't figure out anything better.\n // TODO: because other option would be to store it on each model instance, not better...\n\n me.stores.forEach((store) => {\n if (!store.modelRelations) store.initRelations();\n\n // TODO: not at all tested for multiple stores, can't imagine it works as is\n const relatedRecords = [];\n\n store.modelRelations &&\n store.modelRelations.forEach((config) => {\n relatedRecords.push({ related: me.initRelation(config), config });\n });\n store.updateRecordRelationCache(me, relatedRecords);\n });\n }", "static associate(models) {\n cd.belongsTo(models.list);\n // define association here\n }", "static associate(models) {\n // define association here\n PropertyUnitAttribute.belongsTo(models.PropertyUnit);\n PropertyUnitAttribute.belongsTo(models.Attribute);\n PropertyUnitAttribute.belongsTo(models.AttributeUnit);\n PropertyUnitAttribute.hasMany(models.ScopeOfWorkPropertyUnit);\n }", "initRelations() {\n const me = this,\n relations = me.constructor.relations;\n if (!relations) return; // TODO: feels strange to have to look at the store for relation config but didn't figure out anything better.\n // TODO: because other option would be to store it on each model instance, not better...\n\n me.stores.forEach(store => {\n if (!store.modelRelations) store.initRelations(); // TODO: not at all tested for multiple stores, can't imagine it works as is\n\n const relatedRecords = [];\n store.modelRelations && store.modelRelations.forEach(config => {\n relatedRecords.push({\n related: me.initRelation(config),\n config\n });\n });\n store.updateRecordRelationCache(me, relatedRecords);\n });\n }", "static associate(models) {\n // define association here\n this.hasMany(models.Friendship, { foreignKey: \"user_1\" });\n this.hasMany(models.Friendship, { foreignKey: \"user_2\" });\n this.hasMany(models.Post, { foreignKey: \"userId\" });\n this.hasMany(models.Likes, { foreignKey: \"userId\" });\n this.belongsToMany(models.Chat, {\n through: \"ChatUser\",\n foreignKey: \"userId\",\n });\n this.hasMany(models.ChatUser, { foreignKey: \"userId\" });\n this.hasMany(models.Message, { foreignKey: \"fromUserId\" });\n this.hasMany(models.LastReadMessage, { foreignKey: \"chatId\" });\n }", "static associate(models) {\n Pessoas.hasMany(models.Turmas, { \n foreignKey : 'docente_id'\n });\n Pessoas.hasMany(models.Matriculas, { \n foreignKey : 'estudante_id', \n /**\n * Escopo de associacao.\n * Funciona como \"where status = 'confirmado'\"\n */\n scope : { status : 'confirmado' },\n /**\n * Nome do \"mixim\" personalizado \"getAulasMatriculadas()\"\n * Mixins são métodos que podem ser utilizados por \n * outras classes, sem a necessidade de herança direta.\n * Eles existem somente nas intâncias dos modelos\n */\n as : 'aulasMatriculadas'\n });\n }", "static associate(models) {\n // define association here\n // this.hasMany(models.StepIngredient);\n this.belongsTo(models.Recipe);\n }", "static associate(models) {\n // define association here\n Order.belongsTo(models.User, { foreignKey: 'orderedBy' });\n Order.hasMany(models.Transaction, {\n foreignKey: 'order_id',\n onDelete: 'CASCADE',\n onUpdate: 'CASCADE'\n });\n }", "static associate(models) {\n Resposible_people.belongsTo(models.Responsible_type, {\n foreignKey: \"responsible_type_id\",\n });\n Resposible_people.belongsTo(models.Transition, {\n foreignKey: \"transition_id\",\n });\n }", "getRelated() {}", "static associate(models) {\n // define association here\n this.belongsTo(models.credential, { foreignKey: 'credential_id' })\n this.belongsTo(models.destination_package, { foreignKey: 'package_id' })\n }", "static associate(models) {\n // define association here\n this.hasMany(models['Orders'], { foreignKey: 'owner', sourceKey: 'id', });\n }", "static associate(models) {\n // define association here\n Vehicle.belongsTo(models.User);\n Vehicle.belongsTo(models.Category);\n Vehicle.hasMany(models.Order);\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.Task, {\n foreignKey: \"taskId\",\n });\n this.belongsTo(models.TaskLabel, {\n foreignKey: \"labelId\",\n });\n this.hasMany(models.Grade, {\n foreignKey: \"belongsToId\",\n });\n }", "static associate(models) {\n // User.hasMany(models.Rating)\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }" ]
[ "0.59146315", "0.562054", "0.5558384", "0.5542222", "0.55338585", "0.54198736", "0.5309598", "0.52964157", "0.52761626", "0.52741593", "0.52637345", "0.52509266", "0.52458644", "0.5226481", "0.5218306", "0.52124584", "0.52124584", "0.52124584", "0.52122283", "0.52005553", "0.5195793", "0.51917076", "0.51885104", "0.5185065", "0.5183152", "0.51696354", "0.51564884", "0.51422215", "0.5134901", "0.51263994", "0.51175356", "0.5115434", "0.510858", "0.5094427", "0.50932556", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679", "0.5089679" ]
0.5731722
1
add dependency for angular bootstrap Lightbox
function bookController($uibModal, $cookies, $stateParams, bookService, signInTitle, dontMissOutMessage, luckyDayMessgae, loginService, gbsHotelConfig, $state, base64, hoteldetailService, scope, Lightbox, topNavigationService) { var vm = this; vm.isDisabled = false; vm.bookHotel = bookHotel; vm.bookingObject = {}; vm.signInTitle = signInTitle; vm.dontMissOutMessage = dontMissOutMessage; vm.luckyDayMessgae = luckyDayMessgae; vm.showLoginPopup = showLoginPopup; vm.ChangeBookingDate = ChangeBookingDate; // was created for the Changedate Controller & Popup //vm.showDateChangePopup = showDateChangePopup; vm.closePopup = closePopup; vm.changecardupdate = changecardupdate; vm.showTermsPopup = showTermsPopup; vm.selected_CVCLenth = 3;// initial set vm.printDiv = function (divName) { var printContents = document.getElementById(divName).innerHTML; var popupWin = window.open('', '_blank', 'left=0,top=0,toolbar=0,sta­tus=0'); popupWin.document.open(); popupWin.document.write(printContents); popupWin.document.close(); popupWin.focus(); popupWin.print(); } //Lightbox vm.openLightboxModal = function (index) { Lightbox.openModal(scope.images, index); }; vm.beforeRender = beforeRender_CheckInDate; vm.beforeRender_CheckOutDate = beforeRender_CheckOutDate; //vm.handleStripe = function (status, response) { // if (response.error) { // alert("Error: " + response.error) // // there was an error. Fix it. // } else { // // got stripe token, now charge it or smt // token = response.id; // console.log(token); // } //} function closePopup() { $uibModalInstance.dismiss(true); } vm.years = []; activate(); function activate() { var culture = $cookies.get("lang"); typeMonth(culture); var userId = $cookies.get("userId"); if (userId == null || userId == "" || userId == undefined) { if ($cookies.get("UserCookies") != null || $cookies.get("UserCookies") != undefined) { userId = $cookies.get("UserCookies"); } else userId = ""; if (userId != "" && userId.split('&').length == 2) { userId = userId.split('&')[1].split('=')[1]; } } vm.LoggedUserID = userId; //getCurrencyLoad(culture).then(function () { // debugger // //get response from hotel details: By AB // SelectedHotel(culture, userId); //}); //get response from hotel details: By AB SelectedHotel(culture, userId); var arrId = "lblCharge,lblPropertyCurrency,lblYourCurency,Closebutton,Facebooklog,gmaillog,lblSelectHotel,lblBookingDetails,labelBookingSucessText,lblcheckinDate,lblcheckoutdate,lblyourdetails,lblrequiredFields,lbltitle,lblname,lblSurname," + "lblEmail,lblPhone,lblCountry,lblcreditCardProvider,lblNameOntheCard,lblCreditcardNumber,lblExpirationDate," + "lblcvvCode,lblreservationAgreement,lblLogintext,txtLoginEmail,txtLoginPassword," + "lblLoginFailInvalidEmail,btnloginBook,lblReservationSucessMessage,lblReservationStatusText,lblReservationIDText," + "lblOperationSucessMessage,lblPincodeText,btnbooknowReservation,lblBookingStartMessage,lblBestPrice,lblInstantConformation," + "lblEmailGoesMessage,lblnightStayText,lblRoomNotFound,lblCreditcardNumberError,lblCVCCodeError,lblSelectCreditCardError,lblTermsCheckError,lblExpirationError"; var arrMessageCode = "Charge,PropertyCurrencyin,YourCurrency,Close,RegisterWithFacebook,RegisterWithGooglePlus,SelectHotel,BookingDetails,BookingSuccess,CheckInDate,CheckOutDate,YourDetails,FillFieldsWarning,Salutation,Name,"+ "Surname,Email,Phone,Country,CCType,CCFullName,CCNo,CCExpiration,CCCVC,"+ "ReservationBookAgreement,UserLogin,Email Address,Password,InvalidEmailId,Login,ReservationSucesssMessage,"+ "ReservationID,ReservationID,OperationSuccess,PinCode,BookNow,BookingStartMessage,BestPrice,InstantConformation,"+ "ConfirmMessageEmail,nightstay,RoomNotAvailableWarning,CreditCardNumberError,CVCCodeError,CreditCardProviderError,termsandconditionsError,ExpirationDateError"; getBookingTextMessage(culture, arrMessageCode, arrId); generateYears(); getCountry(); if (vm.LoggedUserID && userId) getProfileDetailsIfAvailable(culture, userId); typeTraveller(culture); getSalutation(culture); vm.isLogin = gbsHotelConfig.checkLoggedIn(); } function getCurrencyLoad(culture) { return topNavigationService.getCurrencyLoad(culture).then(function (response) { vm.currency = response; setCurrency(); }).catch(function (err) { console.log(err); }) } function showTermsPopup() { vm.animationsEnabled = true; var modalInstance = $uibModal.open({ animation: vm.animationsEnabled, size: "lg", templateUrl: "app/termsandcondition/terms.tmpl.html?v=3.10", controller: 'termsController', controllerAs: "vm" }); } function beforeRender_CheckInDate($view, $dates, $leftDate, $upDate, $rightDate) { var index = Math.floor(Math.random() * $dates.length); var max = moment().add('day', 7).valueOf(); var now = moment().add('day', -1).valueOf(); angular.forEach($dates, function (dateObject) { dateObject.selectable = (dateObject.localDateValue() >= now) }); } function beforeRender_CheckOutDate($view, $dates, $leftDate, $upDate, $rightDate) { var index = Math.floor(Math.random() * $dates.length); var now = moment().add('day', -1).valueOf(); angular.forEach($dates, function (dateObject) { dateObject.selectable = (dateObject.localDateValue() >= now) }); } function showLoginPopup() { vm.animationsEnabled = true; var modalInstance = $uibModal.open({ animation: vm.animationsEnabled, size: "md", templateUrl: "app/book/booklogin.tmpl.html?v=3.10", controller: 'bookLoginController', controllerAs: "vm" }); } //function showDateChangePopup() { // vm.animationsEnabled = true; // vm.modalDateInstance = $uibModal.open({ // animation: vm.animationsEnabled, // size: "md", // templateUrl: 'app/book/BookingChangeDate.tmpl.html', // controller: 'bookDateController', // controllerAs: "vm" // }); //} function getCountry() { bookService.getCountryForDropdown($cookies.get("lang")).then(function (response) { vm.countryList = response; }); } function getBookingTextMessage(culture, messageCode, labelId) { bookService.getBookingTextMessage(culture, messageCode, labelId).then(function (response) { vm.bookinglabel = response; }).catch(function (error) { }); } //decode parameters function decode_params(obj) { return decodeURIComponent(base64.urldecode($.trim(obj))); } //Bind the Hotel Details and all the relavant objects function SelectedHotel(culture, userId) { //vm.hotelBookingConfirm = bookService.getSelectedHotel(); // if hotelBookingConfirmation object null then get the object from the State Parameter, Its use to Make URL to anytime access for booking. if (vm.hotelBookingConfirm == undefined && $stateParams.cultureid && $stateParams.checkdatefrom && $stateParams.checkdateto && $stateParams.hotelid && $stateParams.roomcount && $stateParams.roomprice && $stateParams.pricetype) //if (vm.hotelBookingConfirm == undefined && $stateParams.confirmbook) { //var base64EncodedString = decodeURIComponent($stateParams.confirmbook); //var decodedString = $base64.decode(base64EncodedString); //var decodedJson = JSON.parse(decodedString); var json = { //cultureid: decode_params($stateParams.cultureid), cultureid: $cookies.get("lang") ? $cookies.get("lang") : decode_params($stateParams.cultureid), checkdatefrom: moment(decode_params($stateParams.checkdatefrom)).format("DD-MMM-YYYY"), checkdateto: moment(decode_params($stateParams.checkdateto)).format("DD-MMM-YYYY"), hotelcity: decode_params($stateParams.hotelcity), hotelid: decode_params($stateParams.hotelid), address: decode_params($stateParams.address), mainphotoname: decode_params($stateParams.mainphotoname), hotelclass: decode_params($stateParams.hotelclass), hotelname: decode_params($stateParams.hotelname), roomid: decode_params($stateParams.roomid), uniqueid: decode_params($stateParams.uniqueid), accommodationtypeid: decode_params($stateParams.accommodationtypeid), accommodationtypename: decode_params($stateParams.accommodationtypename), accommodationtypedescription: decode_params($stateParams.accommodationtypedescription), pricepolicytypeid: decode_params($stateParams.pricepolicytypeid), pricepolicytypename: decode_params($stateParams.pricepolicytypename), singlerate: decode_params($stateParams.singlerate), doublerate: decode_params($stateParams.doublerate), dailyroomprices: decode_params($stateParams.dailyroomprices), originalroomprice: decode_params($stateParams.originalroomprice), currencyid: decode_params($stateParams.currencyid), currencysymbol: decode_params($stateParams.currencysymbol), roomcount: decode_params($stateParams.roomcount), maxpeoplecount: decode_params($stateParams.maxpeoplecount), roomprice: decode_params($stateParams.roomprice), currencycode: decode_params($stateParams.currencycode), hoteltypename: decode_params($stateParams.hoteltypename), pricetype: decode_params($stateParams.pricetype), creditcardnotrequired: decode_params($stateParams.creditcardnotrequired), currentcurrency: $cookies.get("currency")?$cookies.get("currency"):decode_params($stateParams.currentcurrency) } vm.storeHotelConfirms = json; hoteldetailService.storeHotelRoomInfo( json.cultureid, json.checkdatefrom, json.checkdateto, json.hotelcity, json.hotelid, json.address, json.mainphotoname, json.hotelclass, json.hotelname, json.roomid, json.uniqueid, json.accommodationtypeid, json.accommodationtypename, json.accommodationtypedescription, json.pricepolicytypeid, json.pricepolicytypename, json.singlerate, json.doublerate, json.dailyroomprices, json.originalroomprice, json.currencyid, json.currencysymbol, json.roomcount, json.maxpeoplecount, json.roomprice, json.currencycode, json.hoteltypename, json.pricetype, json.creditcardnotrequired, json.currentcurrency ).then(function (response) { // copy from the hoteldetails page to make same object rebind again in booking ( current ) vm.hotelBookingConfirm = response; //console.log(vm.hotelBookingConfirm); vm.hotelBookingConfirm.pricetype = vm.storeHotelConfirms.pricetype; vm.hotelBookingConfirm.roomcount = vm.storeHotelConfirms.roomcount; vm.hotelBookingConfirm.roomid = vm.storeHotelConfirms.roomid; vm.hotelBookingConfirm.pricepolicytypeid = vm.storeHotelConfirms.pricepolicytypeid; //set has discount object if not empty vm.hotelBookingConfirm.hasDiscount =$stateParams.hasdiscount? decode_params($stateParams.hasdiscount):""; //set store confirm objects for ChangeDate function at booking module. if (vm.storeHotelConfirms) vm.hotelBookingConfirm.storeHotelConfirms = vm.storeHotelConfirms; //Bind current booking object BindBookObjects(vm.hotelBookingConfirm,culture, userId); }).catch(function (error) { }); } else { //Bind current booking object BindBookObjects(vm.hotelBookingConfirm, culture,userId); } } function setCurrency() { var currCurrrency = $cookies.get("currency"); if (currCurrrency == undefined) { $cookies.put("currency", "EUR", { expires: GBSHelper.helpers.getCookieExpire() }); currCurrrency = "EUR"; _.each(vm.currency, function (currency) { if (currCurrrency == currency.CurrencyCode) { vm.currentCurrency = { CurrencyName: currency.CurrencyName, CurrencySymbol: currency.CurrencySymbol }; } }); } else { _.each(vm.currency, function (currency) { if (currCurrrency == currency.CurrencyCode) { vm.currentCurrency = { CurrencyName: currency.CurrencyName, CurrencySymbol: currency.CurrencySymbol }; } }); } } //bind hotel informations object function BindBookObjects(hotelBookingConfirm,culture, userId) { //below object will Used for changeDate functions.//its json objects if (hotelBookingConfirm) { //set current currency again from cookie //hotelBookingConfirm.storeHotelConfirms.currencycode = $cookies.get("currency"); //hotelBookingConfirm.storeHotelConfirms.currentcurrency = $cookies.get("currency"); //hotelBookingConfirm.storeHotelConfirms.currencysymbol = vm.currentCurrency.CurrencySymbol; vm.storeHotelConfirms = hotelBookingConfirm.storeHotelConfirms; } if (vm.hotelBookingConfirm) { //console.log(vm.hotelBookingConfirm); vm.HotelInformation = hotelBookingConfirm.list; try { if (vm.HotelInformation && vm.HotelInformation.length > 0) { //moment(vm.HotelInformation[0].CheckDatefrom).format('MM-YYYY') //vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format('MM/DD/YYYY') }; //vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format('MM/DD/YYYY') }; //vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format('MMM DD,ddd') }; //vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format('MMM DD,ddd') }; vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format() }; vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format() }; scope.images = []; for(var i=0;i<vm.HotelInformation.length;i++) { if(!vm.HotelInformation[i].RoomPhotoName) { vm.HotelInformation[i].RoomPhotoName = "/images/noimage.jpg?v=3.10"; } scope.images.push(vm.HotelInformation[i].RoomPhotoName); //vm.himages.push( { // 'url': vm.HotelInformation[i].RoomPhotoName, // 'caption': vm.HotelInformation[i].HotelTypeName, // 'thumbUrl': vm.HotelInformation[i].RoomPhotoName // used only for this example //}); } } } catch (ett) { } vm.HotelTax = vm.hotelBookingConfirm.HotelTax; vm.convertedRoomPriceTotal = vm.hotelBookingConfirm.convertedRoomPriceTotal; vm.total = vm.hotelBookingConfirm.total; vm.totalInHotelCurrency = vm.hotelBookingConfirm.totalInHotelCurrency; //set for one day room count from nightcount //comment below to call again to recalculate changedDate Prices & Total payable. //vm.priceForSingalNight_ConvertedRoomPriceTotal=vm.convertedRoomPriceTotal/vm.HotelInformation[0].NightCount; //vm.priceForSingalNight_total = vm.total/vm.HotelInformation[0].NightCount; //vm.priceForSingalNight_InHotelCurrency = vm.totalInHotelCurrency / vm.HotelInformation[0].NightCount; vm.NewCurrencySymbol = vm.HotelInformation[vm.HotelInformation.length - 1].NewCurrencySymbol; vm.CurrencySymbol = vm.HotelInformation[vm.HotelInformation.length - 1].CurrencySymbol; //set local hasDiscout object vm.hasDiscount = vm.hotelBookingConfirm.hasDiscount; //init with zero vm.CreditCardNotRequired = 0; for (var rs = 0; rs < vm.hotelBookingConfirm.list.length; rs++) { var rsRequired = vm.hotelBookingConfirm.list[rs].CreditCardNotRequired; if (rsRequired) { vm.CreditCardNotRequired = rsRequired; break; } } if (!vm.typeCreditCardByHotel) { typeCreditCardByHotel(culture, vm.HotelInformation[0].HotelID); } } else { $state.go("master.gbs.home"); } } /* function SelectedHotelAfterChangeDate(response) { //reset old store info JSON to below object storeHotelConfirms : it will back from hotel details page vm.storeHotelConfirms = vm.hotelBookingConfirm.storeHotelConfirms; vm.hotelBookingConfirm = response; debugger; if (vm.hotelBookingConfirm) { console.log("after change date: " +vm.hotelBookingConfirm); vm.HotelInformation = vm.hotelBookingConfirm.list; try { if (vm.HotelInformation && vm.HotelInformation.length > 0) { vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format() }; vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format() }; } } catch (ett) { } vm.HotelTax = vm.hotelBookingConfirm.HotelTax; vm.convertedRoomPriceTotal = vm.hotelBookingConfirm.convertedRoomPriceTotal; vm.total = vm.hotelBookingConfirm.total; vm.totalInHotelCurrency = vm.hotelBookingConfirm.totalInHotelCurrency; //symblow no need reset so comment below //vm.NewCurrencySymbol = vm.HotelInformation[vm.HotelInformation.length - 1].NewCurrencySymbol; //vm.CurrencySymbol = vm.HotelInformation[vm.HotelInformation.length - 1].CurrencySymbol; if (!vm.profileCarddetails) { getUserSavedCardDetailsByHotel(userId, vm.HotelInformation[0].HotelID); } // Card details set when controller load when initialized //if (!vm.CreditCardNotRequired) { // //init with zero // vm.CreditCardNotRequired = 0; // for (var rs = 0; rs < vm.hotelBookingConfirm.list.length; rs++) { // var rsRequired = vm.hotelBookingConfirm.list[rs].CreditCardNotRequired; // if (rsRequired) { // vm.CreditCardNotRequired = rsRequired; // break; // } // } //} //if (!vm.typeCreditCardByHotel) { // typeCreditCardByHotel(culture, vm.HotelInformation[0].HotelID); //} } else { $state.go("master.gbs.home"); } } */ function SelectedHotelAfterChangeDate(response) { //debugger; vm.hotelBookingConfirm = response; if (vm.hotelBookingConfirm) { // console.log("after change date: " + vm.hotelBookingConfirm); vm.HotelInformation = vm.hotelBookingConfirm.list; try { if (vm.HotelInformation && vm.HotelInformation.length > 0) { vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format() }; vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format() }; } } catch (ett) { toastr.error(ett.message); } vm.HotelTax = vm.hotelBookingConfirm.HotelTax; vm.convertedRoomPriceTotal = vm.hotelBookingConfirm.convertedRoomPriceTotal; vm.total = vm.hotelBookingConfirm.total; vm.totalInHotelCurrency = vm.hotelBookingConfirm.totalInHotelCurrency; //ReSet the Hotel Discount and Room details. vm.hotelBookingConfirm.pricetype = vm.tempObj.pricetype; vm.hotelBookingConfirm.roomcount = vm.tempObj.roomcount; vm.hotelBookingConfirm.roomid = vm.tempObj.roomid; vm.hotelBookingConfirm.pricepolicytypeid = vm.tempObj.pricepolicytypeid; //set has discount object if not empty vm.hotelBookingConfirm.hasDiscount = vm.tempObj.hasdiscount; //if required then again call on change update dates if (!vm.profileCarddetails) { getUserSavedCardDetailsByHotel(userId, vm.HotelInformation[0].HotelID); } } else { vm.tempObj = null; $state.go("master.gbs.home"); } } //call when the date changed model popup call function ChangeBookingDate() { //set vm object to price,roomtype,count and policy that was coming from hotelbooking previous page. vm.tempObj = { hotelid:vm.HotelInformation[0].HotelID ,pricetype:vm.hotelBookingConfirm.pricetype ,roomcount:vm.hotelBookingConfirm.roomcount ,roomid:vm.hotelBookingConfirm.roomid ,pricepolicytypeid:vm.hotelBookingConfirm.pricepolicytypeid ,hasdiscount:vm.hotelBookingConfirm.hasDiscount } var checkin= moment( vm.ChangeCheckInDate.date).format("MM/DD/YYYY") , checkout = moment( vm.ChangeCheckoutDate.date).format("MM/DD/YYYY") , Session_Code = $cookies.get("lang"); bookService.changeBookingDate(checkin , checkout , vm.tempObj.pricepolicytypeid , vm.tempObj.hotelid , Session_Code , vm.tempObj.pricetype , vm.tempObj.roomcount , vm.tempObj.roomid) .then(function (response) { vm.Countavailable = response; if(vm.Countavailable==0) { vm.CountavailableNone = true; //here it will show warning message.. } else { //debugger; //vm.HotelInformation[0].CheckDatefrom = moment(vm.ChangeCheckInDate.date).format("DD-MMM-YYYY"); //vm.HotelInformation[0].CheckDateto = moment(vm.ChangeCheckoutDate.date).format("DD-MMM-YYYY"); for (var i = 0; i < vm.HotelInformation.length; i++) { vm.HotelInformation[i].CheckDatefrom=moment(vm.ChangeCheckInDate.date).format("DD-MMM-YYYY"); vm.HotelInformation[i].CheckDateto = moment(vm.ChangeCheckoutDate.date).format("DD-MMM-YYYY"); } //call store information same as hoteldetails to recalculate pricing // No need to call store object here. it will call the GetValuewithChangeLang service API //if (vm.storeHotelConfirms && vm.HotelInformation.length > 0) { if (vm.HotelInformation.length > 0) { try{ //vm.storeHotelConfirms.checkdatefrom = vm.HotelInformation[0].CheckDatefrom; //vm.storeHotelConfirms.checkdateto = vm.HotelInformation[0].CheckDateto //storeHotelRoomInfo(vm.storeHotelConfirms); // OR we can call to update pricing. > GetValuesWhileChangelang(); var json = { currentCurrency: $cookies.get("currency"), culture: $cookies.get("lang"), hotelId: vm.tempObj.hotelid, roomPriceTypeId: vm.tempObj.pricetype, //no need to use Store Object to pass into json parameter //checkDatefrom: vm.storeHotelConfirms.checkdatefrom, //checkDateTo: vm.storeHotelConfirms.checkdateto, checkDatefrom: vm.HotelInformation[0].CheckDatefrom, checkDateTo: vm.HotelInformation[0].CheckDateto, roomCountHId: vm.tempObj.roomcount, policyTypeId: vm.tempObj.pricepolicytypeid, hotelRoomIdAry: vm.tempObj.roomid }; GetValuesWhileChangelangRe(json); } catch (tr) { vm.tempObj = null; toastr.error("Try again "+tr.Message); } } /* comment below to reagain call to calculate prices & taxes var totalNight = moment(vm.ChangeCheckoutDate.date).diff(moment(vm.ChangeCheckInDate.date), 'days'); //var totalNight = vm.HotelInformation[0].CheckDatefrom.diff(vm.HotelInformation[0].CheckDateto, 'days'); vm.HotelInformation[0].NightCount = totalNight; //update pricing. vm.convertedRoomPriceTotal = parseFloat( vm.priceForSingalNight_ConvertedRoomPriceTotal * totalNight); vm.total = parseFloat(vm.priceForSingalNight_total * totalNight); vm.totalInHotelCurrency = parseFloat(vm.priceForSingalNight_InHotelCurrency * totalNight); */ $('#changeDateModal').modal('hide'); } }).catch(function (error) { console.log(error); }); } //call this function to reupdate price and counts. function GetValuesWhileChangelangRe(json) { bookService.getValuesWhileChangelangRe(json).then(function (response) { //debugger; SelectedHotelAfterChangeDate(response); }).catch(function (error) { vm.tempObj = null; toastr.error(error); }); } /* function storeHotelRoomInfo(json) { var tempjson = json; bookService.storeHotelRoomInfo( json.cultureid, json.checkdatefrom, json.checkdateto, json.hotelcity, json.hotelid, json.address, json.mainphotoname, json.hotelclass, json.hotelname, json.roomid, json.uniqueid, json.accommodationtypeid, json.accommodationtypename, json.accommodationtypedescription, json.pricepolicytypeid, json.pricepolicytypename, json.singlerate, json.doublerate, json.dailyroomprices, json.originalroomprice, json.currencyid, json.currencysymbol, json.roomcount, json.maxpeoplecount, json.roomprice, json.currencycode, json.hoteltypename, json.pricetype, json.creditcardnotrequired, json.currentcurrency ).then(function (response) { SelectedHotelAfterChangeDate(response); //vm.hotelBookingConfirm = response; //vm.HotelInformation = vm.hotelBookingConfirm.list; // vm.convertedRoomPriceTotal = vm.hotelBookingConfirm.convertedRoomPriceTotal; // vm.total = vm.hotelBookingConfirm.total; // vm.totalInHotelCurrency = vm.hotelBookingConfirm.totalInHotelCurrency; ////check value must be > 0 // if (vm.total && vm.total > 0) { // $state.go("master.gbs.Home"); //} //else { // toastr.error("total value can't be zero, try again!"); //} }).catch(function (error) { }); } */ function generateYears() { var currentYear = moment().year(); for (var i = currentYear; i < currentYear + 10; i++) { vm.years.push({ 'id': i, 'DisplayYear': i }); } vm.profileCarddetails = { Year: vm.years[0]}; } function bookHotel(hotelForm) { $("#lblCreditcardNumberError").hide(); if (hotelForm.$invalid) { var isvalid = true; $("form[name^='" + hotelForm.$name + "']").find(".ng-invalid").each(function (i, o) { if($(o).attr("id").indexOf("cvv") != -1) { toastr.error("Please enter valid CVV code!"); } else if ($(o).attr("id").indexOf("txtCreditcardNumber") != -1) { toastr.error("Please enter valid CreditCard!"); } $(o).focus(); isvalid = false; return false; }); if (isvalid && (!vm.selected_CreditTypeCode || vm.selected_CreditTypeCode == undefined) && vm.CreditCardNotRequired == 0) { toastr.error("Please select credit card provider!"); } //else if (angular.element('input.ng-invalid-cc-number').first().length > 0) { // angular.element('input.ng-invalid-cc-number').first().focus(); // toastr.error("Please enter valid credit card details!"); // // $("#lblCreditcardNumberError").show(); //} } else if ((!vm.selected_CreditTypeCode || vm.selected_CreditTypeCode == undefined) && vm.CreditCardNotRequired == 0) { toastr.error("Please select credit card provider !"); } else if (!vm.selected_CVCLenth || (vm.profileCarddetails != undefined && vm.profileCarddetails.CardCvc.toString().length != vm.selected_CVCLenth)) { toastr.error("Please enter valid CVV code!"); return; // $("#lblCVCCodeError").show(); } else if (!$("#chkAgreee").is(":checked")) { toastr.error("please choose 'Terms and Conditions' agreement!"); $(".popupnew").removeClass("hidden"); return; } else if (parseInt(vm.selected_CreditCardTypeID) > 0 && !checkCreditCard(vm.profileCarddetails.CreditCardNumber, vm.selected_CreditTypeCode)) { toastr.error("Invalid Credit Card, try again!"); //$("#lblCreditcardNumberError").show(); } else { //set disable submit button on single click vm.isDisabled = true; try{ var aryRoomCount = vm.hotelBookingConfirm.roomcount, aryPriceType = vm.hotelBookingConfirm.pricetype, aryHotelRoomID = vm.hotelBookingConfirm.roomid, aryPricePolicyTypeID = vm.hotelBookingConfirm.pricepolicytypeid, aryGuestname = "", aryTavellerTypeSelect = "", aryEstimatedArrivalTimeSelect = "", arySelectBedTypeID = "", arySelectBedType=[], aryTavellerTypeSelectID = ""; if (vm.book != undefined) { aryGuestname = (vm.book.hasOwnProperty('Guest') ? (Object.keys(vm.book.Guest).map(function (k) { return vm.book.Guest[k] }).join(",")) : ""), arySelectBedType = ( vm.book.hasOwnProperty('BedPreference') ? Object.keys(vm.book.BedPreference).map(function (k) { return vm.book.BedPreference[k].BedTypeNameWithCount }).join(",") : "" ); aryTavellerTypeSelect = ( vm.book.hasOwnProperty('TravelerType') ? Object.keys(vm.book.TravelerType).map(function (k) { return vm.book.TravelerType[k].TravellerType }).join(",") : "" ); aryEstimatedArrivalTimeSelect = ( vm.book.hasOwnProperty('ArivalTime') ? Object.keys(vm.book.ArivalTime).map(function (k) { return vm.book.ArivalTime[k] }).join(",") : "" ); arySelectBedTypeID = ( vm.book.hasOwnProperty('BedPreference') ? Object.keys(vm.book.BedPreference).map(function (k) { return vm.book.BedPreference[k].BedTypeID }).join(",") : "" ); aryTavellerTypeSelectID = ( vm.book.hasOwnProperty('TravelerType') ? Object.keys(vm.book.TravelerType).map(function (k) { return vm.book.TravelerType[k].TravellerID }).join(",") : "" ); } ; var jsonReserv = { TotalPricewithTax: vm.total, title: vm.profiledetails.SalutationTypeID, Name: vm.profiledetails.Name, SurName: vm.profiledetails.Surname, Email: vm.profiledetails.Email, Phone: vm.profiledetails.Phone, Country: vm.profiledetails.CountryID, CreditcardProvider: vm.selected_CreditCardTypeID,//set card type ID NameOnCreditcard: vm.profileCarddetails.NameOnCreditCard, CreditcardNumber: vm.profileCarddetails.CreditCardNumber, CVCCode: vm.profileCarddetails.CardCvc, ExpirationMonth: vm.profileCarddetails.cardMonth, ExpirationYear: vm.profileCarddetails.Year.id, HotelID: vm.HotelInformation[0].HotelID, CheckinDate: vm.HotelInformation[0].CheckDatefrom, CheckOutDate: vm.HotelInformation[0].CheckDateto, PayableAmount: vm.total,//PayableAmount, Culturecode: $cookies.get("lang"), LoggedUserID: (vm.LoggedUserID.indexOf('GUEST') != -1? "" : vm.LoggedUserID), HiidenCurrencyCode: $cookies.get("currency"), SpecialNote: vm.book.hasOwnProperty('SpecialNote') ? vm.book.SpecialNote:"", HotelName: vm.HotelInformation[0].HotelName, RoomCount: [aryRoomCount],//fetch PriceType: [aryPriceType],//fetch Guestname: [aryGuestname],//fetch SelectBedType: arySelectBedType ? [arySelectBedType]:"", TavellerTypeSelect: aryTavellerTypeSelect? [aryTavellerTypeSelect]:"", EstimatedArrivalTimeSelect: aryEstimatedArrivalTimeSelect ? [aryEstimatedArrivalTimeSelect] : "", HotelRoomID: aryHotelRoomID?[aryHotelRoomID]:"", SelectBedTypeID: arySelectBedTypeID?[arySelectBedTypeID]:"", TavellerTypeSelectID: aryTavellerTypeSelectID?[aryTavellerTypeSelectID]:"", PricePolicyType: aryPricePolicyTypeID?[aryPricePolicyTypeID]:"", CreditCardNotRequired: vm.CreditCardNotRequired, culture: $cookies.get("lang"), HasDiscount: vm.hasDiscount }; console.log(jsonReserv); bookService.hotelReservationFunc(jsonReserv).then(function (response) { toastr.success("Booking Success"); vm.BookingSuccess = response; vm.isDisabled = false; }).catch(function (error) { vm.isDisabled = false; toastr.error("Error occured while saving details."); }); } catch (etr) { console.log(etr); vm.isDisabled = false; } } } function getProfileDetailsIfAvailable(culture, userId) { if (userId) { bookService.getProfileDetailsIfAvailable(culture, userId).then(function (response) { vm.profiledetails = response; }).catch(function (error) { }); } } function typeTraveller(culture) { bookService.typeTraveller(culture).then(function (response) { vm.typeTraveller = response; }).catch(function (error) { }); } function getSalutation(culture) { bookService.getSalutation(culture).then(function (response) { vm.Salutation = response; }).catch(function (error) { }); } function getUserSavedCardDetailsByHotel(userId, hotelId) { bookService.getUserSavedCardDetailsByHotel(userId, hotelId).then(function (response) { vm.profileCarddetails = response; if(vm.profileCarddetails.length >0) { changecardupdate(vm.profileCarddetails[0].CreditCardProviderID, vm.profileCarddetails[0].CreditCardTypeName); vm.profileCarddetails.CreditCardNumber = vm.profileCarddetails[0].CreditCardNumber; vm.profileCarddetails.NameOnCreditCard = vm.profileCarddetails[0].NameOnCreditCard; vm.profileCarddetails.cardMonth = vm.profileCarddetails[0].month; vm.profileCarddetails.Year = { id: vm.profileCarddetails[0].year, DisplayYear: vm.profileCarddetails[0].year }; } }).catch(function (error) { }); } function typeMonth(culture) { bookService.typeMonth(culture).then(function (response) { vm.typeMonth = response; }).catch(function (error) { }); } function typeCreditCardByHotel(culture, hotelId) { bookService.typeCreditCardByHotel(culture, hotelId).then(function (response) { //vm._creditcards = response; vm.typeCreditCardByHotel = response; getUserSavedCardDetailsByHotel(vm.LoggedUserID, hotelId); //vm.typeCreditCardByHotel = []; //vm.typeCreditCardByHotel.push({ CreditCardTypeName: '--Select--', CreditCardTypeID: -1, CreditTypeCode:'',CVCLenth:0 }); //for (var i = 0; i < response.length ; i++) //{ // vm.typeCreditCardByHotel.push({ CreditCardTypeName: response[i].CreditCardTypeName, CreditCardTypeID: response[i].CreditCardTypeID, CreditTypeCode: response[i].CreditTypeCode, CVCLenth: response[i].CVCLenth }); //} //set inital value //vm.profileCarddetails.typeCreditCard = vm.typeCreditCardByHotel[0]; //console.log(vm.typeCreditCardByHotel); }).catch(function (error) { }); } //update selections function changecardupdate(CreditCardTypeID,CreditCardTypeName) { //debugger; vm.selected_CreditCardTypeID = CreditCardTypeID; vm.selected_CreditCardTypeName = CreditCardTypeName; $(".card-select").find("li").removeClass('active'); $.each(vm.typeCreditCardByHotel, function (key, val) { if (val.CreditCardTypeID == CreditCardTypeID) { vm.selected_CreditTypeCode = val.CreditTypeCode; vm.selected_CVCLenth = val.CVCLenth; $(".card-select").find("li").each(function (i,o) { if($(o).attr("value")== val.CreditCardTypeName) { if (!$(o).hasClass("active")) { $(o).addClass("active"); } } }); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initLightbox() {\n\t\tif (jQuery.fancybox != null) {\n\t\t\tjQuery('a.lightbox, a[rel*=\"lightbox\"]').fancybox({\n\t\t\t\thelpers: {\n\t\t\t\t\toverlay: {\n\t\t\t\t\t\tcss: {\n\t\t\t\t\t\t\tbackground: 'rgba(0, 0, 0, 0.65)'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tafterLoad: function(current, previous) {\n\t\t\t\t\t// handle custom close button in inline modal\n\t\t\t\t\tif (current.href.indexOf('#') === 0) {\n\t\t\t\t\t\tjQuery(current.href).find('a.close').off('click.fb').on('click.fb', function(e) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tjQuery.fancybox.close();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function initLightbox() {\n\tjQuery('a.lightbox, a[rel*=\"lightbox\"]').fancybox({\n\t\thelpers: {\n\t\t\toverlay: {\n\t\t\t\tcss: {\n\t\t\t\t\tbackground: 'rgba(0, 0, 0, 0.6)'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tafterLoad: function(current) {\n\t\t\t// handle custom close button in inline modal\n\t\t\tif (current.href.indexOf('#') === 0) {\n\t\t\t\tjQuery(current.href).find('a.close').off('click.fb').on('click.fb', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tjQuery.fancybox.close();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tpadding: 0\n\t});\n}", "function angularBootstrap() {\n window.angular.resumeBootstrap(angularModules);\n window.angular.module = $module;\n }", "function lightBoxInit() {\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif ($('body[data-ls=\"magnific\"]').length > 0 || $('body[data-ls=\"pretty_photo\"]').length > 0) {\r\n\t\t\t\t\tmagnificInit();\r\n\t\t\t\t} else if ($('body[data-ls=\"fancybox\"]').length > 0) {\r\n\t\t\t\t\tfancyBoxInit();\r\n\t\t\t\t}\r\n\t\t\t},100);\r\n\t\t\t\r\n\t\t}", "function initLightbox() {\n jQuery('a.lightbox, a[rel*=\"lightbox\"]').fancybox({\n helpers: {\n overlay: {\n css: {\n background: 'rgba(0, 0, 0, 0.65)'\n }\n }\n },\n afterLoad: function(current, previous) {\n // handle custom close button in inline modal\n if(current.href.indexOf('#') === 0) {\n jQuery(current.href).find('a.close').off('click.fb').on('click.fb', function(e){\n e.preventDefault();\n jQuery.fancybox.close();\n });\n }\n },\n padding: 0\n });\n}", "attached(){\n angular.bootstrap(this.element, ['pdb.component.library']);\n }", "function initLightbox(options) {\n var lightbox = $(options.lightbox);\n lightbox.css({\n 'display': 'none',\n 'z-index': '99999',\n 'position': options.lightboxPosition,\n 'top': '50%',\n 'left': '50%',\n 'transform': 'translate(-50%,-50%)'\n });\n lightbox.appendTo('body');\n }", "function setLightbox() {\n if ( $.fn.magnificPopup ) {\n $( '.mfp-zoom' ).magnificPopup({\n type: 'image',\n closeOnContentClick: true,\n closeBtnInside: false,\n mainClass: 'mfp-with-zoom',\n image: {\n verticalFit: true\n }\n });\n }\n }", "_addLightbox(id) {\n const images = document.querySelectorAll(id + ' .media.photoset-grid .image-container a:not(.lightbox-decorated)')\n new LuminousGalleryCaptions(images)\n images.forEach(img => img.classList.add('lightbox-decorated'))\n }", "function WR_Lightbox() {\n\t \tif ( $.fn.nivoLightbox ) {\n\t \t\t$( 'a[data-lightbox^=\"nivo\"]' ).nivoLightbox( {\n\t \t\t\teffect: 'fall',\n\t \t\t\tkeyboardNav: true,\n\t \t\t\tclickOverlayToClose: true,\n\t \t\t} );\n\t \t}\n\t }", "Lightbox() {\n $('.fancybox').fancybox({\n loop: false,\n });\n\n $('.fancybox-media').attr('rel', 'media-gallery').fancybox({\n openEffect: 'none',\n closeEffect: 'none',\n prevEffect: 'none',\n nextEffect: 'none',\n arrows: false,\n helpers: {\n media: {},\n buttons: {},\n },\n });\n }", "function addLightBox(elm, settings){\n\t\t\n\t\t//Default settings\n\t\tsettings = $.extend({\n\t\t\t\tfixedNavigation:true,\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Always visible (true) or only on hover (false)\n\t\t\t\timageLoading: \"http://i.c.dk/gfx/grd/common/spinner.gif\",\n\t\t\t\timageBtnNext : \"http://i.c.dk/gfx/grd/local/smart_selector/btn_next.png\",\t//cant be positioned, overwrite position in CSS \n\t\t\t\timageBtnPrev : \"http://i.c.dk/gfx/grd/local/smart_selector/btn_prev.png\",\t//cant be positioned, overwrite position in CSS\n\t\t\t\timageBtnClose: \"http://i.c.dk/gfx/grd/local/smart_selector/btn_close.png\",\n\t\t\t\timageBlank: \"http://i.c.dk/gfx/grd/local/common/transparent.gif\",\t\t\t//Not sure this is used when we have next and prev images specified\n\t\t\t\ttxtImage: \"Billede\",\n\t\t\t\ttxtOf: \"af\",\n\t\t\t\toverlayBgColor: \"#90979b\",\t//to match our own overlay background color\n\t\t\t\toverlayOpacity: 0.80\t\t//to match our own overlay opacity\n\t\t}, settings);\n\t\t\n\t\t//Add lightBox on click, and move text and close button to the top of the overlay, doing it like this, to avoid altering the downloaded LightBox plugin source\n\t\t$(elm).lightBox(settings).click(function(){\n\t\t\t$(\"#lightbox-container-image-data-box\").prependTo(\"#jquery-lightbox\"); //move buttons to the top of the overlay\n\t\t});\n\n\t}", "init() {\n\t\tthis.lightbox = document.createElement(\"div\");\n\t\tthis.lightbox.className = \"lightbox\";\n\t\tdocument.body.appendChild(this.lightbox);\n\t}", "function initGallery() {\n $('.image-gallery').lightSlider({\n gallery:true,\n item:1,\n loop:true,\n thumbItem: 5,\n slideMargin:0,\n enableDrag: true,\n currentPagerPosition:'left',\n onSliderLoad: function(el) {\n el.lightGallery({\n selector: '.image-gallery .lslide'\n });\n }\n });\n}", "function onLightboxInit() {\n\n\t\tif (g_options.theme_auto_open !== null) {\n\t\t\tg_lightbox.open(g_options.theme_auto_open);\n\t\t\tg_options.theme_auto_open = null;\n\t\t}\n\t}", "function onReady() {\n angular.bootstrap(document, ['simple-social']);\n }", "function addBootstrapPhotoGallery(images) {\n // TODO: MODULE_ADVENTURE_DETAILS\n // 1. Add the bootstrap carousel to show the Adventure images\n\n}", "function addLightboxMarkup() {\n\tbod \t\t\t\t= document.getElementsByTagName('body')[0];\n\toverlay \t\t\t= document.createElement('div');\n\toverlay.id\t\t= 'overlay';\n\tlb\t\t\t\t\t= document.createElement('div');\n\tlb.id\t\t\t\t= 'lightbox';\n\tlb.className \t= 'loading';\n\tlb.innerHTML\t= '<div id=\"lbLoadMessage\">' +\n\t\t\t\t\t\t '<p>Loading</p>' +\n\t\t\t\t\t\t '</div>';\n\tbod.appendChild(overlay);\n\tbod.appendChild(lb);\n}", "function lightbox(){\n $('[rel^=\\'lightbox\\']').prettyPhoto({\n 'social_tools': false\n });\n}", "function initLightbox() {\r\n\tjQuery('a.lightbox, a[rel*=\"lightbox\"]').each(function(){\r\n\t\tvar link = jQuery(this);\r\n\t\tlink.fancybox({\r\n\t\t\tpadding: 10,\r\n\t\t\tcyclic: false,\r\n\t\t\toverlayShow: true,\r\n\t\t\toverlayOpacity: 0.65,\r\n\t\t\toverlayColor: '#000000',\r\n\t\t\ttitlePosition: 'inside',\r\n\t\t\tonComplete: function(box) {\r\n\t\t\t\tif(link.attr('href').indexOf('#') === 0) {\r\n\t\t\t\t\tjQuery('#fancybox-content').find('a.close').unbind('click.fb').bind('click.fb', function(e){\r\n\t\t\t\t\t\tjQuery.fancybox.close();\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function openLightbox() {\n\n document.getElementById('Lightbox').setAttribute(\"style\", \"display:flex; opacity:1;\", \"class\", \"active\");\n document.body.classList.toggle('noscroll');\n\n }", "function lightboxInit() {\n $('.thumbnail').click(function(e){\n let size = window.getComputedStyle(document.body,':after').getPropertyValue('content').replace( /\"/g, '' ); //http://adactio.com/journal/5429/\n\n /* http://codepen.io/bradfrost/pen/tfCAp */\n if(size == \"widescreen\") {\n e.preventDefault();\n var $img = $(this).find('img'),\n src = $img.attr('src');\n name = $img.attr('alt');\n buildLightBox(src, name);\n }\n });\n }", "function lightbox(){\n\t\t\n\t\t$('.portfolioOneExpandButton, .portfolioFilterableExpandButton, .singleProjectExpandButton').colorbox({\n\t\t\n\t\t\tmaxWidth: windowWidth,\n\t\t\tinitialWidth: lightboxInitialWidth,\n\t\t\tinitialHeight: lightboxInitialHeight\n\t\t\t\n\t\t});\n\t\t\n\t}", "function install(Vue) {\n \tif (install.installed) { return; }\n \tinstall.installed = true;\n \tVue.component('Lightbox', Lightbox);\n }", "function thememascot_nivolightbox() {\n $('a[data-lightbox-gallery]').nivoLightbox({\n effect: 'fadeScale'\n });\n }", "function showNewLightboxDiv() {\n $(CorbisUI.GlobalVars.AddToLightbox.createLightboxSection).removeClass('displayNone');\n ResizeModal('addToLightboxModalPopup');\n}", "function showModal() {\n $uibModal.open({\n animation: true,\n templateUrl: 'app/shared/media-lightbox/media-lightbox.html',\n controller: 'MediaLightboxController',\n controllerAs: 'vm',\n bindToController: true,\n size: 'lg',\n resolve: {\n mediaData: function() {\n return {\n id: vm.photoData.id,\n name: vm.photoData.name,\n mediaImg: vm.photoData.key\n };\n }\n }\n });\n }", "function thememascot_lightboxPopup() {\n lightbox.option({\n resizeDuration: 200,\n alwaysShowNavOnTouchDevices: true,\n positionFromTop: 50,\n wrapAround: true\n });\n\n $(\"a[data-rel^='prettyPhoto']\").prettyPhoto({\n hook: 'data-rel',\n animation_speed:'normal',\n theme:'light_square',\n slideshow:3000, \n autoplay_slideshow: false,\n social_tools: false\n });\n\n }", "function lightBoxSlide() {\n $('.lightbox-slide').show(function(){\n $('.lightbox-slide').owlCarousel({\n autoPlay : 3000,\n rtl: houzez_rtl,\n dots: false,\n items: 1,\n smartSpeed: 700,\n slideBy: 1,\n nav: true,\n stopOnHover : true,\n autoHeight : true,\n navText : [\"<i class='fa fa-angle-left'></i>\",\"<i class='fa fa-angle-right'></i>\"],\n });\n });\n }", "function lightboxInit() {\n $('.magnific').magnificPopup({\n type:'image',\n removalDelay: 300,\n mainClass: 'mfp-fade'\n });\n $('.magnific-youtube, .magnific-vimeo, .magnific-gmaps').magnificPopup({\n disableOn: 700,\n type: 'iframe',\n mainClass: 'mfp-fade',\n removalDelay: 300,\n preloader: false,\n fixedContentPos: false\n });\n $('.magnific-gallery').each(function(index , value){\n var gallery = $(this);\n var galleryImages = $(this).data(\"links\").split(\",\");\n var galleryTitle = $(this).attr(\"title\");\n var items = [];\n for(var i=0;i<galleryImages.length; i++){\n items.push({\n src:galleryImages[i],\n title:galleryTitle\n });\n }\n gallery.magnificPopup({\n mainClass: 'mfp-fade',\n items:items,\n gallery:{\n enabled:true\n },\n type: 'image'\n });\n });\n $('.product-gallery').magnificPopup({\n delegate: 'li figcaption a',\n type: 'image',\n mainClass: 'mfp-fade',\n gallery:{\n enabled:true,\n navigateByImgClick:true\n }\n });\n}", "init() {\n this._super(...arguments);\n this.set('dependencies', {\n services: [\n 'themeChanger'\n ]\n });\n }", "function bootOverlay() {\n\t$(\"#gallery a\").click(function(event) {\n\t\t// Prevent the default click behavior (which is maintained for users without JavaScript)\n\t\tevent.preventDefault();\n\n\t\t// Record the clicked image.\n\t\tcurrent_image = $(this);\n\n\t\t// Adjust caption based on clicked image.\n\t\tvar captionText = $(this).children(\"img\").attr(\"alt\");\n\t\t$caption.text(captionText);\n\n\t\t// This function loads the image or video into the overlay. (See below.)\n\t\tloadAsset();\n\n\t\t// Show the completely adjusted overlay.\n\t\t$overlay.show();\n\n\t});\n}", "function initLightbox()\r{\r\tvar anchors = document.getElementsByTagName(\"a\");\n\t\r\t// loop through all anchor tags\r\tfor (var i=0; i<anchors.length; i++){\r\t\tvar anchor = anchors[i];\n\t\tif ( anchor.hasAttribute(\"href\") ) {\n\t\t if ( anchor.getAttribute(\"rel\") == \"lightbox\" ) break;\r var href = anchor.getAttribute(\"href\");\r var extension = href.substring(href.lastIndexOf('.')+1, href.length).toLowerCase();\n\r if ( (extension == \"jpg\") || (extension == \"jpeg\") || extension == \"gif\" || extension == \"png\" )\r anchor.addEventListener('click', function(event) {\n if (event.metaKey || event.shiftKey ||\n event.altKey || event.ctrlKey) return true;\n showLightbox(this);\n event.stopPropagation();\n event.preventDefault();\n return false;\n }, true);\n }\r }\n \r\t// this code inserts html at the top of the page that looks like this:\r\t//\r\t// <div id=\"overlay\"><a href=\"#\" onclick=\"hideLightbox(); return false;\"><img id=\"loadingImage\" /></a></div>\r\t// <div id=\"lightbox\">\r\t//\t\t<a href=\"#\" onclick=\"hideLightbox(); return false;\"><img /></a>\r\t// </div>\r\t\r\tvar objBody = document.getElementsByTagName(\"body\").item(0);\r\t\r\t// create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)\r\tvar objOverlay = document.createElement(\"div\");\r\tobjOverlay.setAttribute('id','overlay');\r\tobjOverlay.style.display = 'none';\r\tobjOverlay.style.position = 'absolute';\r\tobjOverlay.style.top = '0';\r\tobjOverlay.style.left = '0';\r\tobjOverlay.style.zIndex = '90';\r \tobjOverlay.style.width = '100%';\r\tobjBody.insertBefore(objOverlay, objBody.firstChild);\r\t\r\tvar arrayPageSize = getPageSize();\r\tvar arrayPageScroll = getPageScroll();\n\t\r\t// preload and create loader image\r\tvar imgPreloader = document.createElement(\"img\");\n\timgPreloader.src = loadingImage;\r\t\r\t// if loader image found, create link to hide lightbox and create loadingimage\r\timgPreloader.addEventListener('load', function(){\r\t\tvar objLoadingImageLink = document.createElement(\"a\");\r\t\tobjLoadingImageLink.setAttribute('href','#');\r\t\tobjLoadingImageLink.addEventListener('click', function (event){\n hideLightbox();\n if (event.metaKey || event.shiftKey ||\n event.altKey || event.ctrlKey) return true;\n event.stopPropagation(); event.preventDefault();\n return false;\n }, true);\r\t\tobjOverlay.appendChild(objLoadingImageLink);\r\t\t\r\t\tvar objLoadingImage = document.createElement(\"img\");\r\t\tobjLoadingImage.src = loadingImage;\r\t\tobjLoadingImage.setAttribute('id','loadingImage');\r\t\tobjLoadingImage.style.position = 'absolute';\r\t\tobjLoadingImage.style.zIndex = '150';\r\t\tobjLoadingImageLink.appendChild(objLoadingImage);\r\r\t\treturn false;\r\t}, true);\r\r\r\t// create lightbox div, same note about styles as above\r\tvar objLightbox = document.createElement(\"div\");\r\tobjLightbox.setAttribute('id','lightbox');\r\tobjLightbox.style.display = 'none';\r\tobjLightbox.style.position = 'absolute';\r\tobjLightbox.style.zIndex = '100';\t\r\tobjBody.insertBefore(objLightbox, objOverlay.nextSibling);\r\t\r\t// create link\r\tvar objLink = document.createElement(\"a\");\r\tobjLink.setAttribute('href','#');\r\tobjLink.addEventListener('click', function (event) {\n hideLightbox();\n if (event.metaKey || event.shiftKey ||\n event.altKey || event.ctrlKey) return true;\n event.stopPropagation(); event.preventDefault(); return false;}, true);\r\tobjLightbox.appendChild(objLink);\r\t\r\t// create image\r\tvar objImage = document.createElement(\"img\");\r\tobjImage.setAttribute('id','lightboxImage');\r\tobjLink.appendChild(objImage);\r}", "function initVideoLightbox() {\n var videoSlides = $('.video-launcher');\n\n if (videoSlides.length > 0) {\n for (var i = 0; i < videoSlides.length; i++) {\n var slide = $(videoSlides[i]);\n var videoUrl = slide.attr('data-video');\n var videoHtml = \"<div class=\\\"lightbox-content\\\">\\n\\t\\t\\t\\t<video id=\\\"video-slide-\".concat(i, \"\\\" autoplay controls>\\n\\t\\t\\t\\t\\t<source type=\\\"video/mp4\\\" src=\\\"\").concat(videoUrl, \"\\\">\\n\\t\\t\\t\\t\\tYour browser does not appear to support HTML5 videos :(\\n\\t\\t\\t\\t</video>\\n\\t\\t\\t</div>\");\n applyFeatherlight(slide, videoHtml);\n $(\"video-slide-\".concat(i)).click(function () {\n video.load();\n video.play();\n });\n }\n } else {\n console.log('no video slides detected');\n }\n}", "function qodefInitSingleProductLightbox() {\n\t\tvar item = $('.qodef-woo-single-page.qodef-woo-single-has-pretty-photo .images .woocommerce-product-gallery__image');\n\t\t\n\t\tif(item.length) {\n\t\t\titem.children('a').attr('data-rel', 'prettyPhoto[woo_single_pretty_photo]');\n\t\t\t\n\t\t\tif (typeof qodef.modules.common.qodefPrettyPhoto === \"function\") {\n\t\t\t\tqodef.modules.common.qodefPrettyPhoto();\n\t\t\t}\n\t\t}\n\t}", "function install(Vue) {\n\tif (install.installed) { return; }\n\tinstall.installed = true;\n\tVue.component('Lightbox', Lightbox);\n}", "function initFeatherLight() {\n\t $('a.gallery').featherlightGallery({\n\t previousIcon: '«', /* Code that is used as previous icon */\n\t\t\tnextIcon: '»', /* Code that is used as next icon */\n\t\t\tgalleryFadeIn: 100, /* fadeIn speed when slide is loaded */\n\t\t\tgalleryFadeOut: 100 /* fadeOut speed before slide is loaded */\n\t\t});\n\t}", "function eltdfInitSingleProductLightbox() {\n var item = $('.eltdf-woo-single-page .images .woocommerce-product-gallery__image');\n\n if(item.length) {\n item.children('a').attr('data-rel', 'prettyPhoto[woo_single_pretty_photo]');\n\n if (typeof eltdf.modules.common.eltdfPrettyPhoto === \"function\") {\n eltdf.modules.common.eltdfPrettyPhoto();\n }\n }\n }", "function showLightBox() {\r\n // show the lightbox on a click\r\n lightBox.classList.add(\"show-lightbox\");\r\n\r\n // play the lightbox video when it opens\r\n houseVideo.play();\r\n }", "function buidCarouselView(){\n $timeout(function() {\n showBorrowerCarousel();\n }, 100);\n \n }", "activateLightTheme() {\n this._reset();\n $('#side-main-logo').attr('src', './public/images/logo-dark.png');\n this.body.attr('data-leftbar-theme', 'light');\n }", "function initialize(){\n\taddLightboxMarkup();\n\tlbox = document.getElementsByClassName('lbOn');\n\tfor(i = 0; i < lbox.length; i++) {\n\t\tvalid = new lightbox(lbox[i]);\n\t}\n}", "function $$jqLiteProvider(){this.$get=function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node=node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node=node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node=node[0];return jqLiteRemoveClass(node,classes);}});};}", "function $$jqLiteProvider(){this.$get=function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node=node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node=node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node=node[0];return jqLiteRemoveClass(node,classes);}});};}", "function openLightbox(){\n $('.cycle-slideshow').cycle({\n slides : \".image-single\",\n fx : \"scrollHorz\",\n swipe : \"true\",\n timeout : \"0\",\n centerHorz : \"true\",\n centerVert : \"true\"\n });\n $('.lightbox').show();\n}", "openGallery_() {\n // Build gallery div for the first time\n if (!this.gallery_) {\n this.buildGallery_();\n }\n this.container_.setAttribute('gallery-view', '');\n this.topBar_.classList.add('fullscreen');\n }", "function BootstrapOptions(){}", "function Litebox (element, options, overlay, content) {\n\t\t\t\tthis.element = element;\n\t\t\t\tthis.settings = $.extend({}, defaults, options);\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = litebox;\n\t\t\t\tthis.overlay = document.getElementsByClassName('liteBox');\n\t\t\t\tthis.content = document.getElementsByClassName('litebox-content');\n\t\t\t\tthis.init();\n\t\t}", "function setLightboxImage() {\n\t\tvar dom = _lightbox.$img;\n\t\tvar image = _images[_lightbox.idx].image;\n\t\trenderImage(image, dom);\n\t\tsetLightboxImageSize();\n\t}", "function popupPagesLoad() {\n\t\t\t$(document).ready(function() {\n\t\t\t\t$('.js-lightbox').addClass('is-active');\n\t\t\t})\n\t\t}", "ngOnInit() {\n // Function to Call Home Page Slider and other jQuery Effects\n Object(src_assets_js_custom_script__WEBPACK_IMPORTED_MODULE_1__[\"fnCalljQuery\"])();\n }", "function GalleryFancyboxActivator () {\n var galleryFcb = $('.fancybox');\n if(galleryFcb.length){\n galleryFcb.fancybox({\n openEffect : 'elastic',\n closeEffect : 'elastic',\n helpers : {\n media : {}\n }\n });\n }\n}", "function removeLightBox() {\n\t\t\tlbContainer.addEventListener('click', () => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tchangeScreens('default');\n\t\t\t});\n\t\t}", "function showLightbox(id){\n $('body').addClass('noScroll'); //disable scroll for content behind lightbox\n\n\tvar lightbox = $('#' + id);\n\t$('#darkBack').css('display', 'block').click(function(){closeLightboxById(id)});\n lightbox.css('display', 'block');\n\n if(id == 'sampleStatsMore'){\n let tableauPromise = new Promise((resolve, reject) => {\n var divElement = $('#viz1513614270547');\n var vizElement = $(divElement.find('object')[0]);\n vizElement.width('100%');\n vizElement.height(vizElement.width()*0.75);\n var scriptElement = $('<script></script>');\n scriptElement.attr('src','https://public.tableau.com/javascripts/api/viz_v1.js');\n scriptElement.insertBefore(vizElement);\n\n divElement = $('#viz1513614387971');\n var vizElement = $(divElement.find('object')[0]);\n vizElement.width('100%');\n vizElement.height(vizElement.width()*0.75);\n var scriptElement = $('<script></script>');\n scriptElement.attr('src','https://public.tableau.com/javascripts/api/viz_v1.js');\n scriptElement.insertBefore(vizElement);\n\n resolve();\n });\n\n tableauPromise.then( function(){ positionLightbox(lightbox); } ) //if loaded tableau figures, position lightbox\n .catch( function(){ console.log('Failed to load tableau figures'); } ); //else print error\n }\n else{\n positionLightbox(lightbox);\n }\n\n}", "function init(element) {\n if (modulesToLoad.length === 0) {\n var elements = [element],\n names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],\n NG_APP_CLASS_REGEXP = /\\sng[:\\-]app(:\\s*([\\w\\d_]+);?)?\\s/,\n append = function append(elm) {\n return (elm && elements.push(elm));\n };\n\n angular.forEach(names, function (name) {\n names[name] = true;\n append(document.getElementById(name));\n name = name.replace(':', '\\\\:');\n if (element[0].querySelectorAll) {\n angular.forEach(element[0].querySelectorAll('.' + name), append);\n angular.forEach(element[0].querySelectorAll('.' + name + '\\\\:'), append);\n angular.forEach(element[0].querySelectorAll('[' + name + ']'), append);\n }\n });\n\n angular.forEach(elements, function (elm) {\n if (modulesToLoad.length === 0) {\n var className = ' ' + element.className + ' ';\n var match = NG_APP_CLASS_REGEXP.exec(className);\n if (match) {\n modulesToLoad.push((match[2] || '').replace(/\\s+/g, ','));\n } else {\n angular.forEach(elm.attributes, function (attr) {\n if (modulesToLoad.length === 0 && names[attr.name]) {\n modulesToLoad.push(attr.value);\n }\n });\n }\n }\n });\n }\n\n if (modulesToLoad.length === 0 && !((window.jasmine || window.mocha) && angular.isDefined(angular.mock))) {\n console.error('No module found during bootstrap, unable to init ocLazyLoad. You should always use the ng-app directive or angular.boostrap when you use ocLazyLoad.');\n }\n\n var addReg = function addReg(moduleName) {\n if (regModules.indexOf(moduleName) === -1) {\n // register existing modules\n regModules.push(moduleName);\n var mainModule = angular.module(moduleName);\n\n // register existing components (directives, services, ...)\n invokeQueue(null, mainModule._invokeQueue, moduleName);\n invokeQueue(null, mainModule._configBlocks, moduleName); // angular 1.3+\n\n angular.forEach(mainModule.requires, addReg);\n }\n };\n\n angular.forEach(modulesToLoad, function (moduleName) {\n addReg(moduleName);\n });\n\n modulesToLoad = []; // reset for next bootstrap\n recordDeclarations.pop(); // wait for the next lazy load\n }", "function updateGalleryContainer() {\r\n\t\t\tvar tileContainerTop = vm.getRoot().offset().top;\r\n\t\t\tvm.galleryContainerStyle['height'] = _($window).height() - tileContainerTop - 30;\r\n\t\t\t$scope.$applyAsync();\r\n\t\t}", "function injectLightCss(el) {\n if (hasShadowCSS) { return; }\n el.lightStyle = document.createElement('style');\n el.lightStyle.setAttribute('scoped', '');\n el.lightStyle.innerHTML = el.lightCss;\n el.appendChild(el.lightStyle);\n}", "loadDependencies(){\n\n }", "function view_get_started_with_bitly_brand_tools_init() {\n\t\t\n\t\t$(window).scroll(function () { \n\t\t\t\n\t\t});\n\t\t\n\t\t$(window).resize(function () { \n\t\t\t\n\t\t});\n\t\t\n\t\t// Setup Carousel for Bitly Values\n\t\t\n\t\t$(\"#page-home-trust-quotes\").carousel({\n\t\t\t\n\t\t\tspeed\t\t\t\t\t\t\t:\t8000,\n\t\t\tclass_active\t\t\t\t\t:\t'active',\n\t\t\tclass_inactive\t\t\t\t\t:\t'inactive',\n\t slide_animate_callback\t\t\t:\tfunction(){},\n\t\t\tnavigation_option_previous\t\t:\tnull,\n\t\t\tnavigation_option_next\t\t\t:\tnull,\n\t pagination\t\t\t\t\t\t:\tfalse,\n\t pagination_navigation\t\t\t:\tfalse,\n\t\t\tchild_selector\t\t\t\t\t:\t'.page-home-trust-quote'\n\t \n\t\t});\n\t\t\n\t}", "function refreshLightbox() {\n\t\tif (_lightbox) {\n\t\t\tvar item = _images[_lightbox.idx];\n\t\t\t_lightbox.$titleText.nodeValue = item.title || \"\";\n\t\t\t_lightbox.$imgAnchor.setAttribute(\"href\", item.image.url);\n\t\t\tif (_lightbox.$img.getAttribute(\"src\") !== item.image.url) {\n\t\t\t\t_lightbox.$img.classList.add(\"loading\");\n\t\t\t}\n\t\t\tsetLightboxImage();\n\t\t\tsetLightboxNav(_lightbox.$nav, _lightbox.idx);\n\t\t}\n\t}", "bootstrap() {\n $('.photo_select, .file_upload_select').toArray()\n .filter(Picker.shouldInstall)\n .forEach(Picker.install)\n }", "buildGallery_() {\n // Build gallery\n this.gallery_ = this.win.document.createElement('div');\n this.gallery_.classList.add('i-amphtml-lbv-gallery');\n\n // Initialize thumbnails\n this.updateThumbnails_();\n\n this.vsync_.mutate(() => {\n this.container_.appendChild(this.gallery_);\n });\n }", "function GalleryFancyboxActivator() {\n var galleryFcb = $('.fancybox');\n if (galleryFcb.length) {\n galleryFcb.fancybox({\n openEffect: 'elastic',\n closeEffect: 'elastic',\n helpers: {\n media: {}\n }\n });\n }\n}", "function BootstrapOptions() {}", "function BootstrapOptions() {}", "function BootstrapOptions() {}", "initModule( $container ) {\n // load HTML and map jQuery collections\n this.stateMap.$container = $container;\n $container.html( this.configMap.main_html );\n this.setJqueryMap();\n\n // configure uriAnchor to use our schema\n $.uriAnchor.configModule({\n schema_map : this.configMap.anchor_schema_map\n });\n\n // configure and initialize feature modules\n // spa.menubar.configModule({\n // toolbox_model : spa.model.toolbox,\n // people_model : spa.model.people\n // });\n spa.menubar.initModule( this.jqueryMap.$menubar );\n\n spa.imagelist.configModule({\n cropper_model : spa.model,\n on_load : (input_files) => {this.loadImages(input_files);},\n });\n spa.imagelist.initModule( this.jqueryMap.$imagelist );\n\n spa.imagelistmodel.configModule({\n show_config : (config) => {spa.toolbox.updateConfig(config);},\n add_image_frontend : (backend) => {return spa.imagelist.addImagebox(backend);},\n });\n // imagelistmodel does not need init\n\n // configure and initialize feature modules\n spa.toolbox.configModule({\n set_toolbox_anchor : (position) => {this.setToolboxAnchor(position);},\n on_load : (input_files) => {this.loadImages(input_files);},\n on_save : () => {spa.imagelistmodel.saveImages()},\n lock_all : (input_type) => {\n spa.imagelistmodel.lockAll(input_type)}, // TODO\n on_input_change : (config) => {spa.imagelistmodel.updateConfig(config)},\n });\n spa.toolbox.initModule( this.jqueryMap.$container );\n\n // spa.footer.initModule( this.jqueryMap.$container );\n\n spa.announcement.initModule( this.jqueryMap.$container );\n\n // Handle URI anchor change events.\n // This is done /after/ all feature modules are configured\n // and initialized, otherwise they will not be ready to handle\n // the trigger event, which is used to ensure the anchor\n // is considered on-load\n //\n $(window)\n .bind( 'resize', () => {this.onResize();} )\n .bind( 'hashchange', () => {this.onHashchange();} )\n .trigger( 'hashchange' );\n }", "function initLazyElements() {\n $window.lazyLoadXT();\n }", "function initLazyElements() {\n $window.lazyLoadXT();\n }", "function initLazyElements() {\n $window.lazyLoadXT();\n }", "addOverlay(overlay) {\n this.overlay = overlay;\n }", "function Lightbox() {\r\n\t\t\r\n\t\t$('.image-link').magnificPopup({\r\n\t\t \ttype: 'image',\r\n\t\t\tmainClass: 'mfp-with-zoom',\t\r\n\t\t\tgallery: {\r\n\t\t\t enabled:true\r\n\t\t\t},\t\t\r\n\t\t\tzoom: {\r\n\t\t\t\tenabled: true, \t\t\t\r\n\t\t\t\tduration: 300, \r\n\t\t\t\teasing: 'ease-in-out', \r\n\t\t\t\topener: function(openerElement) {\r\n\t\t\t\t\treturn openerElement.is('img') ? openerElement : openerElement.find('img');\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t$(\".image-link\").mouseenter(function(e) {\t\r\n\t\t\tTweenMax.to('#ball', 0.1,{transformOrigin: '15px 15px', borderWidth: '1px', scale: 1.8});\r\n\t\t\tTweenMax.to('#ball-loader', 0.1,{borderWidth: '1px', top: 1, left: 1});\r\n\t\t\t$( \"#ball\" ).addClass(\"with-icon\").append( '<i class=\"fa fa-plus\"></i>' );\r\n\t\t});\r\n\t\t\t\r\n\t\t$(\".image-link\").mouseleave(function(e) {\r\n\t\t\tTweenMax.to('#ball', 0.1,{borderWidth: '2px', scale:1, x: -15, y: -15});\r\n\t\t\tTweenMax.to('#ball-loader', 0.1,{borderWidth: '2px', top: 0, left: 0});\r\n\t\t\t$(\"#ball\").removeClass(\"with-icon\");\r\n\t\t\t$('#ball i').remove();\r\n\t\t});\r\n\t\t\t\r\n\t}", "function lightMode() {\n $('#lightMode').fadeOut(50)\n setTimeout(function () {\n $('#darkMode').fadeIn('50')\n }, 50)\n\n // Background photo for light mode\n $('#body').css('background-image', 'url(\"/../assets/hypnotize.png\")')\n\n if ($('.main-container').hasClass('bg-dark-slow')) {\n $('.main-container').removeClass('bg-dark-slow')\n }\n $('.main-container').addClass('bg-light-slow')\n\n if ($('#nav').hasClass('navbar-light bg-grey-slow')) {\n $('#nav').removeClass('navbar-light bg-grey-slow')\n }\n $('#nav').addClass('navbar-dark bg-dark-slow')\n\n if ($('#searchBtn').hasClass('btn-outline-dark')) {\n $('#searchBtn').removeClass('btn-outline-dark')\n }\n $('#searchBtn').addClass('btn-outline-light')\n $('#content-heading').addClass('text-dark')\n\n if ($('#user-icon').hasClass('text-dark')) {\n $('#user-icon').removeClass('text-dark')\n }\n $('#user-icon').addClass('text-white')\n\n if ($('#home-icon').hasClass('text-dark')) {\n $('#home-icon').removeClass('text-dark')\n }\n $('#home-icon').addClass('text-white')\n}", "function openLightbox(item) {\n var href = item.children('a').attr('href');\n var cap = item.children('a').children('img').attr('alt'); \n $img.attr('src', href); \n $caption.text(cap); \n $overlay.show('slow'); \n}", "function createLightbox() {\n lightBox = document.createElement(\"div\");\n imageContainer = document.createElement(\"div\");\n arrowRightBox = document.createElement(\"div\");\n arrowLeftBox = document.createElement(\"div\");\n let closeBox = document.createElement(\"div\");\n let closeIcon = document.createElement(\"i\");\n let arrowRightIcon = document.createElement(\"i\");\n let arrowLeftIcon = document.createElement(\"i\");\n let thumbContainer = document.createElement(\"div\");\n let thumbList = document.createElement(\"ul\");\n let spinnerIcon = document.createElement(\"i\");\n\n closeBox.addEventListener(\"click\", function() {\n let img = document.querySelector(\".img-active\");\n img.parentNode.removeChild(img);\n document.querySelector(\".lightbox\").classList.add(\"hidden\");\n document.body.classList.remove(\"no-scroll\");\n });\n\n arrowRightBox.addEventListener(\"click\", function() {\n let index = this.getAttribute(\"data-id\");\n arrowClick(index);\n });\n\n arrowLeftBox.addEventListener(\"click\", function() {\n let index = this.getAttribute(\"data-id\");\n arrowClick(index);\n });\n\n closeBox.classList.add(\"close-box\");\n closeIcon.classList.add(\"fas\", \"fa-times\", \"fa-2x\");\n arrowRightBox.classList.add(\n \"slider-control-arrows__button\",\n \"icon-box\",\n \"light\",\n \"arrow-right\"\n );\n arrowLeftBox.classList.add(\n \"slider-control-arrows__button\",\n \"icon-box\",\n \"light\",\n \"arrow-left\"\n );\n arrowRightIcon.classList.add(\"fas\", \"fa-arrow-right\");\n arrowLeftIcon.classList.add(\"fas\", \"fa-arrow-left\");\n spinnerIcon.classList.add(\"fas\", \"fa-spinner\", \"fa-pulse\", \"fa-3x\");\n imageContainer.classList.add(\"image-container\");\n lightBox.classList.add(\"lightbox\", \"hidden\");\n thumbContainer.classList.add(\"thumb-container\");\n thumbList.classList.add(\"thumb-list\");\n closeBox.appendChild(closeIcon);\n arrowRightBox.appendChild(arrowRightIcon);\n arrowLeftBox.appendChild(arrowLeftIcon);\n thumbContainer.appendChild(thumbList);\n lightBox.appendChild(closeBox);\n lightBox.appendChild(spinnerIcon);\n lightBox.appendChild(arrowRightBox);\n lightBox.appendChild(arrowLeftBox);\n lightBox.appendChild(imageContainer);\n lightBox.appendChild(thumbContainer);\n document.body.appendChild(lightBox);\n}", "function wlCommonInit(){\r\n // Common initialization code goes here\r\n console.log('>> MobileFirst Client SDK Initilized ...');\r\n angular.element(document).ready(function() {\r\n mfpMagicPreviewSetup();\r\n angular.bootstrap(document.body, ['starter']);\r\n });\r\n }", "function bootstrap(app) {\r\n if (!window['mooa']) {\r\n window.mooa = {};\r\n }\r\n window.mooa.isSingleSpa = true;\r\n window.mooa.name = app.name;\r\n if (app.mode && app.mode === 'iframe') {\r\n var iframeElementExist = isIframeElementExist(app);\r\n if (app.switchMode === 'coexist' && iframeElementExist) {\r\n iframeElementExist.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationIframeContainer(app);\r\n if (app.sourceType === 'link') {\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsForIframeAndUrl(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n else {\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsForIframe(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n }\r\n else if (app.sourceType && app.sourceType === 'link') {\r\n var hasElement = isElementExist(app.appConfig.name);\r\n if (app.switchMode === 'coexist' && hasElement) {\r\n hasElement.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationContainer(app);\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsByUrl(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n else {\r\n var hasElement = isElementExist(app.appConfig.name);\r\n if (app.switchMode === 'coexist' && hasElement) {\r\n hasElement.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationContainer(app);\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssets(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n}", "function Lightbox() {\r\n\t\t\r\n\t\t$('.image-link').magnificPopup({\r\n\t\t \ttype: 'image',\r\n\t\t\tmainClass: 'mfp-with-zoom',\t\r\n\t\t\tgallery: {\r\n\t\t\t enabled:true\r\n\t\t\t},\t\t\r\n\t\t\tzoom: {\r\n\t\t\t\tenabled: true, \t\t\t\r\n\t\t\t\tduration: 300, \r\n\t\t\t\teasing: 'ease-in-out', \r\n\t\t\t\topener: function(openerElement) {\r\n\t\t\t\t\treturn openerElement.is('img') ? openerElement : openerElement.find('img');\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t$(\".image-link\").mouseenter(function(e) {\t\r\n\t\t\tTweenMax.to('#ball', 0.1,{transformOrigin: '15px 15px', borderWidth: '1px', backgroundColor : 'rgba(0, 0, 0, 1)', scale: 1.8});\r\n\t\t\tTweenMax.to('#ball-loader', 0.1,{borderWidth: '1px', top: 1, left: 1});\r\n\t\t\t$( \"#ball\" ).addClass(\"with-icon\").append( '<i class=\"fa fa-plus\"></i>' );\r\n\t\t});\r\n\t\t\t\r\n\t\t$(\".image-link\").mouseleave(function(e) {\r\n\t\t\tTweenMax.to('#ball', 0.1,{borderWidth: '2px', scale:1, backgroundColor : 'rgba(0, 0, 0, 0)', x: -15, y: -15});\r\n\t\t\tTweenMax.to('#ball-loader', 0.1,{borderWidth: '2px', top: 0, left: 0});\r\n\t\t\t$(\"#ball\").removeClass(\"with-icon\");\r\n\t\t\t$('#ball i').remove();\r\n\t\t});\r\n\t\t\t\r\n\t}", "initCustomModal() {\n (function ($) {\n const modal = $.fn.modal;\n $.fn.customModal = function (options) {\n modal.apply(this);\n const settings = $.extend({\n color: 'black'\n }, options)\n return this.css('color', settings.color);\n };\n }(jQuery));\n\n $('#subscribe-modal-link').on('click', () => {\n $('#modal-subscribe-div').customModal({\n color: 'green'\n });\n });\n }", "function showLightbox(options) {\n $(\"#lightbox\").fadeIn();\n $(\"#lightbox-content\").css(options || {});\n if (options.width) {\n $(\"#lightbox-header\").css(\"width\", options.width);\n $(\"#lightbox-header\").css(\"width\", \"+=80px\");\n }\n}", "function BootstrapOptions() { }", "function BootstrapOptions() { }", "function prepareLightbox() {\n\t\t$(\"[data-chyjicebox]\").each(function() {\n\t\t\tconst el = $(this);\n\t\t\tconst href = el.attr(\"href\");\n\t\t\tconst format = href.toLowerCase().split(\".\")[href.toLowerCase().split(\".\").length - 1];\n\t\t\tif ($.inArray(format, formats) !== -1) {\n\t\t\t\tconst group = el.attr(\"data-chyjicebox\");\n\t\t\t\tconst title = el.children().attr(\"alt\");\n\t\t\t\tconst date = el.attr(\"data-date\");\n\t\t\t\tconst lat = el.attr(\"data-lat\");\n\t\t\t\tconst longt = el.attr(\"data-long\");\n\n\t\t\t\t// order of image when lightbox is opened to know it immediately\n\t\t\t\tlet ii = 0;\n\t\t\t\tif (group !== \"\") {\n\t\t\t\t\tii = currentImageOrder++;\n\t\t\t\t}\n\n\t\t\t\tconst type = (format === \"webm\" || format === \"mp4\") ? Types.VIDEO : Types.IMAGE;\n\t\t\t\tconst ab = new MyImage(href, title, type, date, lat, longt);\n\n\t\t\t\tif (group !== \"\" && format !== \"pdf\") images.push(ab);\n\t\t\t\t// when thumb image or link is clicked show the image\n\t\t\t\tel.click(function(e) {\n\t\t\t\t\tif (e.button === 1) {\n\t\t\t\t\t\t// allow clicking with mouse wheel to open in a new panel\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (group === \"\") {\n\t\t\t\t\t\tfitToScreen = el.attr(\"data-fittoscreen\") !== undefined;\n\t\t\t\t\t}\n\t\t\t\t\tisPDF = (format === \"pdf\");\n\t\t\t\t\tif (isPDF) {\n\t\t\t\t\t\tiframe.attr(\"src\", href);\n\t\t\t\t\t\topen();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmulti = (group !== \"\");\n\t\t\t\t\t\tif (multi) imgbox.addClass(\"cursorpointer\");\n\t\t\t\t\t\telse imgbox.removeClass(\"cursorpointer\");\n\t\t\t\t\t\tfirst = true;\n\t\t\t\t\t\tisClosed = false;\n\t\t\t\t\t\tshowedImage = ab;\n\t\t\t\t\t\tcurrentImageOrder = ii;\n\t\t\t\t\t\taddKeyListener();\n\t\t\t\t\t\tloadImg();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "afterInstall () {\n return this.addBowerPackageToProject ('justgage', 'https://github.com/toorshia/justgage.git#1.2.9');\n }", "function showLightbox(){\n\tdocument.getElementById('light').style.display='block';\n\tdocument.getElementById('fade').style.display='block';\n}", "initializeModal () {\n if (!$.fn.modal) {\n throw new Error('[vmodal] Bootstrap is required.')\n }\n\n this.$modal.modal({\n show: false,\n focus: this.focus,\n backdrop: this.backdrop,\n keyboard: this.keyboard\n })\n\n this.$modal.on({\n 'show.bs.modal': e => this.$emit('show', e),\n 'shown.bs.modal': e => this.$emit('shown', e),\n 'hide.bs.modal': e => this.$emit('hide', e),\n 'hidden.bs.modal': e => this.$emit('hidden', e)\n })\n }", "bootstrap() { }", "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "loadDependencies() {\n gulpNunjucksRender = require('gulp-nunjucks-render');\n }", "function wlCommonInit() {\n // Common initialization code goes here\n console.log('MobileFirst Client SDK Initilized');\n angular.element(document).ready(function () {\n mfpMagicPreviewSetup();\n angular.bootstrap(document.body, ['ibmApp']);\n });\n}", "function doPhotoLightbox(lightbox, link) {\n\t\"use strict\";\n\tlightbox.setAttribute('data-upload-type', link.getAttribute('data-upload-type'));\n\tcompleteLightbox(lightbox, link);\n\tcallFunction('initUploadPhoto', 'photo-upload', lightbox);\n}", "function addModalToDom() {\n // create an instance of the overlay\n var $overlay = $('<div class=\"modal-overlay\"></div>');\n $('body').prepend($overlay);\n $overlay.addClass('-active');\n $('body').css('overflow','hidden');\n // load the modal content\n $.get('business/includes/request-demo.html?cache=bust', function(data) {\n $overlay.html(data);\n doFormStuff($overlay);\n });\n }", "function openCreateLightbox()\n{\n\tif (!CorbisUI.GlobalVars.SearchResults.isAnonymous)\n\t{\n\t\tnew CorbisUI.Popup('createLightboxModalPopup', { \n\t\t\tshowModalBackground: false,\n\t\t\tcenterOverElement: 'SearchBuddy',\n\t\t\tcloseOnLoseFocus: true,\n\t\t\tpositionVert: '60', \n\t\t\tpositionHoriz: '5'\n\t\t}); \n\n\t\t//Reposition because getCoordinate() does not work so well for Safari.\n\t\tvar SB = $('SearchBuddy');\n\t\t$('createLightboxModalPopupWindow').setStyles({\n\t\t\ttop: SB.offsetTop + window.getScroll().y + 60,\n\t\t\tleft: SB.offsetLeft + window.getScroll().x + 5\n\t\t});\n\t\t\n\t}\n}", "function selectBox() {\r\n\r\n\t//Select box\r\n\t$('.select-box').selectpicker();\r\n}", "function addLibraryPlugin(lib) {\n\t lib.fn.swiper = function (params) {\n\t var firstInstance;\n\t lib(this).each(function () {\n\t var s = new Swiper(this, params);\n\t if (!firstInstance) firstInstance = s;\n\t });\n\t return firstInstance;\n\t };\n\t }", "function addLibraryPlugin(lib) {\n\t lib.fn.swiper = function (params) {\n\t var firstInstance;\n\t lib(this).each(function () {\n\t var s = new Swiper(this, params);\n\t if (!firstInstance) firstInstance = s;\n\t });\n\t return firstInstance;\n\t };\n\t }", "function initBootstrap()\r\n{\r\n\t// Activate tooltips\r\n\t$('[data-toggle=\"tooltip\"]').tooltip();\r\n}", "function lightBoxOn() {\n\tvar overlay = document.getElementById('_overlay');\n\tif (overlay==null) {\n\t\toverlay = document.createElement(\"div\");\n\t \toverlay.className = \"overlay\";\n\t \toverlay.setAttribute(\"id\", \"_overlay\");\n\t \tdocument.body.appendChild(overlay);\n\t}\n\t \t\n\tif (document.body.scrollHeight > pageHeight()) \n\t \toverlay.style.height = document.body.scrollHeight + 'px';\n\telse\n\t\toverlay.style.height = pageHeight() + 'px';\n\t \n\tif (document.body.scrollWidth > pageWidth()) \n \toverlay.style.width = document.body.scrollWidth + 'px';\n\telse\n\t\toverlay.style.width = \"100%\"; \n\n\toverlay.style.display='block';\n}", "function addModalToDom() {\n // create an instance of the overlay\n var $overlay = $('<div class=\"modal-overlay\"></div>');\n $('body').prepend($overlay);\n $overlay.addClass('-active');\n $('body').css('overflow','hidden');\n // load the modal content\n $.get('includes/request-demo.html?cache=bust1', function(data) {\n $overlay.html(data);\n setTimeout(function() {\n $('.modal-contents', $overlay).addClass('-active');\n },50)\n doFormStuff($overlay);\n });\n }", "function init() {\n this.$ = require(\"jquery/dist/jquery\");\n this.jQuery = this.$;\n\n require(\"svg4everybody/dist/svg4everybody\")();\n require(\"retinajs/dist/retina\");\n\n require(\"bootstrap/dist/js/bootstrap.bundle\");\n\n\n\n $(document).ready(function () {\n require(\"./components/interractionObserver\")();\n });\n}", "function TB_init(root) {\n\t$(\"a.thickbox\",root).each(\n\t\tfunction(i) {\n\t\t\tthis.onclick = TB_image;\n\t\t\tvar t = this.alt || this.name || null;\n\t\t\tthis.alt = t + \" - view bigger version\";\n\t\t\tif (\n\t\t\t\t(this.type && this.type.match(/^image[\\/](jpeg|gif|png)$/i))\n\t\t\t\t|| (this.href && this.href.match(/\\.(jpeg|jpg|png|gif)$/i))\n\t\t\t) {\n\n\t\t\t\t// we store image links in an array (for a gallery)\n\t\t\t\timageArray.push ([\n\t\t\t\t\tthis.href,\n\t\t\t\t\tthis.title || this.name\n\t\t\t\t]);\n\n\t\t\t}\n\t\t}\n\t);\n//console.log(imageArray);\n}" ]
[ "0.6214217", "0.6178263", "0.6161205", "0.6104012", "0.60720986", "0.60283697", "0.5975248", "0.5899931", "0.5841094", "0.58254915", "0.580368", "0.5796946", "0.57480806", "0.559905", "0.5522319", "0.55151147", "0.54960936", "0.5477676", "0.5475328", "0.5470543", "0.5464596", "0.54380023", "0.5426929", "0.5396691", "0.530407", "0.5298582", "0.5283833", "0.52773976", "0.5276778", "0.5275289", "0.5230112", "0.5214224", "0.5204557", "0.51878047", "0.5174934", "0.5141636", "0.5133518", "0.5129647", "0.51107526", "0.50984013", "0.5095352", "0.5070912", "0.50608647", "0.50608647", "0.5017257", "0.496953", "0.49468553", "0.49171987", "0.49045873", "0.49034962", "0.48918548", "0.4889609", "0.4882461", "0.48812285", "0.487127", "0.48702553", "0.48559186", "0.4845884", "0.48361436", "0.48330337", "0.4829492", "0.48214212", "0.48188508", "0.47989815", "0.47989815", "0.47989815", "0.47973126", "0.47953063", "0.47953063", "0.47953063", "0.47807553", "0.47779718", "0.47757256", "0.4768882", "0.47631508", "0.47547996", "0.47456047", "0.47418198", "0.47288904", "0.47238764", "0.4721562", "0.4721562", "0.47160605", "0.47140917", "0.47102436", "0.46908242", "0.46895143", "0.4676003", "0.46751738", "0.46653405", "0.46602502", "0.46567488", "0.4656213", "0.4651191", "0.46490768", "0.46490768", "0.4646849", "0.464177", "0.46358916", "0.46337065", "0.46260226" ]
0.0
-1
Bind the Hotel Details and all the relavant objects
function SelectedHotel(culture, userId) { //vm.hotelBookingConfirm = bookService.getSelectedHotel(); // if hotelBookingConfirmation object null then get the object from the State Parameter, Its use to Make URL to anytime access for booking. if (vm.hotelBookingConfirm == undefined && $stateParams.cultureid && $stateParams.checkdatefrom && $stateParams.checkdateto && $stateParams.hotelid && $stateParams.roomcount && $stateParams.roomprice && $stateParams.pricetype) //if (vm.hotelBookingConfirm == undefined && $stateParams.confirmbook) { //var base64EncodedString = decodeURIComponent($stateParams.confirmbook); //var decodedString = $base64.decode(base64EncodedString); //var decodedJson = JSON.parse(decodedString); var json = { //cultureid: decode_params($stateParams.cultureid), cultureid: $cookies.get("lang") ? $cookies.get("lang") : decode_params($stateParams.cultureid), checkdatefrom: moment(decode_params($stateParams.checkdatefrom)).format("DD-MMM-YYYY"), checkdateto: moment(decode_params($stateParams.checkdateto)).format("DD-MMM-YYYY"), hotelcity: decode_params($stateParams.hotelcity), hotelid: decode_params($stateParams.hotelid), address: decode_params($stateParams.address), mainphotoname: decode_params($stateParams.mainphotoname), hotelclass: decode_params($stateParams.hotelclass), hotelname: decode_params($stateParams.hotelname), roomid: decode_params($stateParams.roomid), uniqueid: decode_params($stateParams.uniqueid), accommodationtypeid: decode_params($stateParams.accommodationtypeid), accommodationtypename: decode_params($stateParams.accommodationtypename), accommodationtypedescription: decode_params($stateParams.accommodationtypedescription), pricepolicytypeid: decode_params($stateParams.pricepolicytypeid), pricepolicytypename: decode_params($stateParams.pricepolicytypename), singlerate: decode_params($stateParams.singlerate), doublerate: decode_params($stateParams.doublerate), dailyroomprices: decode_params($stateParams.dailyroomprices), originalroomprice: decode_params($stateParams.originalroomprice), currencyid: decode_params($stateParams.currencyid), currencysymbol: decode_params($stateParams.currencysymbol), roomcount: decode_params($stateParams.roomcount), maxpeoplecount: decode_params($stateParams.maxpeoplecount), roomprice: decode_params($stateParams.roomprice), currencycode: decode_params($stateParams.currencycode), hoteltypename: decode_params($stateParams.hoteltypename), pricetype: decode_params($stateParams.pricetype), creditcardnotrequired: decode_params($stateParams.creditcardnotrequired), currentcurrency: $cookies.get("currency")?$cookies.get("currency"):decode_params($stateParams.currentcurrency) } vm.storeHotelConfirms = json; hoteldetailService.storeHotelRoomInfo( json.cultureid, json.checkdatefrom, json.checkdateto, json.hotelcity, json.hotelid, json.address, json.mainphotoname, json.hotelclass, json.hotelname, json.roomid, json.uniqueid, json.accommodationtypeid, json.accommodationtypename, json.accommodationtypedescription, json.pricepolicytypeid, json.pricepolicytypename, json.singlerate, json.doublerate, json.dailyroomprices, json.originalroomprice, json.currencyid, json.currencysymbol, json.roomcount, json.maxpeoplecount, json.roomprice, json.currencycode, json.hoteltypename, json.pricetype, json.creditcardnotrequired, json.currentcurrency ).then(function (response) { // copy from the hoteldetails page to make same object rebind again in booking ( current ) vm.hotelBookingConfirm = response; //console.log(vm.hotelBookingConfirm); vm.hotelBookingConfirm.pricetype = vm.storeHotelConfirms.pricetype; vm.hotelBookingConfirm.roomcount = vm.storeHotelConfirms.roomcount; vm.hotelBookingConfirm.roomid = vm.storeHotelConfirms.roomid; vm.hotelBookingConfirm.pricepolicytypeid = vm.storeHotelConfirms.pricepolicytypeid; //set has discount object if not empty vm.hotelBookingConfirm.hasDiscount =$stateParams.hasdiscount? decode_params($stateParams.hasdiscount):""; //set store confirm objects for ChangeDate function at booking module. if (vm.storeHotelConfirms) vm.hotelBookingConfirm.storeHotelConfirms = vm.storeHotelConfirms; //Bind current booking object BindBookObjects(vm.hotelBookingConfirm,culture, userId); }).catch(function (error) { }); } else { //Bind current booking object BindBookObjects(vm.hotelBookingConfirm, culture,userId); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HotelCollection(attrs) {\n _.extend(this, _.map(attrs, HotelClass.build).filter(Boolean));\n // this.data = _.map(attrs, HotelClass.build).filter(Boolean);\n }", "function hotelBooking() {\n\n // Comment it- No need to default Hotel Room selected on avaialbility load\n // Date: 15-Nov-2016\n //if (!vm.initCallBook)\n //{\n // //trigger to set initial object of the \n // if ($(\"#roomCount1_\" + vm.initRoomObj).length)\n // $(\"#roomCount1_\" + vm.initRoomObj).trigger(\"click\");\n //}\n\n var culture = $cookies.get(\"lang\");\n \n var hd = vm.hotelInfo[0];\n //Note: we have to choose availablity object based on the selection of the HotelRoom from Chooseavailability data.\n // var hd_available = vm.hotelAvaibility[0];// changed it..\n var json = {\n cultureid: culture,\n checkdatefrom: moment(vm.confirm_CheckInDate1).format(\"DD-MMM-YYYY\"),\n checkdateto: moment(vm.confirm_CheckOutDate1).format(\"DD-MMM-YYYY\"),\n hotelcity: hd.CityName,\n hotelid: hd.Id,\n address: hd.Address,\n mainphotoname: hd.MainPhotoName,\n hotelclass: hd.HotelClassValue,\n hotelname: hd.RoutingName,\n roomid: vm.selectedHotelRoomIDs.join(\",\"),\n uniqueid: vm.selectedHotelUniqeIDs.join(\",\"),\n accommodationtypeid: getHotelConfirmData(\"AccommodationTypeID\"),\n accommodationtypename: getHotelConfirmData(\"AccommodationTypeName\"),\n accommodationtypedescription: getHotelConfirmData(\"AccommodationTypeDescription\"),\n pricepolicytypeid: getHotelConfirmData(\"PricePolicyTypeID\"),\n pricepolicytypename: getHotelConfirmData(\"PricePolicyTypeName\"),\n singlerate: getHotelConfirmData(\"SingleRate\"),\n doublerate: getHotelConfirmData(\"DoubleRate\"),\n dailyroomprices: getHotelConfirmData(\"DailyRoomPrices\"),\n originalroomprice: getHotelConfirmData(\"OriginalRoomPrice\"),\n currencyid: getHotelConfirmData(\"CurrencyID\"),\n currencysymbol: getHotelConfirmData(\"CurrencySymbol\"),\n roomcount: vm.selectedRoomCountArray.join(\",\"),\n maxpeoplecount: getHotelConfirmData(\"MaxPeopleCountval\"),\n roomprice: getHotelConfirmData(\"RoomPrice\"),\n currencycode: getHotelConfirmData(\"CurrencyCode\"),\n hoteltypename: getHotelConfirmData(\"HotelTypeName\"),\n pricetype: getHotelConfirmData(\"PriceType\"),\n creditcardnotrequired: getHotelConfirmData(\"CreditCardNotRequired\"),\n currentcurrency: vm.selectedRoomsCurrencySymbol\n }\n \n //service call and redirect to Booking final URL\n storeHotelRoomInfo(json);\n }", "function Hotel(name,rooms,booked){\n this.name = name;\n this.rooms = rooms;\n this.booked = booked;\n}", "getHotels() {\n return this.catHotel;\n }", "getHotelBookings() {\n return this.hotelBooking;\n }", "renderView() {\n super.renderView();\n\n this.parent.className = 'detail';\n\n const tag = this.getTagFromLocation();\n\n this.db.fetchRestaurantByTag(tag).then(restaurant => {\n if (restaurant) {\n this.bc.reset();\n this.bc.addCrumb(restaurant.name, '');\n this.bc.render();\n\n // Add map marker\n this.map.addMarker(restaurant.name, restaurant.latlng, DBHelper.urlForRestaurant(restaurant));\n this.map.resetView();\n\n this.appendRestaurantDetails(restaurant);\n\n this.appendReviews(restaurant.id, restaurant.tag);\n }\n else {\n this.renderError();\n }\n });\n }", "get(req, res) {\n Hotel.findOne({_id: req.params.id}, function(err, result) {\n if (err) {\n return res.send(err);\n }\n return res.json(result);\n });\n }", "function BindBookObjects(hotelBookingConfirm,culture, userId) {\n \n //below object will Used for changeDate functions.//its json objects\n if (hotelBookingConfirm) {\n //set current currency again from cookie\n //hotelBookingConfirm.storeHotelConfirms.currencycode = $cookies.get(\"currency\");\n //hotelBookingConfirm.storeHotelConfirms.currentcurrency = $cookies.get(\"currency\");\n //hotelBookingConfirm.storeHotelConfirms.currencysymbol = vm.currentCurrency.CurrencySymbol;\n\n vm.storeHotelConfirms = hotelBookingConfirm.storeHotelConfirms;\n }\n if (vm.hotelBookingConfirm) {\n //console.log(vm.hotelBookingConfirm);\n vm.HotelInformation = hotelBookingConfirm.list;\n try {\n if (vm.HotelInformation && vm.HotelInformation.length > 0) {\n //moment(vm.HotelInformation[0].CheckDatefrom).format('MM-YYYY')\n //vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format('MM/DD/YYYY') };\n //vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format('MM/DD/YYYY') };\n //vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format('MMM DD,ddd') };\n //vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format('MMM DD,ddd') };\n vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format() };\n vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format() };\n scope.images = [];\n for(var i=0;i<vm.HotelInformation.length;i++)\n {\n if(!vm.HotelInformation[i].RoomPhotoName)\n {\n vm.HotelInformation[i].RoomPhotoName = \"/images/noimage.jpg?v=3.10\";\n }\n scope.images.push(vm.HotelInformation[i].RoomPhotoName);\n //vm.himages.push( {\n // 'url': vm.HotelInformation[i].RoomPhotoName,\n // 'caption': vm.HotelInformation[i].HotelTypeName,\n // 'thumbUrl': vm.HotelInformation[i].RoomPhotoName // used only for this example\n //});\n }\n }\n }\n catch (ett) {\n\n }\n vm.HotelTax = vm.hotelBookingConfirm.HotelTax;\n vm.convertedRoomPriceTotal = vm.hotelBookingConfirm.convertedRoomPriceTotal;\n vm.total = vm.hotelBookingConfirm.total;\n vm.totalInHotelCurrency = vm.hotelBookingConfirm.totalInHotelCurrency;\n\n //set for one day room count from nightcount\n //comment below to call again to recalculate changedDate Prices & Total payable.\n //vm.priceForSingalNight_ConvertedRoomPriceTotal=vm.convertedRoomPriceTotal/vm.HotelInformation[0].NightCount;\n //vm.priceForSingalNight_total = vm.total/vm.HotelInformation[0].NightCount;\n //vm.priceForSingalNight_InHotelCurrency = vm.totalInHotelCurrency / vm.HotelInformation[0].NightCount;\n\n vm.NewCurrencySymbol = vm.HotelInformation[vm.HotelInformation.length - 1].NewCurrencySymbol;\n vm.CurrencySymbol = vm.HotelInformation[vm.HotelInformation.length - 1].CurrencySymbol;\n\n //set local hasDiscout object\n vm.hasDiscount = vm.hotelBookingConfirm.hasDiscount;\n \n //init with zero\n vm.CreditCardNotRequired = 0;\n for (var rs = 0; rs < vm.hotelBookingConfirm.list.length; rs++) {\n var rsRequired = vm.hotelBookingConfirm.list[rs].CreditCardNotRequired;\n if (rsRequired) {\n vm.CreditCardNotRequired = rsRequired;\n break;\n }\n }\n if (!vm.typeCreditCardByHotel) {\n typeCreditCardByHotel(culture, vm.HotelInformation[0].HotelID);\n }\n\n }\n else {\n $state.go(\"master.gbs.home\");\n }\n }", "function showHotels(region){\n\n\t\tif (markers) //clears hotel markers currently on display\n\t\t{\n\t\t\tmarkers.clearLayers();\t\n\t\t}\n\n\t\tdata = {'region': region};\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: \"/maps/hoteldata\",\n\t\t\tdata: data,\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(data) {\n\t\t\t\tfor (var i = data.length - 1; i >= 0; i--) {\n\t\t\t\t\tvar marker = L.marker([data[i].latitude, data[i].longitude],{icon: happy})\n\t\t\t\t\tmarker.bindPopup(data[i].id + '-' + data[i].name);\n\t\t\t\t\tmarkers.addLayer(marker);\n\t\t\t\t\thotelsDisplayed = region;\n\t\t\t\t};\n\t\t\t}\n\t\t}).done(function() {\n\t\t \tmap.addLayer(markers);\n\t\t});\n\n\t}", "reloadData()\n {\n this.getBooks();\n this.getGenres();\n }", "render() {\n const restaurantId = +getUrlParameter('id');\n\n if (!restaurantId) {\n console.error('The restaurant ID could not be located');\n return;\n }\n\n DBHelper.fetchRestaurant(restaurantId)\n .then(restaurant => {\n this.restaurant = restaurant;\n document.title += ` | ${this.restaurant.name}`;\n\n this.fillBreadcrumb();\n this.renderRestaurant();\n this.loadMap();\n })\n .catch(console.error);\n }", "mockHotels() {\n this.setState({\n hotels: [\n {\n destinationId: \"561413\",\n name: \"LondonHouse Chicago, Curio Collection by Hilton\",\n },\n {\n destinationId: \"235666\",\n\t name: \"London Heathrow Marriott Hotel\",\n },\n {\n destinationId: \"234896\",\n\t\t name: \"London Marriott Hotel County Hall\",\n },\n ],\n\n hotelDetails: [\n {\n address: \"85 East Wacker Drive, Chicago, IL, 60601, United States of America\",\n destinationId: \"561413\",\n price: \"$107\",\n starRating: 4.5,\n whatIsAround: [\n \"In The Loop\",\n \"Chicago Riverwalk - 1 min walk\",\n \"Grant Park - 7 min walk\",\n \"Chicago Theatre - 7 min walk\",\n \"House of Blues Chicago - 9 min walk\",\n \"Millennium Park - 10 min walk\",\n \"Art Institute of Chicago - 13 min walk\",\n \"Water Tower Place - 15 min walk\",\n \"John Hancock Center - 16 min walk\",\n \"Willis Tower - 21 min walk\",\n \"Navy Pier - 22 min walk\",\n ],\n },\n {\n address: \"Bath Road, Heathrow Airport, Hayes, England, UB3 5AN, United Kingdom\",\n destinationId: \"235666\",\n price: \"$124\",\n starRating: 4,\n whatIsAround: [\n \"In Hillingdon\",\n \"Twickenham Stadium - 5.3 mi / 8.5 km\",\n \"Kempton Racecourse - 6.6 mi / 10.6 km\",\n \"Hampton Court Palace - 8.3 mi / 13.4 km\",\n \"Windsor Castle - 8.4 mi / 13.5 km\",\n \"Thorpe Park - 9.8 mi / 15.8 km\",\n \"Hampton Court - 12 mi / 19.2 km\",\n \"Legoland - 13.3 mi / 21.4 km\",\n \"Chessington World of Adventures - 24.4 mi / 39.3 km\",\n ],\n },\n {\n address: \"London County Hall, Westminster Bridge Road, London, England, SE1 7PB, United Kingdom\",\n destinationId: \"234896\",\n price: \"$307\",\n starRating: 5,\n whatIsAround: [\n \"In London City Centre\",\n \"London Eye - 4 min walk\",\n \"Big Ben - 5 min walk\",\n \"Buckingham Palace - 20 min walk\",\n \"St. Paul's Cathedral - 28 min walk\",\n \"Hyde Park - 30 min walk\",\n \"The British Museum - 30 min walk\",\n \"Tower of London - 2.4 mi / 3.8 km\",\n \"London Stadium - 7.1 mi / 11.4 km\",\n \"O2 Arena - 8 mi / 12.8 km\",\n \"Wembley Stadium - 12.5 mi / 20.2 km\",\n ],\n },\n ],\n\n hotelPhotos: [\n {\n destinationId: \"561413\",\n\t\t imageDetails: [\n {\n imageId: 431500626,\n mediaGUID: \"7ce1e40d-f42b-4eb8-9fb9-db323b94fac4\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/7ce1e40d_z.jpg\",\n },\n {\n imageId: 391789343,\n mediaGUID: \"8ab5cac0-e9ea-45e1-8477-0289a551e00f\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/8ab5cac0_z.jpg\",\n },\n {\n imageId: 105602083,\n mediaGUID: \"e78f46c2-ca35-4398-a2ca-821c58eba188\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/e78f46c2_z.jpg\",\n },\n {\n imageId: 105602109,\n mediaGUID: \"4fdc0540-3caa-4338-9de9-2c44a9706834\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/4fdc0540_z.jpg\",\n },\n {\n imageId: 105602225,\n mediaGUID: \"6c647f92-dd23-4bc5-bdc7-2182cbdd40e7\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/6c647f92_z.jpg\",\n },\n {\n imageId: 391791720,\n mediaGUID: \"c0962bc3-1b4f-4fd9-81a2-d7e53ac1d0b0\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/c0962bc3_z.jpg\",\n },\n {\n imageId: 391791490,\n mediaGUID: \"0b2651d2-73dd-4db3-8b36-04595500ed21\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/0b2651d2_z.jpg\",\n },\n ],\n },\n {\n destinationId: \"235666\",\n\t\t\t imageDetails: [\n {\n imageId: 95096904,\n mediaGUID: \"2829b516-adc8-417d-843f-669cc35905d7\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/440000/438600/438504/2829b516_z.jpg\",\n },\n {\n imageId: 62208258,\n mediaGUID: \"1e4e5443-a89a-417f-8916-b76e3244a72e\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/440000/438600/438504/1e4e5443_z.jpg\",\n },\n ],\n },\n {\n destinationId: \"234896\",\n\t\t\t imageDetails: [\n {\n imageId: 100519485,\n mediaGUID: \"159e137a-905a-41c7-8826-84879599642f\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/159e137a_z.jpg\",\n },\n {\n imageId: 257744115,\n mediaGUID: \"6b48aa8c-eb5c-4c73-b07f-be9dd9fe3513\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/6b48aa8c_z.jpg\",\n },\n {\n imageId: 66462293,\n mediaGUID: \"bd205f95-6798-45ce-bcdf-2bf4b3ed8c7f\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/bd205f95_z.jpg\",\n },\n {\n imageId: 100519288,\n mediaGUID: \"0f60b2e1-9096-4cf6-984b-f6146ccab1c9\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/0f60b2e1_z.jpg\",\n },\n {\n imageId: 100519436,\n mediaGUID: \"a933ae79-65f0-4f0b-ba5b-17e2ba6797c6\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/a933ae79_z.jpg\",\n },\n ],\n },\n ],\n });\n }", "function gethotels() {\n var data;\n\n $.ajax({\n url: 'https://api.foursquare.com/v2/venues/search',\n dataType: 'json',\n data: 'client_id=JDZ2RTQ3D1VSVUOY42A5ROL0IASDWQFIPYQUO315HFBY1HC4&client_secret=ILBIH43ZVUQN4A0R3KU5IBZEX1VHXAUTHPBS10KQVMKEOXDU&v=20161016%20&ll=29.9090984,73.8439466%20&query=hotel',\n async: true,\n }).done(function (response) {\n data = response.response.venues;\n data.forEach(function (hotel) {\n foursquare = new Foursquare(hotel, map);\n self.hotelList.push(foursquare);\n });\n self.hotelList().forEach(function (hotel) {\n if (hotel.map_location()) {\n google.maps.event.addListener(hotel.marker, 'click', function () {\n self.populateInfoWindow(hotel);\n });\n }\n });\n }).fail(function (response, status, error) {\n $('#query-summary').text('Hotels not loaded');\n });\n }", "function pickHotel() {\n\n console.log('hello from hotel');\n for ( let i = 0 ; i < Hotel.all.length ; i++ ){\n if ( plan.budget === Hotel.all[i].hotelBudget && plan.planDays[0].dayLocation === Hotel.all[i].location ) {\n plan.planDays[0].planHotel = Hotel.all[i];\n\n }\n \n\n }\n\n}", "function searchHotels(ll){\n console.log(\"in\",ll)\n // foursquare.clientId & foursquare.clientSecret live in keys.js which is listed about this file so you are able to access the objects\n var queryURL = \"https://api.foursquare.com/v2/venues/search?client_id=\"+foursquare.clientId+\"&client_secret=\"+foursquare.clientSecret +\"&ll=\"+ ll + \"&query=hotels&limit=8&v=20180206\";\n \n // // .get is short hand for .ajax see links below\n // // https://stackoverflow.com/questions/3870086/difference-between-ajax-and-get-and-load\n // // http://api.jquery.com/jquery.ajax/\n $.get(queryURL, function(results){\n var data = results.response.venues;\n for(var i = 0; i < data.length;i++){\n \n \n var wrap = $('<div>').addClass('hotel-card');\n var addr = data[i].location.formattedAddress.join(\",\")\n var map = \"<iframe width='300' height='300' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com/maps?&amp;q=\"+encodeURIComponent( addr ) + \n \"&amp;output=embed'></iframe>\"; \n $(wrap).html(map);\n\n var latlong = data[i].location.lat + \",\" + data[i].location.lng\n wrap.attr('data-fsqHid', data[i].id).attr('data-fsqHlatlng', latlong)\n \n var name = $('<h5>').text(data[i].name);\n var address = $('<p>').text(addr);\n $(wrap).append(name, address);\n $('#hotel-display').append(wrap)\n }\n })\n }", "render(){\n return(\n <div>\n <h1>Here are the available vehicle listings:</h1>\n <br />\n <Vehicles vehicles={this.state.vehicles} ReloadData={this.ReloadData}></Vehicles>\n </div>\n );\n }", "function setupHotel() {\r\n // Get hotel info from localStorage\r\n var data = JSON.parse(localStorage.getItem('chosenHotel'));\r\n var index = localStorage.getItem('chosenHotNum');\r\n\r\n // Populate info template with chosen data\r\n var parentDiv = $('#info');\r\n var template = Handlebars.compile(document.getElementById('infoTemplate').innerHTML);\r\n var html = template(data);\r\n parentDiv.append(html);\r\n\r\n // Set up back button link and hotel name\r\n document.getElementById('link').setAttribute('href', localStorage.getItem('link'));\r\n document.getElementById('name').innerHTML = data.hotel;\r\n\r\n // Choose correct pictures to display based on hotel choice\r\n if (index == '0') {\r\n document.getElementById('img1').setAttribute('src', 'pics/motel1.jpg');\r\n document.getElementById('img2').setAttribute('src', 'pics/motel2.jpg');\r\n document.getElementById('img3').setAttribute('src', 'pics/motel3.jpg');\r\n }\r\n\r\n else if (index == '1') {\r\n document.getElementById('img1').setAttribute('src', 'pics/hotel1.jpg');\r\n document.getElementById('img2').setAttribute('src', 'pics/hotel2.jpg');\r\n document.getElementById('img3').setAttribute('src', 'pics/hotel3.jpg');\r\n }\r\n\r\n else if (index == '2') {\r\n document.getElementById('img1').setAttribute('src', 'pics/bhotel1.jpg');\r\n document.getElementById('img2').setAttribute('src', 'pics/bhotel2.jpg');\r\n document.getElementById('img3').setAttribute('src', 'pics/bhotel3.jpg');\r\n }\r\n}", "function showAllHotelMap(){\n\t\n\tvar array_hotels = [];\n\tvar array_links = {};\n\t$(\"a.map-link\").each(function(i,e){\n array_hotels.push($(e).attr(\"tab\"));\n\t});\n\t$(\"span.bold-blue-text a\").each(function(i,e){\n var href = $(e).attr(\"href\");\n var h_key = href.match(/\\d+\\?/)[0].match(/\\d+/)[0];\n array_links[h_key] = $(e).outer();\n\t});\n\t\n\t$(\"#map_canvas\").html(\"\");\n $(\"#map_canvas\").mask(\"Loading...\");\n\n\t//send request to get location of current hotel and other places around it\n\t$.ajax({\n\t\turl: allHotelServiceUrl,\n\t\tdata: {'hotelIds' : array_hotels},\n\t\ttype: 'GET',\n\t\tdataType: 'JSON',\n\t\tsuccess: function(response){\n\t\t\t//process data\n\t\t\tif(response.data != false){\n\t\t\t\tvar hotel = response.data.hotel;\n\t\t\t\t\n\t\t\t\tvar places = response.data.places;\n\n\n\t\t\t\t//display the map here\n\t\t\t\tvar center = new google.maps.LatLng(places[0][\"Latitude\"], places[0][\"Longitude\"]);\n\n\t\t\t\t//initialize map with provided center\n\t\t\t\tinitializeMap(center);\n\n\t\t\t\t//info\n\t\t\t\t var html = \"<div>\" + array_links[places[0][\"EANHotelID\"].toString()] + \"<br />\" + places[0][\"Address1\"] + \"</div>\";\n\t\t\t\t var infoWindow = new google.maps.InfoWindow({\n\t\t\t\t \tcontent: html\n\t\t\t\t })\n\n\t\t\t\t//display hotel at the center of the map\n\t\t\t\tmainMarker = new google.maps.Marker({\n\t\t\t\t \tposition: center,\n\t\t\t\t \t//title: places[0][\"Name\"] + \"\\n\" + places[0][\"Address1\"] ,\n\t\t\t\t \tmap: map,\n\t\t\t\t \ticon: '/assets/hotel.png'\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//infoWindow.open(map, mainMarker);\n\t\t\t\tgoogle.maps.event.addListener(mainMarker, 'mouseover', function(){\n\t\t\t\t\t\tinfoWindow.setContent(html);\n\t\t\t\t\t\tinfoWindow.open(map, mainMarker);\n\t\t\t\t\t})\n\t\t\t\t\n\t\t\t\t//places.splice(0, 1);\n\t\t\t\tvar subInfoWindow = new google.maps.InfoWindow();\n\t\t\t\t//display other places on the map\n\t\t\t\t$.each(places, function(index, place){\n\t\t\t\t\tvar desc = place[\"Name\"] + \"\\n\" + place[\"Address1\"];\n\t\t\t\t\tvar html = \"<div>\" + array_links[place[\"EANHotelID\"].toString()] + \"<br />\" + place[\"Address1\"] + \"</div>\";\n\t\t\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\t\t\tposition: new google.maps.LatLng(place[\"Latitude\"], place[\"Longitude\"]),\n\t\t\t\t\t\t//title: desc,\n\t\t\t\t\t\tmap: map,\n\t\t\t\t \t\ticon: '/assets/hotel.png'\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t\totherMarkers.push(map,marker);\n\t\t\t\t\t//subInfoWindow.open(map, marker);\n\t\t\t\t\tgoogle.maps.event.addListener(marker, 'mouseover', function(){\n\t\t\t\t\t\tsubInfoWindow.setContent(html);\n\t\t\t\t\t\tsubInfoWindow.open(map, marker);\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t $(\"#map_canvas\").unmask();\n\t }else{\n\t \t$(\"#map_canvas\").text(\"No maps found\")\n\t \t$(\"#map_canvas\").unmask();\n\t \t//alert(\"No maps found\");\n\t \t\n\t \t\n\t }\n\t\t}\n\t})\n}", "function setupPersonFullView() {\r\n populatePersonFullData();\r\n}", "function setupHotels() {\r\n // Get current hotel choice information from localStorage\r\n var current = JSON.parse(localStorage.getItem('hotel'));\r\n var current_num = localStorage.getItem('hotNum');\r\n\r\n // Populate current hotel card template\r\n var parentDiv = $('#currentCard');\r\n var template = Handlebars.compile(document.getElementById('currentTemplate').innerHTML);\r\n var html = template(setHotelData(current));\r\n parentDiv.append(html);\r\n\r\n // Onclick to set link and chosen hotel to view\r\n document.getElementById('currentView').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('hotel'));\r\n localStorage.setItem('chosenHotNum', localStorage.getItem('hotNum'));\r\n };\r\n\r\n // Current hotel is the basic hotel\r\n if (current_num == '0') {\r\n // Populate alternative card templates\r\n parentDiv = $('#alternativeCard1');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate1').innerHTML);\r\n data = JSON.parse(localStorage.getItem('premHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n parentDiv = $('#alternativeCard2');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate2').innerHTML);\r\n data = JSON.parse(localStorage.getItem('luxHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n // Onclicks to change hotel when choose is clicked\r\n document.getElementById('alternativeBtn1').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('premHot'));\r\n localStorage.setItem('hotNum', '1');\r\n };\r\n document.getElementById('alternativeBtn2').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('luxHot'));\r\n localStorage.setItem('hotNum', '2');\r\n };\r\n\r\n // Onclicks to set link and chosen hotel to view\r\n document.getElementById('alternativeView1').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('premHot'));\r\n localStorage.setItem('chosenHotNum', '1');\r\n };\r\n document.getElementById('alternativeView2').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('luxHot'));\r\n localStorage.setItem('chosenHotNum', '2');\r\n };\r\n }\r\n\r\n // Current hotel is the premium hotel\r\n else if (current_num == '1') {\r\n // Populate alternative card templates\r\n parentDiv = $('#alternativeCard1');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate1').innerHTML);\r\n data = JSON.parse(localStorage.getItem('basicHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n parentDiv = $('#alternativeCard2');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate2').innerHTML);\r\n data = JSON.parse(localStorage.getItem('luxHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n // Onclicks to change hotel when choose is clicked\r\n document.getElementById('alternativeBtn1').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('basicHot'));\r\n localStorage.setItem('hotNum', '0');\r\n };\r\n document.getElementById('alternativeBtn2').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('luxHot'));\r\n localStorage.setItem('hotNum', '2');\r\n };\r\n\r\n // Onclicks to set link and chosen hotel to view\r\n document.getElementById('alternativeView1').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('basicHot'));\r\n localStorage.setItem('chosenHotNum', '0');\r\n };\r\n document.getElementById('alternativeView2').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('luxHot'));\r\n localStorage.setItem('chosenHotNum', '2');\r\n };\r\n }\r\n\r\n // Current hotel is the luxury hotel\r\n else if (current_num == '2') {\r\n // Populate alternative card templates\r\n parentDiv = $('#alternativeCard1');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate1').innerHTML);\r\n data = JSON.parse(localStorage.getItem('basicHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n parentDiv = $('#alternativeCard2');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate2').innerHTML);\r\n data = JSON.parse(localStorage.getItem('premHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n // Onclicks to change hotel when choose is clicked\r\n document.getElementById('alternativeBtn1').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('basicHot'));\r\n localStorage.setItem('hotNum', '0');\r\n };\r\n document.getElementById('alternativeBtn2').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('premHot'));\r\n localStorage.setItem('hotNum', '1');\r\n };\r\n\r\n // Onclicks to set link and chosen hotel to view\r\n document.getElementById('alternativeView1').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('basicHot'));\r\n localStorage.setItem('chosenHotNum', '0');\r\n };\r\n document.getElementById('alternativeView2').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('premHot'));\r\n localStorage.setItem('chosenHotNum', '1');\r\n };\r\n }\r\n}", "function refresh() {\n\n var categories = {};\n var brands = {};\n var models = {}, engines = {}, gearboxes = {}, levels = {}; // for car\n\n var callback = function() {\n\n var keys = Object.keys(categories);\n var length = keys.length;\n var arr = new Array(length);\n for (var i = 0; i < length; i++) {\n var name = keys[i];\n var linker = name.slug();\n arr[i] = { name: name, linker: linker, count: categories[name] };\n }\n\n F.global.categories = arr;\n\n // products attributes\n F.global.attributes = {};\n\n var keys = Object.keys(brands);\n var length = keys.length;\n var arr = new Array(length);\n for (var i = 0; i < length; i++) {\n var name = keys[i];\n var linker = name.slug();\n arr[i] = { name: name, linker: linker, count: brands[name]['count'] };\n if (brands[name]['category']) {\n var categoryname = brands[name]['category'];\n var categoryid = categoryname.slug();\n arr[i]['category'] = categoryname;\n arr[i]['categoryid'] = categoryid;\n }\n }\n F.global.attributes.brands = arr;\n\n var keys = Object.keys(models);\n var length = keys.length;\n var arr = new Array(length);\n for (var i = 0, length = keys.length; i < length; i++) {\n var name = keys[i];\n var linker = name.slug();\n arr[i] = { name: name, linker: linker, count: models[name]['count'] };\n if (models[name]['category']) {\n var categoryname = models[name]['category'];\n var categoryid = categoryname.slug();\n arr[i]['category'] = categoryname;\n arr[i]['categoryid'] = categoryid;\n }\n }\n F.global.attributes.models = arr;\n\n var keys = Object.keys(engines);\n var length = keys.length;\n var arr = new Array(length);\n for (var i = 0, length = keys.length; i < length; i++) {\n var name = keys[i];\n var linker = name.slug();\n arr[i] = { name: name, linker: linker, count: engines[name]['count'] };\n if (engines[name]['category']) {\n var categoryname = engines[name]['category'];\n var categoryid = categoryname.slug();\n arr[i]['category'] = categoryname;\n arr[i]['categoryid'] = categoryid;\n }\n }\n F.global.attributes.engines = arr;\n\n var keys = Object.keys(gearboxes);\n var length = keys.length;\n var arr = new Array(length);\n for (var i = 0, length = keys.length; i < length; i++) {\n var name = keys[i];\n var linker = name.slug();\n arr[i] = { name: name, linker: linker, count: gearboxes[name]['count'] };\n if (gearboxes[name]['category']) {\n var categoryname = gearboxes[name]['category'];\n var categoryid = categoryname.slug();\n arr[i]['category'] = categoryname;\n arr[i]['categoryid'] = categoryid;\n }\n }\n F.global.attributes.gearboxes = arr;\n\n var keys = Object.keys(levels);\n var length = keys.length;\n var arr = new Array(length);\n for (var i = 0, length = keys.length; i < length; i++) {\n var name = keys[i];\n var linker = name.slug();\n arr[i] = { name: name, linker: linker, count: levels[name]['count'] };\n if (levels[name]['category']) {\n var categoryname = levels[name]['category'];\n var categoryid = categoryname.slug();\n arr[i]['category'] = categoryname;\n arr[i]['categoryid'] = categoryid;\n }\n }\n F.global.attributes.levels = arr;\n };\n\n var refreshGroups = function(){\n var groupContainers = [brands, models, engines, gearboxes, levels];\n var groupNames = [\"$brandName\", \"$model\", \"$engine\", \"$gearbox\", \"$level\"];\n\n (function refreshGroup(index){\n if(index >= groupNames.length){\n callback();\n }\n else {\n var container = groupContainers[index];\n var groupName = groupNames[index];\n\n ProductModel.aggregate([ {\n $group: {\n _id: groupName,\n count: { $sum: 1 },\n category: {$first: \"$category\"}\n }\n } ],\n function(error, result){\n if(error){\n console.log('error occurred while refreshing ' + groupName + ', and the error is ' + error);\n }\n else {\n var container = groupContainers[index];\n\n for (var k = 0; k < ((result && result.length) || 0); k++) {\n (container[result[k]._id] || (container[result[k]._id] = {}))[\"count\"] = result[k].count;\n container[result[k]._id][\"category\"] = result[k].category;\n }\n }\n\n refreshGroup(index + 1);\n });\n }\n })(0);\n };\n\n ProductModel.aggregate([ {\n $group: {\n _id: \"$category\",\n count: { $sum: 1 }\n }\n } ], function(error, result) {\n if(error){\n console.log('error occurred while refreshing categories, and the error is ' + error);\n }\n else {\n for (var i = 0; i < ((result && result.length) || 0); i++) {\n categories[result[i]._id] = result[i].count;\n }\n }\n\n refreshGroups();\n } );\n}", "function listAllHotel(req, res) {\n Hotel.findAll((err, hotel) => {\n if (err) {\n res.status(500).send({ status: false, message: \"Fallo al listar los Hoteles\" });\n } else {\n res.status(200).send({ status: true, message: \"Hoteles listados exitosamente\", data: hotel });\n }\n });\n}", "set hydrate(res) {\n this.recipes = res;\n }", "constructor() { \n \n SearchRestaurants200ResponseRestaurantsInner.initialize(this);\n }", "bindingAll() {\n this.getAllDataJQ = this.getAllDataJQ.bind(this);\n this.creaTabella = this.creaTabella.bind(this);\n this.deleteRow = this.deleteRow .bind(this);\n this.addRow = this.addRow.bind(this);\n this.editRow = this.editRow.bind(this); \n this.ricreaJson = this.ricreaJson.bind(this); \n this.ricreaArrJson = this.ricreaArrJson.bind(this); \n this.creaJsonRes = this.creaJsonRes.bind(this); \n this.riempiFlussi = this.riempiFlussi.bind(this); \n }", "function luxuryHotel() {\n this.workDay = function (day) {\n //todo \n console.log(\"Today is \", day);\n this.buildRooms = function () {\n for (var index = 1; index <= 120; index++) {\n var room = new Object(index); //TO Implement\n this.rooms.push(room);\n }\n console.log(this.rooms)\n }\n }\n this.hireEmployee = function (employee) { //dodava\n this.employees.push(employee)\n }\n\n this.rooms = this.buildRooms();\n this.employees = [];\n this.restaurant = new Object(); //TODO not implemented;\n this.employeesHired = 0;\n this.income = 0;\n this.guestServed = 0;\n this.generateHotel = function () {\n this.buildRooms();\n }\n this.generateHotel();\n}", "_init() {\n this.floors.all = FloorsJSON\n this.locations.all = LocationsJSON\n this._segregateLocations()\n this._groupFloorsByBuildings()\n }", "function getBackgroundHotelFacilties()\n {\n WidgetsServices.getBackgroundHotelFacilties().success(function(res){\n if(res.status == 'OK')\n {\n $scope.background = {\n background : res.data.background\n }\n console.clear();\n }\n })\n }", "setUpRoutes () {\n\n /*\n * Hotels Query\n * GET /hotels\n * params: stringify query\n * - ?name=**&stars=[2, 5]\n * - ?_id=**\n */\n this.app.get('/hotels', async (req, res) => {\n const query = parse(req.url, true).query\n\n for (const i in query) query[i] = JSON.parse(unescape(query[i])) // parse query to object\n\n console.log(query)\n const results = this.filterData(query, data)\n res.status(200).json(results)\n })\n\n /*\n * Hotels Create\n * POST /\n * body: Hotel fields (see validator)\n */\n this.app.post('/', db(async (req, res) => {\n const {Model} = req\n const data = req.body\n let result = {}\n try {\n result = await new Model(data).save()\n } catch (err) {\n console.log('error', err)\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: save hotel'})\n }\n return res.status(200).send(result)\n }))\n\n /*\n * Hotel Update\n * PUT /:id\n * params: @id\n * body: Dataset to update\n */\n this.app.put('/:id', db(async (req, res) => {\n const {Model} = req\n const data = req.body\n const {id} = req.params\n delete data._id\n let result = {}\n try {\n result = await Model.findByIdAndUpdate(id, { $set: data }, { new: true })\n } catch (err) {\n console.log('error', err)\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: update hotel'})\n }\n return res.status(200).send(result)\n }))\n\n /*\n * Hotel Delete\n * DELETE /:id\n * params: @id\n */\n this.app.delete('/:id', db(async (req, res) => {\n const {Model} = req\n const {id} = req.params\n let result = {}\n try {\n result = await Model.findByIdAndRemove(id)\n if (!result) {\n return res.status(404).send({message: 'hotel not found'})\n }\n } catch (err) {\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: delete hotel'})\n }\n return res.status(200).send({message: 'delete ok', data: result})\n }))\n\n /*\n * Hotels find by id\n * GET /:id\n * params: @id\n */\n this.app.get('/:id', db(async (req, res) => {\n const {Model} = req\n const {id} = req.params\n let result = {}\n try {\n result = await Model.findById(id)\n if (!result) {\n return res.status(404).send({message: 'hotel not found'})\n }\n } catch (err) {\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: find by id hotel'})\n }\n return res.status(200).send(result)\n }))\n\n /*\n * Hotels Query\n * GET /hotels\n * params: stringify query\n * - ?name=**&stars=[2, 5]\n * - ?_id=**\n */\n this.app.get('/', db(async (req, res) => {\n const {Model} = req\n const query = parse(req.url, true).query\n\n for (const i in query) query[i] = JSON.parse(unescape(query[i])) // parse query to object\n let results = []\n try {\n results = await Model.find(query)\n } catch (err) {\n return res.status(500).send({message: 'Error: find all hotels'})\n }\n return res.status(200).send(results)\n }))\n }", "constructor() {\n super();\n this.__floorplan = new Floorplan();\n this.__roomItems = [];\n }", "function processAPI_DATA() {\n STATE.searchResult = STATE.searchResult.restaurants.map(currentRestaurant => {\n let restaurant = currentRestaurant.restaurant;\n\n return {\n name: restaurant.name,\n address: restaurant.location.address,\n thumb: restaurant.thumb,\n priceRange: restaurant.price_range,\n ratings: restaurant.user_rating.aggregate_rating\n };\n });\n\n render();\n}", "function Hotel(name, rooms, booked) {\n this.name = name;\n this.rooms = rooms;\n this.booked = booked;\n this.checkAvailability = function() {\n return this.rooms- this.booked;\n };\n}", "function hotelAdvisor(latitude, longitude) {\n\n fetch(\"https://travel-advisor.p.rapidapi.com/hotels/list-by-latlng?latitude=\" + latitude + \"&longitude=\" + longitude + \"&lang=en_US&hotel_class=3&limit=25&adults=2&amenities=bar_lounge&rooms=1&currency=USD&subcategory=hotel%2Cbb&nights=5\", {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"b519689459msheabfb47c1ca1bb2p18f9bcjsne0e023037538\",\n \"x-rapidapi-host\": \"travel-advisor.p.rapidapi.com\"\n }\n })\n .then(response => response.json())\n .then((data) => {\n console.log(data);\n var hotelLocationID = [];\n var hotelNameArray = [];\n\n for (i = 0; i < data.data.length; i++) {\n var hotelID = data.data[i].location_id;\n var hotelName = data.data[i].name;\n hotelLocationID.push(hotelID);\n hotelNameArray.push(hotelName);\n }\n console.log(hotelLocationID);\n console.log(hotelNameArray);\n //for loop function to get the images and names and add them to the html.\n hotelPhotos(hotelLocationID, hotelNameArray);\n })\n .catch(err => {\n console.error(err);\n });\n}", "function Hotel(name, rooms, booked) {\n this.nome = name; //this está no escopo da função... refere-se a Hotel, criada pela funçao.\n this.rooms = rooms;\n this.booked = booked;\n this.checkAvailability = function() {\n return this.rooms - this.booked;\n /*\n \n - A palavra chave this é usada em vez do nome do objeto para indicar que a propriedae ou método\n pertence ao objeto que a função this cria. ver p. 114 e 115.\n \n - This, cria as propriedades do objeto, cujos nomes não precisam necessariamente serem iguais aos\n parâmetros das funções que poderiam, por exemplo, serem n, r, b...\n \n */\n };\n}", "appendRestaurantDetails(restaurant) {\n this.content.insertAdjacentHTML('beforeend',`<h2>${restaurant.name}</h2>`);\n\n this.content.append(this.getFigure(restaurant));\n\n this.content.append(this.getCuisineAndFavoriteDiv(restaurant));\n\n this.content.insertAdjacentHTML('beforeend', `<address>${restaurant.address}</address>`);\n\n this.content.append(this.getHoursTable(restaurant.operating_hours));\n }", "function renderAllRes(tx) {\n tx.executeSql('select * from restaurants', [], function (t, rs) {\n for (let i = 0; i < rs.rows.length; i++) {\n let { restaurantID, restaurantName, imageURI } = rs.rows.item(i);\n addRes(restaurantID, restaurantName, imageURI)\n }\n\n $(\"#restaurantList\").listview('refresh')\n\n $(\".showResDetails\").on('click', function (e) {\n let resId = $(this).attr('res-id')\n $.mobile.changePage('#resDetails', { dataUrl: `/#resDetails?resId=${resId}` });\n })\n })\n}", "'click #view-entity'(event, instance){\n temp_list = [];\n\t\tvar template = Template.instance();\n\t\tentities.remove({});\n\t\tvar pqr = myContract.entityLength(function (err, res){\n\t\t\tfor(var i=0; i<res; i++)\n\t\t\t{\n\t\t\t\t\tmyContract.allEntity(i, function (err, res2){\n\t\t\t\t\tmyContract.viewEntity(res2, function (err, res3){\n\t\t\t\t\t\tconsole.log(res3);\n\t\t\t\t\t\ttemp_list.push(res3);\n\t\t\t\t\t\tTemplateVar.set(template,\"ent\",res3);\n\t\t\t\t\t\tif(res3[2]['c']==\"1\")\n\t\t\t\t\t\t\tentities.insert({address: res3[0] ,name:res3[1], mtd:\"Manufacturer\"});\n\t\t\t\t\t\tif(res3[2]['c']==\"2\")\n\t\t\t\t\t\t\tentities.insert({address: res3[0] ,name:res3[1], mtd:\"Transporter\"});\n\t\t\t\t\t\tif(res3[2]['c']==\"3\")\n\t\t\t\t\t\t\tentities.insert({address: res3[0] ,name:res3[1], mtd:\"Distributor\"});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "binds () {\n let self = this;\n\n $('.papi-property-color-picker input').each(self.showColorPicker);\n\n // Bind all new inputs when added in repeater.\n $(document).on('papi/property/repeater/added', '[data-property=\"color\"]', function () {\n $('.papi-property-color-picker input').each(self.showColorPicker);\n });\n }", "function getFeaturedHouses(response) {\n extractDataOfInterest(response, featuredHouses, createHouseFromHouseForSaleData);\n if (featuredHouses.length === 0) {\n initiateBindings();\n }\n \n updateSlideshowBindings();\n setFeaturedHousesContaierTitle();\n addFeaturedHousesToContainer();\n makeInvisible(loadingContainer);\n makeVisible(featuredHousesContainer);\n}", "function init() {\n\n\n new Vue({\n el: \"#app\",\n data: {\n restaurants: [{\n nom: 'café de Paris',\n cuisine: 'Française',\n },\n {\n nom: 'Sun City Café',\n cuisine: 'Américaine',\n }\n ],\n alert:false,\n creation_en_cours:false,\n edition_en_cours:false,\n en_edition:{\n name:'',\n cuisine:'',\n _id:\"\"\n },\n nom: '',\n cuisine: '',\n nbRestaurants: 0,\n page: 0,\n nbRestaurantsParPage: 5,\n nomRecherche: \"\",\n restaurant_id:\"\"\n\n },\n mounted(){\n console.log(\"AVANT AFFICHAGE\");\n this.getRestaurantsFromServer();\n },\n methods: {\n getRestaurantsFromServer() {\n let url = \"http://localhost:8080/api/restaurants?page=\" +\n this.page + \"&name=\" + this.nomRecherche +\n \"&pagesize=\" + this.nbRestaurantsParPage;\n\n console.log(\"Je vais chercher les restaurants sur : \"+ url)\n\n fetch(url)\n .then((reponseJSON) => {\n //console.log(\"reponse json\");\n return reponseJSON.json();\n })\n .then((reponseJS) => {\n // ici on a une réponse en JS\n this.restaurants = reponseJS.data;\n this.nbRestaurants = reponseJS.count;\n\n })\n .catch((err) => {\n console.log(\"Une erreur est intervenue \" + err);\n })\n },\n\n // _.debounce vient de lodash et permet de n'appeler getRestaurantsFromServer que lorsqu'on a arrêté de taper\n // pendant 300ms, ça évite d'envoyer une requête au serveur à chaque touche...\n searchRestaurantsFromServer: _.debounce(\n function () {\n this.getRestaurantsFromServer();\n }, 300),\n\n\n supprimerRestaurant(id) {\n let url = \"http://localhost:8080/api/restaurants/\"+id;\n\n fetch(url, {\n method: \"DELETE\",\n })\n .then((responseJSON) => {\n responseJSON.json()\n .then((res) => { // arrow function préserve le this\n // Maintenant res est un vrai objet JavaScript\n console.log(\"Restaurant supprimé\");\n this.getRestaurantsFromServer();\n });\n })\n .catch(function (err) {\n console.log(err);\n });\n },\n abort_edition(){\n this.alert=false;\n this.creation_en_cours=false;\n this.edition_en_cours=false;\n this.en_edition.nom ='';\n this.en_edition.cuisine = '';\n this.en_edition.id = '';\n this.nom = \"\";\n this.cuisine = \"\";\n },\n open_create_restaurant(){\n this.alert=true;\n this.creation_en_cours=true;\n },\n open_edit_restaurant(r){\n console.log(r);\n this.en_edition.name = r.name;\n this.en_edition.cuisine = r.cuisine;\n this.en_edition._id = r._id;\n\n console.log(this.en_edition);\n this.alert=true;\n this.edition_en_cours=true;\n },\n edit_restaurant(event){\n\n event.preventDefault();\n\n // Récupération du formulaire. Pas besoin de document.querySelector\n // ou document.getElementById puisque c'est le formulaire qui a généré\n // l'événement\n let form = event.target;\n\n // Récupération des valeurs des champs du formulaire\n // en prévision d'un envoi multipart en ajax/fetch\n let donneesFormulaire = new FormData(form);\n\n let url = \"http://localhost:8080/api/restaurants/\"+this.en_edition._id;\n console.log(\"edition\",donneesFormulaire);\n fetch(url, {\n method: \"PUT\",\n body: donneesFormulaire\n\n })\n .then((responseJSON) => {\n responseJSON.json()\n .then((res) => { // arrow function préserve le this\n // Maintenant res est un vrai objet JavaScript\n console.log(\"Restaurant inséré\");\n\n // remettre le formulaire à zéro\n this.en_edition.nom ='';\n this.en_edition.cuisine = '';\n this.en_edition.id = '';\n this.getRestaurantsFromServer();console.log(this.alert);\n this.alert=false;\n this.edition_en_cours_en_cours=false;\n });\n })\n .catch(function (err) {\n console.log(err);\n\n });\n\n },\n\n ajouterRestaurant(event) {\n // On récupère le formulaire\n // on l'envoie en multipart sur le serveur\n // Pour éviter que la page ne se ré-affiche\n event.preventDefault();\n\n // Récupération du formulaire. Pas besoin de document.querySelector\n // ou document.getElementById puisque c'est le formulaire qui a généré\n // l'événement\n let form = event.target;\n\n // Récupération des valeurs des champs du formulaire\n // en prévision d'un envoi multipart en ajax/fetch\n let donneesFormulaire = new FormData(form);\n\n let url = \"http://localhost:8080/api/restaurants\";\n\n fetch(url, {\n method: \"POST\",\n body: donneesFormulaire\n })\n .then((responseJSON) => {\n responseJSON.json()\n .then((res) => { // arrow function préserve le this\n // Maintenant res est un vrai objet JavaScript\n console.log(\"Restaurant inséré\");\n\n // remettre le formulaire à zéro\n this.nom = \"\";\n this.cuisine = \"\";\n this.alert=false;\n this.getRestaurantsFromServer();console.log(this.alert);\n this.creation_en_cours=false;\n });\n })\n .catch(function (err) {\n console.log(err);\n });\n\n },\n getColor(index) {\n return (index == 4) ? 'pink' : 'orange';\n },\n pagePrecedente() {\n if (this.page > 0) {\n this.page--;\n this.getRestaurantsFromServer();\n }\n },\n pageSuivante() {\n this.page++;\n this.getRestaurantsFromServer();\n },\n pageMax(){\n let pagemax = 0\n if (this.nbRestaurants%this.nbRestaurantsParPage != 0){\n pagemax = (this.nbRestaurants - this.nbRestaurants%this.nbRestaurantsParPage )/ this.nbRestaurantsParPage ;\n }\n else {\n pagemax = (this.nbRestaurants)/ this.nbRestaurantsParPage -1;\n }\n return pagemax\n },\n\n derniere_page() {\n this.page = this.pageMax();\n console.log((this.nbRestaurants+1)%10);\n this.getRestaurantsFromServer();\n },\n\n premiere_page() {\n this.page=0;\n this.getRestaurantsFromServer();\n },\n\n\n changePageSize() {\n this.page=0;\n this.getRestaurantsFromServer();\n }\n }\n });\n}", "populateDetails() {\n const { restaurantHoursContainer } = this.pageElements;\n const { operating_hours: operatingHours } = this.restaurant;\n\n restaurantHoursContainer.appendChild(generateHoursHtml(operatingHours));\n }", "refreshDatas() {\n this.populateBrandsData(); \n this.forceUpdate();\n }", "function showHotelListings() {\n let bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (let i = 0; i < markersHotel.length; i++) {\n markersHotel[i].setMap(map);\n bounds.extend(markersHotel[i].position);\n }\n map.fitBounds(bounds);\n}", "function populate() {\n apiService.genre.query().$promise.then(function (res) {\n $scope.genres = res;\n });\n apiService.author.query().$promise.then(function (result) {\n authors = result;\n });\n }", "function getSelectedHotel() {\n return hoteldetailService.getSelectedHotel();\n }", "function modal_hotel(id)\n { \n document.getElementById('mg_title').innerHTML=\"Hotel Information\";\n console.log(server+'_data_hotel_1.php?cari='+id);\n $.ajax({url: server+'_data_hotel_1.php?cari='+id, data: \"\", dataType: 'json', success: function(rows){ \n for (var i in rows.data){ \n var row = rows.data[i];\n var id = row.id;\n var name = row.name;\n var address = row.address;\n var cp = row.cp;\n var ktp = row.ktp;\n var marriage_book = row.marriage_book;\n var mushalla = row.mushalla;\n var type_hotel = row.type_hotel;\n var lat=row.lat;\n var lng = row.lng;\n\n if (mushalla == 1) {\n mushalla= \"Available\";\n } else {\n mushalla= \"Not Available\";\n }\n console.log(name);\n var syarat = \"-\";\n if (marriage_book == 1 && ktp == 1) {\n syarat= \"Marriage Book & KTP\";\n } else if (marriage_book == 1) {\n syarat= \"Marriage Book\";\n } else if (ktp == 1) {\n syarat= \"KTP\";\n }\n document.getElementById('mg_body').innerHTML=\"<h2>\"+name+\"</h2><h4>\"+type_hotel+\"</h4><br><div style='margin-left:20px'>Address: \"+address+\"<br>Contact Person: \"+cp+\"<br>Mushalla: \"+mushalla+\"<br>Requirement: \"+syarat+\"</div>\";\n }//end for\n\n //FASILITAS HOTEL\n // var isi=\"<br><b style='margin-left:20px'>Facility</b> <br><ol>\";\n // for (var i in rows.fasilitas){ \n // var row = rows.fasilitas[i];\n // var id = row.id;\n // var name = row.name;\n // console.log(name);\n // isi = isi+\"<li>\"+name+\"</li>\";\n // }//end for\n // isi = isi + \"</ol>\";\n // $('#mg_body').append(isi);\n\n //KAMAR HOTEL\n // var isi=\"<b style='margin-left:20px'>Room</b> <br><ol>\";\n // for (var i in rows.kamar){ \n // var row = rows.kamar[i];\n // var id = row.id;\n // var name = row.name;\n // var price = row.price;\n // console.log(name);\n // isi = isi+\"<li>\"+name+\" - Rp. \"+price+\",-</li>\";\n // }//end for\n // isi = isi + \"</ol>\";\n // $('#mg_body').append(isi);\n\n $('#modal_gallery').modal('show');\n }});//end ajax \n }", "function listarLlaves(){\n $http.get('/api/llaves').success(function(response){\n $scope.llavesCombo = response;\n });\n }", "viewDetails(id) {\n let productToView = _.find(this.products, {id:parseInt(id)});\n this.$emit(\"viewDetails_From_Product_List\", productToView); //в productDetails listening use $on and send all info which get from upper line.\n }", "function generateHotel ()\n{\n new Hotel ( 'Hotel','L','south' );\n new Hotel ( 'Hotel','L','north' );\n new Hotel ( 'Hotel','L','middle' );\n\n new Hotel ( 'Hotel','M','south' );\n new Hotel ( 'Hotel','M','north' );\n new Hotel ( 'Hotel','M','middle' );\n\n new Hotel ( 'Hotel','G','south' );\n new Hotel ( 'Hotel','G','north' );\n new Hotel ( 'Hotel','G','middle' );\n\n console.log( Hotel.all );\n}", "function getRoomAvailabilityDetails(culture, hotelId, currentCurrency) {\n hoteldetailService.getRoomAvailabilityDetails(culture, hotelId, currentCurrency).then(function (response) {\n vm.hotelRoomAvailability = response;\n vm.hotelPolicy = [];\n if (vm.hotelRoomAvailability.HotelRoomCondition != null) {\n $.each(vm.hotelRoomAvailability.HotelRoomCondition, function (key, value) {\n if (value.HotelRoomCondition[0].AttributeTypeID == \"2\") {\n vm.hotelPolicy.push(value);\n }\n });\n }\n //need to set to map\n }).catch(function (error) {\n\n })\n }", "function Hotel(name, totalRooms, bookedRooms) {\n\tthis.name = name;\n\tthis.rooms = totalRooms;\n\tthis.booked = bookedRooms;\n\tthis.roomsAvailable = function check() {\n\t\treturn this.totalRooms - this.bookedRooms;\n\t}\n\t//if you use literal notation you will need to return the Hotel\n\n\t//If you use object notation you will not need to return anything.\n}", "hent() {\n // Bruker b_id'en til å hente infor om bestillingen\n s_bestilling.InfoBestilling(this.b_id, valgt => {\n this.valgt = valgt;\n });\n // Bruker b_id'en til å hente info om varene i bestillingen\n s_bestilling.InfoBestillingVarer(this.b_id, varer => {\n this.varer = varer;\n });\n this.visInfoPop();\n }", "function hdlClickNewEngineerObj () {\n\tc4s.clearValidate({\n\t\t\t\"client_id\": \"m_engineer_client_id\",\n\t\t\t\"client_name\": \"m_engineer_client_name\",\n\t\t\t\"name\": \"m_engineer_name\",\n\t\t\t\"kana\": \"m_engineer_kana\",\n\t\t\t\"visible_name\": \"m_engineer_visible_name\",\n\t\t\t\"tel\": \"m_engineer_tel\",\n\t\t\t\"mail1\": \"m_engineer_mail1\",\n\t\t\t\"mail2\": \"m_engineer_mail2\",\n\t\t\t\"birth\": \"m_engineer_birth\",\n\t\t\t\"gender\": \"m_engineer_gender_container\",\n\t\t\t\"state_work\": \"m_engineer_state_work\",\n\t\t\t\"age\": \"m_engineer_age\",\n\t\t\t\"fee\": \"m_engineer_fee\",\n\t\t\t\"station\": \"m_engineer_station\",\n\t\t\t\"skill\": \"m_engineer_skill\",\n\t\t\t\"note\": \"m_engineer_note\",\n\t\t\t\"internal_note\": \"m_engineer_internal_note\",\n\t\t\t\"charging_user_id\": \"m_engineer_charging_user_id\",\n\t\t\t\"employer\": \"m_engineer_employer\",\n\t\t\t\"operation_begin\": \"m_engineer_operation_begin\",\n\t\t\t// \"addr_vip\": \"m_engineer_addr_vip\",\n\t\t\t// \"addr1\": \"m_engineer_addr1\",\n\t\t\t// \"addr2\": \"m_engineer_addr2\",\n\t\t});\n\t// [begin] Clear fields.\n\tvar textSymbols = [\n\t\t\"#m_engineer_client_id\",\n\t\t\"#m_engineer_client_name\",\n\t\t\"#m_engineer_name\",\n\t\t\"#m_engineer_kana\",\n\t\t\"#m_engineer_visible_name\",\n\t\t\"#m_engineer_tel\",\n\t\t\"#m_engineer_mail1\",\n\t\t\"#m_engineer_mail2\",\n\t\t\"#m_engineer_birth\",\n\t\t\"#m_engineer_age\",\n\t\t\"#m_engineer_fee\",\n\t\t\"#m_engineer_station\",\n\t\t\"#m_engineer_state_work\",\n\t\t\"#m_engineer_employer\",\n\t\t/*\n\t\t\"#m_engineer_dt_assignable\",\n\t\t*/\n\t\t\"#m_engineer_note\",\n\t\t\"#m_engineer_internal_note\",\n\t\t\"#attachment_id_0\",\n\t\t\"#attachment_label_0\",\n\t\t\"#m_engineer_skill\",\n\t\t\"#m_engineer_operation_begin\",\n\t\t\"#m_engineer_station_cd\",\n\t\t\"#m_engineer_station_pref_cd\",\n\t\t\"#m_engineer_station_line_cd\",\n\t\t\"#m_engineer_station_lon\",\n\t\t\"#m_engineer_station_lat\",\n\t\t// \"#m_engineer_addr_vip\",\n\t\t// \"#m_engineer_addr1\",\n\t\t// \"#m_engineer_addr2\",\n\t];\n\tvar checkSymbols = [\n\t\t\"#m_engineer_flg_caution\",\n\t\t\"#m_engineer_flg_registered\",\n\t\t\"#m_engineer_flg_assignable\",\n\t\t\"#m_engineer_flg_public\",\n\t\t\"#m_engineer_web_public\",\n\t\t\"#m_engineer_flg_careful\",\n\t];\n\tvar comboSymbols = [\n\t\t\"#m_engineer_contract\",\n\t];\n\tvar radioSymbols = [\n\t\t\"[name=m_engineer_gender_grp]\",\n\t];\n\tvar i;\n\tfor (i = 0; i < textSymbols.length; i++) {\n\t\t$(textSymbols[i]).val(null);\n\t}\n\tfor (i = 0; i < checkSymbols.length; i++) {\n\t\t$(checkSymbols[i])[0].checked = false;\n\t}\n\tfor (i = 0; i < comboSymbols.length; i++) {\n\t\t$(comboSymbols[i])[0].selectedIndex = 0;\n\t}\n\tfor (i = 0; i < radioSymbols.length; i++) {\n\t\t$(radioSymbols[i])[0].checked = true;\n\t}\n\t$(\"#m_engineer_id\").val(null);\n\t$(\"#m_engineer_flg_registered\")[0].checked = true;\n\t$(\"#m_engineer_flg_assignable\")[0].checked = true;\n\t$(\"#m_engineer_flg_public\")[0].checked = false;\n\t$(\"#m_engineer_web_public\")[0].checked = false;\n\t$(\"#m_engineer_flg_careful\")[0].checked = false;\n\t$(\"#m_engineer_charging_user_id\").val(env.userInfo.id);\n\t$('[name=\"m_engineer_skill_level[]\"]').each(function (idx, el) {\n\t\tel.selectedIndex = 0;\n\t});\n\t$('[name=\"m_engineer_skill[]\"]').each(function (idx, el) {\n\t\tel.checked = false;\n\t});\n\tviewSelectedEngineerSkill();\n\t$('[name=\"m_engineer_occupation[]\"]').each(function (idx, el) {\n\t\tel.checked = false;\n\t});\n\t// [end] Clear fields.\n\tsetEngineerMenuItem(0, 0, null, null);\n\t$(\"#es\").val(0);\n\t$(\"#edit_engineer_modal_title\").replaceWith($(\"<span id='edit_engineer_modal_title'>新規要員登録</span>\"));\n\tdeleteEngineerAttachment(0);\n\t$(\"#edit_engineer_modal\").modal(\"show\");\n\t$('#m_engineer_client_id').select2({allowClear: true});\n\t$(\"#m_engineer_skill_container\").html(\"<span style='color:#9b9b9b;'>java(3年~5年),PHP(1年~2年)</span>\");\n\t$('#m_skill_sort')[0].checked = false\n\tskill_id_list = '';\n\tskill_level_list = [];\n}", "function getHelicopterDetails () {\n helicopterDetailedService.helicopter(vm.id).then(function successCallback(response) {\n vm.data = response.data;\n vm.getOneRevenue();\n //First function handles success\n }, function errorCallback(response) {\n //Second function handles error\n vm.helicopter = 'An error has occured';\n });\n }", "refferalList(data){\nreturn this.post(Config.API_URL + Constant.REFFERAL_REFFERALLIST, data);\n}", "@wire(getBrandList)\n loadBrandList({data,error}){\n \n if(data){\n this.brandListToDisplay = [{value : '', label:'Select'}];\n\n data.forEach(element => {\n\n const brand = {};\n \n brand.label = element.Name;\n \n // console.log(\"Enterd brandListToDisplay label\",brand.label);\n \n brand.value = element.Id;\n \n this.brandListToDisplay.push(brand);\n // console.log(\"Enterd Brand list\",JSON.stringify(this.brandListToDisplay));\n });\n }\n else if(error){\n console.log('Error',error.body.message , 'error');\n }\n }", "function loadDetailedView(prop) {\n current_prop = prop;\n enablePropertyOptions();\n $(\"#mortgagebtn\").unbind();\n var property = prop.card;\n $(\"#propDetails\").html(\" \");\n var detailedView = $(\"<div>\").addClass(\"propertyCard\");\n var titleDeed = $(\"<div>\").addClass(\"titleDeed\");\n var mortgaged = $(\"<div>\").addClass(\"mortgaged\").html(\"MORTGAGED\");\n if (prop.mortgaged) mortgaged.show();\n titleDeed.append(mortgaged);\n var titleTextColor = \"black\";\n if (property.color === \"blue\" || property.color === \"purple\") {\n titleTextColor = \"white\";\n }\n var details;\n var costTable;\n if (property.color === \"rr\") { // handle railroad\n titleDeed.append($(\"<div>\").addClass(\"railroadImg\"));\n titleDeed.append($(\"<div>\").addClass(\"propertyName\")\n .addClass(\"railroad\")\n .append($(\"<h1>\").html(property.title))\n .css(\"color\", titleTextColor));\n details = $(\"<div>\").addClass(\"details\")\n .addClass(\"railroad\");\n details.append($(\"<div>\").addClass(\"rentDisplay\")\n .html(property.rent + \".\"));\n var houseCosts = $(\"<div>\").addClass(\"houseCosts\");\n\n costTable = $(\"<table>\").addClass(\"railroad\");\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"If 2 R.R.'s are owned\"),\n $(\"<td>\").html(\"$ \" + property.tworr + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"If 3 &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\"\"),\n $(\"<td>\").html(property.threerr + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"If 4 &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\"\"),\n $(\"<td>\").html(property.fourrr + \".\")));\n houseCosts.append(costTable);\n\n details.append(houseCosts);\n details.addClass(\"railroad\");\n details.append($(\"<div>\").addClass(\"mortgage\")\n .html(property.mortgage + \".\"));\n details.append($(\"<div>\").addClass(\"copyright\")\n .html(\"&copy;1935 Hasbro, Inc.\"));\n\n } else if (property.color === \"utility\") { // duquesne light or PWSA\n if (property.title.indexOf(\"Light\") != -1) {\n titleDeed.append($(\"<div>\").addClass(\"electricImg\"));\n } else {\n titleDeed.append($(\"<div>\").addClass(\"waterImg\"));\n }\n\n titleDeed.append($(\"<div>\").addClass(\"propertyName\")\n .addClass(\"utility\")\n .append($(\"<h1>\").html(property.title))\n .css(\"color\", titleTextColor));\n details = $(\"<div>\").addClass(\"details\")\n .addClass(\"utility\");\n var houseCosts = $(\"<div>\").addClass(\"houseCosts\");\n\n costTable = $(\"<div>\").addClass(\"utilityCostTable\");\n costTable.append($(\"<span>\").addClass(\"utilityText\")\n .html(\"If one \\\"Utility\\\" is owned rent is 4 times amount shown on dice.\"));\n costTable.append($(\"<span>\").addClass(\"utilityText\")\n .html(\"If both \\\"Utilities\\\" are owned rent is 10 times amount shown on dice.\"));\n houseCosts.append(costTable);\n\n details.append(houseCosts);\n details.append($(\"<div>\").addClass(\"mortgage\")\n .html(property.mortgage + \".\"));\n details.append($(\"<div>\").addClass(\"copyright\")\n .html(\"&copy;1935 Hasbro, Inc.\"));\n\n } else { // handle regular property\n titleDeed.append($(\"<div>\").addClass(\"propertyName\")\n .addClass(property.color)\n .append($(\"<h1>\").html(property.title))\n .css(\"color\", titleTextColor));\n details = $(\"<div>\").addClass(\"details\");\n details.append($(\"<div>\").addClass(\"rentDisplay\")\n .html(property.rent + \".\"));\n var houseCosts = $(\"<div>\").addClass(\"houseCosts\");\n\n var costTable = $(\"<table>\");\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 1 House\"),\n $(\"<td>\").html(\"$ \" + property.onehouse + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 2 Houses\"),\n $(\"<td>\").html(property.twohouse + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 3 Houses\"),\n $(\"<td>\").html(property.threehouse + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 4 Houses\"),\n $(\"<td>\").html(property.fourhouse + \".\")));\n houseCosts.append(costTable);\n details.append(houseCosts);\n\n details.append($(\"<div>\").addClass(\"hotel\")\n .html(property.hotel + \".\"));\n details.append($(\"<div>\").addClass(\"mortgage\")\n .html(property.mortgage + \".\"));\n details.append($(\"<div>\").addClass(\"houses\")\n .html(property.housecost + \".\"));\n details.append($(\"<div>\").addClass(\"hotelCost\")\n .html(property.hotelcost + \".\"));\n details.append($(\"<div>\").addClass(\"monopoly\")\n .html(\"If a player owns ALL the Lots of any Color-Group, the rent is Doubled on Unimproved Lots in that group.\"));\n details.append($(\"<div>\").addClass(\"copyright\")\n .html(\"&copy;1935 Hasbro, Inc.\"));\n }\n\n\n titleDeed.append(details);\n detailedView.append(titleDeed);\n detailedView.hide();\n $(\"#propDetails\").append(detailedView);\n var widthPercent = (document.documentElement.clientWidth * 0.40) / 440;\n var heightPercent = (document.documentElement.clientHeight) / 520;\n var percentScale = (widthPercent > heightPercent) ? heightPercent : widthPercent;\n $(\"#propDetails .propertyCard\").css(\"-webkit-transform\", \"scale(\" + percentScale + \")\");\n $(\"#propDetails .propertyCard\").css(\"transform\", \"scale(\" + percentScale + \")\");\n $(\"#propDetails .propertyCard\").css(\"-ms-transform\", \"scale(\" + percentScale + \")\");\n\n detailedView.show();\n setupMortgageBtn(prop);\n setupHouseButtons();\n\n // Send currently viewed property to the server so the board can update\n socket.emit('inspectProperty', {\n fbid: window.fbid,\n property: propertyDatabase[property.title].id\n });\n}", "function showRestaurantData(e) {\r\n\r\n //Retrieve the data stored in the node\r\n var restaurant = e.target.getData('data-info-restaurant');\r\n\r\n //Show it!\r\n Y.one('#title').setHTML(restaurant.Title);\r\n Y.one('#address').setHTML(restaurant.Address);\r\n Y.one('#phone').setHTML(restaurant.Phone);\r\n\r\n //Sometimes the text NaN is stored in this field\r\n if(restaurant.Rating.AverageRating!='NaN')\r\n Y.one('#rating').setHTML(restaurant.Rating.AverageRating);\r\n else\r\n Y.one('#rating').setHTML(configuration.msg.notAvailable);\r\n\r\n var restaurantLink = Y.Node.create('<a></a>');\r\n restaurantLink.set('href',restaurant.Url);\r\n restaurantLink.set('target','_blank');\r\n restaurantLink.setHTML(restaurant.Url);\r\n\r\n var link = Y.one('#link');\r\n link.setHTML(restaurantLink);\r\n\r\n }", "getHairdresser(id){\n var self=this;\n self.Auth.getHairdresserById(id)\n .then((response)=>{ \n self.hairdresser = response;\n self.rating = self.hairdresser.rating; \n self.listOfPerformances = self.hairdresser.listOfPerformances.map(function(performance){\n if(performance.hasOwnProperty('_id') && performance.price!=null){\n return performance;\n }\n });\n console.log(\"list of performance\",JSON.stringify(self.listOfPerformances, null, 7));\n\n var data ={\n categoryName:[],\n galeryEntries:[]\n };\n \n angular.forEach(self.hairdresser.categories,(category, ind)=>{\n data.categoryName.push(category.name);\n angular.forEach(self.hairdresser.gallery_pictures, (elt)=>{ \n if(elt.published){\n data.galeryEntries.push({url:elt.url}); \n }\n });\n if(!!self.listOfAvailableCategories[ind]){\n self.listOfAvailableCategories.push(data);\n }\n data ={\n categoryName:[],\n galeryEntries:[]\n };\n });\n self.listOfAvailableCategories = self.listOfAvailableCategories.slice(1); \n self.selectedCategory = self.listOfAvailableCategories[0].categoryName[0]; \n angular.forEach(self.hairdresser.appointments, (appt,key)=>{\n //self.events.push({id:appt._id, date:appt.dayOfWeek, startTime:appt.slotTime, type:appt.slotType,state:appt.slotState,status: appt.slotState==0?'booked':(appt.slotState==-1?'pending':(appt.slotType===-1?'locked':'free')), relatedCustomer:appt.relatedCustomers,allDay:false});\n if(appt.slotType!=-1 && appt.hasOwnProperty('slotTime')){\n self.events.push({\n id:appt._id, \n startTime:self.DateHandler.moment(appt.dayOfWeek.split('T')[0]).add(parseInt(appt.slotTime.split('h')[0]),'hours').toDate() , \n endTime:self.DateHandler.moment(appt.dayOfWeek.split('T')[0]).add(parseInt(appt.slotTime.split('h')[0])+3,'hours').toDate(),\n type:appt.slotType,\n state:appt.slotState,\n status: appt.slotState==0?'booked':(appt.slotState==-1?'pending':(appt.slotType===-1?'locked':'free')),\n relatedCustomer:appt.relatedCustomers,\n allDay:false\n });\n } \n else if(appt.slotType==-1){\n self.events.push({\n id:appt._id, \n startTime:self.DateHandler.moment(appt.dayOfWeek.split('T')[0]).add(1, 'hours').toDate(), \n endTime:self.DateHandler.moment(appt.dayOfWeek.split('T')[0]).add(24,'hours').toDate(), \n type:appt.slotType,\n state:appt.slotState,\n status: 'locked', \n allDay:false\n });\n }else{\n throw new Error(\" no slot time available\");\n } \n \n }); \n console.log(\"events array struct \",self.events);\n self.eventSource = self.events;\n })\n .finally(()=>{\n // this.defineCalendarOption()\n // .then(()=>{\n // this.loadLogbook=true;\n // }); \n });\n }", "function getHotels (req,res){\n const params = req.query //porque viene como parámetro en la url\n\n Hotel.find(params, (err, hotel) => {\n if(err) return res.status(500).send({message: `Error making the request: ${err}` })\n if(!hotel) return res.status(404).send({message: `The hotel does not exist`})\n //Si no ocurre nada de esto es pq si existe.\n res.status(200).send({ hotel })\n })\n /*\n Hotel.find({}).exec().then((docs) => {\n docs.forEach(function(hotel, index) {\n const address = hotel.ADDRESS.replace(/[\"]+/g, '');\n if(hotel.Latitude === undefined ){\n console.log(hotel.Latitude === undefined)\n https.get(\"https://geocoder.api.here.com/6.2/geocode.json?app_id=sNvkDXsVsZ5XFarQRCeF&app_code=T30x8qywRMP_zpZVcjRN8A&searchtext=\" + address, (resp) => {\n let data = '';\n resp.on('data', (chunk) => {\n data += chunk;\n });\n resp.on('end', () => {\n try {\n JSON.parse(data).Response.View.length;\n const coordinates = JSON.parse(data).Response.View[0].Result[0].Location.NavigationPosition[0];\n //console.log(coordinates);\n //console.log(\"i'm here \")\n Hotel.updateMany({ADDRESS: hotel.ADDRESS}, { Latitude: coordinates.Latitude, Longitude: coordinates.Longitude }, (err) => {});\n } catch(e) {}\n })\n })\n }\n });\n })*/\n //res.json({});\n}", "function initHome(){\n\n //set currentRestaurant storage\n window.LE.userData.currentRestaurant = null;\n\n if(_debug){ console.log('initHome called'); }\n\n //prepare template that shows restaurant details\n var source;\n\n if(!templates.templateRestInfo){\n source = $(\"#restaurant-info-template\").html();\n templates.templateRestInfo = Handlebars.compile(source);\n }\n\n // prepare template that shows restaurant dropdown\n var source = $(\"#restaurant-dropdown-template\").html();\n var templateRestaurantDropdown = Handlebars.compile(source);\n\n $(function(){\n var getRestaurant = window.LE.restaurants.getRestaurant,\n getRestaurantsBySearchTerm = window.LE.restaurants.getRestaurantsBySearchTerm;\n var isSearch,\n searchTerm;\n\n // populate dropdown for restaurants\n var html = templateRestaurantDropdown(getRestaurant());\n var renderingRestaurants = $('#render-restaurants').after(html);\n\n // when the restaurant changes, we need to display rate and other data\n $.when(renderingRestaurants).done(function(){\n renderRestaurantDetails(templates.templateRestInfo, getRestaurant, isSearch);\n });\n\n // handler to process changes to the search bar for food\n $('#food').on(\"input\", function(){\n var searchVal = $(this).val();\n\n //only is a search if there is content in the field\n isSearch = (searchVal.length > 0);\n\n searchTerm = $(this).val().toLowerCase();\n $(\"#restaurant\").val(\"\");\n });\n\n $(\"#home-screen-continue-button\").on(\"click\", function(){\n if(isSearch){\n //TODO\n // GET RESULTS THEN GET PAGE!\n var restaurants = getRestaurantsBySearchTerm(searchTerm);\n\n var gettingPage = getpage('select_restaurant');\n\n // synchronization - ensure that search.json is loaded and select restaurant page fetched\n $.when(window.LE.loadingSearchIndex, gettingPage).done(function(){\n // cleanup old event handlers before leaving home context\n destroyHome();\n\n initSelectRestaurant(restaurants, searchTerm);\n\n // ease scroll to top of next view\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n });\n }else{\n // this is the restaurant id to render later\n var selectedVal = $(\"#restaurant\").val();\n \n if(_debug){ console.log(selectedVal); }\n\n if(selectedVal == \"\"){\n document.getElementById(\"id-alert\").innerHTML = \"Required.\";\n }else{\n\n // cleanup old event handlers before leaving home context\n destroyHome();\n\n userdata.currentRestaurant = selectedVal;\n initSelectItem(selectedVal);\n // ease scroll to top of next view\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n }\n }\n });\n });\n\n}", "refresh() {\n this.layersHerald_.refresh();\n }", "function Hotel(name, location, couplesMax, groupsMax, couplesPrice, groupsPrice, discount) {\n // set object variables\n this.name = name;\n this.location = location;\n this.couplesMax = couplesMax;\n this.groupsMax = groupsMax;\n this.couplesPrice = couplesPrice;\n this.groupsPrice = groupsPrice;\n this.discount = discount;\n \n // set random number of available rooms\n this.couplesFree = Math.floor(Math.random() * this.couplesMax);\n this.groupsFree = Math.floor(Math.random() * this.groupsMax);\n this.couplesBooked = this.couplesMax - this.couplesFree;\n this.groupsBooked = this.groupsMax - this.groupsFree;\n \n // set methods\n this.bookCouplesRooms = function (amount) {\n var couplesRoomsBooked = 0;\n \n if (amount > 0) {\n if (this.couplesBooked + amount < this.couplesMax) {\n this.couplesBooked += amount;\n this.couplesFree -= amount;\n couplesRoomsBooked += amount;\n }\n }\n \n return couplesRoomsBooked;\n \n };\n \n this.bookGroupsRooms = function (amount) {\n var groupsRoomsBooked = 0, couplesRoomsBooked = 0;\n \n if (amount > 0) {\n if (this.groupsBooked + amount < this.groupsMax) {\n this.groupsBooked += amount;\n this.groupsFree -= amount;\n groupsRoomsBooked += amount;\n } else {\n groupsRoomsBooked += this.groupsMax = this.groupsBooked;\n couplesRoomsBooked += this.BookCouplesRooms(amount - groupsRoomsBooked);\n }\n }\n \n return { groupsRoomsBooked : groupsRoomsBooked,\n couplesRoomsBooked : couplesRoomsBooked };\n };\n}", "function bindProductGrid() {\r\n // init kendo ui grid with brand data\r\n vm.mainGridOptions = {\r\n dataSource: {\r\n transport: {\r\n read: function (e) {\r\n brandDataFactory.getAll()\r\n .success(function (data) {\r\n // kendo grid callback\r\n e.success(data);\r\n });\r\n }\r\n }\r\n },\r\n pageable: {\r\n numeric: false,\r\n previousNext: false,\r\n messages: {\r\n display: \"总计: {2}\"\r\n }\r\n },\r\n sortable: true,\r\n height: 650,\r\n filterable: false,\r\n columns: [\r\n //{\r\n // field: \"primaryName\", title: \"名称\",\r\n // template: \"<div class='product-grid-img'\" +\r\n // \"style='background-image: url(#:gbmono.img_product_path + '/' + data.imgUrl#);'></div>\" +\r\n // \"<div class='product-grid-name'><a ng-href='\\\\#/products/edit/#=productId#'>#: primaryName #</a></div>\"\r\n //},\r\n { field: \"name\", title: \"名称\" },\r\n // { field: \"description\", title: \"简介\" },\r\n {\r\n template: '<a class=\"btn btn-xs btn-info\" ng-href=\"\\\\#/brands/edit/#=brandId#\"><i class=\"ace-icon fa fa-pencil bigger-120\"></i></a>&nbsp;&nbsp;' +\r\n '<button class=\"btn btn-xs btn-danger\" ng-click=\"\"><i class=\"ace-icon fa fa-trash-o bigger-120\"></i></button>', width: 100\r\n }\r\n ]\r\n };\r\n }", "function showDetails(){\n\tView.controllers.get('visitorController')['editTag']=true;\n var grid = View.panels.get('visitorsGrid');\n var selectedRow = grid.rows[grid.selectedRowIndex];\n var visitorId = selectedRow[\"visitors.visitor_id\"];\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"visitors.visitor_id\", visitorId, \"=\");\n View.panels.get('visitorsForm').refresh(restriction,false);\n}", "afficherRecruter(model,view){\n let complite=(res)=>{\n let recruter = JSON.parse(res.response);\n let recruterNode = view.createElement(recruter);\n view.appendTo(recruterNode,\"#disponible .content\");\n let recruterPrix = view.getElement(\"#recruter .panel_content span\");\n view.addHtml(recruterPrix,\"Prix : \"+view.simpleValue(model.user.recruter.prix)+\"&cent;\")\n recruterNode.addEventListener(\"click\",this.recruter.bind(this,model,recruterNode));\n\n }\n model.loadData(\"get\",\"/recruter\",{complite})\n }", "function loadProducts() {\r\n var brands = \"dove\";\r\n var fromDt = $(\"#fromDt\").val() || \"2018-10-15\";\r\n var toDt = $(\"#toDt\").val() || \"2018-10-24\";\r\n var produrl = \"http://analyticsapi-in.shortlyst.com/analytics-service/v1/insights/market/OSA/trend?brands=axe%2Cdove&type=EAN&fromDate=\" + fromDt + \"&toDate=\" + toDt + \"&mode=lite\";\r\n var responseObj = null;\r\n var brands = null;\r\n $.ajax({\r\n url: produrl,\r\n dataType: \"json\",\r\n success: function(result) {\r\n if(result){\r\n\t\t\t\t\tresponseObj = JSON.parse(JSON.stringify(result));\r\n\t\t\t\t\trenderZing(responseObj);\r\n\t\t\t\t}\r\n }\r\n });\r\n }", "constructor() { \n \n RecentDataProduct.initialize(this);\n }", "loadData() {\n this.hvacData = HVACDataLoader.getHVACData(this);\n if (this.hvacData.getBuildingList().length > 0) this.selectBuilding(this.hvacData.getBuildingList()[0]);\n }", "function displayRestaurant(obj) {\n const li = document.createElement('li');\n li.classList.value = 'ul-item result';\n\n const div = document.createElement('div');\n div.classList.value = 'li-item result-div';\n div.id = obj.id;\n div.innerText = obj.name + ' ' + obj.review_count;\n \n const reviewsBtn = document.createElement('button');\n reviewsBtn.classList.value = 'btn get-reviews';\n reviewsBtn.innerText = 'See reviews';\n reviewsBtn.addEventListener('click', getReviews, { once: true });\n\n const goingBtn = document.createElement('button');\n goingBtn.classList.value = 'btn going';\n goingBtn.addEventListener('click', updateDb);\n\n div.appendChild(reviewsBtn);\n div.appendChild(goingBtn);\n li.appendChild(div);\n document.getElementById('results').appendChild(li);\n }", "function loadSupplierData() {\n SupplierFactory.supplier.get({id: vm.supplierID}, function (data) {\n vm.supplier = data;\n vm.morePhones = []; //Holds additional phone numbers. (2-extra)\n if (CommonService.checkUndefinedOrNull(vm.supplier.phone2)) {\n vm.morePhones.push({phoneNumber: vm.supplier.phone2})\n }\n if (CommonService.checkUndefinedOrNull(vm.supplier.phone3)) {\n vm.morePhones.push({phoneNumber: vm.supplier.phone3})\n }\n });\n }", "onSelectRestaurant(restaurant){\n this.closeAllRestaurant()\n restaurant.viewDetailsComments()\n restaurant.viewImg()\n\n }", "model() {\n \n //Got this piece of fetch code from Laurens' example at: https://codepen.io/Razpudding/pen/LKMbwZ \n const connectionString = url+\"?query=\"+ encodeURIComponent(query) +\"&format=json\";\n\n return fetch(connectionString)\n .then(response => response.json())\n .then(json => {\n //console.log(json)\n\n //puts the bindings array in a new bindings variable\n let bindings = json.results.bindings\n\n //loops through the bindings array\n for (let i=0; i < bindings.length; i++){\n \n //puts every binding in item variable\n let item = bindings[i]\n //console.log(item)\n \n //gives every object value a new name, makes it easier to call upon from template\n item.cho = item.cho.value\n item.continent = item.continent.value\n item.placeName = item.placeName.value\n item.title = item.title.value\n item.type = item.type.value\n item.description = item.firstDescription.value\n item.img = item.instrumentImg.value\n\n }\n //console.log(bindings)\n\n //returns the bindings so they can be used in the component\n return bindings\n })\n }", "function Rental(name, price, rating, location, rooms, features, availability) {\n this.name = name;\n this.price = price;\n this.rating = rating;\n this.location = location;\n this.rooms = rooms;\n this.availability = availability;\n this.features = features;\n}", "function showRestaurants(data){\n bounds = new google.maps.LatLngBounds();\n bounds = placeBounds;\n for(var i=0;i<data.results_shown;i++){\n var r = data.restaurants[i].restaurant;\n var marker = createMarker(r);\n if(marker){\n var newRestaurant = new restaurant(r);\n self.restaurantList.push({restaurant:newRestaurant,\n marker:marker});\n }\n }\n if(bounds){\n google.maps.event.addDomListener(window, 'resize', function() {\n map.fitBounds(bounds);\n });\n }\n\n b = map.getBounds();\n z = map.getZoom();\n } //end of showRestaurants", "function editPage(req, res) {\n db.Burgers.findAll({}).then(function (dbBurger) {\n res.render(\"edit\", dbBurger);\n // res.json(dbBurger);\n });\n // burger.selectAllBurger(function (data) {\n // var hbsObject = {\n // burgers: data\n // };\n // console.log(hbsObject);\n // res.render(\"editPage\", hbsObject);\n // });\n}", "constructor(props){\n //Call the constructor of Super class i.e The Component\n super(props);\n //maintain the state required for this component\n this.state = {\n restaurant_ID: null,\n customer_ID: 13,\n const_restaurant_name: \"\",\n restaurant_name: \"\",\n owner_name: \"\",\n line1: \"\",\n line2: \"\",\n city: \"\",\n state_name: \"\",\n zipcode: \"\",\n phone_number: \"\",\n vegetarian: false,\n non_vegetarian: false,\n vegan: false,\n delivery: false,\n pickup: false,\n short_address: \"\",\n cover_image: \"\",\n const_cover_image: \"\",\n about: \"\",\n const_about: \"\",\n opening_time: \"\",\n closing_time: \"\",\n full_adress: \"\",\n fetchedDishes: [],\n cover_image_file: \"\",\n showModal: false,\n new_dish: {\n category_ID: 1\n },\n fetchedOrders: [],\n filteredOrders: [],\n selectedOrderFilter: \"all\"\n }\n //Bind the handlers to this class\n this.setRestaurantState = this.setRestaurantState.bind(this);\n this.fetchRestaurantDetails = this.fetchRestaurantDetails.bind(this);\n this.fetchDishes = this.fetchDishes.bind(this);\n this.restaurantNameChangeHandler = this.restaurantNameChangeHandler.bind(this);\n this.ownerNameChangeHandler = this.ownerNameChangeHandler.bind(this);\n this.addressLine1ChangeHandler = this.addressLine1ChangeHandler.bind(this);\n this.addressLine2ChangeHandler = this.addressLine2ChangeHandler.bind(this);\n this.cityChangeHandler = this.cityChangeHandler.bind(this);\n this.stateChangeHandler = this.stateChangeHandler.bind(this);\n this.zipChangeHandler = this.zipChangeHandler.bind(this);\n this.phoneNumberChangeHandler = this.phoneNumberChangeHandler.bind(this);\n this.vegetarianChangeHandler = this.vegetarianChangeHandler.bind(this);\n this.nonVegetarianChangeHandler = this.nonVegetarianChangeHandler.bind(this);\n this.veganChangeHandler = this.veganChangeHandler.bind(this);\n this.deliveryChangeHandler = this.deliveryChangeHandler.bind(this);\n this.pickupChangeHandler = this.pickupChangeHandler.bind(this);\n this.coverImageChangeHandler = this.coverImageChangeHandler.bind(this);\n this.submitUpdate = this.submitUpdate.bind(this);\n this.toggleModal = this.toggleModal.bind(this);\n this.dishFieldsChangeHandler = this.dishFieldsChangeHandler.bind(this);\n this.addNewDish = this.addNewDish.bind(this);\n this.selectedDishTypeChangeHandler = this.selectedDishTypeChangeHandler.bind(this);\n this.fetchOrders = this.fetchOrders.bind(this);\n this.selectedOrderFilterChangeHandler = this.selectedOrderFilterChangeHandler.bind(this);\n this.orderStatusChangeHandler = this.orderStatusChangeHandler.bind(this);\n }", "refresh() {\n this.buildLookupTable();\n }", "function populateMain() {\n directView(\"main-view\");\n id(\"product-list\").innerHTML = \"\";\n let section = this.id;\n let url = URL;\n if(section ===\"all\") {\n id(\"category\").textContent = \"SHOP ALL\"\n url += \"sneaker/all\";\n } else {\n id(\"category\").textContent = section.toUpperCase();\n url += \"category/\" + section;\n }\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(appendMain)\n .catch(handleRequestError);\n }", "function Hoteles(props) {\r\n const {\r\n filterCountry,\r\n filterPrice,\r\n filterSize,\r\n filterDateFrom,\r\n filterDateTo,\r\n filtersActives,\r\n defaultValues,\r\n sizeOptions,\r\n checkPrice,\r\n priceIcon\r\n } = props;\r\n\r\n let hotels = hotelsData;\r\n\r\n /* Filters hotels by countries */\r\n if (filterCountry !== defaultValues.COUNTRIES) {\r\n hotels = hotels.filter((hotel) => filterCountry === hotel.country);\r\n }\r\n\r\n /* Filters hotels by prices */\r\n if (filterPrice !== defaultValues.PRICES) {\r\n hotels = hotels.filter(\r\n (hotel) => parseInt(filterPrice, 10) === hotel.price\r\n );\r\n }\r\n\r\n /* Return the index of and object inside an array by its attribute */\r\n const findWithAttr = (array, attr, value) => {\r\n for (let i = 0; i < array.length; i++) {\r\n if (array[i][attr] === value) {\r\n return i;\r\n }\r\n }\r\n };\r\n\r\n /* Filters hotels by rooms */\r\n if (filterSize !== defaultValues.SIZES) {\r\n if (\r\n filterSize ===\r\n sizeOptions[findWithAttr(sizeOptions, \"size\", \"small\")].value\r\n ) {\r\n hotels = hotels.filter((hotel) => hotel.rooms <= 10);\r\n } else {\r\n if (\r\n filterSize ===\r\n sizeOptions[findWithAttr(sizeOptions, \"size\", \"medium\")].value\r\n ) {\r\n hotels = hotels.filter(\r\n (hotel) => hotel.rooms > 10 && hotel.rooms <= 20\r\n );\r\n } else {\r\n if (\r\n filterSize ===\r\n sizeOptions[findWithAttr(sizeOptions, \"size\", \"big\")].value\r\n ) {\r\n hotels = hotels.filter((hotel) => hotel.rooms > 20);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /* Filters hotels by check-in and check-out */\r\n if (filterDateFrom && filterDateTo) {\r\n if (filterDateTo >= filterDateFrom) {\r\n let format = \"YYYY-MM-DD\";\r\n let startDate = moment(filterDateFrom).format(format);\r\n let endDate = moment(filterDateTo).format(format);\r\n hotels = hotels.filter(\r\n (hotel) =>\r\n startDate >= moment(hotel.availabilityFrom).format(format) &&\r\n endDate <= moment(hotel.availabilityTo).format(format)\r\n );\r\n }\r\n }\r\n\r\n /* Creates a boolean variable that indicates if results are found \r\n or not when a filter is active */\r\n const checkResults = (hotels) => {\r\n let searchResults = false;\r\n let filterIsActive = filtersActives;\r\n if (filterIsActive) {\r\n if (Array.isArray(hotels) && hotels.length) {\r\n searchResults = true;\r\n }\r\n }\r\n return searchResults;\r\n };\r\n\r\n return (\r\n <React.Fragment>\r\n <div>\r\n {filtersActives && (\r\n <h3 className=\"searchText\">\r\n {checkResults(hotels)\r\n ? \"Estos son los resultados de tu búsqueda: \"\r\n : \"Ops...lo siento. No pudimos encontrar lo que estabas buscando. \"}\r\n </h3>\r\n )}\r\n </div>\r\n <section className=\"hotelList\">\r\n {hotels.map((hotel) => {\r\n /* Sets different icons to display in hotel cards\r\n for prices */\r\n let price = checkPrice(hotel.price, priceIcon);\r\n\r\n return (\r\n <HotelCard\r\n key={hotel.slug}\r\n img={hotel.photo}\r\n name={hotel.name}\r\n description={hotel.description}\r\n city={hotel.city}\r\n country={hotel.country}\r\n rooms={hotel.rooms}\r\n price={price}\r\n />\r\n );\r\n })}\r\n </section>\r\n </React.Fragment>\r\n );\r\n}", "function renderBreweryView(scroll = true){\n\t\t//make sure to disable old event handlers since they will be regenerated\n\t\t$('#js-brewery-list').off(\"click\");\n\t\t$('.js-green-go-button').off(\"click\");\n\t\t$('.plan-button').off('click');\n\n\t\t\tif(scroll){\n\t\t\t\t\tdocument.body.scrollTop = 0;\n\t\t\t \tdocument.documentElement.scrollTop = 0;\n\t\t\t}\n\t\tlet brewerylistContent = '';\n\n\t\tlet breweryCount = breweryData.length;\n\n\t\tif(breweryCount <= 0) {\n\n\t\t\t//The hike/location is too remote that no breweries can be found. So render a modal popup and then send user back to search another location\n\n\t\t\tbrewerylistContent =`<div class=\"col-4\">\n\t\t\t\t\t\t\t\t\t<p>No breweries were found within 30 miles of this hike. </p></div>`\n\n\t\t\t\t$('.modal-text').html(`Oh no! You must be hiking way out there. We can't seem to find any breweries near the hike you chose. Please try a new location.`);\n\t\t\t\t $('.modal').removeClass('hide').prop('hidden', false);\n\t\t\t\t $('.compass').addClass('hide');\n\t\t\t\t $('#modal-button-container').removeClass('hide');\n\n\t\t\t\t $('#modal-button-container').on(\"click\", '.modal-button', function (event) {\n \t\t\t\tevent.preventDefault();\n \t\t\t\t$('#modal-button-container').off('click');\n\t\t\t\t\t$('.compass').removeClass('hide');\n\t\t\t\t \t$('#modal-button-container').addClass('hide');\n\t\t\t\t\t$('.modal').addClass('hide').prop('hidden', true);;\n\t\t\t\t\tlocation.reload();\n\n\t\t\t\t\t});\n\n\t\t} else {\n\t\t\t\n\t\t\t\n\t\t\tlet i = currentBrewery;\n\t\t\tlet ii = 0;\n\n\t\t\tlet count = 0;\n\n\t\t\tif(i+showAmount < breweryData.length) { \n\t\t\t\tii = (i+showAmount); \n\t\t\t} else { \n\t\t\t\tii = breweryData.length;\n\t\t\t\t}\n\n\t\t\t\n\t\t\twhile (count < showAmount)\n\t\t\t{\n\n\t\t\t\tconsole.log(i , breweryCount);\n\t\t\t\tconsole.log(\"lat\", breweryData[i].geometry.location.lat(), breweryData[i].geometry.location.lng() );\n\n\t\t\t\tbreweryData[i].distanceMi = findDistance(userLat, userLong, breweryData[i].geometry.location.lat(), breweryData[i].geometry.location.lng() ).distanceMi; \n\n\t\t\t\tlet imageToShow = \"\";\n\n\t\t\t\t\n\t\t\t\t\timageToShow\t= breweryData[i].myImage;\n\t\t\t\t\n\n\t\t\t\tif(breweryData[i].selected) { \n\t\t\t\t\tbrewerylistContent += `<div class=\"col-4 brew-card\" id='${breweryData[i].place_id}'>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box highlight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"check-mark\"><i class=\"far fa-check-circle\"></i></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img class=\"img-brew\" src=\"${imageToShow}\" alt=\"${breweryData[i].name}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"brewery-name\"><span class=\"info-bold\">${breweryData[i].name}</span><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"info-bold\">Location:</span> ${ precisionRound(breweryData[i].distanceMi, 1)} miles away<br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"info-bold\">Rating:</span> ${breweryData[i].rating} stars</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button name=\"brewery\" id=\"brewery${breweryData[i].place_id}\" data=\"${i}\" class=\"js-remove-brewery-button brew-button\">Remove</button>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>`;\n\t\t\t\t\n\t\t\t\t} else { \n\t\t\t\t\tbrewerylistContent += `<div class=\"col-4 brew-card\" id='${breweryData[i].place_id}'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"check-mark hide\"><i class=\"far fa-check-circle\"></i></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img class=\"img-brew\" src=\"${imageToShow}\" alt=\"${breweryData[i].name}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"brewery-name\"><span class=\"info-bold\">${breweryData[i].name}</span><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"info-bold\">Location:</span> ${ precisionRound(breweryData[i].distanceMi, 1)} miles away<br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"info-bold\">Rating:</span> ${breweryData[i].rating} stars</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button name=\"brewery\" id=\"brewery${breweryData[i].place_id}\" data=\"${i}\" class=\"js-add-brewery-button brew-button\"> Add to list</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>`;\n\t\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t\ti++; \n\n\t\t\t\tif(i >= breweryData.length) count = 1000;\n\n\t\t\t}\n\n\t\t\tbrewerylistContent += `</div>`;\n\n\t\t\tconsole.log(\"generating next buttons\",currentBrewery, breweryData.length);\n\n\t\t\tif(currentBrewery != 0) {\n\t\t\t\tbrewerylistContent += `<div class=\"row\" style=\"clear: both\"><div class=\"col-4 hide-on-mobile\">\n\t\t\t\t\t\t\t\t\t\t\t<button class=\"previous-button\"><< Previous Breweries</button></div>`\n\t\t\t} else {\n\t\t\t\tbrewerylistContent +=`<div class=\"row\" style=\"clear: both\"><div class=\"col-4 hide-on-mobile\">\n\t\t\t\t\t\t\t\t\t\t\t&nbsp; </div>`\n\t\t\t}\n\n\t\t\tbrewerylistContent += `<div class=\"col-4 hide-on-mobile\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"showing-results\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"show-results-inner\">Showing results ${currentBrewery+1} to ${ii}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>`\n\n\t\t\tif( breweryData.length > currentBrewery+6) {\n\t\t\t\tbrewerylistContent += `<div class=\"col-4 hide-on-mobile\"><button class=\"next-button\">Next Breweries >></button></div>`\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\tif(showAmount < breweryData.length) {\n\t\t\t\tbrewerylistContent += `<div class=\"col-12 hide-on-big\">\n\t\t\t\t\t\t\t\t\t<button class=\"js-show-more\">Show more breweries</button>\n\t\t\t\t\t\t\t\t\t</div>`;\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\n\t\t$('.js-hike-view').addClass('hide').prop('hidden', true);\n\n\t\t$('.js-brewery-view').removeClass('hide').prop('hidden', false);\n\n\t\t$('.js-breweries-search-results').html(`Choose from ${breweryCount} breweries listed below.`);\n\n\t\t$('.js-pick-breweries').html(`Step 3: Choose a few breweries from this list of ${breweryCount} near ${hikeData.trails[userHikes[0]].name}`);\n\n\t\t$('#js-brewery-list').html(brewerylistContent);\t\n\n\t\t$('.modal').addClass('hide').prop('hidden', true);;\n\n\t\trenderProgressSection(3);\n\n\t\tif(userBreweries.length > 0) {\n\t\t\t$('.generate-trip').removeClass('hide'); \n\t\t\t//$('.generate-trip-button').html(`Generate Trip`);\n\t\t\t$('.plan-button').removeClass('hide'); \n\t\t\t$('.trip-summary').html(`1 hike and ${userBreweries.length} breweries selected`);\n\t\t}\n\n\t\t//reset to default value just in case we enlarged the search\n\t\tradiusAmount = 10000; \n\n\t\t\n\n\t\t//------------------create dynamic event listeners for new brewery BUTTONS \n\n\t\t$(\".js-show-more\").click( event => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconsole.log('clicked');\n\t\t\t\tshowAmount = showAmount + 6; \n\t\t\t\trenderBreweryView(false);\n\n\t\t});\n\n\t\t$(\".previous-button\").click( event => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconsole.log('clicked', currentBrewery);\n\t\t\t\tcurrentBrewery = currentBrewery-6;\n\t\t\t\tif(currentBrewery < 0) {currentBrewery = 0};\n\t\t\t\trenderBreweryView();\n\n\t\t});\n\n\t\t$(\".next-button\").click( event => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconsole.log('clicked');\n\t\t\t\tcurrentBrewery = currentBrewery\t+6;\n\t\t\t\tif((currentBrewery) >= breweryData.length) {\n\t\t\t\tcurrentBrewery = currentBrewery\t-6;\n\t\t\t\t return; \n\t\t\t\t} else {\n\t\t\t\t\trenderBreweryView();\n\t\t\t\t }\n\n\t\t});\n\n\n\t\t$(\"#js-brewery-list\").on(\"click\", \".js-add-brewery-button\", function (event) {\n \t\tevent.preventDefault();\n\t\t\t\n\t\t\tuserBreweries.push($(event.currentTarget).attr(\"data\"));\n\n\t\t\tbreweryData[parseInt($(event.currentTarget).attr(\"data\"))].selected = true;\n\n\t\t\tconsole.log('clicked', userBreweries);\n\n\t\t\t$(event.currentTarget).parent().parent().find('.box').addClass(\"highlight\");\n\t\t\t$(event.currentTarget).parent().parent().find('.check-mark').removeClass(\"hide\");\n\n\t\t\tlet step3text = \"\";\n\n\t\t\tif(userBreweries.length > 0){\n\t\t\t \tstep3text = \"Step 3: Selected \" + userBreweries.length\n\n\t\t\t \tif(userBreweries.length >1) {\n\t\t\t \t\tstep3text += \" breweries to visit.\";\n\t\t\t\t} \telse {\n\t\t\t\t\t\tstep3text += \" brewery to visit\";\n\t\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tstep3text = \"Step 3: Choose breweries to visit...\";\n\t\t\t\t}\n\n\t\t\t$('.js-step3-txt').html(step3text);\n\n\t\t\t$(event.currentTarget).removeClass('js-add-brewery-button').addClass('js-remove-brewery-button').html('Remove'); \n\n\t\t\t$('.generate-trip').removeClass('hide'); \n\t\t\t$('.plan-button').removeClass('hide'); \n\t\t\t//$('.generate-trip-button').html(`Generate Trip`);\n\t\t\t$('.trip-summary').html(`1 hike and ${userBreweries.length} breweries selected`);\n\t\t\t\n\t\t});\n\n\t\t$('.js-green-go-button').on('click', '.generate-trip', function (event) {\n\t\t\tevent.preventDefault();\n\t\t\t\t$('.js-brewery-view').addClass('hide').prop('hidden', true);\n\t\t\t\t$('#show-map').removeClass('hide').prop('hidden', false);\n\t\t\t\tcurrentBrewery = 0;\n\t\t\t\tinitMap();\n\t\t}); \n\n\t\t$('.plan-button').on('click', '.js-top-plan-button', function (event) {\n\t\t\tevent.preventDefault();\n\t\t\t\t$('.js-brewery-view').addClass('hide').prop('hidden', true);\n\t\t\t\t$('#show-map').removeClass('hide').prop('hidden', false);\n\t\t\t\tcurrentBrewery = 0;\n\t\t\t\tinitMap();\n\t\t}); \n\n\n\t\t$('#js-brewery-list').on('click', '.js-remove-brewery-button', function (event) {\n \t\tevent.preventDefault();\n\t\t\t\n \t\tlet breweryToRemove = userBreweries.indexOf($(event.currentTarget).attr(\"data\"));\n\n \t\tuserBreweries.splice(breweryToRemove, 1);\n\n \t\tbreweryData[parseInt($(event.currentTarget).attr(\"data\"))].selected = false;\n\n \t\t$(event.currentTarget).parent().parent().find('.box').removeClass(\"highlight\");\n \t\t$(event.currentTarget).parent().parent().find('.check-mark').addClass(\"hide\");\n\n\t\t\tlet step3text = \"\";\n\t\t\tif(userBreweries.length > 0){\n\t\t\t \tstep3text = \"Step 3: Selected \" + userBreweries.length\n\n\n\t\t\t \tif(userBreweries.length >1) {\n\t\t\t \tstep3text += \" breweries to visit.\";\n\t\t\t\t} else {\n\t\t\t\t\tstep3text += \" brewery to visit\";\n\t\t\t\t}\n\n\t\t\t\t$('.trip-summary').html(`1 hike and ${userBreweries.length} breweries selected`);\n\n\t\t\t}\telse {\n\t\t\t\t\tstep3text = \"Step 3: Choose breweries to visit...\";\n\t\t\t\t\t$('.generate-trip').addClass('hide');\n\t\t\t\t\t$('.plan-button').addClass('hide'); \n\t\t\t\t}\n\t\t\t\n\t\t\n\t\t\t$('.js-step3-txt').html(step3text);\n\n\t\t\t\n\t\t\t$(event.currentTarget).removeClass('js-remove-brewery-button').addClass('js-add-brewery-button').html('Add to list'); \n\n\n\n\t\t});\n\n\t\t\n\t} //else \n\n\n\n\t}", "function renderProductData () {\n fetch(`http://localhost:3001/api/products/allBySeller/${dt._id}`).then(res => {\n return res.json()\n }).then(data => {\n setProducts(data)\n })\n }", "getAllReservations() {\n return this._connection\n .find({ HotelID: this._HotelID })\n .select('-__v -_id -created_date')\n .lean();\n }", "function getRestaurants(e) {\n e.preventDefault();\n // clear results from previous search\n document.getElementById('results').innerHTML = '';\n const params = 'location=' + this['user-location'].value;\n getRequest('GET', '/get_restaurants.php?' + params, function(results) {\n const businesses = JSON.parse(results).businesses;\n for (let i = 0; i < businesses.length; i++) {\n displayRestaurant(businesses[i]);\n }\n });\n\n /*\n * Create a div with `image_url`, `name`, `location.display_address`,\n * `price`, `rating` and `review_count`, `url`\n * Children: <button class=\"btn get-reviews\">\n * <button class=\"btn going\">\n */\n function displayRestaurant(obj) {\n const li = document.createElement('li');\n li.classList.value = 'ul-item result';\n\n const div = document.createElement('div');\n div.classList.value = 'li-item result-div';\n div.id = obj.id;\n div.innerText = obj.name + ' ' + obj.review_count;\n \n const reviewsBtn = document.createElement('button');\n reviewsBtn.classList.value = 'btn get-reviews';\n reviewsBtn.innerText = 'See reviews';\n reviewsBtn.addEventListener('click', getReviews, { once: true });\n\n const goingBtn = document.createElement('button');\n goingBtn.classList.value = 'btn going';\n goingBtn.addEventListener('click', updateDb);\n\n div.appendChild(reviewsBtn);\n div.appendChild(goingBtn);\n li.appendChild(div);\n document.getElementById('results').appendChild(li);\n }\n}", "function viewDetails(appointment_id) {\n console.log('view details clicked ', appointment_id);\n $http.get('/appointments/' + appointment_id).then(function(response) {\n appointment.selected = response.data;\n console.log('Apt & Client details back from db: ', appointment.selected);\n });\n }", "function getRoomListForOverview() {\r\n loadAllRoomData(onLoadAllRoomDataForOverviewSuccess);\r\n switchView('roomsOverview');\r\n}", "function init() {\n vm.products = orderService.getAll();\n }", "function fillRoomListDisplay(responseText) {\n loadedData = JSON.parse(responseText);\n \n loadedData.forEach(function (room) {\n \n room.type = roomType[room.type];\n });\n\n paginationRoomListDisplay();\n}", "getRefferalAndAngentList(){\nreturn this.get(Config.API_URL + Constant.REFFERAL_GETREFFERALANDANGENTLIST);\n}", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "beerDetaile(){\n this.id = window.location.href.split('/').pop();\n fetch(`https://api.punkapi.com/v2/beers/${this.id}`, {\n method: 'GET'\n }).then((response) => {\n if(response.ok){\n return response.json();\n } else {\n throw new Error('Error');\n }\n }).then(object => this.setState({\n beerData: object,\n })).catch(error => error);\n }", "function AppInit(){\n \n ctx = document.body.getAttribute(\"data-context\");\n if (ctx == null) throw \"No context defined!\" ;//on verra plus tard!\n\n //si une function, initialise\n ctx = window[ctx];\n if (ctx instanceof Function){\n CONTEXT = new ctx();\n }\n else {\n CONTEXT = ctx;//permet toujours de recuperer un objet, pour un site tout simple amateur, c'est suffisant\n ctx = CONTEXT.constructor;//recupere le type;\n }\n if (CONTEXT == null)throw \"No context defined!\" ;//on verra plus tard!\n \n defineBindObject(CONTEXT);\n\n //qqs property necessaires:\n //process_update: true/false: indique si est en train de mettre a jour les données\n \n CONTEXT[\"__process_update\"] = false;\n ctx.defineBindProperty( \"process_update\",{\n get : function(){\n return this.__process_update;\n },\n set: function(value){\n if (this.__process_update != value){\n this.__process_update = value;\n key = this.__uuid__+\":process_update\";\n\n if (key in BINDINGS) {\n\n __notifyDatasetChanged(this,BINDINGS[key], key);\n }\n }\n\n\n },\n enumerable: false,\n });\n\n //end_init: si true, initialisations terminées\n //en theorie, modifié 1 seule fois dans l'appli...\n CONTEXT[\"__end_init\"] = false;\n ctx.defineBindProperty( \"end_init\",{\n get : function(){\n return this.__end_init;\n },\n set: function(value){\n if (this.__end_init != value){\n this.__end_init = value;\n key = this.__uuid__+\":end_init\";\n\n if (key in BINDINGS) {\n __notifyDatasetChanged(this,BINDINGS[key], key);\n }\n }\n\n\n },\n enumerable: false,\n });\n \n \n //si existent des models dans la page (ie: models globaux), recupere les\n var model_node = document.querySelector(\"body>div[data-role='presenters']\");\n\n if (model_node != null){\n //n'affiche pas le contenu\n model_node.style.display = \"none\";\n\n models = model_node.querySelectorAll(\"body>div[data-role=presenters]>[data-role=presenter]\");\n //pour chque model trouvé....\n for (moi=0;moi<models.length;moi++){\n var model = models[moi];\n\n id = model.getAttribute(\"id\");\n //probleme EDGE et SVG: pas de children pour le SVG...\n if (id == null || (model.children==null && model.childNodes == null)) continue; //n'autorise pas de models sans id!\n \n\n //SI EDGE ET SVG, DOIT PASSER PAR ChildNodes????\n children = model.children;\n if (children==null){\n children = [];\n \n end = model.childNodes.length ;\n current = 0;\n cn = model.childNodes;\n do{\n node = cn[current];\n if (node.nodeType != 8 && (node.nodeType!=3 || /\\S/.test(node.nodeValue))){\n \n children.push(node);;\n }\n //ajoute\n \n current++;\n }while(current<end);\n }\n \n //ici, si plusieurs childs, veut dire plusieurs data-type\n if (children.length == 1){\n //cree les bindings pour ce model\n //bindings: les bindings presents dans le model\n //template: le template/presenter html pour le model\n //recycle: des presenters deja crées pour reutilisation\n //MODELS[id] = __get_bindings(children[0], false);//false: ne met pas en place les events handlers\n MODELS[id] ={bindings: __get_bindings(children[0], false), template: children[0], recycle:[]};\n } else {\n //utilise des data-types, doit creer un binding par data-type\n for (c_i = 0; c_i < children.length; c_i++){\n mdl = children[c_i];\n dtype = mdl.getAttribute(\"data-type\");\n \n if (dtype == null){\n //model par defaut\n //MODELS[id] = __get_bindings(mdl, false);\n MODELS[id] = {bindings: __get_bindings(mdl, false), template: mdl, recycle:[]};\n } else {\n //un datatype\n MODELS[id+\"_\"+dtype] = {bindings: __get_bindings(mdl, false), template: mdl, recycle:[]};\n }\n }\n }\n \n \n //comment faire pour eviter a chaque initialisation de binding model de devoir recuperer le html????\n }\n\n }\n\n //les bindings de la page web...\n BINDINGS = __get_bindings(document.body, true, \"//*[not(ancestor::div[@data-role='presenters']) and (@*[contains(.,'{binding ')] or contains(text(),'{binding ')) ]\");\n \n \n notifyDatasetChanged();\n\n CONTEXT.end_init = true;//notifie la fin du chargement...\n}", "constructor() {\n this.expenses = []\n this.items = []\n this.expensesAdapter = new ExpensesAdapter()\n this.itemsAdapter = new ItemsAdapter()\n this.expenseBindingsAndEventListeners()\n this.fetchAndLoadExpenses()\n }", "function display_listing(data) {\n\t\t$(data).each(function(index, data) {\n\n\t\t// Create main restaurant div\n\t\tvar div = $('<div class=\"restaurant-div row\">').appendTo(\".main-listing-div\");\n\t\t\n\t\t// Append left sub and right sub div\n\t\tvar divLeft = $('<div class=\"left-restaurant-subdiv col-xs-6\">').appendTo(div);\n\t\tvar divRight = $('<div class=\"right-restaurant-subdiv col-xs-6\">').appendTo(div); \n\n\t\t\t\n\t\t\tdivLeft.append(\n\t\t\t\t$(document.createElement('h3')).text(data.name)\n\t\t\t);\n\t\t\tdivLeft.append(\n\t\t\t\t$(document.createElement('h4')).text(\"Address\")\n\t\t\t);\n\t\t\t\tdivLeft.append(\n\t\t\t\t$(document.createElement('p')).text(data.formatted_address.replace(\", United States\", \"\"))\n\t\t\t);\n\t\t\tdivLeft.append(\n\t\t\t\t$(document.createElement('h4')).text(\"Rating\")\n\t\t\t);\n\t\t\tdivLeft.append(\n\t\t\t\t$(document.createElement('div')).rateYo({rating: data.rating, readOnly: true})\n\t\t\t);\n\t\t\tdivLeft.append(\n\t\t\t\t$(document.createElement('h4')).text(\"Price\")\n\t\t\t);\n\t\t\tdivLeft.append(\n\t\t\t\t$(document.createElement('h4')).text(\"$\".repeat(data.price_level)).css(\"color\", \"#42f48c\").css(\"font-weight\", 800)\n\t\t\t);\n\t\t\t\t\n\t\t\t// Check to make sure a photo exists\n\t\t\tif (data.photos != undefined) {\n\t\t\t\tvar img = data.photos[0].getUrl({'maxWidth': 500, 'maxHeight': 500})\n\t\t\t\tdivRight.append(\"<img class='restaurant-img' src='\" + img +\"'/>\");\n\t\t\t}\n\t\t\t\n\n\t\t\tdiv.attr(\"place\", data.place_id);\n\t\t});\n\t}", "function displayReps(apiResponse){\n $(\"#candidateListId\").empty();\n var offices = apiResponse.offices;\n for (var officeIndex=0; officeIndex<offices.length; officeIndex++){\n var office = offices[officeIndex];\n var newDiv = $(\"<div></div>\");\n var dropDownId = officeName2Id(office.name);\n var dropDownContent = $(\"<ul class='dropdowncontent'></ul>\");\n dropDownContent.attr(\"id\",dropDownId);\n\n var dropDownHead = $(\"<button class='dropdownbutton btn' data-show=0></button>\");\n dropDownHead.text(office.name);\n dropDownHead.attr(\"data-activates\", dropDownId);\n\n for (officialIndex = 0; officialIndex<office.officialIndices.length; officialIndex++){\n var officialObj = apiResponse.officials[office.officialIndices[officialIndex]];\n var official = $(\"<li>\");\n var link = $(\"<a href='#' target='iframe_a' class='repLink'></a>\");\n $(link).text(officialObj.name);\n $(official).append(link);\n $(dropDownContent).append(official);\n }\n $(dropDownContent).hide();\n $(newDiv).append(dropDownHead);\n $(newDiv).append(dropDownContent);\n $(\"#candidateListId\").append(newDiv);\n }\n}", "function onInit() {\n vm.lists = mainService.get();\n }", "function _refresh() {\n $('body[role=\"application\"] section[role=\"region\"] > header h1').last().html(_venue.get('name'));\n $('section div[role=\"main\"]').last().html(_.template(template, _venue));\n $('button.recommend').one('click', _checkin);\n }", "function renderNew() {\n Items.getAll()\n .then(res => {\n $scope.items = res.data;\n })\n .catch(err => {\n $scope.items = err;\n });\n }", "function getDrinks(){\n $http\n .get('/drinks')\n .then(function(response){\n self.all = response.data;\n });\n }", "async refresh() {\n this.notifyLoading(true);\n refreshApex(this.boats); \n this.notifyLoading(false);\n }" ]
[ "0.62943375", "0.61110705", "0.5949075", "0.5888359", "0.5713022", "0.55092865", "0.5508702", "0.54448915", "0.54233885", "0.5417948", "0.54058516", "0.5388644", "0.5352086", "0.5341387", "0.5313017", "0.53030896", "0.529068", "0.5282575", "0.5276515", "0.5276491", "0.52764875", "0.5261317", "0.5256095", "0.5251456", "0.5244667", "0.5216398", "0.52129316", "0.52076924", "0.51973206", "0.5192193", "0.51407117", "0.51208043", "0.51183486", "0.5118252", "0.51181865", "0.51145285", "0.51074886", "0.50860184", "0.50833964", "0.5081303", "0.5071328", "0.50682014", "0.50677025", "0.5066176", "0.50628155", "0.5057295", "0.5053815", "0.50462574", "0.50455993", "0.5042192", "0.5037356", "0.5034213", "0.5029157", "0.50100327", "0.50097734", "0.50026387", "0.5001757", "0.49949872", "0.49918842", "0.4978567", "0.49749896", "0.49745792", "0.496999", "0.49698415", "0.4964066", "0.49587068", "0.49579504", "0.49537906", "0.49522147", "0.4947542", "0.4943626", "0.4937079", "0.49289736", "0.49218053", "0.49129584", "0.4904008", "0.4902056", "0.4898798", "0.48906618", "0.4890106", "0.48727676", "0.48697755", "0.4867855", "0.48614126", "0.48543984", "0.4843783", "0.48437697", "0.48420084", "0.48402876", "0.48382592", "0.48382592", "0.48373502", "0.48351952", "0.4835144", "0.48304734", "0.4830057", "0.48281538", "0.4824896", "0.4823823", "0.4818908", "0.48174137" ]
0.0
-1
bind hotel informations object
function BindBookObjects(hotelBookingConfirm,culture, userId) { //below object will Used for changeDate functions.//its json objects if (hotelBookingConfirm) { //set current currency again from cookie //hotelBookingConfirm.storeHotelConfirms.currencycode = $cookies.get("currency"); //hotelBookingConfirm.storeHotelConfirms.currentcurrency = $cookies.get("currency"); //hotelBookingConfirm.storeHotelConfirms.currencysymbol = vm.currentCurrency.CurrencySymbol; vm.storeHotelConfirms = hotelBookingConfirm.storeHotelConfirms; } if (vm.hotelBookingConfirm) { //console.log(vm.hotelBookingConfirm); vm.HotelInformation = hotelBookingConfirm.list; try { if (vm.HotelInformation && vm.HotelInformation.length > 0) { //moment(vm.HotelInformation[0].CheckDatefrom).format('MM-YYYY') //vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format('MM/DD/YYYY') }; //vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format('MM/DD/YYYY') }; //vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format('MMM DD,ddd') }; //vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format('MMM DD,ddd') }; vm.ChangeCheckInDate = { date: moment(vm.HotelInformation[0].CheckDatefrom).format() }; vm.ChangeCheckoutDate = { date: moment(vm.HotelInformation[0].CheckDateto).format() }; scope.images = []; for(var i=0;i<vm.HotelInformation.length;i++) { if(!vm.HotelInformation[i].RoomPhotoName) { vm.HotelInformation[i].RoomPhotoName = "/images/noimage.jpg?v=3.10"; } scope.images.push(vm.HotelInformation[i].RoomPhotoName); //vm.himages.push( { // 'url': vm.HotelInformation[i].RoomPhotoName, // 'caption': vm.HotelInformation[i].HotelTypeName, // 'thumbUrl': vm.HotelInformation[i].RoomPhotoName // used only for this example //}); } } } catch (ett) { } vm.HotelTax = vm.hotelBookingConfirm.HotelTax; vm.convertedRoomPriceTotal = vm.hotelBookingConfirm.convertedRoomPriceTotal; vm.total = vm.hotelBookingConfirm.total; vm.totalInHotelCurrency = vm.hotelBookingConfirm.totalInHotelCurrency; //set for one day room count from nightcount //comment below to call again to recalculate changedDate Prices & Total payable. //vm.priceForSingalNight_ConvertedRoomPriceTotal=vm.convertedRoomPriceTotal/vm.HotelInformation[0].NightCount; //vm.priceForSingalNight_total = vm.total/vm.HotelInformation[0].NightCount; //vm.priceForSingalNight_InHotelCurrency = vm.totalInHotelCurrency / vm.HotelInformation[0].NightCount; vm.NewCurrencySymbol = vm.HotelInformation[vm.HotelInformation.length - 1].NewCurrencySymbol; vm.CurrencySymbol = vm.HotelInformation[vm.HotelInformation.length - 1].CurrencySymbol; //set local hasDiscout object vm.hasDiscount = vm.hotelBookingConfirm.hasDiscount; //init with zero vm.CreditCardNotRequired = 0; for (var rs = 0; rs < vm.hotelBookingConfirm.list.length; rs++) { var rsRequired = vm.hotelBookingConfirm.list[rs].CreditCardNotRequired; if (rsRequired) { vm.CreditCardNotRequired = rsRequired; break; } } if (!vm.typeCreditCardByHotel) { typeCreditCardByHotel(culture, vm.HotelInformation[0].HotelID); } } else { $state.go("master.gbs.home"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Hotel(name,rooms,booked){\n this.name = name;\n this.rooms = rooms;\n this.booked = booked;\n}", "function HotelCollection(attrs) {\n _.extend(this, _.map(attrs, HotelClass.build).filter(Boolean));\n // this.data = _.map(attrs, HotelClass.build).filter(Boolean);\n }", "function gethotels() {\n var data;\n\n $.ajax({\n url: 'https://api.foursquare.com/v2/venues/search',\n dataType: 'json',\n data: 'client_id=JDZ2RTQ3D1VSVUOY42A5ROL0IASDWQFIPYQUO315HFBY1HC4&client_secret=ILBIH43ZVUQN4A0R3KU5IBZEX1VHXAUTHPBS10KQVMKEOXDU&v=20161016%20&ll=29.9090984,73.8439466%20&query=hotel',\n async: true,\n }).done(function (response) {\n data = response.response.venues;\n data.forEach(function (hotel) {\n foursquare = new Foursquare(hotel, map);\n self.hotelList.push(foursquare);\n });\n self.hotelList().forEach(function (hotel) {\n if (hotel.map_location()) {\n google.maps.event.addListener(hotel.marker, 'click', function () {\n self.populateInfoWindow(hotel);\n });\n }\n });\n }).fail(function (response, status, error) {\n $('#query-summary').text('Hotels not loaded');\n });\n }", "function Hotel(name, rooms, booked) {\n this.nome = name; //this está no escopo da função... refere-se a Hotel, criada pela funçao.\n this.rooms = rooms;\n this.booked = booked;\n this.checkAvailability = function() {\n return this.rooms - this.booked;\n /*\n \n - A palavra chave this é usada em vez do nome do objeto para indicar que a propriedae ou método\n pertence ao objeto que a função this cria. ver p. 114 e 115.\n \n - This, cria as propriedades do objeto, cujos nomes não precisam necessariamente serem iguais aos\n parâmetros das funções que poderiam, por exemplo, serem n, r, b...\n \n */\n };\n}", "function Hotel(name, rooms, booked) {\n this.name = name;\n this.rooms = rooms;\n this.booked = booked;\n this.checkAvailability = function() {\n return this.rooms- this.booked;\n };\n}", "getHotels() {\n return this.catHotel;\n }", "function setupHotel() {\r\n // Get hotel info from localStorage\r\n var data = JSON.parse(localStorage.getItem('chosenHotel'));\r\n var index = localStorage.getItem('chosenHotNum');\r\n\r\n // Populate info template with chosen data\r\n var parentDiv = $('#info');\r\n var template = Handlebars.compile(document.getElementById('infoTemplate').innerHTML);\r\n var html = template(data);\r\n parentDiv.append(html);\r\n\r\n // Set up back button link and hotel name\r\n document.getElementById('link').setAttribute('href', localStorage.getItem('link'));\r\n document.getElementById('name').innerHTML = data.hotel;\r\n\r\n // Choose correct pictures to display based on hotel choice\r\n if (index == '0') {\r\n document.getElementById('img1').setAttribute('src', 'pics/motel1.jpg');\r\n document.getElementById('img2').setAttribute('src', 'pics/motel2.jpg');\r\n document.getElementById('img3').setAttribute('src', 'pics/motel3.jpg');\r\n }\r\n\r\n else if (index == '1') {\r\n document.getElementById('img1').setAttribute('src', 'pics/hotel1.jpg');\r\n document.getElementById('img2').setAttribute('src', 'pics/hotel2.jpg');\r\n document.getElementById('img3').setAttribute('src', 'pics/hotel3.jpg');\r\n }\r\n\r\n else if (index == '2') {\r\n document.getElementById('img1').setAttribute('src', 'pics/bhotel1.jpg');\r\n document.getElementById('img2').setAttribute('src', 'pics/bhotel2.jpg');\r\n document.getElementById('img3').setAttribute('src', 'pics/bhotel3.jpg');\r\n }\r\n}", "constructor(infos) {\n this.nbRefugees = infos.nbRefugees;\n this.gridRow = infos.gridRow;\n this.gridColumn = infos.gridColumn;\n this.landingFirstPort = 0;\n }", "function showHotels(region){\n\n\t\tif (markers) //clears hotel markers currently on display\n\t\t{\n\t\t\tmarkers.clearLayers();\t\n\t\t}\n\n\t\tdata = {'region': region};\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: \"/maps/hoteldata\",\n\t\t\tdata: data,\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(data) {\n\t\t\t\tfor (var i = data.length - 1; i >= 0; i--) {\n\t\t\t\t\tvar marker = L.marker([data[i].latitude, data[i].longitude],{icon: happy})\n\t\t\t\t\tmarker.bindPopup(data[i].id + '-' + data[i].name);\n\t\t\t\t\tmarkers.addLayer(marker);\n\t\t\t\t\thotelsDisplayed = region;\n\t\t\t\t};\n\t\t\t}\n\t\t}).done(function() {\n\t\t \tmap.addLayer(markers);\n\t\t});\n\n\t}", "function searchHotels(ll){\n console.log(\"in\",ll)\n // foursquare.clientId & foursquare.clientSecret live in keys.js which is listed about this file so you are able to access the objects\n var queryURL = \"https://api.foursquare.com/v2/venues/search?client_id=\"+foursquare.clientId+\"&client_secret=\"+foursquare.clientSecret +\"&ll=\"+ ll + \"&query=hotels&limit=8&v=20180206\";\n \n // // .get is short hand for .ajax see links below\n // // https://stackoverflow.com/questions/3870086/difference-between-ajax-and-get-and-load\n // // http://api.jquery.com/jquery.ajax/\n $.get(queryURL, function(results){\n var data = results.response.venues;\n for(var i = 0; i < data.length;i++){\n \n \n var wrap = $('<div>').addClass('hotel-card');\n var addr = data[i].location.formattedAddress.join(\",\")\n var map = \"<iframe width='300' height='300' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com/maps?&amp;q=\"+encodeURIComponent( addr ) + \n \"&amp;output=embed'></iframe>\"; \n $(wrap).html(map);\n\n var latlong = data[i].location.lat + \",\" + data[i].location.lng\n wrap.attr('data-fsqHid', data[i].id).attr('data-fsqHlatlng', latlong)\n \n var name = $('<h5>').text(data[i].name);\n var address = $('<p>').text(addr);\n $(wrap).append(name, address);\n $('#hotel-display').append(wrap)\n }\n })\n }", "function Hotel(name, totalRooms, bookedRooms) {\n\tthis.name = name;\n\tthis.rooms = totalRooms;\n\tthis.booked = bookedRooms;\n\tthis.roomsAvailable = function check() {\n\t\treturn this.totalRooms - this.bookedRooms;\n\t}\n\t//if you use literal notation you will need to return the Hotel\n\n\t//If you use object notation you will not need to return anything.\n}", "function Hotspot(id, endtime, hsobj, clickHandler, parent) {\n this.id = id; \n this.endtime = endtime;\n\n var box = hsobj.rect.split(\",\");\n var id = 'ivs-hotspot-holder-' + id;\n var holderDiv = _createElm({\n type: 'div',\n id: id,\n classes: 'ivs-hotspot-holder',\n styles: {\n 'position': 'absolute',\n 'top': box[0] + '%',\n 'left': box[1] + '%',\n 'width': box[2] + '%',\n 'height': box[3] + '%'\n }\n });\n _append(parent, [holderDiv]);\n\n //if there is a secondary image to be shown in for the hotspot, \n //use that one (creativeInfo is the one when the hotspot \"opens up\" \n //upon click)\n var image_url = (hsobj.image_url ? hsobj.image_url : hsobj.creativeInfo.thumbnail_url);\n\n var overlayImage = _createElm({\n type: 'img',\n src: image_url\n });\n\n //What is a better way to differentiate\n if (image_url.indexOf(stylesPath) == -1) {\n //i.e. it is not our own standard icons but something from IVX\n _addClass(overlayImage, 'circular--square');\n } \n \n _append(holderDiv, [overlayImage]);\n holderDiv.onclick = clickHandler;\n\n this.start = function() {\n holderDiv.style.display = 'block';\n }\n this.stop = function() {\n if (holderDiv) {\n _removeElm(holderDiv);\n holderDiv = null;\n }\n }\n \n}", "function hotSpotHoverBind() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add pulse animation\r\n\t\t\t\t\t$('.nectar_image_with_hotspots[data-hotspot-icon=\"numerical\"]').each(function () {\r\n\t\t\t\t\t\t$(this).find('.nectar_hotspot_wrap').each(function (i) {\r\n\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t$that.find('.nectar_hotspot').addClass('pulse');\r\n\t\t\t\t\t\t\t}, i * 300);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar hotSpotHoverTimeout = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.nectar_image_with_hotspots:not([data-tooltip-func=\"click\"]) .nectar_hotspot').each(function (i) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\thotSpotHoverTimeout[i] = '';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).on('mouseover', function () {\r\n\t\t\t\t\t\t\tclearTimeout(hotSpotHoverTimeout[i]);\r\n\t\t\t\t\t\t\t$(this).parent().css({\r\n\t\t\t\t\t\t\t\t'z-index': '400',\r\n\t\t\t\t\t\t\t\t'height': 'auto',\r\n\t\t\t\t\t\t\t\t'width': 'auto'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).on('mouseleave', function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\t$that.parent().css({\r\n\t\t\t\t\t\t\t\t'z-index': 'auto'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\thotSpotHoverTimeout[i] = setTimeout(function () {\r\n\t\t\t\t\t\t\t\t$that.parent().css({\r\n\t\t\t\t\t\t\t\t\t'height': '30px',\r\n\t\t\t\t\t\t\t\t\t'width': '30px'\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}, 300);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function hotelBooking() {\n\n // Comment it- No need to default Hotel Room selected on avaialbility load\n // Date: 15-Nov-2016\n //if (!vm.initCallBook)\n //{\n // //trigger to set initial object of the \n // if ($(\"#roomCount1_\" + vm.initRoomObj).length)\n // $(\"#roomCount1_\" + vm.initRoomObj).trigger(\"click\");\n //}\n\n var culture = $cookies.get(\"lang\");\n \n var hd = vm.hotelInfo[0];\n //Note: we have to choose availablity object based on the selection of the HotelRoom from Chooseavailability data.\n // var hd_available = vm.hotelAvaibility[0];// changed it..\n var json = {\n cultureid: culture,\n checkdatefrom: moment(vm.confirm_CheckInDate1).format(\"DD-MMM-YYYY\"),\n checkdateto: moment(vm.confirm_CheckOutDate1).format(\"DD-MMM-YYYY\"),\n hotelcity: hd.CityName,\n hotelid: hd.Id,\n address: hd.Address,\n mainphotoname: hd.MainPhotoName,\n hotelclass: hd.HotelClassValue,\n hotelname: hd.RoutingName,\n roomid: vm.selectedHotelRoomIDs.join(\",\"),\n uniqueid: vm.selectedHotelUniqeIDs.join(\",\"),\n accommodationtypeid: getHotelConfirmData(\"AccommodationTypeID\"),\n accommodationtypename: getHotelConfirmData(\"AccommodationTypeName\"),\n accommodationtypedescription: getHotelConfirmData(\"AccommodationTypeDescription\"),\n pricepolicytypeid: getHotelConfirmData(\"PricePolicyTypeID\"),\n pricepolicytypename: getHotelConfirmData(\"PricePolicyTypeName\"),\n singlerate: getHotelConfirmData(\"SingleRate\"),\n doublerate: getHotelConfirmData(\"DoubleRate\"),\n dailyroomprices: getHotelConfirmData(\"DailyRoomPrices\"),\n originalroomprice: getHotelConfirmData(\"OriginalRoomPrice\"),\n currencyid: getHotelConfirmData(\"CurrencyID\"),\n currencysymbol: getHotelConfirmData(\"CurrencySymbol\"),\n roomcount: vm.selectedRoomCountArray.join(\",\"),\n maxpeoplecount: getHotelConfirmData(\"MaxPeopleCountval\"),\n roomprice: getHotelConfirmData(\"RoomPrice\"),\n currencycode: getHotelConfirmData(\"CurrencyCode\"),\n hoteltypename: getHotelConfirmData(\"HotelTypeName\"),\n pricetype: getHotelConfirmData(\"PriceType\"),\n creditcardnotrequired: getHotelConfirmData(\"CreditCardNotRequired\"),\n currentcurrency: vm.selectedRoomsCurrencySymbol\n }\n \n //service call and redirect to Booking final URL\n storeHotelRoomInfo(json);\n }", "function hotelAdvisor(latitude, longitude) {\n\n fetch(\"https://travel-advisor.p.rapidapi.com/hotels/list-by-latlng?latitude=\" + latitude + \"&longitude=\" + longitude + \"&lang=en_US&hotel_class=3&limit=25&adults=2&amenities=bar_lounge&rooms=1&currency=USD&subcategory=hotel%2Cbb&nights=5\", {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"b519689459msheabfb47c1ca1bb2p18f9bcjsne0e023037538\",\n \"x-rapidapi-host\": \"travel-advisor.p.rapidapi.com\"\n }\n })\n .then(response => response.json())\n .then((data) => {\n console.log(data);\n var hotelLocationID = [];\n var hotelNameArray = [];\n\n for (i = 0; i < data.data.length; i++) {\n var hotelID = data.data[i].location_id;\n var hotelName = data.data[i].name;\n hotelLocationID.push(hotelID);\n hotelNameArray.push(hotelName);\n }\n console.log(hotelLocationID);\n console.log(hotelNameArray);\n //for loop function to get the images and names and add them to the html.\n hotelPhotos(hotelLocationID, hotelNameArray);\n })\n .catch(err => {\n console.error(err);\n });\n}", "function Hotel(name, location, couplesMax, groupsMax, couplesPrice, groupsPrice, discount) {\n // set object variables\n this.name = name;\n this.location = location;\n this.couplesMax = couplesMax;\n this.groupsMax = groupsMax;\n this.couplesPrice = couplesPrice;\n this.groupsPrice = groupsPrice;\n this.discount = discount;\n \n // set random number of available rooms\n this.couplesFree = Math.floor(Math.random() * this.couplesMax);\n this.groupsFree = Math.floor(Math.random() * this.groupsMax);\n this.couplesBooked = this.couplesMax - this.couplesFree;\n this.groupsBooked = this.groupsMax - this.groupsFree;\n \n // set methods\n this.bookCouplesRooms = function (amount) {\n var couplesRoomsBooked = 0;\n \n if (amount > 0) {\n if (this.couplesBooked + amount < this.couplesMax) {\n this.couplesBooked += amount;\n this.couplesFree -= amount;\n couplesRoomsBooked += amount;\n }\n }\n \n return couplesRoomsBooked;\n \n };\n \n this.bookGroupsRooms = function (amount) {\n var groupsRoomsBooked = 0, couplesRoomsBooked = 0;\n \n if (amount > 0) {\n if (this.groupsBooked + amount < this.groupsMax) {\n this.groupsBooked += amount;\n this.groupsFree -= amount;\n groupsRoomsBooked += amount;\n } else {\n groupsRoomsBooked += this.groupsMax = this.groupsBooked;\n couplesRoomsBooked += this.BookCouplesRooms(amount - groupsRoomsBooked);\n }\n }\n \n return { groupsRoomsBooked : groupsRoomsBooked,\n couplesRoomsBooked : couplesRoomsBooked };\n };\n}", "inicializar() {\n\n\n let uri = this.ip + \"Observacion_items\";\n this.axios.get(uri).then(response => {\n\n this.chips = response.data; \n }); /* */\n }", "function Hoteles(props) {\r\n const {\r\n filterCountry,\r\n filterPrice,\r\n filterSize,\r\n filterDateFrom,\r\n filterDateTo,\r\n filtersActives,\r\n defaultValues,\r\n sizeOptions,\r\n checkPrice,\r\n priceIcon\r\n } = props;\r\n\r\n let hotels = hotelsData;\r\n\r\n /* Filters hotels by countries */\r\n if (filterCountry !== defaultValues.COUNTRIES) {\r\n hotels = hotels.filter((hotel) => filterCountry === hotel.country);\r\n }\r\n\r\n /* Filters hotels by prices */\r\n if (filterPrice !== defaultValues.PRICES) {\r\n hotels = hotels.filter(\r\n (hotel) => parseInt(filterPrice, 10) === hotel.price\r\n );\r\n }\r\n\r\n /* Return the index of and object inside an array by its attribute */\r\n const findWithAttr = (array, attr, value) => {\r\n for (let i = 0; i < array.length; i++) {\r\n if (array[i][attr] === value) {\r\n return i;\r\n }\r\n }\r\n };\r\n\r\n /* Filters hotels by rooms */\r\n if (filterSize !== defaultValues.SIZES) {\r\n if (\r\n filterSize ===\r\n sizeOptions[findWithAttr(sizeOptions, \"size\", \"small\")].value\r\n ) {\r\n hotels = hotels.filter((hotel) => hotel.rooms <= 10);\r\n } else {\r\n if (\r\n filterSize ===\r\n sizeOptions[findWithAttr(sizeOptions, \"size\", \"medium\")].value\r\n ) {\r\n hotels = hotels.filter(\r\n (hotel) => hotel.rooms > 10 && hotel.rooms <= 20\r\n );\r\n } else {\r\n if (\r\n filterSize ===\r\n sizeOptions[findWithAttr(sizeOptions, \"size\", \"big\")].value\r\n ) {\r\n hotels = hotels.filter((hotel) => hotel.rooms > 20);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /* Filters hotels by check-in and check-out */\r\n if (filterDateFrom && filterDateTo) {\r\n if (filterDateTo >= filterDateFrom) {\r\n let format = \"YYYY-MM-DD\";\r\n let startDate = moment(filterDateFrom).format(format);\r\n let endDate = moment(filterDateTo).format(format);\r\n hotels = hotels.filter(\r\n (hotel) =>\r\n startDate >= moment(hotel.availabilityFrom).format(format) &&\r\n endDate <= moment(hotel.availabilityTo).format(format)\r\n );\r\n }\r\n }\r\n\r\n /* Creates a boolean variable that indicates if results are found \r\n or not when a filter is active */\r\n const checkResults = (hotels) => {\r\n let searchResults = false;\r\n let filterIsActive = filtersActives;\r\n if (filterIsActive) {\r\n if (Array.isArray(hotels) && hotels.length) {\r\n searchResults = true;\r\n }\r\n }\r\n return searchResults;\r\n };\r\n\r\n return (\r\n <React.Fragment>\r\n <div>\r\n {filtersActives && (\r\n <h3 className=\"searchText\">\r\n {checkResults(hotels)\r\n ? \"Estos son los resultados de tu búsqueda: \"\r\n : \"Ops...lo siento. No pudimos encontrar lo que estabas buscando. \"}\r\n </h3>\r\n )}\r\n </div>\r\n <section className=\"hotelList\">\r\n {hotels.map((hotel) => {\r\n /* Sets different icons to display in hotel cards\r\n for prices */\r\n let price = checkPrice(hotel.price, priceIcon);\r\n\r\n return (\r\n <HotelCard\r\n key={hotel.slug}\r\n img={hotel.photo}\r\n name={hotel.name}\r\n description={hotel.description}\r\n city={hotel.city}\r\n country={hotel.country}\r\n rooms={hotel.rooms}\r\n price={price}\r\n />\r\n );\r\n })}\r\n </section>\r\n </React.Fragment>\r\n );\r\n}", "function Yelp(object){\n this.name=object.name;\n this.image_url=object.image_url;\n this.price=object.price;\n this.rating=object.rating;\n this.url=object.url;\n}", "function OdysseyTileInfo() {\n this.eventDispatcher = new Odyssey.Events.EventDispatcher();\n }", "function Food(name, price) {\n let bindo = product.bind(this, name, price);\n // this.name = name;\n console.log(bindo) // ƒ product(name, price) { this.name = name; this.price = price;}\n // this.price = price;\n this.category = 'food';\n}", "function getHotels (req,res){\n const params = req.query //porque viene como parámetro en la url\n\n Hotel.find(params, (err, hotel) => {\n if(err) return res.status(500).send({message: `Error making the request: ${err}` })\n if(!hotel) return res.status(404).send({message: `The hotel does not exist`})\n //Si no ocurre nada de esto es pq si existe.\n res.status(200).send({ hotel })\n })\n /*\n Hotel.find({}).exec().then((docs) => {\n docs.forEach(function(hotel, index) {\n const address = hotel.ADDRESS.replace(/[\"]+/g, '');\n if(hotel.Latitude === undefined ){\n console.log(hotel.Latitude === undefined)\n https.get(\"https://geocoder.api.here.com/6.2/geocode.json?app_id=sNvkDXsVsZ5XFarQRCeF&app_code=T30x8qywRMP_zpZVcjRN8A&searchtext=\" + address, (resp) => {\n let data = '';\n resp.on('data', (chunk) => {\n data += chunk;\n });\n resp.on('end', () => {\n try {\n JSON.parse(data).Response.View.length;\n const coordinates = JSON.parse(data).Response.View[0].Result[0].Location.NavigationPosition[0];\n //console.log(coordinates);\n //console.log(\"i'm here \")\n Hotel.updateMany({ADDRESS: hotel.ADDRESS}, { Latitude: coordinates.Latitude, Longitude: coordinates.Longitude }, (err) => {});\n } catch(e) {}\n })\n })\n }\n });\n })*/\n //res.json({});\n}", "function bindBgs(els) {\n els.forEach(element => {\n element.style.backgroundImage = \" url('\" + element.getAttribute(\"data-img\") + \"')\"\n });\n}", "function activate() {\n WeatherFactory.getWeather('http://api.openweathermap.org/data/2.5/weather?q=palmsprings&units=imperial&APPID=fbe8d3c5bbdf529fc2c01b2859b54fa3').then(\n function(response) {\n\n //assign a variable to the reponse from the api\n vm.weather = response.data;\n\n //call function to add History, passing the name of the city searched and the time of the search\n addHistory(vm.weather.name, moment().format('MM-DD-YY h:mm:ss a'));\n },\n function(error) {\n $log.error(error);\n });\n\n }", "constructor (data) {\n this.location = data.geometry.location\n this.id = data.id;\n this.name = data.name;\n //opening_hours = { \"open_now\" : false, \"weekday_text\" : [] }\n this.opening_hours = data.opening_hours;\n this.vicinity = data.vicinity;\n this.rating = data.rating;\n this.d2a = 0;\n this.d2b = 0;\n }", "function Yelp(obj){\n this.name = obj.name;\n this.image_url = obj.image_url;\n this.price = obj.price;\n this.rating = obj.rating;\n this.url = obj.url;\n}", "function visualizarHotel() {\n let nombreHotel = this.dataset.nombre;\n\n let hotel = buscarHotelPorNombre(nombreHotel)[0];\n\n setHotelVisualizar(hotel);\n\n initMap();\n openModal()\n\n document.querySelector('#imgHotel').src = 'http://res.cloudinary.com/pbonillag/image/upload/' + hotel['fotografia'];\n document.querySelector('#lblNombre').innerHTML = 'Hotel ' + hotel['nombre'];\n\n let phoneS = hotel['telServicio'].split('');\n phoneS[8] = phoneS[7];\n phoneS[7] = phoneS[6];\n phoneS[6] = phoneS[5];\n phoneS[5] = phoneS[4];\n phoneS[4] = phoneS[3];\n phoneS[4] = '-';\n document.querySelector('#lblTelefonoServicio').innerHTML = phoneS.join('');\n document.querySelector('#lblCorreoServicio').innerHTML = hotel['correoServicio'];\n\n let phoneR = hotel['telReservacion'].split('');\n phoneR[8] = phoneR[7];\n phoneR[7] = phoneR[6];\n phoneR[6] = phoneR[5];\n phoneR[5] = phoneR[4];\n phoneR[4] = phoneR[3];\n phoneR[4] = '-';\n document.querySelector('#lblTelefonoReservacion').innerHTML = phoneR.join('');\n document.querySelector('#lblCorreoReservacion').innerHTML = hotel['correoReservacion'];\n\n document.querySelector('#lblUbicacion').innerHTML = hotel['distrito'] + ', ' + hotel['canton'] + ', ' + hotel['provincia'];\n document.querySelector('#lblDireccion').innerHTML = hotel['direccion'];\n\n mostrarEvaluaciones(hotel['nombre']);\n\n\n\n\n return false;\n}", "hent() {\n // Bruker b_id'en til å hente infor om bestillingen\n s_bestilling.InfoBestilling(this.b_id, valgt => {\n this.valgt = valgt;\n });\n // Bruker b_id'en til å hente info om varene i bestillingen\n s_bestilling.InfoBestillingVarer(this.b_id, varer => {\n this.varer = varer;\n });\n this.visInfoPop();\n }", "function onitemUpdate (data) {\n\tonitemremove(data);\n\tland.push(new land_object(data.id, data.owner, data.x, data.y, data.color)); \n}", "function buildIWContentApi(place) {\n if (place.icon) {\n document.getElementById('iw-icon').innerHTML = '<img class=\"hotelIcon\" ' +\n 'src=\"' + place.icon + '\"/>';\n }\n document.getElementById('iw-url').innerHTML = '<b>' + place.name + '</b>';\n document.getElementById('iw-address').textContent = place.address;\n\n if (place.phone) {\n document.getElementById('iw-phone-row').style.display = '';\n document.getElementById('iw-phone').textContent =\n place.phone;\n } else {\n document.getElementById('iw-phone-row').style.display = 'none';\n }\n\n // Assign a five-star rating to the hotel, using a black star ('&#10029;')\n // to indicate the rating the hotel has earned, and a white star ('&#10025;')\n // for the rating points not achieved.\n if (place.rating) {\n var ratingHtml = '';\n for (var i = 0; i < 5; i++) {\n if (place.rating < (i + 0.5)) {\n ratingHtml += '&#10025;';\n } else {\n ratingHtml += '&#10029;';\n }\n document.getElementById('iw-rating-row').style.display = '';\n document.getElementById('iw-rating').innerHTML = ratingHtml;\n }\n } else {\n document.getElementById('iw-rating-row').style.display = 'none';\n }\n\n // The regexp isolates the first part of the URL (domain plus subdomain)\n // to give a short URL for displaying in the info window.\n if (place.website) {\n var hostnameRegexp = new RegExp('^https?://.+?/');\n var fullUrl = place.website;\n var website = hostnameRegexp.exec(place.website);\n if (website === null) {\n website = 'http://' + place.website + '/';\n fullUrl = website;\n }\n document.getElementById('iw-website-row').style.display = '';\n document.getElementById('iw-website').textContent = website;\n } else {\n document.getElementById('iw-website-row').style.display = 'none';\n }\n}", "function setupHotels() {\r\n // Get current hotel choice information from localStorage\r\n var current = JSON.parse(localStorage.getItem('hotel'));\r\n var current_num = localStorage.getItem('hotNum');\r\n\r\n // Populate current hotel card template\r\n var parentDiv = $('#currentCard');\r\n var template = Handlebars.compile(document.getElementById('currentTemplate').innerHTML);\r\n var html = template(setHotelData(current));\r\n parentDiv.append(html);\r\n\r\n // Onclick to set link and chosen hotel to view\r\n document.getElementById('currentView').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('hotel'));\r\n localStorage.setItem('chosenHotNum', localStorage.getItem('hotNum'));\r\n };\r\n\r\n // Current hotel is the basic hotel\r\n if (current_num == '0') {\r\n // Populate alternative card templates\r\n parentDiv = $('#alternativeCard1');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate1').innerHTML);\r\n data = JSON.parse(localStorage.getItem('premHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n parentDiv = $('#alternativeCard2');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate2').innerHTML);\r\n data = JSON.parse(localStorage.getItem('luxHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n // Onclicks to change hotel when choose is clicked\r\n document.getElementById('alternativeBtn1').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('premHot'));\r\n localStorage.setItem('hotNum', '1');\r\n };\r\n document.getElementById('alternativeBtn2').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('luxHot'));\r\n localStorage.setItem('hotNum', '2');\r\n };\r\n\r\n // Onclicks to set link and chosen hotel to view\r\n document.getElementById('alternativeView1').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('premHot'));\r\n localStorage.setItem('chosenHotNum', '1');\r\n };\r\n document.getElementById('alternativeView2').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('luxHot'));\r\n localStorage.setItem('chosenHotNum', '2');\r\n };\r\n }\r\n\r\n // Current hotel is the premium hotel\r\n else if (current_num == '1') {\r\n // Populate alternative card templates\r\n parentDiv = $('#alternativeCard1');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate1').innerHTML);\r\n data = JSON.parse(localStorage.getItem('basicHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n parentDiv = $('#alternativeCard2');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate2').innerHTML);\r\n data = JSON.parse(localStorage.getItem('luxHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n // Onclicks to change hotel when choose is clicked\r\n document.getElementById('alternativeBtn1').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('basicHot'));\r\n localStorage.setItem('hotNum', '0');\r\n };\r\n document.getElementById('alternativeBtn2').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('luxHot'));\r\n localStorage.setItem('hotNum', '2');\r\n };\r\n\r\n // Onclicks to set link and chosen hotel to view\r\n document.getElementById('alternativeView1').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('basicHot'));\r\n localStorage.setItem('chosenHotNum', '0');\r\n };\r\n document.getElementById('alternativeView2').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('luxHot'));\r\n localStorage.setItem('chosenHotNum', '2');\r\n };\r\n }\r\n\r\n // Current hotel is the luxury hotel\r\n else if (current_num == '2') {\r\n // Populate alternative card templates\r\n parentDiv = $('#alternativeCard1');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate1').innerHTML);\r\n data = JSON.parse(localStorage.getItem('basicHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n parentDiv = $('#alternativeCard2');\r\n template = Handlebars.compile(document.getElementById('alternativeTemplate2').innerHTML);\r\n data = JSON.parse(localStorage.getItem('premHot'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n // Onclicks to change hotel when choose is clicked\r\n document.getElementById('alternativeBtn1').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('basicHot'));\r\n localStorage.setItem('hotNum', '0');\r\n };\r\n document.getElementById('alternativeBtn2').onclick = function() {\r\n localStorage.setItem('hotel', localStorage.getItem('premHot'));\r\n localStorage.setItem('hotNum', '1');\r\n };\r\n\r\n // Onclicks to set link and chosen hotel to view\r\n document.getElementById('alternativeView1').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('basicHot'));\r\n localStorage.setItem('chosenHotNum', '0');\r\n };\r\n document.getElementById('alternativeView2').onclick = function() {\r\n localStorage.setItem('link', 'hotels.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('premHot'));\r\n localStorage.setItem('chosenHotNum', '1');\r\n };\r\n }\r\n}", "function eqfeed_callback(data) {\n map.data.addGeoJson(data);\n }", "function Yelp(food){\n this.name = food.name \n this.image_url = food.image_url\n this.price = food.price\n this.rating = food.rating\n this.url = food.url\n }", "function addWifihotspotData() {\n // let's add pawn shops data\n $.getJSON( \"geojson/NYC Wi-Fi Hotspot Locations.geojson\", function( data ) {\n // ensure jQuery has pulled all data out of the geojson file\n var wifihotspot = data;\n\n // pawn shop dots\n var wifihotpotspotPointToLayer = function (Feature, latlng){\n var wifihotspotMarker= L.circle(latlng, 100, {\n stroke: false,\n fillColor: '#2ca25f',\n fillOpacity: 0.5\n });\n \n return wifihotspotMarker; \n }\n\n var WifihotspotClick = function (Feature, layer) {\n\n // let's bind some feature properties to a pop up\n layer.bindPopup(\"<strong>Name:</strong> \" + feature.properties.name+ \"<br/><strong>Location:</strong>\" + feature.properties.location + \"<br/><strong>Provider</strong>\" + feature.properties.provider);\n }\n\n // create Leaflet layer using L.geojson; don't add to the map just yet\n wifihotspotGeoJSON = L.geoJson(wifihotspot, {\n pointToLayer: wifihotspotPointToLayer,\n onEachFeature: wifihotspotClick\n });\n\n // don't add the pawn shop layer to the map yet\n\n // run our next function to bring in the Pawn Shop data\n addNeighborhoodData();\n\n });\n\n}", "function bindDataLayerListeners(dataLayer) {\n dataLayer.addListener('addfeature', refreshGeoJsonFromData);\n dataLayer.addListener('removefeature', refreshGeoJsonFromData);\n dataLayer.addListener('setgeometry', refreshGeoJsonFromData);\n}", "connectedCallback(){super.connectedCallback();this.HAXWiring=new HAXWiring;this.HAXWiring.setup(RssItems.haxProperties,RssItems.tag,this)}", "function bindInfoWindow(item, loc, code, data) {\n\t// html string to display 'weight : count'\n\tvar count_text = \"\";\n\tfor (var i = 0; i<data[\"counts\"].length; i++) {\n\t\tcount_text += i.toString() + \" : \" + data[\"counts\"][i].toString() + \"<br>\";\n\t}\n\t\n\tgoogle.maps.event.addListener(item, 'mouseover', function() {\n\t\tinfoWindow.setContent(\"<div class='info-box'><b>\" + code + \"</b><br>\" + count_text + \"</div>\");\n\t\tinfoWindow.setPosition(loc);\n\t\tinfoWindow.open(map);\n\t});\n\tgoogle.maps.event.addListener(item, 'mouseout', function() {\n\t\tinfoWindow.close();\n\t});\n\treturn item;\n}", "function addwifihotspotData() {\n $.getJSON( \"../../geojson/NYC_Wi-Fi_Hotspot_Locations.geojson\", function( data ) {\n var wifihotspot = data;\n\n var wifihotspotPointToLayer = function (Feature, latlng){\n var wifihotspotMarker= L.circle(latlng, 300, {\n fillColor: 'tomato',\n fillOpacity: 1\n });\n \n return wifihotspotMarker; \n }\n\n var wifihotspotMouseOver = function (Feature, layer) {\n\n // let's bind some feature properties to a pop up\n layer.bindPopup(\"<strong>Name:</strong> \" + Feature.properties.businessname+ \"<br/><strong>Business Type: </strong>\" + Feature.properties.businesstype +\"<br/><strong>Address:</br></strong>\" + Feature.properties.address + \"<br/><strong>Design Services Needed: </strong>\" + Feature.properties.design);\n }\n\n // create Leaflet layer using L.geojson; don't add to the map just yet\n wifihotspotGeoJSON = L.geoJson(wifihotspot, {\n pointToLayer: wifihotspotPointToLayer,\n onEachFeature: wifihotspotMouseOver\n });\n\n // don't add the pawn shop layer to the map yet\n\n // run our next function to bring in the Pawn Shop data\n addNeighborhoodData();\n\n });\n\n}", "getHotelBookings() {\n return this.hotelBooking;\n }", "function bindPushDataToGlobalListShippingLease(data) {\n // clear first the array\n listOfCustomerDropShipperLease = [];\n // check data length is not 0\n if(typeof data !== 'undefined') {\n for(var index in data) {\n listOfCustomerDropShipperLease.push({\n id: data[index].id,\n value: data[index].ship_to_location\n });\n }\n } else {\n listOfCustomerDropShipperLease = [];\n } \n \n // reset input auto complete data\n bindResetAutoCompleteShippingDataLease();\n}", "function Hotspot(hotspotId, x1, y1, width, height, caption, silent)\t//Coords & dims are in PHOTO PIXEL space\n{\n\tthis.x1 = x1;\n\tthis.y1 = y1;\n\tthis.width = width;\n\tthis.height = height;\n\t\n\tthis.silent = false;\n\tif(silent != null && silent == true)\n\t{\n\t\tthis.silent = true;\n\t}\n\t\n\tthis.id = 'hotspot_' + hotspotId;\n\t\n\tthis.caption = caption;\n\tthis.givesItem = null;\n\t\n\tthis.setGivenItem = function(item)\n\t{\n\t\tthis.givesItem = item;\n\t};\n\t\n\tthis.remove = function()\n\t{\n\t\tif(document.getElementById(this.id))\n\t\t{\n\t\t\tvar element = document.getElementById(this.id);\n\t\t\tdocument.getElementById('canvas').removeChild(element);\n\t\t}\n\t};\n\t\n\tthis.display = function()\n\t{\n\t\tif(this.givesItem != null)\n\t\t{\n\t\t\tthis.givesItem.displayOnScreen();\n\t\t}\n\t\t\n\t\tvar div = document.createElement('div');\n\t\t\n\t\tdiv.id = this.id;\n\t\t\n\t\tdiv.caption = this.caption;\n\t\tdiv.givesItem = this.givesItem;\n\t\t\n\t\tdiv.style.backgroundColor = 'transparent';\n\t\tdiv.style.position = 'absolute';\n\t\t\n\t\tdiv.style.top = this.y1 + 'px';\n\t\tdiv.style.left = this.x1 + 'px';\n\t\tdiv.style.width = this.width + 'px';\n\t\tdiv.style.height = this.height + 'px';\n\t\t//div.style.border = '1px dashed pink';\n\t\t\n\t\tdiv.className = 'hotspot';\n\t\t\n\t\tif(!this.silent)\n\t\t{\n\t\t\tdiv.style.cursor = 'pointer';\n\t\t\tdiv.onmouseover = function(){setCaption(this.caption);};\n\t\t\tdiv.onmouseout = clearCaption;\n\t\t\t\n\t\t\tdiv.onclick = function()\n\t\t\t{\n\t\t\t\tif(this.givesItem != null)\n\t\t\t\t{\n\t\t\t\t\tthis.givesItem.addToInventory();\n\t\t\t\t\tthis.givesItem = null;\n\t\t\t\t\t\n\t\t\t\t\tglobalCurrentScreen.removeHotspotAndItem(this.id);\n\t\t\t\t\t\n\t\t\t\t\tclearCaption();\n\t\t\t\t\tglobalCurrentScreen.display();\t//Refresh\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t\n\t\tdocument.getElementById('canvas').appendChild(div);\n\t};\n}", "mockHotels() {\n this.setState({\n hotels: [\n {\n destinationId: \"561413\",\n name: \"LondonHouse Chicago, Curio Collection by Hilton\",\n },\n {\n destinationId: \"235666\",\n\t name: \"London Heathrow Marriott Hotel\",\n },\n {\n destinationId: \"234896\",\n\t\t name: \"London Marriott Hotel County Hall\",\n },\n ],\n\n hotelDetails: [\n {\n address: \"85 East Wacker Drive, Chicago, IL, 60601, United States of America\",\n destinationId: \"561413\",\n price: \"$107\",\n starRating: 4.5,\n whatIsAround: [\n \"In The Loop\",\n \"Chicago Riverwalk - 1 min walk\",\n \"Grant Park - 7 min walk\",\n \"Chicago Theatre - 7 min walk\",\n \"House of Blues Chicago - 9 min walk\",\n \"Millennium Park - 10 min walk\",\n \"Art Institute of Chicago - 13 min walk\",\n \"Water Tower Place - 15 min walk\",\n \"John Hancock Center - 16 min walk\",\n \"Willis Tower - 21 min walk\",\n \"Navy Pier - 22 min walk\",\n ],\n },\n {\n address: \"Bath Road, Heathrow Airport, Hayes, England, UB3 5AN, United Kingdom\",\n destinationId: \"235666\",\n price: \"$124\",\n starRating: 4,\n whatIsAround: [\n \"In Hillingdon\",\n \"Twickenham Stadium - 5.3 mi / 8.5 km\",\n \"Kempton Racecourse - 6.6 mi / 10.6 km\",\n \"Hampton Court Palace - 8.3 mi / 13.4 km\",\n \"Windsor Castle - 8.4 mi / 13.5 km\",\n \"Thorpe Park - 9.8 mi / 15.8 km\",\n \"Hampton Court - 12 mi / 19.2 km\",\n \"Legoland - 13.3 mi / 21.4 km\",\n \"Chessington World of Adventures - 24.4 mi / 39.3 km\",\n ],\n },\n {\n address: \"London County Hall, Westminster Bridge Road, London, England, SE1 7PB, United Kingdom\",\n destinationId: \"234896\",\n price: \"$307\",\n starRating: 5,\n whatIsAround: [\n \"In London City Centre\",\n \"London Eye - 4 min walk\",\n \"Big Ben - 5 min walk\",\n \"Buckingham Palace - 20 min walk\",\n \"St. Paul's Cathedral - 28 min walk\",\n \"Hyde Park - 30 min walk\",\n \"The British Museum - 30 min walk\",\n \"Tower of London - 2.4 mi / 3.8 km\",\n \"London Stadium - 7.1 mi / 11.4 km\",\n \"O2 Arena - 8 mi / 12.8 km\",\n \"Wembley Stadium - 12.5 mi / 20.2 km\",\n ],\n },\n ],\n\n hotelPhotos: [\n {\n destinationId: \"561413\",\n\t\t imageDetails: [\n {\n imageId: 431500626,\n mediaGUID: \"7ce1e40d-f42b-4eb8-9fb9-db323b94fac4\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/7ce1e40d_z.jpg\",\n },\n {\n imageId: 391789343,\n mediaGUID: \"8ab5cac0-e9ea-45e1-8477-0289a551e00f\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/8ab5cac0_z.jpg\",\n },\n {\n imageId: 105602083,\n mediaGUID: \"e78f46c2-ca35-4398-a2ca-821c58eba188\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/e78f46c2_z.jpg\",\n },\n {\n imageId: 105602109,\n mediaGUID: \"4fdc0540-3caa-4338-9de9-2c44a9706834\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/4fdc0540_z.jpg\",\n },\n {\n imageId: 105602225,\n mediaGUID: \"6c647f92-dd23-4bc5-bdc7-2182cbdd40e7\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/6c647f92_z.jpg\",\n },\n {\n imageId: 391791720,\n mediaGUID: \"c0962bc3-1b4f-4fd9-81a2-d7e53ac1d0b0\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/c0962bc3_z.jpg\",\n },\n {\n imageId: 391791490,\n mediaGUID: \"0b2651d2-73dd-4db3-8b36-04595500ed21\",\n url: \"https://exp.cdn-hotels.com/hotels/13000000/12790000/12786700/12786616/0b2651d2_z.jpg\",\n },\n ],\n },\n {\n destinationId: \"235666\",\n\t\t\t imageDetails: [\n {\n imageId: 95096904,\n mediaGUID: \"2829b516-adc8-417d-843f-669cc35905d7\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/440000/438600/438504/2829b516_z.jpg\",\n },\n {\n imageId: 62208258,\n mediaGUID: \"1e4e5443-a89a-417f-8916-b76e3244a72e\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/440000/438600/438504/1e4e5443_z.jpg\",\n },\n ],\n },\n {\n destinationId: \"234896\",\n\t\t\t imageDetails: [\n {\n imageId: 100519485,\n mediaGUID: \"159e137a-905a-41c7-8826-84879599642f\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/159e137a_z.jpg\",\n },\n {\n imageId: 257744115,\n mediaGUID: \"6b48aa8c-eb5c-4c73-b07f-be9dd9fe3513\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/6b48aa8c_z.jpg\",\n },\n {\n imageId: 66462293,\n mediaGUID: \"bd205f95-6798-45ce-bcdf-2bf4b3ed8c7f\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/bd205f95_z.jpg\",\n },\n {\n imageId: 100519288,\n mediaGUID: \"0f60b2e1-9096-4cf6-984b-f6146ccab1c9\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/0f60b2e1_z.jpg\",\n },\n {\n imageId: 100519436,\n mediaGUID: \"a933ae79-65f0-4f0b-ba5b-17e2ba6797c6\",\n url: \"https://exp.cdn-hotels.com/hotels/1000000/20000/19100/19058/a933ae79_z.jpg\",\n },\n ],\n },\n ],\n });\n }", "function onEachfloodincboFeature(feature, layer) {\r\nbo_name = feature.properties.NAME ;\r\nfloodinc = feature.properties.FloodInc_1;\r\nonpopup = \"<b>Borough Name:</b>\"+bo_name +\"<br />\"+\"<b>Flood Incident:</b>\"+floodinc\r\n\r\nlayer.on({\r\n\tmouseover: highlightFeature,\r\n\tmouseout: resetfloodincboHighlight,\r\n\tclick: selectfloodincFeature\r\n\r\n});\r\n\r\nlayer.bindPopup(onpopup);\r\n\r\n\r\n}", "function eqfeed_callback(data) {\n map.data.addGeoJson(data);\n }", "function init() {\n map = new OpenLayers.Map(\"map-id\");\n\n // définition du fond de carte\n const wmsLayer = new OpenLayers.Layer.WMS(\"OpenLayers WMS\",\n \"http://vmap0.tiles.osgeo.org/wms/vmap0?\", {layers: 'basic'});\n\n // définition de la couche vecteur data\n let data = new OpenLayers.Layer.Vector(\"Data\", {\n styleMap: new OpenLayers.StyleMap({\n \"default\": new OpenLayers.Style({\n pointRadius: 6,\n fillColor: \"green\",\n strokeColor: '#000000',\n strokeWidth: 1\n })\n }),\n protocol: new OpenLayers.Protocol.HTTP({\n url: \"data.json\",\n format: new OpenLayers.Format.GeoJSON()\n }),\n strategies: [new OpenLayers.Strategy.Fixed()],\n isBasiclayer: false,\n displayInLayerSwitcher: true,\n });\n\n // ne marche plus mais permet en théorie de modifier les features dessinées\n let modifyControl = new OpenLayers.Control.ModifyFeature(data);\n modifyControl.mode |= OpenLayers.Control.ModifyFeature.RESIZE;\n map.addControl(modifyControl);\n modifyControl.activate();\n\n\n data.setOpacity(0.4);\n\n //Ajout de la pop up pour la couche 'data'\n let popup;\n\n //définition de la fonction de création de la pop-up\n function createPopup(feature) {\n // close existing popup\n if (popup) {\n popup.destroy();\n }\n popup = new GeoExt.Popup({\n title: feature.attributes.name,\n location: feature,\n width: 200,\n height: 130,\n html: \"<br/> Nome du site : \" + feature.attributes.name + \"<br/> <br/> Informations : \" + feature.attributes.infos + \"<br/>\",\n maximizable: true,\n collapsible: true,\n padding: '5 5 5 5'\n //items:items[0]\n });\n popup.show();\n }\n\n // relier la création de la pop up à l'evenement sur la couche data\n data.events.on({\n featureselected: function (e) {\n createPopup(e.feature);\n }\n });\n\n // Ajout des couches data et wmsLayer\n map.addLayers([wmsLayer, data]);\n\n // Fonction pour centrer la carte et définir un niveau de zoom. Ici 3.\n map.setCenter(new OpenLayers.LonLat(0, 0), 3);\n\n\n // définition de l'ensembles des contrôles que l'on souhaite permettre\n controls = {\n layerS : new OpenLayers.Control.LayerSwitcher(),\n mousePosi : new OpenLayers.Control.MousePosition(),\n scale : new OpenLayers.Control.Scale(),\n overView : new OpenLayers.Control.OverviewMap(),\n panZoom : new OpenLayers.Control.PanZoomBar(),\n point: new OpenLayers.Control.DrawFeature(data,\n OpenLayers.Handler.Point),\n line: new OpenLayers.Control.DrawFeature(data,\n OpenLayers.Handler.Path),\n polygon: new OpenLayers.Control.DrawFeature(data,\n OpenLayers.Handler.Polygon)\n };\n\n // association des controles à la carte\n for (let key in controls) {\n map.addControl(controls[key]);\n }\n\n // ajout du controle modifier les feature (not working)\n map.addControl(modifyControl);\n modifyControl.activate();\n\n // définition des actions qui seront incluses dans la toolbar de la carte\n // action pour permettre l'exploration de la couche carte\n const navAction = new GeoExt.Action({\n text: \"Explorer\",\n map: map,\n control: new OpenLayers.Control.Navigation(),\n toggleGroup: \"editing\",\n group: \"draw\",\n tooltip: \"Naviguer dans la carte\"\n });\n\n // Action qui permet de rajouter la possibilité de dessiner des points\n const drawPointAction = new GeoExt.Action({\n text: \"Points\",\n control: controls[\"point\"],\n map: map,\n toggleGroup: \"editing\",\n allowDepress: false,\n group: \"draw\",\n tooltip: \"Ajouter un point sur la carte\"\n });\n\n // Action qui permet de rajouter la possibilité de dessiner des lignes\n const drawLineAction = new GeoExt.Action({\n text: \"Lignes\",\n control: controls[\"line\"],\n map: map,\n toggleGroup: \"editing\",\n allowDepress: false,\n group: \"draw\",\n tooltip: \"Dessiner une poly-ligne sur la carte\"\n });\n\n // Action qui permet de rajouter la possibilité de dessiner des polygones\n const drawPolygonAction = new GeoExt.Action({\n text: \"Polygones\",\n control: controls[\"polygon\"],\n map: map,\n toggleGroup: \"editing\",\n group: \"draw\",\n allowDepress: false,\n tooltip: \"Dessiner un polygone sur la carte\"\n });\n\n\n // Permet de définir le format de la date\n function formatDate(value) {\n return value ? value.dateFormat('d M Y') : '';\n }\n\n // raccourcis\n const fm = Ext.form;\n\n // the column model has information about grid columns\n // dataIndex maps the column to the specific data field in\n // the data store (created below)\n const cm = new Ext.grid.ColumnModel({\n // specify any defaults for each column\n defaults: {\n sortable: true // Attention les colonne ne sont pas triable par défaut\n },\n columns: [{\n id: 'name',\n header: 'Nom du site',\n dataIndex: 'name', // correspond au champs de propriétes dans data.json\n width: 180,\n editor: new fm.TextField({\n allowBlank: false\n })\n }, {\n id: 'elevation', // permet de l'identifier pour des actions ailleurs dans le script (voir plus bas)\n header: 'Altitude',\n dataIndex: 'elevation', // correspond au champs de propriétes dans data.json\n width: 90,\n editor: new fm.NumberField({\n allowBlank: false,\n allowNegative: true\n })\n },\n {\n header: 'Light',\n dataIndex: 'light', // correspond au champs de propriétes dans data.json\n width: 130,\n editor: new fm.ComboBox({\n typeAhead: true,\n triggerAction: 'all',\n // // transform the data already specified in html\n transform: 'light',\n lazyRender: true,\n listClass: 'x-combo-list-small'\n })\n },\n {\n header: 'Price',\n dataIndex: 'price', // correspond au champs de propriétes dans data.json\n width: 70,\n align: 'right',\n renderer: 'usMoney',\n editor: new fm.NumberField({\n allowBlank: true,\n allowNegative: false,\n maxValue: 100000\n })\n },\n {\n header: 'Date d\\'ajout',\n dataIndex: 'availDate', // correspond au champs de propriétes dans data.json\n width: 95,\n renderer: formatDate,\n editor: new fm.DateField({\n format: 'm/d/y',\n minValue: '01/01/06',\n disabledDays: [0, 6],\n disabledDaysText: 'Plants are not available on the weekends'\n })\n }\n , {\n xtype: 'checkcolumn',\n header: 'Sensible?',\n dataIndex: 'sensible', // correspond au champs de propriétes dans data.json\n width: 75\n\n },\n {\n id: 'infos',\n header: 'Informations',\n dataIndex: 'infos', // correspond au champs de propriétes dans data.json\n width: 950,\n editor: new fm.TextField({\n allowBlank: false\n })\n }\n ]\n });\n\n // Création du store qui contiendra les données propriéts ecrites dans le fichier data.json\n // ici le store est également liée au layer data (ce qui permet de liée les selection entre le store et la couche vecteur)\n store = new GeoExt.data.FeatureStore({\n layer: data,\n fields: [\n {name: 'name', type: 'string'},\n {name: 'elevation', type: 'float'},\n {name: 'light', type: 'string'},\n {name: 'price', type: 'float'},\n // dates can be automatically converted by specifying dateFormat\n {name: 'availDate', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},\n {name: 'sensible', type: 'boolean'},\n {name: 'infos', type: 'string'}\n ],\n proxy: new GeoExt.data.ProtocolProxy({\n protocol: new OpenLayers.Protocol.HTTP({\n url: \"data.json\",\n format: new OpenLayers.Format.GeoJSON()\n })\n })\n });\n\n // création du panel qui permeet d'afficher le store et de la rendre modifiable avec les attributs CM et SM\n const gridPanel = new Ext.grid.EditorGridPanel({\n title: \"Feature Grid\",\n renderTo: 'editor-grid',\n autoExpandColumn: 'infos',\n collapsible: true,\n collapseMode: \"mini\",\n store: store,\n cm: cm,\n width: 1915,\n height: 200,\n sm: new GeoExt.grid.FeatureSelectionModel({\n selectControl: modifyControl.selectControl,\n singleSelect: true\n })\n });\n\n // définition de composant qui encaspule le composant carte crée précédement\n const mapPanel = new GeoExt.MapPanel({\n renderTo: 'gxmap',\n height: '100%',\n width: '100%',\n // association de la map précédement créée\n map: map,\n title: 'Carte',\n center: [1.49, 46, 73],\n zoom: 6,\n // asoocition des actions dans la toolbar\n tbar:\n [navAction, { // <-- Add the action directly to a toolbar\n text: 'Edition',\n menu: new Ext.menu.Menu({\n items: [\n new Ext.menu.CheckItem(navAction),\n new Ext.menu.CheckItem(drawPointAction),\n new Ext.menu.CheckItem(drawLineAction),\n new Ext.menu.CheckItem(drawPolygonAction),]\n }) // <-- Add the action directly to a menu\n }]\n });\n\n const layerList = new GeoExt.tree.LayerContainer({\n text: 'Fonds de carte',\n layerStore: mapPanel.layers,\n height: '100%',\n width: '100%',\n leaf: false,\n expanded: true\n });\n\n const layerTree = new Ext.tree.TreePanel({\n title: 'Gestion des couches cartographiques',\n renderTo: 'layerTree',\n root: layerList,\n height: '100%',\n collapsible: true\n });\n}", "function SuperHost(name, price, rating, location, rooms, availability, features, rate) {\n Vacation.call(name, price, rating, location, rooms, availability, features);\n this.rating = rate;\n} // object template for super host property.", "constructor(props){\n super(props);\n this.device = null;\n this.beacons = beacons.map((beacon) => new Beacon(beacon.id, beacon.x, beacon.y))\n this.state = {\n img: verdiep_0,\n verdiep_height: 0,\n verdiep_width: 0,\n active: true,\n scale_x: 0,\n scale_y: 0,\n closestBeacons: [],\n verdiep: 'Verdiep0'\n };\n this.configCanvas = this.configCanvas.bind(this);\n this.drawBeacon = this.drawBeacon.bind(this);\n this.drawBeacons = this.drawBeacons.bind(this);\n this.calcClosestBeacon = this.calcClosestBeacon.bind(this);\n }", "binds () {\n let self = this;\n\n $('.papi-property-color-picker input').each(self.showColorPicker);\n\n // Bind all new inputs when added in repeater.\n $(document).on('papi/property/repeater/added', '[data-property=\"color\"]', function () {\n $('.papi-property-color-picker input').each(self.showColorPicker);\n });\n }", "function updateOffers() {\n var offers = {};\n\n // Loop people\n people.forEach(function(person) {\n // Check if person is offering\n if (person.offering) {\n // Check if halls already has person's hall\n if (!offers.hasOwnProperty(person.offering) ||\n !Array.isArray(offers[person.offering])) {\n // If not, then initialize array\n offers[person.offering] = [];\n }\n\n // Add person to hall's array\n offers[person.offering].push({\n id: person.id,\n screenName: person.screenName\n });\n }\n });\n\n // Emit offers to all clients\n io.emit('offer update', offers);\n }", "_bind() {\n\t\tthis._bindCaption();\n\t\tthis._bindChoices();\n\t}", "function showAllHotelMap(){\n\t\n\tvar array_hotels = [];\n\tvar array_links = {};\n\t$(\"a.map-link\").each(function(i,e){\n array_hotels.push($(e).attr(\"tab\"));\n\t});\n\t$(\"span.bold-blue-text a\").each(function(i,e){\n var href = $(e).attr(\"href\");\n var h_key = href.match(/\\d+\\?/)[0].match(/\\d+/)[0];\n array_links[h_key] = $(e).outer();\n\t});\n\t\n\t$(\"#map_canvas\").html(\"\");\n $(\"#map_canvas\").mask(\"Loading...\");\n\n\t//send request to get location of current hotel and other places around it\n\t$.ajax({\n\t\turl: allHotelServiceUrl,\n\t\tdata: {'hotelIds' : array_hotels},\n\t\ttype: 'GET',\n\t\tdataType: 'JSON',\n\t\tsuccess: function(response){\n\t\t\t//process data\n\t\t\tif(response.data != false){\n\t\t\t\tvar hotel = response.data.hotel;\n\t\t\t\t\n\t\t\t\tvar places = response.data.places;\n\n\n\t\t\t\t//display the map here\n\t\t\t\tvar center = new google.maps.LatLng(places[0][\"Latitude\"], places[0][\"Longitude\"]);\n\n\t\t\t\t//initialize map with provided center\n\t\t\t\tinitializeMap(center);\n\n\t\t\t\t//info\n\t\t\t\t var html = \"<div>\" + array_links[places[0][\"EANHotelID\"].toString()] + \"<br />\" + places[0][\"Address1\"] + \"</div>\";\n\t\t\t\t var infoWindow = new google.maps.InfoWindow({\n\t\t\t\t \tcontent: html\n\t\t\t\t })\n\n\t\t\t\t//display hotel at the center of the map\n\t\t\t\tmainMarker = new google.maps.Marker({\n\t\t\t\t \tposition: center,\n\t\t\t\t \t//title: places[0][\"Name\"] + \"\\n\" + places[0][\"Address1\"] ,\n\t\t\t\t \tmap: map,\n\t\t\t\t \ticon: '/assets/hotel.png'\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//infoWindow.open(map, mainMarker);\n\t\t\t\tgoogle.maps.event.addListener(mainMarker, 'mouseover', function(){\n\t\t\t\t\t\tinfoWindow.setContent(html);\n\t\t\t\t\t\tinfoWindow.open(map, mainMarker);\n\t\t\t\t\t})\n\t\t\t\t\n\t\t\t\t//places.splice(0, 1);\n\t\t\t\tvar subInfoWindow = new google.maps.InfoWindow();\n\t\t\t\t//display other places on the map\n\t\t\t\t$.each(places, function(index, place){\n\t\t\t\t\tvar desc = place[\"Name\"] + \"\\n\" + place[\"Address1\"];\n\t\t\t\t\tvar html = \"<div>\" + array_links[place[\"EANHotelID\"].toString()] + \"<br />\" + place[\"Address1\"] + \"</div>\";\n\t\t\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\t\t\tposition: new google.maps.LatLng(place[\"Latitude\"], place[\"Longitude\"]),\n\t\t\t\t\t\t//title: desc,\n\t\t\t\t\t\tmap: map,\n\t\t\t\t \t\ticon: '/assets/hotel.png'\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t\totherMarkers.push(map,marker);\n\t\t\t\t\t//subInfoWindow.open(map, marker);\n\t\t\t\t\tgoogle.maps.event.addListener(marker, 'mouseover', function(){\n\t\t\t\t\t\tsubInfoWindow.setContent(html);\n\t\t\t\t\t\tsubInfoWindow.open(map, marker);\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t $(\"#map_canvas\").unmask();\n\t }else{\n\t \t$(\"#map_canvas\").text(\"No maps found\")\n\t \t$(\"#map_canvas\").unmask();\n\t \t//alert(\"No maps found\");\n\t \t\n\t \t\n\t }\n\t\t}\n\t})\n}", "function initOpenLayersMapLesLieux() {\n\n\t// Destruction de la cate précédente si elle existe déjà\n\tif (mapLesLieux != null) {\n\t\tmapLesLieux.setTarget(null);\n\t\tmapLesLieux = null;\n\t}\n\n\t// Liste des points\n\tvar pointFeatures = new Array();\n\tvar itemsCollection = App.Collections.itemsCollection;\n\titemsCollection.each(function(item) {\n\t\tvar cartos = item.get(\"cartos\");\n\t\tif (cartos) {\n\t\t\tif (cartos.get(\"y\") && cartos.get(\"x\")) {\n\t\t\t\tvar itemId = item.get(\"id\");\n\t\t\t\tvar motCle1 = item.get(\"motCle1\");\n\t\t\t\tvar motCle2 = item.get(\"motCle2\");\n\t\t\t\tvar motCle3 = item.get(\"motCle3\");\n\t\t\t\tvar titre = item.get(\"title\");\n\t\t\t\tvar user = item.get(\"user\").get(\"pseudo\");\n\t\t\t\tpointFeatures.push(\n\t\t\t\t\tnew ol.Feature({\n\t\t\t\t\t\tgeometry: new ol.geom.Point(ol.proj.transform([parseFloat(cartos.get(\"x\")), parseFloat(cartos.get(\"y\"))], 'EPSG:4326', 'EPSG:3857'))\n\t\t\t\t\t\t, itemId: itemId \n\t\t\t\t\t\t, motCle1: motCle1\n\t\t\t\t\t\t, motCle2: motCle2\n\t\t\t\t\t\t, motCle3: motCle3\n\t\t\t\t\t\t, titre: titre\n\t\t\t\t\t\t, pseudo: user\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t});\n\t\n\t// Rendu de la carte\n\tmapLesLieux = new ol.Map({\n\t layers: [\n\t new ol.layer.Tile({\n\t source: new ol.source.OSM({})\n\t })\n\t , new ol.layer.Vector({\n\t source: new ol.source.Vector({\n\t features: pointFeatures\n\t }),\n\t style: new ol.style.Style({\n\t image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({\n\t scale: 0.25,\n\t src: 'http://cdn.aws.chatanoo.org/mjc/nogent/divers/cercleRouge.png'\n\t })),\n\t stroke: new ol.style.Stroke({\n\t width: 3,\n\t color: [255, 0, 0, 1]\n\t }),\n\t fill: new ol.style.Fill({\n\t color: [0, 0, 255, 0.6]\n\t })\n\t })\n\t })\n\t ],\n\t target: 'carte',\n\t view: new ol.View({\n\t center: ol.proj.transform([App.Views.appView.centerLatCarte, App.Views.appView.centerLongCarte], 'EPSG:4326', 'EPSG:3857'),\n\t zoom: App.Views.appView.zoomCarte\n\t })\n\t});\n\n\t// Clic sur les points\n\tmapLesLieux.on(\"click\", function(e) {\n\t mapLesLieux.forEachFeatureAtPixel(e.pixel, function (feature, layer) {\n\t\t\tvar v = App.eventManager;\n\t\t\tif (v) v.trigger(\"itemSelection\", feature.B.itemId, null, feature.B.motCle1, feature.B.motCle2, feature.B.motCle3, feature.B.titre, feature.B.pseudo);\n\t });\n\t});\n \n \t// Change le cursor en pointer sur les points\n var target = mapLesLieux.getTarget();\n var jTarget = typeof target === \"string\" ? $(\"#\" + target) : $(target);\n // change mouse cursor when over marker\n $(mapLesLieux.getViewport()).on('mousemove', function (e) {\n var pixel = mapLesLieux.getEventPixel(e.originalEvent);\n var hit = mapLesLieux.forEachFeatureAtPixel(pixel, function (feature, layer) {\n return true;\n });\n if (hit) {\n jTarget.css(\"cursor\", \"pointer\");\n } else {\n jTarget.css(\"cursor\", \"\");\n }\n });\n}", "function bindDragHandlerToNewHost(){\r\n\t//array that hold DragHandler object that bind to new host\r\n\tvar hostDragHandler=new Array();\r\n\t//Iterating the received json data of new discovered host \r\n\tfor(i in newHostJson){\r\n\t\t//binding drag handler to new discovered host\r\n\t\tvar dh=DragHandler.attach(document.getElementById(newHostJson[i].name));\r\n\t\t//binding drag end handler function\t\t\r\n\t\tdh.dragEnd=findandmark;\r\n\t\thostDragHandler.push(dh);\r\n\t}\t\r\n}", "function bindEquipListener(){\n\t\t$('.equippable-item').click(function(){\n\t\t\tequippableItemClicked($(this).data('component-id'));\n\t\t});\n\t}", "function Bind_Obound() {\r\n}", "function pickHotel() {\n\n console.log('hello from hotel');\n for ( let i = 0 ; i < Hotel.all.length ; i++ ){\n if ( plan.budget === Hotel.all[i].hotelBudget && plan.planDays[0].dayLocation === Hotel.all[i].location ) {\n plan.planDays[0].planHotel = Hotel.all[i];\n\n }\n \n\n }\n\n}", "function onLoad() {\n // Load map.\n OpenLayers.ProxyHost = '/proxy/';\n map = new OpenLayers.Map('map');\n map.addControl(new OpenLayers.Control.LayerSwitcher());\n\n var layer = new OpenLayers.Layer.WMS('OpenLayers WMS',\n 'http://labs.metacarta.com/wms/vmap0',\n {layers: 'basic'},\n {wrapDateLine: true});\n map.addLayer(layer);\n map.setCenter(new OpenLayers.LonLat(-145, 0), 3);\n\n // Add layer for the buoys.\n buoys = new OpenLayers.Layer.Markers('TAO array');\n map.addLayer(buoys);\n\n // Add buoys. Apparently, dapper always returns the data\n // in the order lon/lat/_id, independently of the projection.\n var url = baseUrl + \".dods?location.lon,location.lat,location._id\";\n jsdap.loadData(url, plotBuoys, '/proxy/');\n\n // Read variables in each location.\n jsdap.loadDataset(baseUrl, loadVariables, '/proxy/');\n}", "function luxuryHotel() {\n this.workDay = function (day) {\n //todo \n console.log(\"Today is \", day);\n this.buildRooms = function () {\n for (var index = 1; index <= 120; index++) {\n var room = new Object(index); //TO Implement\n this.rooms.push(room);\n }\n console.log(this.rooms)\n }\n }\n this.hireEmployee = function (employee) { //dodava\n this.employees.push(employee)\n }\n\n this.rooms = this.buildRooms();\n this.employees = [];\n this.restaurant = new Object(); //TODO not implemented;\n this.employeesHired = 0;\n this.income = 0;\n this.guestServed = 0;\n this.generateHotel = function () {\n this.buildRooms();\n }\n this.generateHotel();\n}", "constructor(name,rating,distanceFromCity, wifi,\r\n\t\tpool, pricePerNight){\r\n\tthis.name=name;\r\n\tthis.rating=rating;\r\n\tthis.distanceFromCity=distanceFromCity;\r\n\tthis.wifi=wifi;\r\n\tthis.pool=pool;\r\n\tthis.pricePerNight=pricePerNight; \r\n}", "function setImages(el){\n $.ajax({\n method: 'post', url: \"https://ewserver.di.unimi.it/mobicomp/mostri/getimage.php\",\n data: JSON.stringify({session_id: session_id,target_id: el[\"id\"]}),\n dataType: 'json',\n success: function (result) {\n //----------------------\n map.on('load', function() {\n map.loadImage(\n \"data:image/png;base64,\" + result[\"img\"],\n function (error, image) {\n if (error) throw error;\n map.addImage(el[\"name\"], image);\n map.addLayer({\n 'id': el[\"id\"],\n 'type': 'symbol',\n 'source': {\n 'type': 'geojson',\n 'data': {\n 'type': 'FeatureCollection',\n 'features': [\n {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': [el[\"lon\"], el[\"lat\"]]\n }\n }\n ]\n }\n },\n 'layout': {\n 'icon-image': el[\"name\"],\n 'icon-size': 0.25\n }\n }).on('click', el[\"id\"], function(e) {\n renderFightEat(el, result[\"img\"]);\n console.log(el[\"id\"]);\n console.log(el[\"lat\"]);\n console.log(el[\"lon\"]);\n });\n }\n );\n });\n //----------------------\n },\n error: function (error) {\n console.error(error);\n }\n });\n }", "function onEachpumpstaFeature(feature, layer) {\r\nBorough = feature.properties.Borough_BN ;\r\nonpopup = \"<b>Pump Station in Borough:</b>\"+Borough;\r\n\r\nlayer.on({\r\n\tmouseover:highlightpumpstaFeature,\r\n\tmouseout:resetpumpstaHighlight,\r\n\tclick: selectpumpfloodriskFeature\r\n});\r\n\r\nlayer.bindPopup(onpopup);\r\n\r\n}", "function buildIWContent(place) {\n document.getElementById('iw-icon').innerHTML = '<img class=\"hotelIcon\" ' +\n 'src=\"' + place.icon + '\"/>';\n document.getElementById('iw-url').innerHTML = '<b><a href=\"' + place.url +\n '\">' + place.name + '</a></b>';\n document.getElementById('iw-address').textContent = place.vicinity;\n\n if (place.formatted_phone_number) {\n document.getElementById('iw-phone-row').style.display = '';\n document.getElementById('iw-phone').textContent =\n place.formatted_phone_number;\n } else {\n document.getElementById('iw-phone-row').style.display = 'none';\n }\n\n // Assign a five-star rating to the hotel, using a black star ('&#10029;')\n // to indicate the rating the hotel has earned, and a white star ('&#10025;')\n // for the rating points not achieved.\n if (place.rating) {\n var ratingHtml = '';\n for (var i = 0; i < 5; i++) {\n if (place.rating < (i + 0.5)) {\n ratingHtml += '&#10025;';\n } else {\n ratingHtml += '&#10029;';\n }\n document.getElementById('iw-rating-row').style.display = '';\n document.getElementById('iw-rating').innerHTML = ratingHtml;\n }\n } else {\n document.getElementById('iw-rating-row').style.display = 'none';\n }\n\n // The regexp isolates the first part of the URL (domain plus subdomain)\n // to give a short URL for displaying in the info window.\n if (place.website != 0) {\n var fullUrl = place.website;\n var website = hostnameRegexp.exec(place.website);\n if (website === null) {\n website = 'http://' + place.website + '/';\n fullUrl = website;\n }\n document.getElementById('iw-website-row').style.display = '';\n document.getElementById('iw-website').textContent = website;\n } else {\n document.getElementById('iw-website-row').style.display = 'none';\n }\n}", "prepareInformationService() {\n\t\t// currently i save the tv info in a file and load if it exists\n\t\tlet modelName = this.name;\n\t\ttry {\n\t\t\tlet infoArr = JSON.parse(fs.readFileSync(this.tvInfoFile));\n\t\t\tmodelName = infoArr.modelName;\n\t\t} catch (err) {\n\t\t\tthis.log.debug('webOS - tv info file does not exist');\n\t\t}\n\n\t\t// there is currently no way to update the AccessoryInformation service after it was added to the service list\n\t\t// when this is fixed in homebridge, update the informationService with the TV info?\n\t\tthis.informationService = new Service.AccessoryInformation();\n\t\tthis.informationService\n\t\t\t.setCharacteristic(Characteristic.Manufacturer, 'LG Electronics Inc.')\n\t\t\t.setCharacteristic(Characteristic.Model, modelName)\n\t\t\t.setCharacteristic(Characteristic.SerialNumber, this.mac)\n\t\t\t.setCharacteristic(Characteristic.FirmwareRevision, '1.0.0');\n\n\t\tthis.enabledServices.push(this.informationService);\n\t}", "constructor() {\n ProxyState.on('houses', _drawHouse)\n\n }", "function roomHotSpot(CpanoramaRoomname)\n{\n //$(\".pnlm-hotspot\").remove();\n \n var FloorName=$(\"#dropdown-floor\").find(\":selected\").attr(\"value\");\n \n defaultRoom={};\n defaultRoom={\n \"default\": {\n \"firstScene\": CpanoramaRoomname,\n \"sceneFadeDuration\": 1000,\n \"autoLoad\":\"true\",\n \"autoRotate\": -2, \n \"compass\": true,\n\n\n }\n};\n\n\n\nfor(var i=0;i<createHotspot.length;i++)\n{\n if(FloorName===createHotspot[i].fName)\n {\n //$.extend(a,createHotspot[i].);\n defaultRoom.scenes=createHotspot[i].scenes;\n console.log(defaultRoom);\n \n \n \n }\n}\n\n \n\n\n\n\ntargetRoom= {};\n\n viewer =pannellum.viewer('panorama',defaultRoom);\n viewer.on('mousedown', function(event) {\n // For pitch and yaw of center of viewer\n // console.log(viewer.getPitch(), viewer.getYaw());\n // For pitch and yaw of mouse location\n var coords;\n coords= viewer.mouseEventToCoords(event).toString();\n var coordinates= coords.split(',');\n pitch=coordinates[0];\n yaw=coordinates[1];\n console.log(pitch);\n console.log(yaw);\n \n targetRoom.pitch=JSON.parse(pitch);\n targetRoom.yaw=JSON.parse(yaw);\n});\n\n\n\n\n\n\n\n\n \n\n $(\"#show-roomName\").html(\"\");\n $(\"#show-roomName\").append(\"<h3 id='current-room' class='heading-position'>\"+defaultRoom[\"default\"].firstScene+\"<i style='display:inline;z-index:1000;margin-left:2px !important;' class='fa fa-fw fa-home ml-3' ></i><h3> \");\n\n}", "function bindDataLayerListeners(dataLayer) {\n dataLayer.addListener('addfeature', refreshGeoJsonFromData);\n dataLayer.addListener('removefeature', refreshGeoJsonFromData);\n dataLayer.addListener('setgeometry', refreshGeoJsonFromData);\n dataLayer.addListener('click', selectFeature);\n}", "bind() {\n this.paramname = [];\n this.paramindex = [];\n if (!this.params) return;\n console.log('watchhashcore.bind() params:', this.params);\n let paramconfs = this.params.split(';');\n for (let paramitem of paramconfs) {\n if (paramitem && paramitem.includes(',')) {\n let paramconf = paramitem.split(',');\n this.paramname.push(paramconf[0]);\n this.paramindex.push(paramconf[1]);\n } else {\n this.paramname.push(paramitem);\n this.paramindex.push(null);\n }\n }\n //register only if the customelement is readmd - contains specific function\n //handle when hash has already some params to override default\n this.handleHashChange(null);\n //register event listener\n window.addEventListener('hashchange', this.handleHashChange);\n }", "function initialize() {\n var map;\n var panorama;\n var var_latitude = 39.7715865; // Google Map Latitude\n var var_longitude = 19.997841; // Google Map Longitude\n var pin = 'images/icons/pin.svg';\n\n //Map pin-window details\n var title = \"Hotel Himara - Click to see\";\n var hotel_name = \"Hotel Himara\";\n var hotel_address = \"Lorem ipsum dolor, 25, Himara\";\n var hotel_desc = \"5 star deluxe Hotel\";\n var hotel_more_desc = \"Lorem ipsum dolor sit amet, consectetur.\";\n\n var hotel_location = new google.maps.LatLng(var_latitude, var_longitude);\n var mapOptions = {\n center: hotel_location,\n zoom: 14,\n scrollwheel: false,\n streetViewControl: false,\n styles: [{\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#444444\"\n }]\n }, {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#f5f5f5\"\n }]\n }, {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"saturation\": -100\n }, {\n \"lightness\": 45\n }]\n }, {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n }, {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#1dc1f8\"\n }, {\n \"visibility\": \"on\"\n }]\n }]\n };\n\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\n var contentString =\n '<div id=\"infowindow_content\">' +\n '<p><strong>' + hotel_name + '</strong><br>' +\n hotel_address + '<br>' +\n hotel_desc + '<br>' +\n hotel_more_desc + '</p>' +\n '</div>';\n\n var var_infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n var marker = new google.maps.Marker({\n position: hotel_location,\n map: map,\n icon: pin,\n title: title,\n maxWidth: 500,\n optimized: false,\n });\n google.maps.event.addListener(marker, 'click', function() {\n var_infowindow.open(map, marker);\n });\n panorama = map.getStreetView();\n panorama.setPosition(hotel_location);\n panorama.setPov( /** @type {google.maps.StreetViewPov} */ ({\n heading: 265,\n pitch: 0\n }));\n var openStreet = document.getElementById('openStreetView');\n if (openStreet) {\n document.getElementById(\"openStreetView\").onclick = function() {\n toggleStreetView()\n };\n }\n\n function toggleStreetView() {\n var toggle = panorama.getVisible();\n if (toggle == false) {\n panorama.setVisible(true);\n } else {\n panorama.setVisible(false);\n }\n }\n }", "function buildIWContent(place) {\n document.getElementById('iw-icon').innerHTML = '<img class=\"hotelIcon\" ' +\n 'src=\"' + place.icon + '\"/>';\n document.getElementById('iw-url').innerHTML = '<b><a href=\"' + place.url +\n '\" target=\"_blank\">' + place.name + '</a></b>';\n document.getElementById('iw-address').textContent = place.vicinity;\n\n if (place.formatted_phone_number) {\n document.getElementById('iw-phone-row').style.display = '';\n document.getElementById('iw-phone').textContent =\n place.formatted_phone_number;\n }\n else {\n document.getElementById('iw-phone-row').style.display = 'none';\n }\n\n // Assign a five-star rating to the hotel/POI, using a black star ('&#10029;')\n // to indicate the rating the hotel has earned, and a white star ('&#10025;')\n // for the rating points not achieved.\n if (place.rating) {\n var ratingHtml = '';\n for (var i = 0; i < 5; i++) {\n if (place.rating < (i + 0.5)) {\n ratingHtml += '&#10025;';\n }\n else {\n ratingHtml += '&#10029;';\n }\n document.getElementById('iw-rating-row').style.display = '';\n document.getElementById('iw-rating').innerHTML = ratingHtml;\n }\n }\n else {\n document.getElementById('iw-rating-row').style.display = 'none';\n }\n\n // The regexp isolates the first part of the URL (domain plus subdomain)\n // to give a short URL for displaying in the info window.\n if (place.website) {\n var fullUrl = place.website;\n var website = hostnameRegexp.exec(place.website);\n if (website === null) {\n website = 'http://' + place.website + '/';\n fullUrl = website;\n }\n document.getElementById('iw-website-row').style.display = '';\n document.getElementById('iw-website').innerHTML = '<a href=\"' + website +\n '\" target=\"_blank\">' + website + '</a>';\n }\n else {\n document.getElementById('iw-website-row').style.display = 'none';\n }\n}", "function loadContent() {\n \"use strict\";\n var comp, data;\n comp = Utils.adfFind$(mapPrefix + 'mapWindowData');\n if (comp) data = comp.getValue();\n if (!data) {\n console.debug('No data was loaded by loadEquipData');\n return;\n }\n data = JSON.parse(data);\n infowindow.setContent('Type : ' + data.type + ' ; ' + 'Key ' + data.key);\n }", "function vxlNotifier(){\r\n\tthis.targetList = {};\r\n\tthis.sourceList = {};\r\n \r\n}", "function applyHotspots(current_data) {\n if(typeof SNI.HGTV.Photogallery4.Hotspots === \"object\") {\n $(SNI.HGTV.Photogallery4.Hotspots.images).each(function() {\n \n var hotspotImage = this;\n if (hotspotImage.id == current_data.iid && !current_data.hotspotSet) {\n \n current_data.hotspotSet = true;\n // create the hotspots holder\n var hotspots_container = $('<div class=\"pg-hotspots\"></div>').appendTo(current_data.image_wrapper);\n \n var hotspots_products, hotspot_items_info;\n // create hot spots\n \n var list_html = [], product_info_html = [], panel_html = [];\n \n list_html.push('<h3>Products From This Photo:</h3><ul class=\"pg-hotspot-list\">');\n product_info_html.push('<ul class=\"pg-hsproducts\">');\n panel_html.push('<div class=\"pg-hotspot-panel clrfix\">' +\n '<div class=\"l\">' +\n '<div class=\"pg-close-hspanel pg-close\">' +\n '<img src=\"' + current_data.itnurl.replace('_sm.jpg', '_med.jpg') + '\" />' +\n '<span><a href=\"javascript: void(0);\">Back to this Photo</a></span>' +\n '</div>');\n \n var showProducts = function(e) {\n SNI.HGTV.Omniture.HotSpotClick(e.data.hotspot, \"c\");\n current_data.image_wrapper.fadeOut(\"fast\", function() {\n hotspots_products.find(\"ul.pg-hotspot-list li.selected\").removeClass(\"selected\");\n hotspot_items_info.hide();\n $(hotspots_products.find(\"ul.pg-hotspot-list li\")[e.data.index]).addClass(\"selected\");\n $(hotspot_items_info[e.data.index]).show();\n current_data.image_wrapper.product_panel.fadeIn(\"fast\", function() {\n current_data.image_wrapper.addClass(\"pg-hide-hotspots\");\n hsproduct_wrapper.fadeIn(\"fast\");\n });\n \n });\n };\n var hoverIn = function() {\n $(this).children().fadeIn(\"fast\");\n };\n var hoverOut = function() {\n $(this).children().fadeOut(\"fast\");\n };\n \n var product_image_url, product_description;\n \n $(hotspotImage.hotspots).each(function(index) {\n var hotspot = this;\n product_image_url = hotspot.imageURL;\n product_description = hotspot.description;\n if (product_description.length > 180) {\n product_description = product_description.substring(0, 180) + '... <a class=\"hotspot_readmore_' + index + '\" href=\"' + hotspot.url + '\">Read More</a>';\n }\n if (hotspot.imageURL === \"null\" || hotspot.imageURL == \"\" || hotspot.imageURL == null) {\n product_image_url = default_product_img_lg.src;\n }\n \n list_html.push('<li>' + hotspot.name + '</li>');\n\n product_info_html.push('<li class=\"clrfix\">'\n + '<p class=\"strong\"><a class=\"hotspot_readmore_' + index + '\" href=\"' + hotspot.url + '\" target=\"_blank\">' + hotspot.name + '</a></p>'\n + ' <div class=\"pg-hsproduct-img\"><a class=\"hotspot_readmore_' + index + '\" href=\"' + hotspot.url + '\" target=\"_blank\"><img src=\"' + product_image_url + '\" alt=\"' + hotspot.name + '\" width=\"266\" height=\"200\" /></a></div>'\n + ' <p>' + product_description + '</p>'\n + ' <a class=\"pg-hsproduct-moreinfo btn small hotspot_readmore_' + index + '\" href=\"' + hotspot.url + '\" target=\"_blank\">'\n + ' <span>More info</span></a>'\n + '</li>');\n \n var hotspotCSS = {\n left: hotspot.hotspotXPercent + \"%\",\n top: hotspot.hotspotYPercent + \"%\"\n };\n \n var hotspot_element = $('<div class=\"pg-hotspot\"><span class=\"pg-hotspot-name\">' + hotspot.name + '</span></div>').appendTo(hotspots_container);\n \n hotspot_element.css(hotspotCSS);\n \n hotspot_element.bind(\"click\", {\n hotspot: hotspot,\n index: index\n }, function(e){\n hoverOut.apply(this, [e]);\n showProducts.apply(this, [e]);\n }); \n hotspot_element.mouseover(hoverIn)\n hotspot_element.mouseout(hoverOut);\n });\n \n list_html.push('</ul>');\n product_info_html.push('</ul>');\n panel_html.push(list_html.join(\"\\n\"));\n panel_html.push('</div><div class=\"r\">');\n panel_html.push(product_info_html.join(\"\\n\"));\n panel_html.push('</div><span class=\"pg-close-btn pg-close\">close</span></div>');\n\n // create product panel\n hotspots_products = $(panel_html.join(\"\\n\")).appendTo(hsproduct_wrapper);\n current_data.image_wrapper.product_panel = hotspots_products;\n \n hotspot_items_info = hotspots_products.find(\"ul.pg-hsproducts li\");\n $(hotspot_items_info[0]).show();\n \n hotspots_products.find(\"ul.pg-hotspot-list li\").each(function(index) {\n $(this).click(function() {\n SNI.HGTV.Omniture.HotSpotClick(hotspotImage.hotspots[index], \"c\");\n hotspots_products.find(\"ul.pg-hotspot-list li.selected\").removeClass(\"selected\");\n hotspot_items_info.hide();\n $(this).addClass(\"selected\");\n $(hotspot_items_info[index]).show();\n });\n });\n\n hotspots_products.find(\".pg-close-btn, .pg-close\").click(function() {\n hsproduct_wrapper.fadeOut(\"fast\", function() {\n current_data.image_wrapper.product_panel.hide();\n current_data.image_wrapper.removeClass(\"pg-hide-hotspots\");\n current_data.image_wrapper.fadeIn(\"fast\");\n });\n });\n \n hotspots_products.find(\"ul.pg-hsproducts li\").each(function(index) {\n $(this).find(\"a.hotspot_readmore_\" + index).click(function(e) {\n SNI.HGTV.Omniture.HotSpotClick(hotspotImage.hotspots[index], \"1\");\n e.stopPropagation();\n return true;\n });\n });\n }\n });\n \n gallery_element.trigger(\"hotspot-render-complete\", {\n gallery: gallery\n });\n }\n }", "activer() {\n\t\tSprite.addEventListeners(window, this.evt.window);\n console.log(this.cellule.infoDebogage());\n }", "function Yelp ( data ){\n this.name = data.name;\n this.image_url = data.image_url;\n this.price = data.price;\n this.rating = data.rating;\n this.url = data.url;\n}", "function getHotloadData() {\n return { selection: g_Selection.selected };\n}", "function addDataServer (b) {\n for (let i = 0; i<price.length; i++){\n x=b;\n y=data.model[x]; \n price[i].innerHTML = y[i]; \n }\n }", "constructor(data) {\n this._id = data._id\n this.imgUrl = data.imgUrl\n this.price = data.price\n this.year = data.year\n this.levels = data.levels\n this.bedrooms = data.bedrooms\n this.bathrooms = data.bathrooms\n this.description = data.description\n }", "function addVenuesInfos(tipsList, dataPhotos) {\n let htmlResult = '';\n \n if (tipsList && tipsList.response.tips.items) {\n const tipsData = tipsList.response.tips.items;\n const photosData = dataPhotos.response.photos.items;\n htmlResult = '<div class=\"infowindow-content\"><h4>' + title + '</h4><div class=\"split\"></div>';\n \n //Photos\n htmlResult += '<h5> Photos </h5> <div id=\"photos-places\">';\n for(let i = 0; i < photosData.length; i++) {\n const photo = photosData[i];\n htmlResult += `<img alt=\"${title}, photo ${i + 1} by a visitor\" style=\"width: 30%; margin-right: 5px;\" src=\"${photo.prefix}150x150${photo.suffix}\" />`;\n }\n\n //Tips\n htmlResult += '</div><h5> Sweet info </h5> <ul id=\"tips-places\">';\n tipsData.forEach( tip => {\n htmlResult += '<li>' + tip.text + ' - 👍 ' + tip.likes.count + ' </li>';\n })\n htmlResult += '</ul> <p style=\"float: right; padding-right: 10px;\"><i><small>provided by Foursquare</small></i></p> </div>';\n } else { //if unsuccessful\n htmlResult = '<p class=\"network-warning\">Unfortunately, no <i>Sweet info</i> was returned for your search.</p>';\n }\n infowindow.setContent(htmlResult);\n }", "function buildIWContent(place) {\n document.getElementById('iw-icon').innerHTML = '<img class=\"hotelIcon\" ' +\n 'src=\"' + place.icon + '\"/>';\n document.getElementById('iw-url').innerHTML = '<b><a href=\"' + place.url +\n '\">' + place.name + '</a></b>';\n document.getElementById('iw-address').textContent = place.vicinity;\n if (place.formatted_phone_number) {\n document.getElementById('iw-phone-row').style.display = '';\n document.getElementById('iw-phone').textContent =\n place.formatted_phone_number;\n } else {\n document.getElementById('iw-phone-row').style.display = 'none';\n }\n // Assign a five-star rating to the hotel, using a black star ('&#10029;')\n // to indicate the rating the hotel has earned, and a white star ('&#10025;')\n // for the rating points not achieved.\n if (place.rating) {\n var ratingHtml = '';\n for (var i = 0; i < 5; i++) {\n if (place.rating < (i + 0.5)) {\n ratingHtml += '&#10025;';\n } else {\n ratingHtml += '&#10029;';\n }\n document.getElementById('iw-rating-row').style.display = '';\n document.getElementById('iw-rating').innerHTML = ratingHtml;\n }\n } else {\n document.getElementById('iw-rating-row').style.display = 'none';\n }\n // The regexp isolates the first part of the URL (domain plus subdomain)\n // to give a short URL for displaying in the info window.\n if (place.website) {\n var fullUrl = place.website;\n var website = hostnameRegexp.exec(place.website);\n if (website === null) {\n website = 'http://' + place.website + '/';\n fullUrl = website;\n }\n document.getElementById('iw-website-row').style.display = '';\n document.getElementById('iw-website').textContent = website;\n } else {\n document.getElementById('iw-website-row').style.display = 'none';\n }\n}", "init() {\n /** The holder for the AltHolder's elements and its children's elements as well */\n this.holder = document.createElement(\"div\")\n this.holder.id = \"altcolholder\"\n this.createAltRowBtn.onclick = this.addRow.bind(this)\n this.holder.append(this.createAltRowBtn)\n this.ctrlDiv.append(this.holder)\n /** the id passed to the altfilter row. Used to uniquely identify each row for export and removal operations */\n this.idCount = 0\n // attach the altfilters to the paneOb for export\n /** testing \n * @alias altFiltersState\n * @memberof Pane\n * @instance\n */\n this.paneOb.altFiltersState = {}\n\n }", "function Bind_A_Obound() {\r\n}", "function init()\n{\n var layers = [\n new ol.layer.Tile( {\n source: new ol.source.TileWMS( {\n url: 'http://demo.opengeo.org/geoserver/wms',\n params: {\n LAYERS: 'ne:NE1_HR_LC_SR_W_DR'\n }\n } )\n } ),\n new ol.layer.Tile( {\n source: new ol.source.TileWMS( {\n url: '/heatmap/heatMapView/getTile',\n params: {\n VERSION: '1.1.1'\n }\n } ),\n extent: ol.extent.buffer( [-180, -90, 180, 90], 0 )\n } )\n ];\n\n var map = new ol.Map( {\n controls: ol.control.defaults().extend( [\n new ol.control.ScaleLine( {\n units: 'degrees'\n } )\n ] ),\n layers: layers,\n target: 'map',\n view: new ol.View( {\n projection: 'EPSG:4326',\n center: [0, 0],\n zoom: 2\n } )\n } );\n\n map.on( 'moveend', function ( evt )\n {\n var map = evt.map;\n var extent = map.getView().calculateExtent( map.getSize() );\n\n console.log( extent );\n\n ['user_name', 'ip', 'layers'].forEach( function ( category )\n {\n $.ajax( {\n url: '/heatmap/heatMapView/getStatsByCategory',\n data: {\n category: category,\n bbox: extent.join( ',' ),\n max: 10\n },\n success: function ( data )\n {\n console.log( JSON.stringify( data ) );\n }\n } );\n } );\n } );\n}", "function init(){\n\t/* Initialize model and octopus*/\n\tvar model = new Model(rawData);\n\tvar octopus = new Octopus(model);\n\t/* set up Map */\n\toctopus.map = octopus.initMap();\n\n\t/* initialize map markers */\n\toctopus.places().forEach(function(place){\n\t\toctopus.createMarker(place, function(marker){\n\t\t\tmarker.setMap(octopus.map);\n\t\t\tmarker.addListener('click',function(){\n\t\t\t\toctopus.setCurrentPlace(place);\n\t\t\t});\n\t\t});\n\t});\n\t/* apply knockout bindings */\n\tko.applyBindings(octopus);\n\tviewmodel = octopus;\n}", "function featureVenues(){\n\t\tfor (i=0;i<hoods.length;i++){\n\t\t\tif (venues.neighborhood = hoods[i]){\n\t\t\t\tfeatVen = venues;\n\t\t\t\tvar x = Math.floor(Math.random() * featVen.length);\n\t\t\t\tconsole.log(\"x: \"+x);\n\t\t\t\tvenueID = featVen[x].id;\n\t\t\t\tconsole.log(\"featured venue \"+venueID);\n\t\t\t\tvenueAPI();\n\t\t\t};\n\t\t};\n\t}", "constructor(objeto,view,...parametros){\n let proxy= ProxyFactory.create(objeto, parametros, (model) => view.update(model));\n view.update(proxy);\n //retorna uma instancia no proprio construtor\n return proxy;\n }", "constructor(){\n\n\tthis.latitude = null;\n\tthis.longitude = null;\n\tthis.idStation = null;\n\tthis.listeStation = null;\n\tthis.stationsDispo = null;\n\tthis.infosStation = \"https://api.jcdecaux.com/vls/v1/stations?contract=Rouen&apiKey=297c7acc588dee590dfc9af66d6d5e174886990c\"; // url de l'api pour requette ajax\n\tthis.nom = $(\".nom\");\n\tthis.adresse = $(\".adresse\");\n\tthis.veloDispo = $(\".dispo\");\n\tthis.etats = $(\".stats\");\n\tthis.markerCarte;\n\tthis.monIcon;\n\tthis.Marker;\n\tthis.reserver;\n\tthis.nombreVelo;\n\n\n\t}", "function getData(map){\n\n //load the data\n $.ajax(\"data/hotspotInfo.geojson\", {\n dataType: \"json\",\n success: function(response){\n\n //create a leaflet GeoJSON layer and add it to the map\n geojson = L.geoJson(response, {\n style: function (feature){\n if(feature.properties.TYPE === 'hotspot_area'){\n return {color: '#3182bd',\n weight: 2,\n stroke:1};\n } else if(feature.properties.TYPE ==='outer_limit'){\n return {color: '#9ecae1',\n weight: 2,\n stroke: 0,\n fillOpacity: .5};\n }\n },\n\n\n onEachFeature: function (feature,layer) {\n var popupContent = \"\";\n if (feature.properties) {\n //loop to add feature property names and values to html string\n popupContent += \"<h5>\" + \"Region\" + \": \" + feature.properties.NAME + \"</h5>\";\n\n if (feature.properties.TYPE ===\"hotspot_area\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot\" + \"</h5>\";\n\n }\n\n\n if (feature.properties.TYPE ===\"outer_limit\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot Outer Limit\" + \"</h5>\";\n\n }\n\n\n layer.bindPopup(popupContent);\n\n };\n\n\n layer.on({\n mouseover: highlightFeature,\n mouseout: resetHighlight,\n click: zoomToFeature\n });\n layer.on({\n click: panelInfo,\n })\n }\n }).addTo(map);\n\n //load in all the biodiversity and threatened species image overlays\n var noneUrl = 'img/.png',\n noneBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var none = L.imageOverlay(noneUrl, noneBounds);\n\n \tvar amphibianUrl = 'img/amphibian_richness_10km_all.png',\n \tamphibianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var amphibians = L.imageOverlay(amphibianUrl, amphibianBounds);\n\n var caecilianUrl = 'img/caecilian_richness_10km.png',\n \tcaecilianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caecilians = L.imageOverlay(caecilianUrl, caecilianBounds);\n\n var anuraUrl = 'img/frog_richness_10km.png',\n \tanuraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var anura = L.imageOverlay(anuraUrl, anuraBounds);\n\n var caudataUrl = 'img/salamander_richness_10km.png',\n \tcaudataBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caudata = L.imageOverlay(caudataUrl, caudataBounds);\n\n var threatenedaUrl = 'img/threatened_amp.png',\n threatenedaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threateneda = L.imageOverlay(threatenedaUrl, threatenedaBounds);\n\n var birdsUrl ='img/birds.png',\n birdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var birds = L.imageOverlay(birdsUrl, birdsBounds);\n\n var psittaciformesUrl = 'img/psittaciformes_richness.png',\n psittaciformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var psittaciformes = L.imageOverlay(psittaciformesUrl, psittaciformesBounds);\n\n var passeriformesUrl = 'img/passeriformes_richness.png',\n \t passeriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var passeriformes = L.imageOverlay(passeriformesUrl, passeriformesBounds)\n\n var nonpasseriformesUrl = 'img/nonPasseriformes.png',\n nonpasseriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var nonpasseriformes = L.imageOverlay(nonpasseriformesUrl, nonpasseriformesBounds)\n\n var hummingbirdsUrl = 'img/hummingbirds.png',\n hummingbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var hummingbirds = L.imageOverlay(hummingbirdsUrl, hummingbirdsBounds)\n\n var songbirdsUrl = 'img/songbirds_richness.png',\n \tsongbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var songbirds = L.imageOverlay(songbirdsUrl, songbirdsBounds);\n\n var threatenedbUrl = 'img/threatened_birds.png',\n threatenedbBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedb = L.imageOverlay(threatenedbUrl, threatenedbBounds);\n\n var mammalsUrl = 'img/mammals.png',\n mammalsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var mammals = L.imageOverlay(mammalsUrl, mammalsBounds);\n\n var carnivoraUrl = 'img/carnivora.png',\n carnivoraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var carnivora = L.imageOverlay(carnivoraUrl, carnivoraBounds);\n\n var cetartiodactylaUrl = 'img/cetartiodactyla.png',\n cetartiodactylaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var cetartiodactyla = L.imageOverlay(cetartiodactylaUrl, cetartiodactylaBounds);\n\n var chiropteraUrl = 'img/chiroptera_bats.png',\n chiropteraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var chiroptera = L.imageOverlay(chiropteraUrl, chiropteraBounds);\n\n var eulipotyphlaUrl = 'img/eulipotyphla.png',\n eulipotyphlaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var eulipotyphla = L.imageOverlay(eulipotyphlaUrl, eulipotyphlaBounds);\n\n var marsupialsUrl = 'img/marsupials.png',\n marsupialsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var marsupials = L.imageOverlay(marsupialsUrl, marsupialsBounds);\n\n var primatesUrl = 'img/primates.png',\n primatesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var primates = L.imageOverlay(primatesUrl, primatesBounds);\n\n var rodentiaUrl = 'img/rodentia.png',\n rodentiaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var rodentia = L.imageOverlay(rodentiaUrl, rodentiaBounds);\n\n var threatenedmUrl = 'img/threatened_mammals.png',\n threatenedmBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedm = L.imageOverlay(threatenedmUrl, threatenedmBounds);\n\n //define structure of layers and overlays\n var animals = [\n {\n groupName: \"Overlays Off\",\n expanded: false,\n layers: {\n \"Overlays Off\": none\n }\n }, {\n groupName: \"Amphibians\",\n expanded: true,\n layers: {\n \"All Amphibians\": amphibians,\n \t\"Caecilian\": caecilians,\n \t\"Anura\": anura,\n \t\"Caudata\": caudata\n }\n }, {\n groupName: \"Birds\",\n expanded: true,\n layers: {\n \"Birds\": birds,\n \t\"Psittaciformes\": psittaciformes,\n \t\"Passeriformes\": passeriformes,\n \"NonPasseriformes\": nonpasseriformes,\n \"Trochilidae\": hummingbirds,\n \t\"Passeri\": songbirds\n }\n }, {\n groupName: \"Mammals\",\n expanded: true,\n layers: {\n \"All Mammals\": mammals,\n \"Carnivora\": carnivora,\n \"Cetartiodactyla\": cetartiodactyla,\n \"Chiroptera\": chiroptera,\n \"Eulipotyphla\": eulipotyphla,\n \"Marsupials\": marsupials,\n \"Primates\": primates,\n \"Rodentia\": rodentia\n }\n }, {\n groupName: \"Threatened Species\",\n expanded: true,\n layers: {\n \"Threatened Amphibians\": threateneda,\n \"Threatened Birds\": threatenedb,\n \"Threatened Mammals\": threatenedm\n }\n }\n ];\n\n var overlay = [\n {\n groupName: \"Hotspots\",\n expanded: true,\n layers: {\n \"Hotspots (Biodiversity Hotspots are regions containing high biodiversity but are also threatened with destruction. Most hotspots have experienced greated than 70% habitat loss.)\": geojson\n }\n }\n ];\n\n //style the controls\n var options = {\n group_maxHeight: \"200px\",\n exclusive: false,\n collapsed: false\n }\n\n //add heat maps and hotspot overlay to map\n var control = L.Control.styledLayerControl(animals, overlay, options);\n control._map = map;\n var controlDiv = control.onAdd(map);\n\n document.getElementById('controls').appendChild(controlDiv);\n\n $(\".leaflet-control-layers-selector\").on(\"change\", function(){\n $(\"#mapinfo\").empty();\n if ( map.hasLayer(amphibians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caecilians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(anura)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caudata)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(threateneda)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(birds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(psittaciformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(nonpasseriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(passeriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(hummingbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(songbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(threatenedb)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if(map.hasLayer(mammals)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(carnivora)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(cetartiodactyla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(chiroptera)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(eulipotyphla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(marsupials)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(primates)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(rodentia)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(threatenedm)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(geojson)){\n };\n });\n\n}\n});\n\n\n\n}", "connectedCallback(){\n registerListener('productSelected', this.handleProductSelected, this); \n registerListener('areaSelect', this.handleNewArea, this);\n registerListener('appSelected', this.update, this); \n }", "function buildIWContent(place) {\n document.getElementById(\"iw-icon\").innerHTML =\n '<img class=\"hotelIcon\" ' + 'src=\"' + place.icon + '\"/>';\n document.getElementById(\"iw-url\").innerHTML =\n '<b><a href=\"' + place.url + '\">' + place.name + \"</a></b>\";\n document.getElementById(\"iw-address\").textContent = place.vicinity;\n\n if (place.formatted_phone_number) {\n document.getElementById(\"iw-phone-row\").style.display = \"\";\n document.getElementById(\"iw-phone\").textContent =\n place.formatted_phone_number;\n } else {\n document.getElementById(\"iw-phone-row\").style.display = \"none\";\n }\n\n // Assign a five-star rating to the hotel, using a black star ('&#10029;')\n // to indicate the rating the hotel has earned, and a white star ('&#10025;')\n // for the rating points not achieved.\n if (place.rating) {\n var ratingHtml = \"\";\n for (var i = 0; i < 5; i++) {\n if (place.rating < i + 0.5) {\n ratingHtml += \"&#10025;\";\n } else {\n ratingHtml += \"&#10029;\";\n }\n document.getElementById(\"iw-rating-row\").style.display = \"\";\n document.getElementById(\"iw-rating\").innerHTML = ratingHtml;\n }\n } else {\n document.getElementById(\"iw-rating-row\").style.display = \"none\";\n }\n\n // The regexp isolates the first part of the URL (domain plus subdomain)\n // to give a short URL for displaying in the info window.\n if (place.website) {\n var fullUrl = place.website;\n var website = hostnameRegexp.exec(place.website);\n if (website === null) {\n website = \"http://\" + place.website + \"/\";\n fullUrl = website;\n }\n document.getElementById(\"iw-website-row\").style.display = \"\";\n document.getElementById(\"iw-website\").textContent = website;\n } else {\n document.getElementById(\"iw-website-row\").style.display = \"none\";\n }\n}", "constructor(ent) {\n this.ent = ent;\n this.detectPool = [];\n }", "function mostrarHotelesActivados() {\n mostraStatus = true;\n\n let sBuscar = document.querySelector('#txtBuscar').value;\n // let listaHoteles = getListaHotel();\n let listaHoteles = obtenerListaHoteles();\n let lista = [];\n lista.sort();\n if (filtroAlfabetico.checked) {\n for (let j = 0; j < listaHoteles.length; j++) {\n lista.push(listaHoteles[j]['nombre']);\n }\n lista.sort();\n } else {\n for (let j = 0; j < listaHoteles.length; j++) {\n lista.push(listaHoteles[j]['nombre']);\n }\n }\n document.querySelector('#hotelList').innerHTML = '';\n\n for (let i = 0; i < lista.length; i++) {\n\n if (buscarHotelPorNombre(lista[i])[0]['nombre'].toLowerCase().includes(sBuscar.toLowerCase())) {\n\n if (buscarHotelPorNombre(lista[i])[0]['estado'] == 'true') {\n listaHoteles = buscarHotelPorNombre(lista[i])[0];\n\n // Card\n let divHotelCard = document.createElement('div');\n divHotelCard.classList.add('hotelCard');\n divHotelCard.dataset.nombre = listaHoteles['nombre'];\n divHotelCard.addEventListener('click', visualizarHotel);\n divHotelCard.setAttribute('data-tooltip', 'Ver hotel');\n divHotelCard.classList.add('tooltip-top');\n\n // Imagen\n let divHotelImagen = document.createElement('div');\n divHotelImagen.classList.add('hotelImagen');\n let imgHotelImagen = document.createElement('img');\n imgHotelImagen.src = 'http://res.cloudinary.com/pbonillag/image/upload/' + listaHoteles['fotografia'];\n imgHotelImagen.id = 'hotelImagenLink';\n divHotelImagen.appendChild(imgHotelImagen);\n divHotelCard.appendChild(divHotelImagen);\n\n // Información\n let divHotelInformacion = document.createElement('div');\n divHotelInformacion.classList.add('hotelInformacion');\n\n let spanHotelNombre = document.createElement('span');\n spanHotelNombre.id = 'hotelNombre';\n spanHotelNombre.innerHTML = listaHoteles['nombre'];\n spanHotelNombre.dataset.hotel = listaHoteles['nombre'];\n\n let divHotelRating = document.createElement('div');\n divHotelRating.id = 'divHotelRating';\n\n let pHotelRating = document.createElement('p');\n pHotelRating.id = 'hotelRating';\n pHotelRating.classList.add('rating');\n let pHotelRating2 = document.createElement('p');\n pHotelRating2.id = 'hotelRating2';\n pHotelRating2.classList.add('rating');\n\n\n\n divHotelRating.appendChild(pHotelRating);\n divHotelRating.appendChild(pHotelRating2);\n\n let divHotelDireccion = document.createElement('div');\n let spanHotelDireccion = document.createElement('span');\n spanHotelDireccion.id = 'hotelDireccion';\n spanHotelDireccion.innerHTML = listaHoteles['direccion'];\n divHotelDireccion.appendChild(spanHotelDireccion);\n\n divHotelInformacion.appendChild(spanHotelNombre);\n divHotelInformacion.appendChild(divHotelRating);\n divHotelInformacion.appendChild(spanHotelDireccion);\n\n let buttonEvaluar = document.createElement('button');\n buttonEvaluar.type = 'button';\n buttonEvaluar.classList.add('hotelEvaluar');\n buttonEvaluar.innerHTML = 'Evaluar';\n buttonEvaluar.addEventListener('click', evaluar);\n buttonEvaluar.dataset.nombre = listaHoteles['nombre'];\n buttonEvaluar.addEventListener('mouseover', function() {\n spanHotelNombre.style.textDecoration = 'underline';\n });\n buttonEvaluar.addEventListener('mouseout', function() {\n spanHotelNombre.style.textDecoration = 'none';\n });\n\n divHotelCard.appendChild(divHotelInformacion);\n divHotelCard.appendChild(buttonEvaluar);\n\n document.querySelector('#hotelList').appendChild(divHotelCard);\n\n let evaluacion = getEvaluacionTotal(listaHoteles['nombre']);\n\n if (isNaN(evaluacion)) {\n evaluacion = 0;\n }\n\n for (let j = 0; j < Math.floor(evaluacion); j++) {\n pHotelRating.innerHTML += '<i class=\"fas fa-star\"></i>';\n }\n for (let k = 0; k < 5 - Math.floor(evaluacion); k++) {\n pHotelRating2.innerHTML += '<i class=\"fas fa-star\"></i>';\n }\n }\n }\n }\n}", "function buildIWContent(place) {\n document.getElementById('iw-icon').innerHTML = '<img class=\"hotelIcon\" ' +\n 'src=\"' + place.icon + '\"/>';\n document.getElementById('iw-url').innerHTML = '<b><a href=\"' + place.url +\n '\">' + place.name + '</a></b>';\n document.getElementById('iw-address').textContent = place.vicinity;\n\n if (place.formatted_phone_number) {\n document.getElementById('iw-phone-row').style.display = '';\n document.getElementById('iw-phone').textContent =\n place.formatted_phone_number;\n } else {\n document.getElementById('iw-phone-row').style.display = 'none';\n }\n\n // Assign a five-star rating to the hotel, using a black star ('&#10029;')\n // to indicate the rating the hotel has earned, and a white star ('&#10025;')\n // for the rating points not achieved.\n if (place.rating) {\n var ratingHtml = '';\n for (var i = 0; i < 5; i++) {\n if (place.rating < (i + 0.5)) {\n ratingHtml += '&#10025;';\n } else {\n ratingHtml += '&#10029;';\n }\n document.getElementById('iw-rating-row').style.display = '';\n document.getElementById('iw-rating').innerHTML = ratingHtml;\n }\n } else {\n document.getElementById('iw-rating-row').style.display = 'none';\n }\nif (place.website) {\n var fullUrl = place.website;\n var website = hostnameRegexp.exec(place.website);\n if (website === null) {\n website = 'http://' + place.website + '/';\n fullUrl = website;\n }\n document.getElementById('iw-website-row').style.display = '';\n document.getElementById('iw-website').textContent = website;\n } else {\n document.getElementById('iw-website-row').style.display = 'none';\n }\n}", "initiate() {\n //TODO: add db support when a new player joins \n SHIP_LIST[this.id] = this;\n initPack.ship.push(this.getInitPack());\n\n }", "function onEachFeature (feature, featureLayer) { 
 \n if (feature.properties && feature.properties.Museum && feature.properties.Activity && feature.properties.Link) {\n 
 featureLayer.bindPopup('<h7>' + feature.properties.Museum + '</h7><br>' + '<b>' + '<h8>' + feature.properties.Activity + '</h8>'+ '</b><br>' \n + '<p class=\"maptext\">' + feature.properties.Short_Description + '</p>' + '<p class=\"maplink\">' + '<a href=\"'+feature.properties.Link+'\" target=\"_blank\">' + feature.properties.Link + '</a>'+'</p>'); 
 
\n }\n 
 //if no properties, popup saying record is being updated 
 \n var popupContent = \"<p>ops, I'm being updated</p>\"; 
\n }", "constructor(name, description, ingredients, allergies, price){\n this.naam = name;\n this.beschrijving = description;\n this.ingredienten = ingredients;\n this.allergie = allergies;\n this.prijs = price;\n }", "function bindCountryList() {\n var countries = getCountries();\n for (var i = 0; i < countries.length; i++) {\n var code = countries[i].code;\n var name = countries[i].name;\n var optionTag = buildOptionTag(code, name);\n elementReferences.countries.appendChild(optionTag);\n\n }\n}", "function showHotelListings() {\n let bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (let i = 0; i < markersHotel.length; i++) {\n markersHotel[i].setMap(map);\n bounds.extend(markersHotel[i].position);\n }\n map.fitBounds(bounds);\n}", "processLocationData(obj) {\n var listData = [];\n var i;\n for(i = 0; i < obj.length; i++) {\n listData.push({\n key: obj[i][\"id\"].toString(),\n name: obj[i][\"name\"],\n imageURL: obj[i][\"imageurl\"]\n });\n }\n this.setState({\n locationsList: listData\n });\n }", "constructor(id){\n this.id = id;\n this._destinations = []; // :: [int]\n this._passengers = []; // :: [passengers]\n this._trips = 0; // :: int\n this._active = true; // :: boolean\n this._currentFloor = 1; // :: int\n }", "function setInfoWindowContents() {\n for (const store of brewData) {\n coordObj.lat = store.latitude;\n coordObj.lng = store.longitude;\n createMarker(store, coordObj);\n\n loc = new google.maps.LatLng(marker.position.lat(), marker.position.lng());\n bounds.extend(loc);\n\n hours = store.hoursOfOperation || '';\n\n address = store.streetAddress || '';\n\n description = store.brewery.description || 'No Description Avaliable';\n\n phone = store.phone || '';\n\n if (store.website === undefined) {\n website = '';\n brewName = '';\n } else {\n website = store.website;\n brewName = store.brewery.name;\n }\n\n if (store.brewery.images === undefined) {\n logo = '';\n } else {\n logo = `<img src=${store.brewery.images.medium}>`;\n }\n\n\n content = '<div id=\"content\">' +\n `<h3 id=\"firstHeading\" class=\"firstHeading\">${store.brewery.name}</h3>` +\n `<div>${logo}` +\n '<div id=\"bodyContent\">' +\n `${description} ` +\n '</div>' +\n '</br>' +\n `<div>${address}</div>` +\n '</br>' +\n `<div>${hours}</div>` +\n '</br>' +\n `<div><a href='tel:${phone}'>${phone}</div>` +\n '</br>' +\n `<div><a href=${website}>${brewName}</div>` +\n '</div>';\n\n infowindow = new google.maps.InfoWindow({\n content: content\n });\n\n setEventListner();\n }\n }" ]
[ "0.62362593", "0.606078", "0.57710654", "0.57194155", "0.5510869", "0.5441143", "0.5408162", "0.5364575", "0.5358531", "0.5357205", "0.53394836", "0.5309018", "0.5259203", "0.52282345", "0.51498795", "0.5124984", "0.51245326", "0.51194656", "0.51068634", "0.51055175", "0.5104651", "0.5098142", "0.50316626", "0.5014746", "0.5014696", "0.50076485", "0.5003565", "0.50030357", "0.49905935", "0.4982639", "0.49596208", "0.49569985", "0.49520975", "0.4941665", "0.49307153", "0.49296346", "0.49204618", "0.49196088", "0.49181518", "0.49171752", "0.49167866", "0.491653", "0.49149075", "0.49103594", "0.49096996", "0.4906025", "0.4889544", "0.4887314", "0.48844796", "0.48779374", "0.4874351", "0.48735002", "0.4872673", "0.48680976", "0.48621944", "0.48556766", "0.48522967", "0.48453808", "0.48427665", "0.48386666", "0.48182827", "0.48109376", "0.48010838", "0.47993526", "0.47936702", "0.4792644", "0.47885758", "0.47875068", "0.4785812", "0.4785511", "0.47795597", "0.47794917", "0.4777251", "0.47708866", "0.47656038", "0.47652218", "0.4762127", "0.4760398", "0.47455257", "0.47450885", "0.47440857", "0.4738443", "0.4738311", "0.4734838", "0.47319463", "0.47306332", "0.47281456", "0.47250688", "0.472105", "0.47118473", "0.47027025", "0.46950367", "0.46915883", "0.4691447", "0.46881285", "0.46834224", "0.4682352", "0.4681", "0.4679562", "0.4677306" ]
0.47650525
76
call when the date changed model popup call
function ChangeBookingDate() { //set vm object to price,roomtype,count and policy that was coming from hotelbooking previous page. vm.tempObj = { hotelid:vm.HotelInformation[0].HotelID ,pricetype:vm.hotelBookingConfirm.pricetype ,roomcount:vm.hotelBookingConfirm.roomcount ,roomid:vm.hotelBookingConfirm.roomid ,pricepolicytypeid:vm.hotelBookingConfirm.pricepolicytypeid ,hasdiscount:vm.hotelBookingConfirm.hasDiscount } var checkin= moment( vm.ChangeCheckInDate.date).format("MM/DD/YYYY") , checkout = moment( vm.ChangeCheckoutDate.date).format("MM/DD/YYYY") , Session_Code = $cookies.get("lang"); bookService.changeBookingDate(checkin , checkout , vm.tempObj.pricepolicytypeid , vm.tempObj.hotelid , Session_Code , vm.tempObj.pricetype , vm.tempObj.roomcount , vm.tempObj.roomid) .then(function (response) { vm.Countavailable = response; if(vm.Countavailable==0) { vm.CountavailableNone = true; //here it will show warning message.. } else { //debugger; //vm.HotelInformation[0].CheckDatefrom = moment(vm.ChangeCheckInDate.date).format("DD-MMM-YYYY"); //vm.HotelInformation[0].CheckDateto = moment(vm.ChangeCheckoutDate.date).format("DD-MMM-YYYY"); for (var i = 0; i < vm.HotelInformation.length; i++) { vm.HotelInformation[i].CheckDatefrom=moment(vm.ChangeCheckInDate.date).format("DD-MMM-YYYY"); vm.HotelInformation[i].CheckDateto = moment(vm.ChangeCheckoutDate.date).format("DD-MMM-YYYY"); } //call store information same as hoteldetails to recalculate pricing // No need to call store object here. it will call the GetValuewithChangeLang service API //if (vm.storeHotelConfirms && vm.HotelInformation.length > 0) { if (vm.HotelInformation.length > 0) { try{ //vm.storeHotelConfirms.checkdatefrom = vm.HotelInformation[0].CheckDatefrom; //vm.storeHotelConfirms.checkdateto = vm.HotelInformation[0].CheckDateto //storeHotelRoomInfo(vm.storeHotelConfirms); // OR we can call to update pricing. > GetValuesWhileChangelang(); var json = { currentCurrency: $cookies.get("currency"), culture: $cookies.get("lang"), hotelId: vm.tempObj.hotelid, roomPriceTypeId: vm.tempObj.pricetype, //no need to use Store Object to pass into json parameter //checkDatefrom: vm.storeHotelConfirms.checkdatefrom, //checkDateTo: vm.storeHotelConfirms.checkdateto, checkDatefrom: vm.HotelInformation[0].CheckDatefrom, checkDateTo: vm.HotelInformation[0].CheckDateto, roomCountHId: vm.tempObj.roomcount, policyTypeId: vm.tempObj.pricepolicytypeid, hotelRoomIdAry: vm.tempObj.roomid }; GetValuesWhileChangelangRe(json); } catch (tr) { vm.tempObj = null; toastr.error("Try again "+tr.Message); } } /* comment below to reagain call to calculate prices & taxes var totalNight = moment(vm.ChangeCheckoutDate.date).diff(moment(vm.ChangeCheckInDate.date), 'days'); //var totalNight = vm.HotelInformation[0].CheckDatefrom.diff(vm.HotelInformation[0].CheckDateto, 'days'); vm.HotelInformation[0].NightCount = totalNight; //update pricing. vm.convertedRoomPriceTotal = parseFloat( vm.priceForSingalNight_ConvertedRoomPriceTotal * totalNight); vm.total = parseFloat(vm.priceForSingalNight_total * totalNight); vm.totalInHotelCurrency = parseFloat(vm.priceForSingalNight_InHotelCurrency * totalNight); */ $('#changeDateModal').modal('hide'); } }).catch(function (error) { console.log(error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afterModelShown() {\n \n $('.input-group.date.start').datepicker({\n format: 'dd-mm-yyyy',\n autoclose: true\n }).on('changeDate', function (e) {\n compareDate(e.date, $(this));\n });\n\n $('.input-group.date.end').datepicker({\n format: 'dd-mm-yyyy',\n autoclose: true\n }).on('changeDate', function (e) {\n compareDate(e.date, $(this));\n });\n}", "date(e){\n this.appDate = e.detail.value; \n \n }", "function actionDateSelectedForAgendaManage(){\n\n\t}", "function refresh( keyboardChange ) {\n\t makeValid();\n\t ngModelCtrl.$setViewValue( new Date(selected) );\n\t updateTemplate( keyboardChange );\n\t }", "function getSelectedDate()\n{\nreturn curr_date;\n}", "onChange() {\n if (this.onDtChange) {\n this.onDtChange({\n $event: {\n dt: this._$filter('date')(this.dt, 'yyyy-MM-dd HH:mm:ss')\n }\n });\n }\n }", "function handleDateChange(date) {\n\t\tsetSelectedDate(date);\n\t\tconsole.log(\"date:-\", Utility.convertDate(date));\n\t\tonSelectedDate(Utility.convertDate(date));\n\t}", "function onSystemDateChanged() {\r\n updateDate();\r\n }", "onClickSaveBtn(ev){\n\tthis.hide()\n\tthis.owner.setDates(this.data)\n}", "function onDateSelection(date) {\n currentDate = date;\n $('.date-selection').val(dateSlashString(date));\n // Update daily data\n getDailyData().done(updateDataByTime);\n // Update display data\n updateVisualData();\n document.dispatchEvent(new CustomEvent('datechanged'));\n}", "function refresh( keyboardChange ) {\n makeValid();\n ngModelCtrl.$setViewValue( new Date(selected) );\n updateTemplate( keyboardChange );\n }", "function refresh( keyboardChange ) {\n makeValid();\n ngModelCtrl.$setViewValue( new Date(selected) );\n updateTemplate( keyboardChange );\n }", "function refresh( keyboardChange ) {\n makeValid();\n ngModelCtrl.$setViewValue( new Date(selected) );\n updateTemplate( keyboardChange );\n }", "function refresh( keyboardChange ) {\n makeValid();\n ngModelCtrl.$setViewValue( new Date(selected) );\n updateTemplate( keyboardChange );\n }", "function onDatePick() {\n calRadioGroupSelectItem(\"view-field\", \"custom-range\");\n refreshHtml();\n}", "changeDate(e) {\n this.props.changeDate(e.target.value)\n }", "updateModel() {\n // Get combo boxes values.\n let date = this._date.getValue();\n let month = this._month.getValue();\n let year = this._year.getValue();\n\n // Verify all values are defined.\n if (ComboDatePicker.isValidValue(date) && ComboDatePicker.isValidValue(month) && ComboDatePicker.isValidValue(year)) {\n // Validate max day of month.\n let maxDate = ComboDatePicker.maxDate(month + 1, year);\n if (date > maxDate) {\n date = maxDate;\n }\n\n // Update model.\n this.model = new Date();\n this.model.setFullYear(year);\n this.model.setMonth(month);\n this.model.setDate(date);\n\n // Validate min and max dates.\n if (this.model < this.minDate) {\n this.model = this.minDate;\n }\n if (this.model > this.maxDate) {\n this.model = this.maxDate;\n }\n } else {\n // Reset model.\n this.model = null;\n }\n\n // Hide or show days and months according to the min and max dates.\n this._date.setItems(this.getDateList());\n this._month.setItems(this.getMonthList());\n this._year.forceUpdate(); // Force update in order to remove/disable the placeholder.\n\n // Invoke callback.\n if (this.changeCallback) {\n this.changeCallback(this, this.model);\n }\n }", "function refresh( keyboardChange ) {\n makeValid();\n ngModel.$setViewValue( new Date(selected) );\n updateTemplate( keyboardChange );\n }", "function changeActivityDate(){\n\t$(\"select[id^='dateSelect']\").change(function(){\n\t\t$(\"#activityPopUp\").block({ message: '<div style=\"position:absolute; left:100px; top:0px\" ><img src=\"images/ajax-loader (1).gif\" /></div>' });\n\t\tCLICKED_ITEM_ID=$(this).attr('id');\n\t\tvar idSplit=$(this).attr('id').split(\"-\");\n\t\tvar param=\"newDate=\"+$(this).val()+\"&searchType=\"+idSplit[3]+\"&itemId=\"+idSplit[2]+\"&resultIndex=\"+idSplit[1]+\"&itemIndex=\"+idSplit[5]+\"&isDateChanged=\"+isDateChanged;\n\t\tdoAjax(\"ChangeDateActivitySearchController\", param, changeActivityDateCallBack, \"\", \"json\");\n\t});\n}", "function datepickerchange_event_trigger() {\n $('#datetimepicker').trigger('dp.change');\n}", "function changeDate(e){\n var _v = e.target.value;\n lastSelectedDay = _v;\n mapL.changeDate(_v);\n mapR.changeDate(_v);\n chartL.changeDate(_v);\n chartR.changeDate(_v);\n}", "function datepickerupdate_event_trigger() {\n $('#datetimepicker').trigger('dp.update');\n}", "function refresh( keyboardChange ) {\n\t\t\tmakeValid();\n\t\t\tngModelCtrl.$setViewValue( new Date(selected) );\n\t\t\tupdateTemplate( keyboardChange );\n\t\t}", "function optionChanged(optDate) {\r\n\r\n updateDailyChart(optDate);\r\n selectedDate = optDate;\r\n}", "function DateUpdater() { }", "function Ezdatejoindate(Ide, JIde, fIde, errmsg) {\n $(Ide).on('dp.change', function (e) {\n \n if (e.oldDate !== null) {\n var ab = 1;\n if (new Date(Ezsetdtpkdate($(JIde).val())) <= new Date(Ezsetdtpkdate($(Ide).val()))) {\n ab = 0;\n }\n if (ab == 0) {\n $(fIde).focus();\n $(fIde).select();\n }\n else {\n $(Ide).focus();\n $(Ide).select(); \n $(Ide).val(EzdteTblPkEdit(new Date()));\n EzAlerterrtxt(errmsg);\n }\n }\n });\n}", "function dateChange(newDate, type) {\n view_model.error = false; // reset and check for error again upon change\n if (type === 'dateSince') {\n if (newDate <= view_model.dateSinceOptions.maxDate) {\n dateService.setDateSince(newDate);\n view_model.dateUntilOptions.minDate = new Date(dateService.getDateSince().getTime() + (1000 * 60 * 60 * 24 * 14));\n } else {\n view_model.dateSince = dateService.getDateSince(); // out of range; correct it to original value\n }\n } else if (type === 'dateUntil') {\n if (newDate >= view_model.dateUntilOptions.minDate && newDate <= view_model.dateUntilOptions.maxDate) {\n dateService.setDateUntil(newDate);\n view_model.dateSinceOptions.maxDate = new Date(dateService.getDateUntil().getTime() - (1000 * 60 * 60 * 24 * 14));\n } else {\n view_model.dateUntil = dateService.getDateUntil(); //out of range; correct to original value\n }\n } else if (type === 'days') {\n if (newDate < 14) {\n view_model.error = true; // minimum 14 days interval\n } \n dateService.setDateSince(new Date(dateService.getDateUntil().getTime() - (1000 * 60 * 60 * 24 * newDate)));\n view_model.dateSince = dateService.getDateSince();\n view_model.dateUntilOptions.minDate = new Date(dateService.getDateSince().getTime() + (1000 * 60 * 60 * 24 * 14));\n }\n dateService.setDays(daysBetween(dateService.getDateSince(),dateService.getDateUntil()));\n view_model.days = dateService.getDays();\n if (view_model.days < 14) {\n view_model.error = true;\n }\n }", "function fndateEventHandler() {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\t$scope.date = $.datepicker.formatDate('dd-mm-yy', $(\"#activityDate\").datepicker(\"getDate\"));\n\t\t$scope.$apply();\n}", "function onChange(date, dateString) {\n\n }", "_handleDateChange(selectedDate) {\n this.props.handleDateChange(selectedDate);\n }", "function datepickerview_event_register() {\n $('#datetimepicker').on('dp.update', function(e){\n if(e.change == 'M' || e.change == null) {\n var initdata = $('.datepicker-days tbody td').eq(CAL_FIRST_DAY).attr(\"data-day\");\n var lastdata = $('.datepicker-days tbody td').eq(CAL_LAST_DAY).attr(\"data-day\");\n var serialized = \"init=\"+initdata+\"&last=\"+lastdata;\n ajax_req(php_crash, serialized, datepicker_fill, datepicker_fill_error);\n }\n });\n}", "function OnIsDropDownOpenChanged(/*DependencyObject*/ d, /*DependencyPropertyChangedEventArgs*/ e) \r\n {\r\n\t\tvar dp = d instanceof DatePicker ? d : null;\r\n// Debug.Assert(dp != null);\r\n\r\n var newValue = e.NewValue;\r\n if (dp._popUp != null && dp._popUp.IsOpen != newValue) \r\n { \r\n dp._popUp.IsOpen = newValue;\r\n if (newValue) \r\n {\r\n dp._originalSelectedDate = dp.SelectedDate;\r\n \r\n //cym comment\r\n// // When the popup is opened set focus to the DisplayDate button. \r\n// // Do this asynchronously because the IsDropDownOpen could\r\n// // have been set even before the template for the DatePicker is \r\n// // applied. And this would mean that the visuals wouldn't be available yet. \r\n//\r\n// dp.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate() \r\n// {\r\n// // setting the focus to the calendar will focus the correct date.\r\n// dp._calendar.Focus();\r\n// }); \r\n }\r\n } \r\n }", "function fndateEventHandler() {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\t$scope.date = $.datepicker.formatDate('dd-mm-yy', $(\"#activityDate\").datepicker(\"getDate\"));\n\t$scope.$apply();\n}", "firstUpdated(e){}", "dateChange(){\n if (this.date.start.getTime() > this.date.end.getTime())\n this.date.end = this.date.start;\n }", "function DateFilterOnchange() {\n BindOrReloadPurchaseTable('Apply');\n}", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }", "handleChangeDate(value) {\n this.changeSearchWithType(null, null, value);\n }", "function onChangeDatepicker(){\n vm.dateString = getFormattedDateString(vm.datepickerStartDate,\n vm.datepickerEndDate);\n performDateSearch();\n }", "function updateDate(){\n LetterDay.changeDay(curDay);\n Schedule.changeDay(curDay);\n refresh();\n }", "function f_tcalUpdate (n_selectedDate, b_keepOpen) {\n var e_activeInput = document.getElementById(s_activeDateInputID);\n if (!e_activeInput) return;\n d_date = new Date(n_selectedDate);\n if (b_keepOpen) {\n var e_calendar = document.getElementById(TCAL_CONFIG.cssprefix);\n if (!e_calendar || e_calendar.style.visibility != 'visible') return;\n e_calendar.innerHTML = f_getCalendarHTML(d_date, e_activeInput);\n }\n else {\n e_activeInput.value = f_tcalDateToString(d_date, TCAL_CONFIG.format);\n f_closeAllCalendars();\n $(e_activeInput).blur();\n $(e_activeInput).change();\n }\n}", "function EzdateCond(EfIde, EnIde, errmsg) {\n $(EfIde).on('dp.change', function (e) {\n \n if (e.oldDate !== null) {\n var ab = 1;\n if (new Date(Ezsetdtpkdate($(EfIde).val())) >= new Date(Ezsetdtpkdate($(EnIde).val()))) {\n ab = 0;\n }\n if (ab == 1) { \n $(EfIde).focus();\n $(EfIde).select();\n $(EfIde).val(EzdteTblPkEdit(new Date()));\n EzAlerterrtxt(errmsg);\n }\n }\n });\n}", "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n this._previewStart = this._previewEnd = null;\n this._changeDetectorRef.markForCheck();\n }", "function dateUpdate()\n {\n var id = $(this).attr('id') || '';\n var baseId = id.substr(0, id.lastIndexOf('_'));\n var objects = false;\n if (baseId == $baseId)\n {\n objects = $widgets;\n }\n else if (baseId == $baseRangeId)\n {\n objects = $rangeWidgets;\n }\n\n $('#'+baseId).val(objects.month.val() + '/' + objects.day.val() + '/' + objects.year.val());\n }", "function viewDate(appuntamento_id, appuntamento_utente_id, appuntamento_title, appuntamento_start, appuntamento_luogo, appuntamento_descrizione){\n\n $('#popup-appuntamento-seleziona').hide();\n $('#popup-appuntamento-more').show();\n\n $('#popup-appuntamento-img').attr('data-id', appuntamento_id);\n\n $('#popup-appuntamento-title').attr('data-utente_id', appuntamento_utente_id);\n $('#popup-appuntamento-title').val(appuntamento_title);\n $('#popup-appuntamento-title').button(\"refresh\");\n\n $('#popup-appuntamento-data').val( appuntamento_start.split(' ')[0] );\n $('#popup-appuntamento-orario').val( appuntamento_start.split(' ')[1] );\n\n if(appuntamento_luogo != \"null\"){\n $('#popup-appuntamento-luogo').val(appuntamento_luogo);\n }else{\n $('#popup-appuntamento-luogo').val('');\n };\n\n if(appuntamento_descrizione != \"null\"){\n $('#popup-appuntamento-descrizione').val(appuntamento_descrizione);\n }else{\n $('#popup-appuntamento-descrizione').val('');\n };\n\n $('#popup-appuntamento').popup('open');\n\n}", "dateChanged(changedData) {\n const value = changedData.day;\n const isLeft = changedData.isLeft;\n if (isLeft) {\n this.fromDate = value;\n if (this.fromDate.isAfter(this.toDate, 'date')) {\n this.toDate = this.fromDate.clone();\n }\n }\n else {\n this.toDate = value;\n if (this.toDate.isBefore(this.fromDate, 'date')) {\n this.fromDate = this.toDate.clone();\n }\n }\n this.setFromToMonthYear(this.fromDate, this.toDate);\n if (this.isAutoApply() && (this.options.singleCalendar || !isLeft) && this.fromDate) {\n this.toggleCalendarVisibility(false);\n this.setRange();\n this.emitRangeSelected();\n }\n }", "onTimeChanged () {\n this.view.renderTimeAndDate();\n }", "handleDateClick(event){\n this.currentSelectedDate = event.currentTarget.getAttribute(\"data-id\");\n console.log('onItemSelected:::',this.currentSelectedDate);\n const selectedDate = new Date(this.currentYear, this.currentMonth, event.target.value);\n console.log('selectedDate-->'+selectedDate);\n this.handleSelectedDate(this.currentSelectedDate);\n //fire an event to set payoff date variable in Parent comp\n const selectedEvent = new CustomEvent(\"seldate\", {\n detail: {\n selectedDateInChild: this.currentSelectedDate\n }\n });\n // Dispatches the event.b\n this.dispatchEvent(selectedEvent);\n }", "function DPC_onEditControlChange(event){DatePickerControl.onEditControlChange(event);}", "function handleDateSelection(date, instance) {\n console.log(\"before: \" + environment.addedMinDate);\n\n\t\tswitch(instance) {\n\t\t\tcase \"from\":\n\t\t\t\tenvironment.addedMinDate = date;\n\t\t\t break;\n\t\t\tcase \"to\":\n\t\t\t\tenvironment.addedMaxDate = date;\n\t\t\t break;\t\t\n\t\t}\n\n console.log(\"after: \" + environment.addedMinDate);\n }", "function OnDisplayDateEndChanged(/*DependencyObject*/ d, /*DependencyPropertyChangedEventArgs*/ e) \r\n { \r\n\t\tvar dp = d instanceof DatePicker ? d : null;\r\n Debug.Assert(dp != null); \r\n\r\n dp.CoerceValue(DatePicker.DisplayDateProperty);\r\n }", "_dateSelected(event) {\n const date = event.value;\n if (this.selected instanceof DateRange ||\n (date && !this._dateAdapter.sameDate(date, this.selected))) {\n this.selectedChange.emit(date);\n }\n this._userSelection.emit(event);\n }", "function OnSelectedDateChanged(/*DependencyObject*/ d, /*DependencyPropertyChangedEventArgs*/ e) \r\n {\r\n /*DatePicker*/var dp = d instanceof DatePicker ? d : null; \r\n// Debug.Assert(dp != null);\r\n\r\n /*Collection<DateTime>*/var addedItems = new Collection();\r\n /*Collection<DateTime>*/var removedItems = new Collection(); \r\n /*DateTime?*/var addedDate;\r\n /*DateTime?*/var removedDate; \r\n\r\n dp.CoerceValue(DatePicker.DisplayDateStartProperty);\r\n dp.CoerceValue(DatePicker.DisplayDateEndProperty); \r\n dp.CoerceValue(DatePicker.DisplayDateProperty);\r\n\r\n addedDate = e.NewValue;\r\n removedDate = e.OldValue; \r\n\r\n if (dp.SelectedDate != null) \r\n { \r\n /*DateTime*/var day = dp.SelectedDate;\r\n dp.SetTextInternal(dp.DateTimeToString(day)); \r\n\r\n // When DatePickerDisplayDateFlag is TRUE, the SelectedDate change is coming from the Calendar UI itself,\r\n // so, we shouldn't change the DisplayDate since it will automatically be changed by the Calendar\r\n if ((day.Month != dp.DisplayDate.Month || day.Year != dp.DisplayDate.Year) && !dp._calendar.DatePickerDisplayDateFlag) \r\n {\r\n dp.SetCurrentValueInternal(DatePicker.DisplayDateProperty, day); \r\n } \r\n\r\n dp._calendar.DatePickerDisplayDateFlag = false; \r\n }\r\n else\r\n {\r\n dp.SetWaterMarkText(); \r\n }\r\n\r\n if (addedDate != null) \r\n {\r\n addedItems.Add(addedDate); \r\n }\r\n\r\n if (removedDate != null)\r\n { \r\n removedItems.Add(removedDate);\r\n } \r\n\r\n dp.OnSelectedDateChanged(new CalendarSelectionChangedEventArgs(DatePicker.SelectedDateChangedEvent, removedItems, addedItems));\r\n\r\n// DatePickerAutomationPeer peer = UIElementAutomationPeer.FromElement(dp) as DatePickerAutomationPeer;\r\n// // Raise the propetyChangeEvent for Value if Automation Peer exist\r\n// if (peer != null)\r\n// { \r\n// var addedDateString = addedDate.HasValue ? dp.DateTimeToString(addedDate.Value) : \"\";\r\n// var removedDateString = removedDate.HasValue ? dp.DateTimeToString(removedDate.Value) : \"\"; \r\n// peer.RaiseValuePropertyChangedEvent(removedDateString, addedDateString); \r\n// }\r\n }", "function initDatePicker() {\n var date = document.querySelector(\"input[type='date']\");\n\n function todayClickBack(){\n date.value = getCurrentJsonDate().split('T')[0];\n update();\n }\n\n getComponent('pick-date-bn').addEventListener('click',function () {\n if(!date.classList.contains('cur')){\n date.classList.add('cur');\n this.classList.add('selected');\n date.disabled = false;\n getComponent('today').addEventListener('click',todayClickBack);\n getComponent('today').classList.add('cur');\n }else{\n date.classList.remove('cur');\n getComponent('today').classList.remove('cur');\n getComponent('today').removeEventListener('click',todayClickBack);\n date.value = null;\n date.disabled = true;\n this.classList.remove('selected');\n update();\n }\n })\n date.addEventListener('change',function (e) {\n console.log(date.value);\n update();\n })\n}", "function test_service_dialog_date_datetime_picker_dynamic_dialog() {}", "_openPopup() {\n this._rangeInput._openDatepicker();\n }", "_openPopup() {\n this._rangeInput._openDatepicker();\n }", "function fninstantEventHandler() {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\t$scope.instant = $.datepicker.formatDate('dd-mm-yy', $(\"#instantDate\").datepicker(\"getDate\")),\n\t\t$scope.$apply();\n}", "function datepickerchange_event_register() {\n $('#datetimepicker').on('dp.change', function(e){\n var date;\n\n if(e != null)\n date = moment(e.date).format('L');\n else\n date = moment();\n\n var serialized = \"date=\"+date;\n ajax_req(php_crash, serialized, table_fill, table_fill_error);\n datepickerupdate_event_trigger();\n });\n}", "function changeDateCallBack(data,div){\n\treplaceExistingResult(data, div);\t\n\tchangeActivityDate();\n\tbindCallPopup();\n\tchangePrice();\n\t\n\t//bind detail view close button function\n\t$(\"#detailViewCloseButton\").unbind('click');\n\t$(\"#detailViewCloseButton\").bind(\"click\", function() {\n\t\t$.unblockUI();\t\t\t\n\t\t$(\"#detailItem\").html(\"\");\n\t});\n\t\n\t//bind detail view close function(clicking outer space)\n\t$(\".blockOverlay\").unbind('click');\n\t$(\".blockOverlay\").bind(\"click\", function() {\n\t\t$.unblockUI();\t\t\t\n\t\t$(\"#detailItem\").html(\"\");\n\t});\n\t\n\t//bind change activity date/time button function\n\t$(\"div[id^='addActivityBtn-']\").unbind('click');\n\t$(\"div[id^='addActivityBtn-']\").bind(\"click\", function() {\n\t\tIS_FILTER_ALREADY_APPLIED=false;\n\t\tIS_SORT_ALREADY_APPLIED=false;\n\t\tselectAlternativeItem($(this),'activity'); //select alternatative activity\n\t});\n\t\n\trenderImages();\n\t $(\".blockPage\").removeAttr(\"style\");\n\t $(\".blockPage\").attr(\"style\",updateBlockUIStyle(\"activityPopUp\"));\n}", "$onChanges(changesObj) {\n if (changesObj.overrideValue.currentValue !== null && changesObj.overrideValue.currentValue !== undefined) {\n this.picker.date = changesObj.overrideValue.currentValue;\n }\n }", "change() {\n\t\tthis.props.onUpdate(this.props.index, this.state.pastDate);\n this.setState({pastDate: !this.state.pastDate});\n }", "function OnDisplayDateStartChanged(/*DependencyObject*/ d, /*DependencyPropertyChangedEventArgs*/ e) \r\n {\r\n\t\tvar dp = d instanceof DatePicker ? d : null;\r\n// Debug.Assert(dp != null);\r\n\r\n dp.CoerceValue(DatePicker.DisplayDateEndProperty);\r\n dp.CoerceValue(DatePicker.DisplayDateProperty); \r\n }", "onChange() {\n let format = this.listObj.value;\n this.datepickerInstance.format = format;\n }", "onDateChange(dates) {\n const task = this.get('actions.dateChangeTask');\n\n return task.perform(dates);\n }", "onClose(selectedDates, dateStr) {\n this.$emit('update:modelValue', dateStr);\n }", "function myDatePicker_dateSelected(page){\n page.children.flexLayout1.children.textFlex.children.dateLabel.text = definedDate;\n}", "handleRefresh() {\n this.updateToday();\n }", "function m_aux_Update(obj_stock, fechaInicio, fechaFin) {\n document.getElementById(\"inicio\").value = formatDate(fechaInicio);\n document.getElementById(\"fin\").value = formatDate(fechaFin);\n obj_stock.e_update_click();\n}", "_changeReleaseDate(evt) {\n var newState = this._mergeWithCurrentState({\n releaseDate: evt.target.value\n });\n\n this._emitChange(newState);\n}", "function dateChange(date) {\n newRequest(current_base, date);\n}", "function onCurrentModelChange() {\n // Set the current model handle variable.\n currentModelHandle = currentModelSelect.value;\n \n // Change the property display values.\n onCurrentPropertyChange();\n}", "function fninstantEventHandler() {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\t$scope.fromDate = $.datepicker.formatDate('dd-mm-yy', $(\"#fromDate\").datepicker(\"getDate\")),\n\t$scope.toDate = $.datepicker.formatDate('dd-mm-yy', $(\"#toDate\").datepicker(\"getDate\")),\n\t\t\n $scope.$apply();\n}", "function update() {\r\n\t\t\r\n\t\tvar selections = cenGrid.getSelections();\r\n\t\tif (selections.length > 0) {\r\n\t\t\twin.show();\r\n\t\t\tform.getForm().reset();\r\n\t\t\tvar record = cenGrid.getSelectionModel().getSelected();\r\n\t\t\tform.getForm().loadRecord(record);\r\n\t\t\trealStartDate.setValue(record.get('startDate'));\r\n\t\t\trealEndDate.setValue(record.get('endDate'));\r\n\t\t\tif(index==cenGrid.getStore().getCount()){\r\n\t\t\t\tlastModifyTime.setValue('');\r\n\t\t\t}else{\r\n Ext.get('lastRepairDate').dom.value = cenGrid.getStore().getAt(index).get('startDate'); \t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tExt.Msg.alert('提示', '请从列表中选择需要修改的记录!');\r\n\t\t}\r\n\t}", "setNewDate() {\n var date = new Date(window.event.target.getAttribute('date'));\n // handle dates outside the range\n if (self.datePicker.max !== null && date > self.datePicker.max) {\n date = self.datePicker.max;\n } else if (self.datePicker.min !== null && date < self.datePicker.min) {\n date = self.datePicker.min;\n }\n\n // Set the new value to the supplied field\n document.getElementById(self.datePicker.id).value = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate();\n // bubble up an onchange event to let the browser know the value has changed\n var event = new Event('change', {bubbles: true});\n document.getElementById(self.datePicker.id).dispatchEvent(event);\n\n // Set the current date to the selected date\n self.datePicker.current = new Date(date);\n\n // Hide the date picker\n self.hideDatePicker();\n }", "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n }", "function setModalInfo() {\n $(\"#eventDetailsForm\").trigger(\"reset\");\n\n const $eventDate = $(\"#eventDate\");\n datepicker();\n $eventDate.data('daterangepicker').setStartDate(new Date($.now()));\n $eventDate.data('daterangepicker').setEndDate(new Date($.now()));\n}", "function calPrevious()\n{\nprevdate= getCalValue();\nlocation.reload();\nsetSelectedMonth(-1,prevdate);\n}", "handleDateToogle(date, e) {\n this.props.dispatch(storePersonalizedDateSelection(date, e.target.value));\n }", "function CalendarPopup_tmpReturnFunction(y,m,d) \r\n{ \r\n\tif (window.CalendarPopup_targetInput!=null) \r\n\t{\r\n\t\tvar d = new Date(y,m-1,d,0,0,0);\r\n\t\twindow.CalendarPopup_targetInput.value = formatDate(d,window.CalendarPopup_dateFormat);\r\n\t}\r\n\telse alert('Use setReturnFunction() to define which function will get the clicked results!'); \r\n}", "updateTodaysDate() {\n const currentView = this.currentView;\n let view;\n if (currentView === 'month') {\n view = this.monthView;\n }\n else if (currentView === 'year') {\n view = this.yearView;\n }\n else {\n view = this.multiYearView;\n }\n view._init();\n }", "updateTodaysDate() {\n const currentView = this.currentView;\n let view;\n if (currentView === 'month') {\n view = this.monthView;\n }\n else if (currentView === 'year') {\n view = this.yearView;\n }\n else {\n view = this.multiYearView;\n }\n view._init();\n }", "onChangeView(view) {\n // console.log(dp1.getCell('2021-01-01', 'month'))\n }" ]
[ "0.70628345", "0.6869198", "0.664149", "0.65964466", "0.65794146", "0.65463597", "0.6531577", "0.65286547", "0.6464555", "0.6461296", "0.6405077", "0.6405077", "0.6405077", "0.6405077", "0.64026755", "0.6399691", "0.63875544", "0.6387227", "0.6381962", "0.6353457", "0.63090265", "0.63037044", "0.63011837", "0.6297492", "0.6267906", "0.624317", "0.621822", "0.6217809", "0.62127346", "0.6189", "0.6187205", "0.6181928", "0.61790067", "0.61768544", "0.61714256", "0.61661637", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61402065", "0.61399865", "0.61289984", "0.6127802", "0.6109152", "0.6108783", "0.60709786", "0.6057599", "0.60495913", "0.6032544", "0.60297734", "0.60138875", "0.60081404", "0.5999268", "0.59716874", "0.59503293", "0.59445125", "0.5938565", "0.59314966", "0.59311897", "0.59311897", "0.5919425", "0.5882376", "0.58822507", "0.58801883", "0.5878099", "0.58732265", "0.5865459", "0.58402514", "0.58361256", "0.58296657", "0.582555", "0.5823158", "0.58178437", "0.5804087", "0.58028996", "0.5793049", "0.5788016", "0.57835054", "0.57795244", "0.5766328", "0.57470953", "0.57421935", "0.5724043", "0.5719336", "0.5719336", "0.57178473" ]
0.0
-1
call this function to reupdate price and counts.
function GetValuesWhileChangelangRe(json) { bookService.getValuesWhileChangelangRe(json).then(function (response) { //debugger; SelectedHotelAfterChangeDate(response); }).catch(function (error) { vm.tempObj = null; toastr.error(error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePrices() {\n}", "function updateprice(){\n\n}", "refresh() {\n if (this.date && this.price)\n this.update(this.date, this.price);\n }", "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}", "updatePrice(){\n if( this.price > 0 ){\n this.price -= 1;\n }\n\n this.sellIn -= 1;\n\n if( this.sellIn < 0 ){\n if( this.price > 0 ) this.price -= 1;\n }\n }", "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 }", "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 }", "updatePriceFromPricing () {\n this.config.display.amount = this.pricing.totalNow;\n this.config.display.currency = this.pricing.currencyCode;\n }", "updatePrice() {\n\t\treturn this.products.map((product) => {\n\t\t\tproduct.updatePrice();\n\t\t\tproduct.updateSellInDays();\n\t\t\treturn product;\n\t\t});\n\t}", "function updatePrice(rate, quantity) {\n totalPrice += rate * quantity;\n console.log(totalPrice);\n updateDomPrice();\n }", "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 }", "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 }", "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 }", "function changeAmount(){\n updateCurrentCost();\n updateAmortization();\n updateTotalCookPerSecChain();\n}", "function reCalculateIncrease(id){\n //get price for peice \n // #P_id is id div for price & substring to remove $ sign\n var price = parseInt($(\"#P_\"+id).text().substring(1));\n //get quantity\n var pecies = parseInt($(\"#V_\"+id).val()) + 1 ;\n $(\"#V_\"+id).val(pecies);\n //edit total for pecies \n $(\"#T_\"+id).text(\"$\"+( pecies*price) );\n \n //edit total and sub total price\n var total = parseInt($(\"#subTotal\").text().substring(1));\n $(\"#subTotal\").text(\"$\"+(total + price));\n $(\"#total\").text(\"$\"+(total + price));\n }", "reloadBookCount()\n {\n this.getNumberOfAvailableBooks();\n }", "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 }", "function updatePriceFunction(cupID) {\r\n\t// update price on current row\r\n\t$(\"tr[name=\" + cupID + \"] text[name=cup-price]\").text(\r\n\t\t\tlistCup[cupID].getPrice());\r\n\tconsole\r\n\t\t\t.log(\"update cup \" + cupID + \", Price: \"\r\n\t\t\t\t\t+ listCup[cupID].getPrice());\r\n\t// update total price\r\n\tupdateTotalPriceFunction();\r\n}", "function updatePrice(Id, price) {\n getElement(Id + \"-price\").innerText = price;\n updateTotal();\n}", "function updatePrice() {\n var sum = 0;\n for(var i = 0; i < $scope.currentItems.length; i++) {\n sum += $scope.currentItems[i].price;\n }\n\n $scope.totalCost = sum + (sum * taxRate);\n $scope.totalCost = Math.floor($scope.totalCost);\n console.log($scope.totalCost);\n }", "function refreshSingleArticleCount(article){\n\n if ( article ) {\n if (article.couponFreeItem) return;\n\n var articleId = article.articleId;\n var quantity = article.quantity;\n var $el = $('#count_' + articleId);\n\n if ($el.length > 0) {\n $el.val(quantity);\n $el.data('count', quantity);\n\n showProductInCartStatus(articleId);\n }\n }\n}", "function updateTotalCartPricing() {\r\n\t $('.cart .pricing').text(formatAsMoney(cart.subtotal));\r\n\t }", "function reset(){\n counter = 0;\n loadProducts()\n}", "function updateTotalCookPerSecChain(){\n updateTotalCookPerSec();\n \n if(dist[item]){\n updateTotalDistribution();\n }\n else{\n updateTotalProduction();\n }\n \n updateTimeToGet();\n updateEfficiency();\n}", "function updateTotal() {\n\n}", "function OTPPriceUpdate(value) {\n console.log(value, 'OTPPriceUpdate');\n\n setOTPSelectedOption(value)\n setPrice(value.value)\n setDiscountedPrice(value.discount_price > 0 ? value.discount_price : value.value)\n }", "resetModalInfo() {\n this.total_price = this.collection.data[this.current_product_index].price;\n this.check_list = [];\n this.check_option_list = [];\n this.show_option = false;\n this.show_price = false;\n }", "function updateSales(count, iid){\n connection.query(\"UPDATE products SET product_sales = product_sales + price * ? WHERE item_id = ?\", [count, iid], function (err, res, fields){\n })\n }", "update(updateData) {\n this.askNewPriceLevels.clear();\n this.bidNewPriceLevels.clear();\n updateData = updateData[0];\n this.askUpdated = false;\n this.bidUpdated = false;\n\n let price = updateData[0];\n let count = updateData[1];\n let size = updateData[2];\n\n if (count === 0) {\n let container;\n if (size === -1) {\n this.askUpdated = true;\n container = this.ask;\n } else {\n this.bidUpdated = true;\n container = this.bid;\n }\n let removeIndex = container.length;\n for (let i = 0; i < container.length; i++) {\n if (container[i][3] === price) {\n removeIndex = i;\n break;\n }\n }\n container.splice(removeIndex, 1);\n\n } else if (count > 0) {\n let total = Math.abs(price * size);\n\n let newRow = [\n 0,\n total,\n Math.abs(size),\n price\n ];\n\n //bids\n if (size > 0) {\n //append row\n this.bidUpdated = true;\n if (this.bid.length === 0 || price < this.bid[this.bid.length - 1][3]) {\n this.bid.push(newRow);\n this.bidNewPriceLevels.add(price);\n } else {\n\n for (let i = 0; i < this.bid.length; i++) {\n //update row\n if (this.bid[i][3] === price) {\n this.bid[i][2] = Math.abs(size);\n this.bid[i][1] = Math.abs(this.bid[i][2] * price);\n break;\n }\n //insert row\n if (price > this.bid[i][3]) {\n this.bid.splice(i, 0, newRow);\n this.bidNewPriceLevels.add(price);\n break;\n }\n }\n }\n //update sum\n let sum = 0;\n for (let i = 0; i < this.bid.length; i++) {\n sum += this.bid[i][1];\n this.bid[i][0] = sum;\n }\n }\n //asks\n if (size < 0) {\n //append row\n this.askUpdated = true;\n if (this.ask.length === 0 || price > this.ask[this.ask.length - 1][3]) {\n this.ask.push(newRow);\n this.askNewPriceLevels.add(price);\n } else {\n\n\n for (let i = 0; i < this.ask.length; i++) {\n //update row\n if (this.ask[i][3] === price) {\n this.ask[i][2] = Math.abs(size);\n this.ask[i][1] = Math.abs(this.ask[i][2] * price);\n break;\n }\n //insert row\n if (price < this.ask[i][3]) {\n this.ask.splice(i, 0, newRow);\n this.askNewPriceLevels.add(price);\n break;\n }\n }\n }\n //update sum\n let sum = 0;\n for (let i = 0; i < this.ask.length; i++) {\n sum += this.ask[i][1];\n this.ask[i][0] = sum;\n }\n }\n }\n return true;\n }", "function updateDomPrice() {\n dom.sPrice.innerHTML = totalPrice - deliveryCharges;\n\n dom.tPrice.innerHTML = totalPrice === deliveryCharges ? 0 : totalPrice;\n }", "updatePrice() {\n for (var i = 0; i < this.products.length; i++) {\n updateValues.updateFunction(this.products[i]);\n }\n\n return this.products;\n }", "function handleUpdate(e) {\n\tfor (let name in updatedQuantity) { // sample updatedQuantity: {usmc fitness book: \"20\", usmc pt shirt 1: \"9\"}\n\t\tcart.updateCart(name, +updatedQuantity[name])\n\t}\n\treRenderTableBody();\n\trenderCartTotal();\n}", "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}", "function refresh() {\n $(\"#subtotal\").empty();\n let subtotal = Number(\n (beefTacoCount * 5 + chickenTacoCount * 6 + shrimpTacoCount * 8).toFixed(\n 2\n )\n );\n let tax = Number((subtotal * 0.05).toFixed(2));\n let total = tax + subtotal;\n $(\"#subtotal\").append(subtotal);\n $(\"#tax\").empty();\n $(\"#tax\").append(tax);\n $(\"#total\").empty();\n $(\"#total\").append(total);\n }", "function recomputeSelTotals() {\n \n resetTotal( $scope.selTotal ) ;\n for( var i=0; i<$scope.buyTxns.length; i++ ) {\n var txn = $scope.buyTxns[i] ;\n if( txn.selected ) {\n $scope.selTotal.costPrice += txn.valueAtCost ;\n }\n } \n }", "function updateAllAdSubTotal() {\n var advertisementList = $scope.advertisementList\n $scope.subTotal = priceCalculator.allAdSubtotal(advertisementList);\n }", "function update() {\n calculateMonthlyPayment(values);\n updateMonthly(monthlyPayment);\n }", "function SubscribePriceUpdate(value) {\n\n console.log(value, 'SubscribePriceUpdate');\n\n setSubscribeSelectedOption(value)\n setPrice(value.value)\n setDiscountedPrice(value.discount_price > 0 ? value.discount_price : value.value)\n }", "function updateSelectedCount() {\n const selectedSeats = document.querySelectorAll('.row .seat.selected');\n const seatsIndex = [...selectedSeats].map(seat => [...seats].indexOf(seat));\n localStorage.setItem('selectedSeats', JSON.stringify(seatsIndex));\n const selectedSeatsCount = selectedSeats.length;\n count.innerText = selectedSeatsCount;\n var tickettotal = selectedSeatsCount * ticketPrice;\n total.innerText = tickettotal;\n \n if (isNaN(ticketPrice)){\n $(\"#tickets\").text(\"🎟️ Tickets: \"+ selectedSeatsCount + \" x $0\");\n }\n else {\n $(\"#tickets\").text(\"🎟️ Tickets: \"+ selectedSeatsCount + \" x $\" + ticketPrice); \n}\n if (isNaN(ticketPrice)){\n total.innerText = 0\n tickettotal = 0\n taxAmt = 0 \n totalPrice = 0\n }\n console.log(tickettotal);\ncalculateSubtotal(tickettotal);\n \n}", "function updateCurrentPrice(){\r\n shoppingCart.currentPrice = 0;\r\n\r\n // We iterate over shopping cart object keys in order to calculate the current price\r\n Object.keys(shoppingCart).forEach((key) => {\r\n if(key !== 'currentPrice'){\r\n shoppingCart.currentPrice += shoppingCart[key].quantity * shoppingCart[key].price;\r\n }\r\n });\r\n\r\n // We update the value on the HTML and prevent float comma\r\n document.querySelector('.current-price').innerHTML = Math.round(shoppingCart.currentPrice * 100 + Number.EPSILON ) / 100;\r\n}", "updateServings(type){\n //update servings based on dec or inc\n const newServings=type==='dec'? this.servings-1:this.servings+1;\n\n //update ingredients\n this.ingredients.forEach(ing=>{\n ing.count*= (newServings/this.servings)\n });\n this.servings= newServings;\n console.log(this.ingredients,this.servings);\n }", "buy() {\n this.amount --;\n this.price ++;\n }", "function refreshTotalCount() {\n\t\t\tconsole.log(\"refreshTotalCount()\");\n LDBTotalCountAPI.get(function(data){\n vm.total_count = data.total_count;\n });\n }", "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}", "function refreshCount() {\n\tsetCount('manager');\n\tsetCount('employee');\n}", "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}", "updateServings(type) {\n const servings = type === \"dec\" ? this.servings - 1 : this.servings + 1;\n\n this.ingredients.forEach(ingredient => {\n ingredient.count *= servings / this.servings;\n });\n this.servings = servings;\n }", "function updateTotal(){\n\t\tvar sum = 0;\n\t\t$(\".cart_items>.item\").each(function(i,v){\n\t\t\tsum += $(v).data(\"price\") * $(v).find(\".cart_cloth_num\").text();\n\t\t});\n\t\t$(\".cart_total\").text(sum);\n\t}", "function refreshTotalCount() {\n NonMutantCellLineTotalCountAPI.get(function(data){\n vm.total_count = data.total_count;\n });\n }", "updateServerings(updateType) {\n //Servings\n const newServings = (updateType === 'dec' ? this.servings - 1 : this.servings + 1);\n\n //Ingredients\n this.ingredients.forEach(ing => {\n ing.qty *= (newServings / this.servings); //this.servings is the old value\n });\n\n //Update servings property\n this.servings = newServings;\n }", "function increase() {\n var holdCount1 = count + 1;\n setCount(holdCount1);\n var holdItem1 = props;\n window.localStorage.setItem(JSON.stringify(holdItem1), holdCount1);\n cartContext.setCartTotal(calTotal());\n }", "function updateOrder(){\r\n ticket.costCurrent = 0;\r\n ticket.passChoice = getSelectedRadioButton(\"pass\");\r\n ticket.noOfAdults = parseInt(txtNoOfAdults.value);\r\n ticket.noOfChildren = parseInt(txtNoOfChildren.value);\r\n ticket.duration = getSelectedRadioButton(\"dur\");\r\n ticket.annualPass = parseInt(txtAnnualPass.value);\r\n ticket.foodToken = parseInt(txtFoodToken.value);\r\n retrievePrices();\r\n}", "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 }", "function refreshTotalCount() {\n AlleleFearTotalCountAPI.get(function(data){\n vm.total_count = data.total_count;\n });\n }", "function updateCurrentCost(){\n \n}", "function updateValues(count){\n $(\"#decCount\").text(count);\n }", "updateSum () {\n const totals = document.getElementsByClassName('product__price')\n let productsPrice = 0\n\n // Add all the total prices of the products\n for (const total of totals) {\n productsPrice += parseInt(total.textContent.replace('€', ''), 10)\n }\n\n // Updates the subtotal and total in the summary\n const productsTotal = app.getProductsCount()\n document.querySelector('.products__total').textContent = productsTotal + ' article' + (productsTotal > 1 ? 's' : '')\n document.querySelector('.subtotal__price').textContent = '€ ' + productsPrice\n document.querySelector('.total__price').textContent = '€ ' + productsPrice\n }", "updateServings(type) {\n // Increase OR Decrease servings\n const newServings = type === 'dec' ? this.servings - 1 : this.servings + 1;\n\n // Change the ingredients count\n this.ingredients.forEach(ingredient => {\n ingredient.count *= newServings / this.servings;\n });\n\n // Append new servings to the instance\n this.servings = newServings;\n }", "function recalc(){\n\t\t$(\"[id^=total_item]\").calc(\"qty * price\", { qty: $(\"input[name^=qty_item_]\"), price: $(\"[id^=price_item_]\") }, function (s){ return \"$\" + s.toFixed(2); },\n\t\t\t\t// define the finish callback, this runs after the calculation has been complete\n\t\t\t\tfunction ($this){\n\t\t\t\t// sum the total of the $(\"[id^=total_item]\") selector\n\t\t\t\tvar sum = $this.sum();\n\t\t\t\t// round the results to 2 digits\n\t\t\t\t$(\"#grandTotal\").text(\"$\" + sum.toFixed(2));\n\t});\n}", "_updateOrderBook(orderBook, price, newAmount) {\n let oldAmount = orderBook[price];\n if (oldAmount === undefined) {\n oldAmount = 0;\n }\n let amountDiff = newAmount - oldAmount;\n orderBook[price] = newAmount;\n return amountDiff;\n }", "function updateOrder(imgsrc, drinkname, price) {\n\tif(counter < 15) {\n\t\tmenuModal.style.display = \"none\";\n\t\taddToOrder(imgsrc, drinkname, price);\n\t\tvar num = price.replace(' kr','');\n\t\tvar numParse = parseInt(num);\n\t\ttotalOrder += numParse;\n\t\t//$('#orderTotal').text(totalOrder + ' ');\n\t\t\tconsole.log(totalOrder);\n\t}\n\telse {\n\t\talert(\"Maximum drink limit had been reached\");\n\t\tmenuModal.style.display = \"none\";\n\t}\n}", "function updatePricingInfo() {\n var laborInvoiced = Number(0);\n var laborToInvoice = Number(0);\n var laborPercentInvoiced = Number(0);\n\n var laborTotal = Number(0);\n\n //populates the laborTotal section\n for (var i = 0; i < DATA.changeOrders.length; i++) {\n //checks if the CO is a laborTotal CO\n if (\n DATA.changeOrders[i].peType == '1' &&\n DATA.changeOrders[i].sell != null &&\n DATA.changeOrders[i].type != 8 &&\n DATA.changeOrders[i].type != 7 &&\n parseChangeOrderStatus(DATA.changeOrders[i].status) != 'Rejected'\n ) {\n laborTotal += Number(DATA.changeOrders[i].sell);\n }\n }\n\n //populates the laborInvoiced section\n for (var i = 0; i < invs.length; i++) {\n //checks if the invoice is a project invoice\n if (\n invs[i].invoiceType == 'Labor' &&\n invs[i].invoiceAmount != null &&\n invs[i].invoiceStatus != 'Rejected' &&\n invs[i].invoiceStatus != 'Requested'\n ) {\n laborInvoiced += Number(invs[i].invoiceAmount);\n }\n }\n\n laborToInvoice = laborTotal - laborInvoiced;\n\n if (laborTotal > 0) {\n laborPercentInvoiced = (laborInvoiced / laborTotal) * 100;\n }\n\n var materialInvoiced = Number(0);\n var materialToInvoice = Number(0);\n var materialPercentInvoiced = Number(0);\n\n var materialCosts = Number(0);\n\n //populates the materialCosts section\n for (var i = 0; i < DATA.changeOrders.length; i++) {\n //checks if the CO is a materialCosts CO\n if (\n DATA.changeOrders[i].peType == '2' &&\n DATA.changeOrders[i].sell != null &&\n DATA.changeOrders[i].type != 8 &&\n DATA.changeOrders[i].type != 7 &&\n parseChangeOrderStatus(DATA.changeOrders[i].status) != 'Rejected'\n ) {\n materialCosts += Number(DATA.changeOrders[i].sell);\n }\n }\n\n //populates the materialInvoiced section\n for (var i = 0; i < invs.length; i++) {\n //checks if the invoice is a project invoice\n if (\n invs[i].invoiceType == 'Materials' &&\n invs[i].invoiceAmount != null &&\n invs[i].invoiceStatus != 'Rejected' &&\n invs[i].invoiceStatus != 'Requested'\n ) {\n materialInvoiced += Number(invs[i].invoiceAmount);\n }\n }\n\n materialToInvoice = materialCosts - materialInvoiced;\n\n if (materialCosts > 0) {\n materialPercentInvoiced = (\n (materialInvoiced / materialCosts) *\n 100\n ).toFixed(2);\n }\n\n var projectInvoiced = Number(0);\n var projectToInvoice = Number(0);\n var projectPercentInvoiced = Number(0);\n\n var projectAmount = Number(0);\n\n //populates the projectAmount section\n for (var i = 0; i < DATA.changeOrders.length; i++) {\n //checks if the CO is a projectAmount CO\n if (\n DATA.changeOrders[i].peType == '0' &&\n DATA.changeOrders[i].sell != null &&\n DATA.changeOrders[i].type != 8 &&\n DATA.changeOrders[i].type != 7 &&\n parseChangeOrderStatus(DATA.changeOrders[i].status) != 'Rejected'\n ) {\n projectAmount += Number(DATA.changeOrders[i].sell);\n }\n }\n\n //populates the projectInvoiced section\n for (var i = 0; i < invs.length; i++) {\n //checks if the invoice is a project invoice\n if (\n invs[i].invoiceType == 'Project' &&\n invs[i].invoiceAmount != null &&\n invs[i].invoiceStatus != 'Rejected' &&\n invs[i].invoiceStatus != 'Requested'\n ) {\n projectInvoiced += Number(invs[i].invoiceAmount);\n }\n }\n\n projectToInvoice = projectAmount - projectInvoiced;\n\n if (projectAmount > 0) {\n projectPercentInvoiced = ((projectInvoiced / projectAmount) * 100).toFixed(\n 2\n );\n }\n\n var aiaInvoiced = Number(0);\n var aiaToInvoice = Number(0);\n var aiaPercentInvoiced = Number(0);\n\n var aiaTotal = Number(0);\n\n //populates the aiaTotal section\n for (var i = 0; i < DATA.changeOrders.length; i++) {\n //checks if the CO is a aiaTotal CO\n if (\n DATA.changeOrders[i].peType == '3' &&\n DATA.changeOrders[i].sell != null &&\n DATA.changeOrders[i].type != 8 &&\n DATA.changeOrders[i].type != 7 &&\n parseChangeOrderStatus(DATA.changeOrders[i].status) != 'Rejected'\n ) {\n aiaTotal += Number(DATA.changeOrders[i].sell);\n }\n }\n\n //populates the aiaInvoiced section\n for (var i = 0; i < invs.length; i++) {\n //checks if the invoice is a project invoice\n if (\n invs[i].invoiceType == 'AIA' &&\n invs[i].invoiceAmount != null &&\n invs[i].invoiceStatus != 'Rejected' &&\n invs[i].invoiceStatus != 'Requested'\n ) {\n aiaInvoiced += Number(invs[i].invoiceAmount);\n }\n }\n\n aiaToInvoice = aiaTotal - aiaInvoiced;\n\n if (aiaTotal > 0) {\n aiaPercentInvoiced = ((aiaInvoiced / aiaTotal) * 100).toFixed(2);\n }\n\n var totalProject = Number(0);\n var totalInvoiced = Number(0);\n var totalToInvoice = Number(0);\n var totalPercentInvoiced = Number(0);\n\n //calculates total cost of entire project\n totalProject =\n Number(laborTotal) +\n Number(materialCosts) +\n Number(projectAmount) +\n Number(aiaTotal);\n totalInvoiced =\n Number(laborInvoiced) +\n Number(materialInvoiced) +\n Number(projectInvoiced) +\n Number(aiaInvoiced);\n totalToInvoice =\n Number(laborToInvoice) +\n Number(materialToInvoice) +\n Number(projectToInvoice) +\n Number(aiaToInvoice);\n totalPercentInvoiced = (totalInvoiced / totalProject) * 100;\n\n totalPercentInvoiced = totalPercentInvoiced.toFixed(2);\n if (totalPercentInvoiced == 'NaN') {\n totalPercentInvoiced = 0;\n }\n\n //fills in the fields\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#laborTotal')\n .html(cleanNumericValueForDisplaying(laborTotal.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#laborInvoiced')\n .html(cleanNumericValueForDisplaying(laborInvoiced.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#laborToInvoice')\n .html(cleanNumericValueForDisplaying(laborToInvoice.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#laborPercentInvoiced')\n .html(Math.trunc(laborPercentInvoiced) + '%');\n\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#materialCosts')\n .html(cleanNumericValueForDisplaying(materialCosts.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#materialInvoiced')\n .html(cleanNumericValueForDisplaying(materialInvoiced.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#materialToInvoice')\n .html(cleanNumericValueForDisplaying(materialToInvoice.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#materialPercentInvoiced')\n .html(Math.trunc(materialPercentInvoiced) + '%');\n\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#projectAmount')\n .html(cleanNumericValueForDisplaying(projectAmount.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#projectInvoiced')\n .html(cleanNumericValueForDisplaying(projectInvoiced.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#projectToInvoice')\n .html(cleanNumericValueForDisplaying(projectToInvoice.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#projectPercentInvoiced')\n .html(Math.trunc(projectPercentInvoiced) + '%');\n\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#aiaTotal')\n .html(cleanNumericValueForDisplaying(aiaTotal.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#aiaInvoiced')\n .html(cleanNumericValueForDisplaying(aiaInvoiced.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#aiaToInvoice')\n .html(cleanNumericValueForDisplaying(aiaToInvoice.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#aiaPercentInvoiced')\n .html(Math.trunc(aiaPercentInvoiced) + '%');\n\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#totalProject')\n .html(cleanNumericValueForDisplaying(totalProject.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#totalInvoiced')\n .html(cleanNumericValueForDisplaying(totalInvoiced.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#totalToInvoice')\n .html(cleanNumericValueForDisplaying(totalToInvoice.toFixed(2)));\n $('#projectData')\n .find('#financialSection')\n .find('#pricingInfo')\n .find('#totalPercentInvoiced')\n .html(Math.trunc(totalPercentInvoiced) + '%');\n}", "function PriceUpdate(price) {\n $(\"#price\").text(price);\n}", "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}", "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}", "function updateCounter() {\n $('#cart-counter').first().text($('.cart-item').length);\n }", "function calculatePrice() {\n const priceTotal = priceCalculation();\n innerChanger('sum', priceTotal);\n innerChanger('sum-footer', priceTotal);\n}", "@onValuesChanged(\"price\", [\"insert\", \"modify\"])\n\t\t\tchangePrice(value) {\n\t\t\t\teventLog.push(\"Price changed: \" + value);\n\t\t\t}", "updateTakeProfit() {\n if (this.type === PositionType.LONG && this.pair.currentPrice > this.takeProfitBasePrice) {\n this.takeProfitPrice = (this.pair.currentPrice *\n (1 + (this.takeProfitPerc / 100)));\n this.takeProfitBasePrice = this.pair.currentPrice;\n console.log(`Take profit updated to: ${this.takeProfitPrice.toFixed(3)}`);\n } else if (this.type === PositionType.SHORT && this.pair.currentPrice < this.takeProfitBasePrice) {\n this.takeProfitPrice = (this.pair.currentPrice *\n (1 - (this.takeProfitPerc / 100)));\n this.takeProfitBasePrice = this.pair.currentPrice;\n console.log(`Take profit updated to: ${this.takeProfitPrice.toFixed(3)}`);\n }\n }", "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 }", "function updateChart() {\r\n if (price_list.length > 0) {\r\n for (var i = 0; i < price_list.length; i++) {\r\n console.log(price_list[i][0] + \"++\" + price_list[i][1]);\r\n callAPI(price_list[i][0], price_list[i][1], i);\r\n }\r\n }\r\n}", "function updatePrice(button){\r\n\tif (button == 1) {\r\n\t\tsize_cost = 0;\r\n\t}\r\n\tif (button == 2) {\r\n\t\tsize_cost = 4;\r\n\t}\r\n\tif (button == 3) {\r\n\t\tglazing_cost = 0;\r\n\t}\r\n\tif (button == 4) {\r\n\t\tglazing_cost = 0.5;\r\n\t}\r\n\tif (button == 5) {\r\n\t\tglazing_cost = 0.5;\r\n\t}\r\n\tif (button == 6) {\r\n\t\tglazing_cost = 1;\r\n\t}\r\n\tdisplayPrice();\r\n}", "function upDateAll(){\n//UIONOFF = false; \n updateSaleItems1();\n// logSales(\"Shop 1 Called\",{})\n updateSaleItems2();\n// logSales(\"Shop 2 Called\",{})\n updateSaleItems3();\n// logSales(\"Shop 3 Called\",{})\n updateSaleItems4();\n// logSales(\"Shop 4 Called\",{})\n updateSaleItems5();\n// logSales(\"Shop 5 Called\",{})\n updateSaleItems6();\n updateSaleItems7();\n}", "updateListAfterSyncCatalogRulePrice(catalogrule_prices = []) {\n if (catalogrule_prices && catalogrule_prices.length) {\n let items = ProductListService.prepareItemsToUpdateListAfterSyncCatalogRulePrice(\n catalogrule_prices, this.state.items\n );\n if (items !== false) {\n this.addItems(items);\n }\n this.props.actions.resetSyncActionUpdateCatalogRulePrice();\n }\n }", "function upVoteUpdate(counter, newval){\n\t \t$(counter).text(parseFloat(newval));\n\t }", "_resetPendingCount() {\n count = updateCount = 0;\n }", "function updatePrice() {\n var count = 0;\n var mat_count = $(\"#tbody-items\").children();\n $.each(mat_count, function (key, value) {\n count++;\n });\n $(\"#count-material\").text(count);\n\n var allprice = 0;\n $(\"td[name='allprice-material']\").each(function (key, value) {\n var res = $(this).text().split(',');\n var price = '';\n $.each(res, function (key2, value2) {\n price += value2\n });\n allprice += parseFloat(price);\n });\n $(\"#allprice-allmaterial\").text(allprice.toFixed(2)).digits();\n\n}", "function updateTruckCost() {\n // Recalculate the truck cost estimate\n $scope.truckCost = $scope.baseEstimate * $scope.truckCostIncrements[$scope.truckCostIndex];\n }", "function updatetotal(priceofproducts) {\n total = total + priceofproducts\n document.getElementsByClassName(\"total\")[0].innerHTML = total\n }", "function updateVariantPrice(variant) {\r\n\t $('#buy-button-1 .variant-price').text('$' + variant.price);\r\n\t }", "function updateValues(count){\n $(\"#incCount\").text(count);\n }", "resetList() {\n let originalList = this.state.products;\n originalList.forEach((product) => {\n if (!product.addedCount) {\n product.inventory = product.inventory;\n\n } else if (product.addedCount && product.inventory === 0) {\n product.inventory = product.addedCount;\n delete product.addedCount;\n delete product.remaningCount;\n\n } else {\n product.inventory = product.addedCount + product.remaningCount;\n delete product.addedCount;\n delete product.remaningCount;\n }\n });\n\n this.setState({\n products: originalList\n });\n }", "function updateCountAndTotal() {\n selectedSeats = document.querySelectorAll('.row .selected');\n const selectedSeatsAmount = selectedSeats.length;\n\n count.innerText = selectedSeatsAmount;\n total.innerText = selectedSeatsAmount * ticketPrice;\n}", "function updatingData1() {\n let mintWaferPrice = store2['inventory prices']['Mint Wafers'];\n mintWaferPrice = 2.09;\n return false;\n //No, the price in the data for store2 doesn't change because we created a new variable \"mintWaferPrice\" and initially set it equal to the price of Mint Wafers. When we assign a new value to that variable, it doesn't effect the original price of Mint Wafers stored in the data for store2.\n}", "function updateCount() {\n\t\t$('#count').html(count);\n\t}", "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}", "function resetPrices() {\n var priceElements = document.getElementsByClassName(\"price\")\n var n = priceElements.length\n for (var i = 0; i < n; i++) {\n priceElements[i].innerHTML = \"$\" + productsJSON.products[i].price\n }\n}", "updateCount(id, newCount) {\n //we want to find an item inself we use find()\n this.items.find(el => el.id === id).count = newCount\n }", "function updatePriceByProduct(product, productPrice){\n product.querySelector('.total-price span').innerHTML = productPrice;\n}", "_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 }", "function change(id){\n\tvar i=findpos(id);\n\n\ttotalprice+=(parseInt($('#'+id+'_cnt').val())-purchased[i].cnt)*purchased[i].price;\n\n\tpurchased[i].cnt=parseInt($('#'+id+'_cnt').val());\n\tupdate_total();\n}", "updateIngredients(type) {\n const newServings = (type === 'dec' ? this.servings - 1 : this.servings + 1);\n this.ingredients.forEach(ing => {\n ing.count *= (newServings / this.servings);\n });\n this.servings = newServings;\n }", "function updateVotes (){\n for (var i in Product.allProducts) {\n productVotes[i] += Product.allProducts[i].votes;\n productShown[i] += Product.allProducts[i].timesDisplayed;\n }\n}", "function resetcounter(){\n //function to reset count value and selected drinks array\n \n totalIntake=0;\n $(\"#result\").html(\"\");\n counsumedDrink.splice(0, counsumedDrink.length);\n displayTotalIntake(0); //call to set total intake display to zero\n displayTotalServing(0); //call to set total intake serving to zero\n displayRemainingIntake(totalLimit); //call to set reminging limit to Max daily intake value\n}", "function refreshPerfInfo(perf, isPerfChanged) {\n curPerformance = perf;\n onChangeGHzCPU(Number($('#cpu-slider').slider('value')));\n\n initPrices();\n setGlobalparam();\n initSliders(false, isPerfChanged);\n price.Calculate();\n }", "update() {\n //Apply changes\n super.update()\n //Remove if expired\n if (this.cycle <= 0) {\n this.destroy()\n }\n }", "function updateStock() {\n\t\t\t\t\t\tupdatedStock = selectedProductDetails.stock_quantity - answer.quantity;\n\t\t\t\t\t}", "function updatePrice(oldPrice) {\n return Math.floor(oldPrice * 1.25);\n}", "function updateTotal() {\n let memoryCost = parseFloat(getElement(\"memory-price\").innerText);\n let storageCost = parseFloat(getElement(\"storage-price\").innerText);\n let deliveryCost = parseFloat(getElement(\"delivery-price\").innerText);\n let total = 1299 + memoryCost + storageCost + deliveryCost; /* total price sum */\n getElement(\"total-price\").innerText = total;\n getElement(\"grand-total-price\").innerText = total;\n}", "handleCounterClick(e, i, price, increase, affectsPrice) {\n const tmp = this.state.counters;\n let multiplier = 1;\n if (increase) tmp[i]++;\n else {\n tmp[i]--;\n if (tmp[i] < 1) {\n tmp[i] = 1;\n return;\n }\n multiplier = -1;\n }\n this.setState({\n counters: tmp,\n price: this.state.price + (!!affectsPrice * (multiplier * price))\n });\n }", "function updateCart(){\n\t\tstorage(['items', 'subtotal'], function(err, col){\n\t\t\t//console.log(\"Cart Collection - \" + JSON.stringify(col));\n\n\t\t\t//items = col[0];\n\t\t\t//subtotal = col[1];\n\n\t\t\tif(console) console.log(\"Items in Cart: \" + items);\n\t\t\tif(console) console.log(\"Subtotal of Cart: \" + subtotal);\n\t\t\t\n\t\t\t// update DOM Here\n\t\t\tdocument.getElementById( _options.itemsEleId ).innerHTML = items;\n\t\t\tdocument.getElementById( _options.subtotalEleId ).value = \"$\" + subtotal.toFixed(2);\n\n\t\t\t// reset default quantity input fields of products\n\t\t\tPRODUCTS.updateProducts();\n\t\t});\n\t}" ]
[ "0.7559779", "0.6838988", "0.6777526", "0.677688", "0.66928816", "0.6452063", "0.6319338", "0.6223703", "0.6206444", "0.6173199", "0.6155833", "0.6152469", "0.61329603", "0.6125377", "0.60645527", "0.6028685", "0.6007", "0.60050434", "0.59976053", "0.5989746", "0.5981638", "0.5968427", "0.59609365", "0.593714", "0.592757", "0.59263945", "0.5924878", "0.59190226", "0.5908245", "0.5896903", "0.5894118", "0.5892373", "0.5877492", "0.5872934", "0.5871536", "0.5863343", "0.5861912", "0.5860461", "0.5850375", "0.5842346", "0.58412826", "0.58267605", "0.5826294", "0.58262414", "0.5812683", "0.5799896", "0.5784415", "0.577369", "0.57707", "0.5768932", "0.57596296", "0.5754285", "0.5750056", "0.5734165", "0.57326597", "0.57321316", "0.57318765", "0.57282144", "0.5726618", "0.5723253", "0.5712369", "0.570912", "0.5704456", "0.5702787", "0.5702217", "0.57007986", "0.56947505", "0.5687852", "0.56866145", "0.5685974", "0.5684919", "0.5682221", "0.56816894", "0.5675377", "0.56648034", "0.5664162", "0.5663393", "0.565875", "0.56560653", "0.56405556", "0.5635556", "0.5635311", "0.5633855", "0.5631084", "0.5630739", "0.5628995", "0.56254625", "0.5622847", "0.5619966", "0.5618998", "0.56172514", "0.561686", "0.5614384", "0.5608216", "0.56052846", "0.55978173", "0.55907553", "0.5587497", "0.5587427", "0.55817455", "0.558016" ]
0.0
-1
In case of IE8, TYPE_BACK_FORWARD is undefined.
function isBackForwardNavigated() { return performance && performance.navigation.type === TYPE_BACK_FORWARD; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function History_Force_MoveBack()\n{\n\t//can we go back?\n\tif (__SIMULATOR.History.CurrentStateIndex > 1)\n\t{\n\t\t//Go back\n\t\t__SIMULATOR.History.MoveBack();\n\t}\n}", "function navigationBack(breadCrumbBack){\n\t\n\tif(!breadCrumbBack){\n\t\tbreadCrumbBack=-1;\n\t} else if(breadCrumbBack>=0){\n\t\tbreadCrumbBack=breadCrumbBack*(-1);\n\t}\n\t\n\tvar currentUrl=document.location.href;\n\tvar questionMarkFound=currentUrl.indexOf(\"?\");\n\tif (questionMarkFound!=-1){\n\t\tcurrentUrl=currentUrl.substring(0, questionMarkFound);\n\t}\n\t\n\tcurrentUrl+=\"?breadCrumbBack=\"+breadCrumbBack;\n\t\n\tdocument.location.href=currentUrl;\t\n}", "function noBack()\r\n{\r\nwindow.history.forward()\r\n}", "navigateBack() {\r\n this.isExplicitNavigationBack = true;\r\n this.history.navigateBack();\r\n }", "goback() { this.back = true; }", "function onBackKeyDown() {\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back( { changed_propagation_event_enabled: false } ) ;\r\n}", "function onBackKeyDown() {\n\t//alert(\"Back Pressed\");\n\tgo_back();\n}", "function navigateBack() {\n try {\n window.history.back();\n console.log(\"status pass : Navigated one step back from current position in recent history\" + url);\n } catch (err) {\n console.log(\"status fail : Broken link or no network connection\");\n }\n}", "handleBackAction(): boolean {\n return this._onNavigationChange('pop');\n }", "function onBackKey(){\n\tif(app.session.data.extra_prev_state > 0){\n\t\tback_to_pre();\n\t}else{\n\t\thide_all_pages();\n\t\tif(app.session.data.cstate > 0){\n\t\t\tvar callback = app.session.data.state_back_callback[app.session.data.cstate];\n\t\t\tif(callback !== null)\n\t\t\t\tcallback();\n\t\t}\n\t\tstop_processing();\n\t}\n}", "back () {\n // realization in Class\n }", "function onBackKeyDown() {\n goBack();\n}", "function History_MoveBack()\n{\n\t//forward to move to index\n\tthis.MoveToIndex(this.CurrentStateIndex - 1);\n}", "function keyNav(e) {\n // why === doesn't work? because if the user input is a HTML input text field, it might interpret a number as a string. \"37\" === 37 false.\n if (e.keyCode == '37') {\n goBack(); \n } else if (e.keyCode == '39') {\n goForward();\n }\n}", "function hwBackButton_Capture(boolForceState)\n{\n try\n {\n //force by default\n if (boolForceState==null)\n {\n boolForceState=true;\n }\n \n if (boolForceState==true && hwBackButton_boolCaptureState==false)\n {\n //capture the back button\n try { AppMobi.device.addVirtualPage(); hwBackButton_boolCaptureState=true; } catch(e) { lq.giveFeedback(\"error adding virtual page:\" + e.message); }\n }\n else if (boolForceState == false)\n {\n //stop capturing the back button\n try { AppMobi.device.removeVirtualPage(); hwBackButton_boolCaptureState=false; } catch(e) { lq.giveFeedback(\"error removing virtual page:\" + e.message); }\n }\n }\n catch(e)\n {\n alert(\"error in captureHWBackButton: \" + e.message);\n }\n\tconsole.log('Is listenning?' + boolForceState);\n}", "function pageForwardAction() {\n if (typeof(navigator) != 'undefined' && typeof(navigator.app) != 'undefined' && typeof(navigator.app.forwardHistory) == 'function')\n navigator.app.forwardHistory();\n else\n history.go(1);\n}", "function pageBackAction() {\n if (typeof(navigator) != 'undefined' && typeof(navigator.app) != 'undefined' && typeof(navigator.app.backHistory) == 'function')\n navigator.app.backHistory();\n else\n history.go(-1);\n}", "function ie03Back(){ \r\n\t\tz_ie03_change_display = false;\r\n\t\tset(\"V[z_ie03_*]\",\"\");\r\n}", "function detectPageType() {\n var backBtn = obj.find(\"div[align='center'] input:image\");\n if (backBtn && (backBtn[0].defaultValue.localeCompare(\"\\u691c\\u7d22\\u7d50\\u679c\\u4e00\\u89a7\\u3078\\u623b\\u308b\") == 0)) {\n return 2;\n } else {\n return 1;\n }\n}", "function pageBack(e){\n\n e.cancelBubble = true;\n\n}", "function onBackKeyDown() {\n\t// Handle the back button\n\tconsole.log('device.onBackKeyDown');\n\twindow.history.back();\n}", "forward () {\n this.history.goForward()\n }", "goBack() {\n try {\n browser.back();\n return true;\n }\n catch (ex) {\n return false;\n }\n }", "function isIE8() {\n if (window.attachEvent && !window.addEventListener) {\n return true;\n } else {\n return false;\n }\n }", "handleNavigateBack() {\n const { onNavigateBack, defaultNavigateBack } = this.props;\n onNavigateBack ? onNavigateBack() : defaultNavigateBack();\n }", "handleBackAction() {\n this._triggerOnBack();\n }", "function goback() {\n showloading();\n var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=zoomback';\n updateMap(mapurl);\n}", "function backStreamPage() {\n\n}", "function onBackKeyDown() {\n window.location.href = \"index.html\";\n}", "function navigateOnePageBack() {\n window.history.back();\n}", "function viewBackFromOther() {\n\tlogInfo('Back change pasword');\n}", "function viewBackFromOther() {\n\tlogInfo('Back change pasword');\n}", "back() {\n let query = {};\n const url = url_1.parse(this.getReferrerUrl());\n /**\n * Parse query string from the referrer url\n */\n if (this.forwardQueryString) {\n query = qs_1.default.parse(url.query || '');\n }\n /**\n * Append custom query string\n */\n Object.assign(query, this.queryString);\n /**\n * Redirect\n */\n this.sendResponse(url.pathname || '', query);\n }", "_triggerOnBack() {\n const {onBack} = this.props;\n if (typeof onBack === 'function') {\n onBack();\n }\n }", "function backwardStep(e) {\n setMedia();\n if (media.currentTime > trjs.param.backwardskip)\n media.currentTime = media.currentTime - trjs.param.backwardskip;\n else\n media.currentTime = 0;\n }", "back()\n\t{\n\t\tconst backAction = NavigationService.back();\n\t\tthis.dispatcher( backAction );\n\t}", "back() {\n this._platformStrategy.back();\n }", "function on_mouseup_back(event){\n\tif(PLACE=='game' && MAP_SCROLL_CONTROLL==true){\n\t\tMAP_SCROLL_CONTROLL=false;\n\t\tif(MAP_SCROLL_MODE==1)\n\t\t\tmove_to_place_reset();\n\t\t}\n\t}", "function onback (fn) {\n window.addEventListener('popstate', function (event) {\n fn(event, fmt(document.location))\n })\n}", "handleBackButton() {\n const {nav, dispatch} = this.props;\n\n if (nav && nav.routes && nav.routes.length > 1) {\n dispatch(NavigationActions.back());\n return true;\n }\n return false;\n }", "handleBackButton() {\n const {nav, dispatch} = this.props;\n\n if (nav && nav.routes && nav.routes.length > 1) {\n dispatch(NavigationActions.back());\n return true;\n }\n return false;\n }", "_detectBrowserSupport () {\n\t\t\n\t\tvar check = true;\n\n\t\t// nothing below IE9\n\t\tif (!document.addEventListener) check = false;\n\n\t\t// nothing below IE10\n\t\t// if (!window.onpopstate) check = false;\n\n\t\treturn check;\n\t}", "forward() {\n if (this._history.length > 0) {\n if (this._index < this._history.length - 1) {\n this._index++;\n }\n return this._history[this._index];\n }\n return '';\n }", "function goBackOrGoHome() {\n if(WinJS.Navigation.canGoBack) {\n WinJS.Navigation.back();\n }\n else {\n navigate('home');\n }\n }", "function back() {\n history.pop();\n if (history.length >= 1) { setMode(history[history.length - 1]) }\n }", "goBack() {\n history.back();\n window.scroll(0,0);\n }", "function navigation_adjust_back_button(){\n\tvar pag_activa = $( \"body\" ).pagecontainer( \"getActivePage\" ).attr('id');\n\tif ( \t\tpag_activa == \"grp_edit_contacts\" ) { goto_grp_activo(); }\n\telse if ( \tpag_activa == \"grp_edit\" ) { goto_grp_activo(); }\n\telse if ( \tpag_activa == \"room\" ) { loader_show(''); $('#listRoom').hide(); navigator.app.backHistory(); }\n\telse if ( \tpag_activa == \"roomGr\" ) { loadGrupos(); }\n\telse if ( \tpag_activa == \"groups\" ) { showSalaH(); }\n\telse if ( \tpag_activa == \"contacts\" ) { showSalaH(); } \n\telse if ( \tpag_activa == \"contact_find_add\" ) { showSalaH(); } \n\t//else if ( \tpag_activa == \"pago_page_details\" ) { showSalaH(); } \t\n\telse if ( \tpag_activa == \"contacts_find\" ) { hide_listContactsFind(); navigator.app.backHistory(); } \n\telse { navigator.app.backHistory(); }\t\n}", "goBack() {\n this._goBack().catch(Cu.reportError);\n }", "function mForward (strURL) {\r\n\twindow.location.href = strURL;\r\n}", "function DETECT_history() {\n return window.history && typeof window.history.pushState !== 'undefined';\n }", "function goBack() {\n\t\ttogglePage();\n\t\tdisposeThrownShurikens();\n\t\tupdateThrownShurikenCount();\n\t\tcleanBelt();\n\t}", "function booleanToSide(back) {\n return back ? trs80_base_1.Side.BACK : trs80_base_1.Side.FRONT;\n}", "function OnAndroidBackButton_Click( e )\r\n{\r\n // We can go back only if a saving is not in progress\r\n if( !bIsWorkInProgress )\r\n {\r\n Back( { changed_propagation_event_enabled: false } ) ;\r\n }\r\n}", "function goBack() {\n window.history.back();\n} // nu merge, mai este si forward, merge inainte spre urmatorul url din history", "function flipPagePickBack()\r\n\t{\r\n\t\tvar theStyle;\r\n\r\n\t\tvar theCell=document.getElementById('PickPageCell' );\r\n\t\tvar theActPick=document.getElementById('activatePickDiv' );\r\n\t\tvar theBrowsePick=document.getElementById('browsePickDiv');\r\n\r\n\t\tif ( undefined !== theActPick )\r\n\t\t{\r\n\t\t\ttheCell.title = LocString( 'Go to page...' );\r\n\t\t\ttheStyle = theCell.style;\r\n\t\t\ttheStyle.visibility=\"hidden\";\r\n\t\t\ttheStyle.display=\"none\";\r\n\r\n\t\t\ttheStyle = theActPick.style;\r\n\t\t\ttheStyle.visibility=\"visible\";\r\n\t\t\ttheStyle.display=\"block\";\r\n\r\n\t\t\ttheStyle = theBrowsePick.style;\r\n\t\t\ttheStyle.visibility=\"hidden\";\r\n\t\t\ttheStyle.display=\"none\";\r\n\r\n\t\t\ttheDiv = document.getElementById( 'typePickDiv' );\r\n\t\t\ttheStyle = theDiv.style;\r\n\t\t\ttheStyle.visibility=\"hidden\";\r\n\t\t\ttheStyle.display=\"none\";\r\n\r\n\t\t\ttheDiv = document.getElementById( 'classPageSelectDiv' );\r\n\t\t\ttheStyle = theDiv.style;\r\n\t\t\ttheStyle.visibility=\"visible\";\r\n\t\t\ttheStyle.display=\"block\";\r\n\r\n\t\t\tbtmPickControlOpen = false;\r\n\t\t}\r\n\t}", "function showBackBt(){\n\t\tif(_historyObj.length>1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function goBack(){\n // *Navigating back:\n window.history.back();\n }", "function supportsPopStateOnHashChange(){return window.navigator.userAgent.indexOf('Trident')===-1;}", "forward() {\n this.lastIndex = Math.min(this.historyStack.length - 1, this.lastIndex + 1);\n }", "goBack(backstackEntry) {\n if (Trace.isEnabled()) {\n Trace.write(`GO BACK`, Trace.categories.Navigation);\n }\n if (!this.canGoBack()) {\n return;\n }\n if (backstackEntry) {\n const index = this._backStack.indexOf(backstackEntry);\n if (index < 0) {\n return;\n }\n }\n const navigationContext = {\n entry: backstackEntry,\n isBackNavigation: true,\n navigationType: NavigationType.back,\n };\n this._navigationQueue.push(navigationContext);\n this._processNextNavigationEntry();\n }", "back() {\n this._platformStrategy.back();\n }", "back() {\n this._platformStrategy.back();\n }", "back() {\n this._platformStrategy.back();\n }", "back() {\n this._platformStrategy.back();\n }", "back() {\n this._platformStrategy.back();\n }", "function bindBackKeyEvents() {\n document.addEventListener('tizenhwkey', function keyEventHandler(ev) {\n var page = document.getElementsByClassName(\"active\")[0],\n pageId = page ? page.id : \"\";\n\n if (ev.keyName === \"back\") {\n if (pageId === \"page-main\") {\n try {\n tizen.application.getCurrentApplication().exit();\n } catch (ignore) {}\n } else if (pageId === \"page-notification-detail\") {\n document.querySelector(\"#page-notification\").classList.toggle(\"active\");\n page.classList.toggle(\"active\");\n } else {\n document.querySelector(\"#page-main\").classList.toggle(\"active\");\n page.classList.toggle(\"active\");\n }\n }\n });\n }", "_onBack () {\n this.props.navigator.pop();\n }", "function newGoBack(url){\r\n\tgoFrame(url);\r\n}", "forward() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n const state = window.history.state;\n if (this._isValidState(state) && state.uid < this._maxUid) {\n window.history.forward();\n }\n }", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function chatBackButton(e) {\n if (e) e.preventDefault();\n client_configuration['chat']['chat_user'] = undefined;\n if ( typeof cordova != 'undefined')\n cordova.plugins.Keyboard.close();\n //ChatPage.keyboardDidHide;\n\n Draw.switchBack();\n}", "navigateBack(url, options = {}) {\n this.setDirection('back', options.animated, options.animationDirection, options.animation);\n return this.navigate(url, options);\n }", "function handleBackButton(event) {\n var currState = state.get();\n \n switch( state.get() ) {\n case \"info\":\n toggleInfo(false);\n break;\n case \"browse\":\n state.change(\"video\");\n hideNavOverVideo();\n break;\n case \"video\":\n if(video.isAdPlaying()) {\n video.clearAd(); // clear the setting of current playing ad.\n video.handleComplete();\n }\n\n // console.log( 'resetting start index' );\n list.resetStartIndex();\n LG.List.getCurrent().resetStartIndex();\n\n video.stop();\n LG.Info.getCurrent() && LG.Info.getCurrent().hide();\n hidePlayer();\n state.change(\"main\");\n break;\n case \"error\":\n hideError();\n state.restore();\n focusActiveSlide();\n break;\n }\n }", "function goBack(num)\n{\n parent.history.go(num);\n}", "function _backState () {\n \t$state.go(projectHeader.backEvent.stateName, projectHeader.backEvent.paramObj)\n }", "function userCSP_backOrForwardBtnClicked () {\n console.log (\"\\n\\n Back or Forward Button pressed\");\n console.log (\"\\n Current URL = \"+tabs.activeTab.url); \n gBrowser.addTabsProgressListener(userCSP_progressListener);\n} // end of userCSP_backOrForwardBtnClicked() function", "function goBack() {\n return history.goBack();\n }", "function goBack() {\r\n window.history.go(-1)\r\n}", "function goBack()\n\t{\n\t\n\t\t window.location = \"input.html?lang=\" + lang +\"&dist=\" + dist +\"&diam=\" + diam + \"&trag=\" + traj + \"&velo=\" + velo + \"&pjd=\" + pjd + \"&tjd=\" + tgd + \"&wlvl=\" + wlvl + \"&planet=\" + planet;\n\t}//=========================================================================================", "_onBack () { \n this.props.navigator.pop();\n }", "function back() {\n setMode(history.pop());\n setHistory(history);\n }", "function registerNavigateAwayCallback(callback){\n\t\t_my.navigateAwayCallback = callback;\n\t}", "function backButtonTrigger() {\n if (window.currentVideoSelectedForPlayback) {\n setCurrentlyPlaying(false)\n const currentNode = window.currentVideoSelectedForPlayback\n const currentTime = currentNode.data.videoCore.currentTime\n const currentVideoStart = currentNode.data.metadata.startTime\n\n if (currentTime - currentVideoStart > 1) {\n currentNode.data.videoCore.currentTime -= 1\n } else if (currentNode.prev) {\n const remainingTime = 1 - currentTime\n window.currentVideoSelectedForPlayback = currentNode.prev\n const prevEndTime = window.currentVideoSelectedForPlayback.data.metadata.endTime\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = prevEndTime - remainingTime\n } else {\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = currentVideoStart\n }\n renderUIAfterFrameChange(window.currentVideoSelectedForPlayback)\n }\n}", "function navigateToPage(destPage, validate, navback){ \n clearTimeout(tstTimerHandle);\n \n var currentPage = tstCurrentPage;\n var currentInput = __$(\"touchscreenInput\"+currentPage);\n\n if (currentInput) {\n // if (__$('dateselector') != null && typeof ds != 'undefined')\n // ds.update(currentInput);\n if (validate) {\n if (!inputIsValid()) return;\n // if (!inputIsAcceptable()) return;\n\n if(dispatchFlag()) return;\n }\n \n tstPageValues[currentPage] = currentInput.value; \n \n tt_update(currentInput, navback);\n \n // Progress Indicator -- disabled\n /*\n\t\t * var currentPageIndex = __$(\"progressAreaPage\"+currentPage); if\n\t\t * (currentPageIndex) { // remove current index mark\n\t\t * currentPageIndex.innerHTML = (currentPage+1)+\". \"+\n\t\t * getHelpText(tstFormElements[tstPages[currentPage]],\n\t\t * currentPage).innerHTML+ \": <div\n\t\t * class='progressInputValue'>\"+progressAreaFormat(currentInput)+\"</div>\";\n\t\t * currentPageIndex.removeAttribute(\"class\"); }\n\t\t */\n }\n //\ttt_OnUnload\n var unloadElementId = 'touchscreenInput';\n if (currentPage < destPage) {\n unloadElementId = 'touchscreenInput'+(destPage-1);\n }\n else if (currentPage > destPage) {\n unloadElementId = 'touchscreenInput'+(destPage+1);\n }\n\n var unloadElement = __$(unloadElementId);\n if (unloadElement) {\n var onUnloadCode = unloadElement.getAttribute('tt_OnUnload');\n if (onUnloadCode) {\n eval(onUnloadCode);\n }\n }\n\n if(destPage < tstPages.length){\n var condition = tstFormElements[tstPages[destPage]].getAttribute(\"condition\");\n // skip destination page when a condition is false\n if (condition) {\n if (!eval(condition)) {\n tstCurrentPage = destPage;\n if (currentPage <= destPage) {\n gotoPage(destPage+1);\n } else if (destPage > 0) {\n gotoPage(destPage-1);\t\t// reverse skipping\n }\n return;\n }\n }\n /*\n\t\ttry {\n\t\t\tvar thisPage = __$('page'+currentPage);\n\t\t\tvar pageWrapper = thisPage.parentNode;\n\t\t\tpageWrapper.parentNode.removeChild(pageWrapper);\n\t\t} catch(e) {\n\t\t\tvar pages = document.getElementsByClassName('inputPage');\n\t\t\tfor(var i=0; i<pages.length; i++) {\n\t\t\t\tpages[i].parentNode.removeChild(pages[i]);\n\t\t\t}\n\t\t}\n */\n\n if(__$('page'+currentPage) != null){\n\n var thisPage = __$('page'+currentPage);\n var pageWrapper = thisPage.parentNode;\n pageWrapper.parentNode.removeChild(pageWrapper);\n\n } else {\n\n var pages = document.getElementsByClassName('inputPage');\n for(var i=0; i<pages.length; i++) {\n pages[i].parentNode.removeChild(pages[i]);\n }\n\n }\n\n inputTargetPageNumber = destPage;\n tstCurrentPage = destPage;\n populateInputPage(destPage);\n __$(\"progressAreaPage\"+destPage).setAttribute(\"class\", \"currentIndex\");\n\n var nextButton = tstNextButton;\n if (destPage+1 == tstPages.length) {\n nextButton.innerHTML = \"<span>Finish</span>\";\n } else {\n nextButton.innerHTML = \"<span>Next</span>\";\n }\n showBestKeyboard(destPage);\n\n // manage whether or not scroll bars are displayed TODO\n var missingDisabled = tstInputTarget.getAttribute(\"tt_missingDisabled\");\n var requireNextClick = tstInputTarget.getAttribute(\"tt_requireNextClick\");\n\n // Make sure the next button is setup for right defaults\n nextButton.setAttribute(\"onMouseDown\", \"gotoNextPage()\");\n // if in fast mode and not retrospective mode and missing is not disabled\n if (requireNextClick == \"false\") {\n if (tstRetrospectiveMode != \"true\"){\n nextButton.innerHTML=\"\"\n nextButton.setAttribute(\"onMouseDown\", \"return false\");\n }\n else if (missingDisabled != true){\n nextButton.innerHTML=\"<span>Skip</span>\"\n }\n }\n\n // execute JS code when a field's page has just been loaded\n if (tstInputTarget.getAttribute(\"tt_onLoad\")) {\n eval(tstInputTarget.getAttribute(\"tt_onLoad\"));\n }\n\n if(tstFormElements[tstCurrentPage].tagName == \"SELECT\") {\n if(tstFormElements[tstCurrentPage].getAttribute(\"multiple\")){\n for(var j=0;j<tstFormElements[tstCurrentPage].options.length;j++){\n if(__$(j)){\n __$(j).click();\n __$(j).click();\n } \n }\n }\n }\n \n }\n else{\n\n /*\n var popupBox = __$(\"popupBox\");\n if (popupBox) {\n popupBox.style.visibility = \"visible\";\n }\n */\n \n showStatus();\n\n document.forms[0].submit();\n }\n}", "function goBack() { $window.history.back(); }", "function goback() \n{\nhistory.go(-1);\n}", "function goBack() {\n goBackArrow.removeEventListener(\"click\", goBack);\n goBackArrow.removeEventListener(\"mouseout\", hoverArrowNo);\n goBackArrow.removeEventListener(\"mouseover\", hoverArrow);\n goBackArrow.classList.remove(\"hover\");\n goBackArrow.classList.remove(\"hover_no_more\");\n window.history.back();\n}", "function goBack() { // go back function\n history.go(-1);\n}", "goBack(){\n this.props.backward();\n }", "function IntObject_ForwardEvent(event, evtType)\n{\n\t//has event forwarding?\n\tif (this.HTML && this.HTML.ForwardEvent)\n\t{\n\t\t//forward it\n\t\tthis.HTML.ForwardEvent(event, evtType);\n\t}\n}", "function goBack() {\r\n\twindow.history.back();\r\n}", "function goBack() {\n window.history.go(-1);\n}", "function onBackKeyDown() {\n\n app.preloader.hide();\n $$(\".page\").removeClass(\"contentload\");\n\n var currentPage = sessionStorage.currentPage;\n\n var orderID = sessionStorage.orderID;\n var backScreenType = sessionStorage.backScreenType;\n var bookingId = sessionStorage.bookingId;\n var pageType = sessionStorage.pageType;\n\n\n if (currentPage == \"task-details\") {\n\n if (sessionStorage.isServiceStartDialogOn == \"false\") {\n\n if (backScreenType == \"allTask\") {\n\n app.views.main.router.navigate('/all-task/');\n\n } else if (backScreenType == \"completedTask\") {\n\n app.views.main.router.navigate('/completed-task/');\n\n } else if (backScreenType == \"assignedTask\") {\n\n app.views.main.router.navigate('/assigned-task/');\n\n } else if (backScreenType == \"dashboardTask\") {\n\n app.views.main.router.navigate('/dashboard/');\n\n } else if (backScreenType == \"profileAssignedTask\") {\n\n app.views.main.router.navigate('/assigned-task/?backScreenType=' + backScreenType);\n\n } else if (backScreenType == \"profileCompletedTask\") {\n\n app.views.main.router.navigate('/completed-task/?backScreenType=' + backScreenType);\n\n } else if (backScreenType == \"profileAllTask\") {\n\n app.views.main.router.navigate('/all-task/?backScreenType=' + backScreenType);\n\n } else if (backScreenType == \"notification\") {\n\n app.views.main.router.navigate('/notification/');\n\n } else {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n }\n\n } if (currentPage == \"generate-bill\") {\n\n if (sessionStorage.isServiceStartDialogOn == \"false\") {\n app.views.main.router.navigate('/task-details/?orderId=' + orderId + '&backScreenType=' + backScreenType);\n }\n }\n else if (currentPage == \"update-details\") {\n\n app.views.main.router.navigate('/task-details/?orderId=' + orderID + '&backScreenType=' + backScreenType);\n\n }\n else if (currentPage == \"all-task\") {\n\n if (backScreenType == \"profileAllTask\") {\n\n app.views.main.router.navigate('/profile/');\n\n } else {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n } else if (currentPage == \"assigned-task\") {\n\n if (backScreenType == \"profileAssignedTask\") {\n\n app.views.main.router.navigate('/profile/');\n\n } else {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n } else if (currentPage == \"completed-task\") {\n\n if (backScreenType == \"profileCompletedTask\") {\n\n app.views.main.router.navigate('/profile/');\n\n } else {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n } else if (currentPage == \"otp\") {\n\n if (pageType == \"taskDetails\") {\n\n app.views.main.router.navigate('/task-details/?orderId=' + bookingId + '&backScreenType=' + backScreenType);\n\n } else {\n\n if (sessionStorage.backButtonOpenDialog == \"false\") {\n\n sessionStorage.backButtonOpenDialog = \"true\";\n\n app.dialog.confirm('Do you want to exit.', function () {\n navigator.app.exitApp();\n },\n function () {\n\n sessionStorage.backButtonOpenDialog = \"false\";\n\n });\n\n }\n\n }\n\n } else if (currentPage == \"profile\") {\n\n if (sessionStorage.logoutDialogOpen == \"false\") {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n } else if (currentPage == \"notification\") {\n\n app.views.main.router.navigate('/dashboard/');\n\n } else if (currentPage == \"login\") {\n\n navigator.app.exitApp();\n\n } else if (currentPage == \"dashboard\") {\n\n if (sessionStorage.logoutDialogOpen == \"false\") {\n\n if (sessionStorage.backButtonOpenDialog == \"false\") {\n\n sessionStorage.backButtonOpenDialog = \"true\";\n\n app.dialog.confirm('Do you want to exit.', function () {\n navigator.app.exitApp();\n },\n function () {\n\n sessionStorage.backButtonOpenDialog = \"false\";\n\n });\n\n }\n\n }\n } else {\n\n mainView.router.back();\n\n }\n}", "function trimBackStack() {\n WinJS.Navigation.history.backStack = WinJS.Navigation.history.backStack.filter(function (item) {\n if (item.location !== 'noConnection') {\n return true;\n }\n return false;\n });\n var stackLength = WinJS.Navigation.history.backStack.length;\n if(stackLength > backMax) {\n var newStack = WinJS.Navigation.history.backStack.slice(length - backMax);\n newStack.unshift({ location:'home', state: false});\n WinJS.Navigation.history.backStack = newStack;\n }\n }" ]
[ "0.60677665", "0.6023602", "0.59616166", "0.5947526", "0.5847864", "0.5810231", "0.57710546", "0.57541686", "0.5754057", "0.5653688", "0.5646662", "0.5645931", "0.5642388", "0.5566274", "0.55658007", "0.5556532", "0.555058", "0.5538328", "0.55370986", "0.5534883", "0.55344456", "0.552338", "0.5511175", "0.5493485", "0.5478813", "0.5458911", "0.5417705", "0.5391606", "0.5388304", "0.5368639", "0.53604925", "0.53506684", "0.53506684", "0.5343219", "0.5339627", "0.5339168", "0.5332235", "0.53251415", "0.5324608", "0.5324275", "0.5307823", "0.5307823", "0.5303809", "0.52840257", "0.5277469", "0.527617", "0.527459", "0.52739364", "0.52582425", "0.5252367", "0.52500534", "0.5247806", "0.52442193", "0.5239612", "0.52335745", "0.5232214", "0.5229713", "0.5228207", "0.5222832", "0.52180964", "0.52110654", "0.5209406", "0.5209406", "0.5209406", "0.5209406", "0.5209406", "0.5205909", "0.52033156", "0.519987", "0.5195597", "0.5191983", "0.5191983", "0.5191983", "0.5191983", "0.5191983", "0.5191983", "0.5190115", "0.51700395", "0.5157931", "0.5156836", "0.51566285", "0.51545596", "0.51441085", "0.5142987", "0.5140429", "0.51386863", "0.51379424", "0.5137496", "0.5136381", "0.5129547", "0.51293737", "0.5128294", "0.51261556", "0.5125199", "0.51203775", "0.51141995", "0.5108487", "0.5101029", "0.5100505", "0.5092148" ]
0.72549057
0
flush current history state
function reset() { setState(null); } // in case of reload
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearChangeHistory() {\n changeHistory = [];\n historyPosition = 0;\n }", "function flushChanges() {\n self.changes = [];\n }", "function flushChanges() {\n self.changes = [];\n }", "function clearUndoHistory() {\n getHistoryFromServer(resetHistList);\n}", "resetStateHistory() {\n // Clears state history, returning it to an empty list.\n this._stateHistory.splice(0, this._stateHistory.length);\n }", "clearHistory(){\n this.setState({\n history: [],\n lastWeighed: 0,\n weighedSum: 0\n });\n }", "function _clearHistory() {\n _bufferHistory = [];\n _rateSelectionHistory = [];\n }", "function deleteHistory(){\n setHistory([]);\n setOP(\"\");\n setFP(\"\");\n setD(\"\");\n console.log(history);\n }", "flushChanges () {\n this._lastTransactionWasUndo = true;\n }", "function resetHistory() {\n // TODO: clean out localStorage\n ExCommandHistory.resetHistory();\n }", "async commitHistory() {\n // Do nothing if no history to be committed, otherwise get history\n if (this.historyBuffer.length === 0) return;\n if (this.lock) return;\n this.lock = true;\n let history = canvas.scene.getFlag(this.layername, \"history\");\n // If history storage doesnt exist, create it\n if (!history) {\n history = {\n events: [],\n pointer: 0,\n };\n }\n // If pointer is less than history length (f.x. user undo), truncate history\n history.events = history.events.slice(0, history.pointer);\n // Push the new history buffer to the scene\n history.events.push(this.historyBuffer);\n history.pointer = history.events.length;\n await canvas.scene.unsetFlag(this.layername, \"history\");\n await this.setSetting(\"history\", history);\n simplefogLog(`Pushed ${this.historyBuffer.length} updates.`);\n // Clear the history buffer\n this.historyBuffer = [];\n this.lock = false;\n }", "function clearEventHistory() {\n Socket.emit(\"clear event history dev\", \"\");\n }", "clearHistory () {\n this.store.updateState({\n [HISTORY_STORE_KEY]: {},\n })\n }", "clearHistory () {\n this.store.updateState({\n [HISTORY_STORE_KEY]: {},\n })\n }", "clear() {\n this.history = [];\n this.acceptIndex = 0;\n }", "function setHistory() {\n // clear undo history\n $('#undoHistoryList')\n .empty();\n\n // load new history list from server\n getHistoryFromServer(addHistList);\n}", "resetHistory() {\n this.autoList.removeAll();\n var history = JSON.parse(localStorage.getItem('searchHistory'));\n if (history) {\n for (var i = 0; i < history.length; i++) {\n this.addBack(history[i]);\n }\n }\n }", "function clearHistory() {\n\tscores = [];\n\tlocalStorage.setItem(\"scores\", JSON.stringify(scores));\n\tlistofscores();\n}", "reset() {\r\n this.historyStates.push(this.currentState);\r\n this.currentState = this.historyStates[0];\r\n }", "function purgeHistoryStates()\n{\n\tvar desc = new ActionDescriptor();\n\tdesc.putEnumerated( typeNULL, typePurgeItem, enumHistory );\n\texecuteAction( eventPurge, desc, DialogModes.NO );\n}", "static reset () {\n this.history = [];\n this.position = 0;\n }", "function History_History()\n{\n\t//call reset\n\tthis.Reset();\n}", "update() {\n this.actionHistory = [];\n this.stateHistory = [];\n this.rewardHistory = [];\n }", "function clear_redo_history() {\n\tredo_history = [];\n}", "flush() {\n this.cache.flushAll();\n }", "@action\n flush() {\n if (this.buffer.length > 0) {\n const newList = [...this.buffer.reverse(), ...this.all.slice()]\n this.buffer = []\n this.all.replace(newList.slice(0, MAX_COMMANDS))\n }\n setTimeout(() => this.flush(), FLUSH_TIME)\n }", "@action clearUndo() {\n let that = this;\n that.undoHistory = A();\n }", "flush() {\n this.entities.forEach(e => e.dispose());\n this.entities = [];\n this.following = null;\n this.onFirstFrame.dispatch();\n }", "function flush() {\n sendEntries();\n events.length = 0;\n totalLogScore = 0;\n}", "reset() {\r\n this._state = this._config.initial;\r\n this._history.push(this._state);\r\n }", "reset() {\r\n this.currentState = this.initalState;\r\n this.clearHistory();\r\n }", "function updateHistory() {\n io.emit('update history', chatrooms);\n }", "function save_history () {\n\tvar ds = currHds();\n\tedit_history [edit_history_index] = JSON.stringify(ds.toJSON());\n}", "function resetFormHistory(){\n\t\t_self.emit(\"log\",\"form.js\",\"resetFormHistory()\",\"info\");\n\t\t_historyObj = new Array();\n\t\treturn true;\n\t}", "function push_history() {\n\tedit_history_index++;\n\tsave_history();\n\tedit_history.length = edit_history_index+1;\n}", "function resetChatHistory() {\n $(\"#txtChat\").attr(\"data-hist-index\", \"-1\");\n }", "clear() {\n\t\treturn this._sendMessage(JSON.stringify({type: \"clearHistory\"}), (resolve, reject) => {\n\t\t\tresolve([channel]);\n\t\t});\n\t}", "function clearHistoryAndGuessedNums() {\n history=[];\n guessedNums=[];\n }", "updateHistory(currentBoard) {\n /* add current board to history and increment history index\n *** if historyIndex is less than historyLength-1, it \n means that a move has been played after the user has \n used the jump backwards button. Therefore, all elements in history after\n where historyIndex currently is should be erased *** \n */\n const historyIndex = this.state.historyIndex;\n const historyLength = this.state.history.length;\n var history = this.state.history;\n if (historyIndex < historyLength - 1) {\n history = this.state.history.splice(0, historyIndex + 1);\n }\n\n return history.concat([{ currentBoard: currentBoard }]);\n }", "_flush() {\n\t\tthis.finished = true;\n\t\tthis._definitelyPush();\n\t}", "function clearHistory() {\n localStorage.clear();\n $('#searchHistory').empty();\n}", "function clearHistory(){\r\n totalHistory = '';\r\n historyValue.innerHTML = \"\";\r\n}", "clearBold()\n {\n this.state.history.forEach(o => \n o.isCurrent = false\n )\n }", "reset() {\r\n this.currentState = this.config.initial;\r\n this.history.push(this.currentState);\r\n }", "static flush() {\n PStore.clearAll();\n }", "function clearHistory() {\n var today = moment().format('DD');\n var yesterday = localStorage.getItem(\"today\");\n\n if (yesterday !== today) {\n localStorage.clear();\n }\n localStorage.setItem(\"today\", today);\n }", "flush() {\n // flush!\n }", "function clear() {\n $log.debug(\"kyc-flow-state clear()\");\n clearCurrent();\n states = [];\n }", "flushBuffer() {\n this._logMap.clear();\n }", "function undoChange() {\n\n this.quill.history.undo();\n}", "flush() {\n this.setObjectRenderer(this.emptyRenderer);\n }", "function uiLog_flush() {\n _uiLog_flushSet = null;\n\n // nothing to flush?\n if(_uiLog_entries.length == 0)\n return;\n\n // prepare log for transfer\n var log = \"\";\n for(var i = 0; i < _uiLog_entries.length; i++) {\n // get an entry\n var entry = _uiLog_entries[i];\n\n // add the entry to the log\n log += entry[\"time\"] + \"\\t\" +\n entry[\"event\"] + \"\\t\" +\n entry[\"target\"] + \"\\t\" +\n entry[\"id\"];\n for(var j = 0; j < entry[\"paramNumber\"]; j++)\n // parameters can have new lines and other special characters\n log += \"\\t\" + escape(entry[\"param\"+j]);\n\n log += \"\\n\";\n }\n\n // use commFrame to communicate to the backend\n top.code.comm_scheduleLoad(\"/uiLog.php?log=\"+escape(log));\n\n // clean up the log\n _uiLog_entries = new Array();\n}", "save() {\n if (this._history.length > 9){\n this._history.shift();\n }\n this._history.push(this.internalData);\n // Make the commit to setup the index and the state\n this.commit();\n }", "historyToEnd() {\n const fenCode = this.state.chessBoardHistory.toEnd();\n console.log('to end');\n console.log(this.state.chessBoardHistory);\n this.updateBoard(fenCode);\n }", "replaceHistState() {\n const params = new URLSearchParams();\n params.set('fg', this.fg);\n params.set('bg', this.bg);\n params.set('mode', this.numberType);\n params.set('showHint', false);\n params.set('directDrive', this.directDrive);\n window.history.replaceState({}, '', '?' + params.toString());\n }", "function reset() {\n save(null);\n }", "function flushLocalStorage() {\n\tlocalStorage.clear();\n\tinitLocalStorage();\n}", "flush()\n {\n this.setObjectRenderer(this.emptyRenderer);\n }", "function clearAll() {\n var tableBody = document.getElementById(\"historyTableBody\");\n tableBody.innerHTML = '';\n storageLocal.removeItem('stopWatchData');\n historyData = [];\n cachedData = [];\n stopButtonsUpdate();\n}", "keepHistory() {\n currentHistory += 1\n history.push(this.state.alasisu)\n }", "_clearWorkspaceHistory() {\n const menu = this.getWorkspaceHistoryMenu();\n const items = Array.from(menu.items);\n menu.clear();\n if (!items[2].visible) {\n items[2].visible = true;\n }\n for (let i = 0; i < 3; i++) {\n menu.append(items[i]);\n }\n }", "function resetHistory(){\r\n\tfor (var i = 1 ; i <= 10; i++) {\r\n\t\tlocalStorage.setItem(\"History\"+i, \"\");\r\n\t\thistory[(i-1)] = \"\";\r\n\r\n\t\tconsole.log(localStorage.setItem(\"History\"+i, \"\"));\r\n\t\tvar clearArray = []\r\n\t\tlocalStorage.setItem(\"HistoryArray\"+i,JSON.stringify(clearArray));\r\n\r\n\t\thistoryArrayList = []\r\n\t\tconsole.log(i);\r\n\t}\r\n}", "switchHistory() {\n // display history page\n const action1 = switchHistoryPage(true);\n store.dispatch(action1);\n // get history from backend\n service.getHistoryall().then((data) => {\n const action2 = changeHistory(data.files);\n store.dispatch(action2);\n });\n }", "function flush () {\n flushing = true\n run(queue)\n run(userQueue)\n reset()\n}", "function flush () {\n flushing = true\n run(queue)\n run(userQueue)\n reset()\n}", "function flush () {\n flushing = true\n run(queue)\n run(userQueue)\n reset()\n}", "function flushBook() {\n book = null;\n }", "undo() {\n const cmd = this.history.pop();\n cmd.undo();\n }", "undo() {\n const cmd = this.history.pop();\n cmd.undo();\n }", "function clearHistory(e) {\n e.preventDefault();\n searchHistory = [];\n localStorage.removeItem(\"cityname\");\n document.location.reload();\n\n}", "function clearHistory() {\n clearButton.on(\"click\", function () {\n console.log(\"hi\");\n savedDiv.empty();\n localStorage.clear();\n });\n}", "historyForward() {\n const fenCode = this.state.chessBoardHistory.forward();\n console.log('forward');\n console.log(this.state.chessBoardHistory);\n this.updateBoard(fenCode);\n }", "function undoLogReset() {\n\tresetBoardToText(resetBoards.pop());\n}", "function appCallbacksFakeResetHistory() {\n Object.keys(appCallbacksFake).forEach((key) => appCallbacksFake[key].resetHistory());\n }", "clear() {\n\t\tlocalStorage.removeItem( 'finished' );\n\t\tthis.setState( { finished: [] } );\n\t}", "set_reverse() {\n// this.prev = this.grid.slice(0);\n if (this.history.length < 10) { // only add to database\n this.history.push(this.grid.slice(0));\n } else {\n this.history.shift(); // remove the first element\n this.history.push(this.grid.slice(0));\n }\n }", "function emptyState(){\n history.pushState(\" \",\" \",\"/\");\n}", "flush() {\n return this.removeAll();\n }", "reset() {\n this.flush();\n this.lastRun = 0;\n this.lag = 0;\n }", "function resetLocalStorate(){\n localStorage.setItem('history', '[]');\n HTMLhistory.innerHTML = '<p class=\"no-history-available\">No history available</p>';\n}", "function resetHistory(ifTemporal) {\n $('#svg_history').remove();\n d3.selectAll(\".code-tree\").remove();\n d3.selectAll(\".kg-network\").remove();\n selectedCode = clone(currentCode);\n updateCodeList();\n renderPtHistory(gPID, gSinPtData, gPtPredData, gSinPtData, gPtPredData, 0, ifTemporal);\n}", "function restore_history () {\n\tvar text = edit_history [edit_history_index];\n\tvar ds = HalfedgeDS.fromJSON (JSON.parse(text));\n\tannotateHdsPolygonSides(ds);\n\thdsDraw (ds);\n\tconfigureButtons();\n}", "function flush () {\n\t flushing = true\n\t run(queue)\n\t run(userQueue)\n\t reset()\n\t}", "revertLastState() {\n // Make sure there is a history of state changes\n if (this._history.length > 0) {\n // Pop off the last state preserved in the history and set the current state equal to that\n this._state = this._history.pop();\n }\n // Since the state has changed, we have to emit those changes\n this._emitChange();\n }", "function histTransaction(history, state, dispatch, redo) {\n var preserveItems = mustPreserveItems(state), histOptions = historyKey.get(state).spec.config;\n var pop = (redo ? history.undone : history.done).popEvent(state, preserveItems);\n if (!pop) { return }\n\n var selection = pop.selection.resolve(pop.transform.doc);\n var added = (redo ? history.done : history.undone).addTransform(pop.transform, state.selection.getBookmark(),\n histOptions, preserveItems);\n\n var newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0);\n dispatch(pop.transform.setSelection(selection).setMeta(historyKey, {redo: redo, historyState: newHist}).scrollIntoView());\n}", "_flush() {\n this.push(this.contents);\n this.emit('end')\n }", "clearCommits(){\n dispatcher.dispatch({type: 'COMMITS_CLEAR'});\n }", "function file_cache_flush() {\n\t\tfile_cache_dir_save(true /* immediately */);\n\t}", "clearStates() {\n // applications should extend this to actually do something, assuming they can save locally\n }", "function voltarHistory()\n\t{\n\t\twindow.history.back();\n\t}", "function ClearStack() {\n UndoStack = [];\n }", "historyBack() {\n const fenCode = this.state.chessBoardHistory.back();\n console.log('back');\n console.log(this.state.chessBoardHistory);\n this.updateBoard(fenCode);\n }", "flush() {\n this.commands = [];\n }", "reset() {\n store.dispatch('setIsUnsavedChanges', { isUnsavedChanges: true });\n this.data = {};\n this.activeIndex = 0;\n this.activeCaption = '';\n }", "_clearFilter() {\n hashHistory.push({pathname: \"/users\", query: {}})\n }", "clearCache() {\n this.options.cache.flushAll();\n }", "function flush() {\n if(currentStreak > 0)//don't bother saving streaks of 0 points. (Consecutive failures.)\n streaks.push(currentStreak)\n currentStreak = 0;\n }", "saveHistory(query) {\n let searchHistory = localStorage.getItem('searchHistory');\n searchHistory = searchHistory ? JSON.parse(searchHistory) : [];\n searchHistory.push({\n query,\n time: Date.now(),\n });\n searchHistory = takeRight(searchHistory, 50); // Latest 50 searches\n this.setState({\n searchHistory: searchHistory,\n });\n localStorage.setItem('searchHistory', JSON.stringify(searchHistory));\n }", "endProcess() {\n this.index.end = this.history.length;\n }", "function clearHistory(){\n\tvar elements = document.getElementsByClassName('history-element');\t\n\twhile(elements[0]){\n\t\telements[0].parentNode.removeChild(elements[0]);\n\t}\n}" ]
[ "0.709372", "0.7037455", "0.7037455", "0.7015005", "0.69102156", "0.69056433", "0.68692094", "0.6843131", "0.68182665", "0.6756189", "0.67134213", "0.6679908", "0.66752666", "0.66752666", "0.66124856", "0.6514325", "0.65132195", "0.6504792", "0.64853007", "0.64226294", "0.6369417", "0.6360733", "0.63385004", "0.6336176", "0.6320129", "0.62434417", "0.6242375", "0.6242252", "0.62212586", "0.6182309", "0.61706764", "0.61664426", "0.61625063", "0.6147481", "0.61467314", "0.61371607", "0.6130025", "0.61083287", "0.61050344", "0.6066062", "0.6063955", "0.6059347", "0.6058067", "0.6023097", "0.60187393", "0.6003318", "0.5979294", "0.5930368", "0.59218085", "0.5913659", "0.5882213", "0.58760744", "0.5862568", "0.584997", "0.5844994", "0.58282614", "0.58271104", "0.5824012", "0.58239955", "0.5800081", "0.57790345", "0.5763981", "0.5759616", "0.57440275", "0.57440275", "0.57440275", "0.5732607", "0.5728858", "0.5728858", "0.5728794", "0.5720963", "0.5715766", "0.5697095", "0.5695781", "0.56942123", "0.5690364", "0.5686701", "0.567699", "0.5675033", "0.56711376", "0.5669315", "0.5662395", "0.5651062", "0.5650176", "0.56489253", "0.5643311", "0.5639441", "0.5631277", "0.5629099", "0.5628209", "0.56213593", "0.5619514", "0.5619028", "0.5598384", "0.5595999", "0.5583362", "0.55819434", "0.556916", "0.5568751", "0.55518126" ]
0.5601759
93
Calculation of memory based on the quantity of nodes and pod Size.
function calculateBasedMem() { //var theForm = document.forms["capacity_form"]; var qtyAppNode = document.getElementById('qtyAppNode').value; var appNodeMem = document.getElementById('memNodeSize').value; var memPodSize = document.getElementById('memPodSize').value; var totalAppNodeMem = appNodeMem * qtyAppNode; var totalPodPerMem = totalAppNodeMem / memPodSize; return totalPodPerMem; //display the result //document.getElementById('ccapacity').innerHTML = "Total pod por Mem: "+totalPodPerMem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_ec2_instance_memory_metrics() {}", "function getMemorySize(functionObject) {\n return Number(functionObject.batch.memory)\n || Number(functionObject.memory)\n || 2048;\n}", "function getMemoryUsage( args ) {\n const v8 = require('v8');\n var\n result = {\n statistics: v8.getHeapStatistics(),\n usage: process.memoryUsage()\n };\n\n args.callback( null, result );\n }", "function calculateBasedCpu() {\n var qtyAppNode = document.getElementById('qtyAppNode').value;\n var appNodeCpu = document.getElementById('cpuNodeSize').value;\n var cpuPodSize = document.getElementById('cpuPodSize').value;\n var totalAppNodeCpu = appNodeCpu * qtyAppNode;\n var totalPodPerCpu = totalAppNodeCpu / cpuPodSize;\n return totalPodPerCpu;\n\t//display the result\n //document.getElementById('ccapacity').innerHTML = \"Total pod por CPU: \"+totalPodPerCpu;\n}", "get nodeSize() {\n return this.isLeaf ? 1 : 2 + this.content.size;\n }", "scaleOnMemoryUtilization(id, props) {\n return super.doScaleToTrackMetric(id, {\n predefinedMetric: appscaling.PredefinedMetric.ECS_SERVICE_AVERAGE_MEMORY_UTILIZATION,\n targetValue: props.targetUtilizationPercent,\n policyName: props.policyName,\n disableScaleIn: props.disableScaleIn,\n scaleInCooldown: props.scaleInCooldown,\n scaleOutCooldown: props.scaleOutCooldown,\n });\n }", "function storageSize(dataType, userDefinedTypes, allocations) {\n return storageSizeAndAllocate(dataType, userDefinedTypes, allocations).size;\n}", "get size() {\n let size = 0;\n for (let i = 0; i < this.children.length; i++)\n size += this.children[i].size;\n return size;\n }", "loadFactor() {\n return this.elements / this.capacity;\n }", "loadFactor() {\n return this.elements / this.capacity;\n }", "function GetSizeOfItems(ns) {\n var ns2 = (ns == 'w') ? 'width' : 'height', ns3 = (ns == 'w') ? 'Width' : 'Height', names = [ns + 'Self', ns + 'ToPadding', ns + 'ToBorder', ns + 'ToMargin'];\n // Reset property at first\n for (i = 0; i < names.length; i++) {\n p[names[i]] = [];\n }\n // Setup each item\n va.$pagItem.each(function () {\n var $itemCur = $(this), dSelf = M.R(M[ns3]($itemCur)), \n // Distance around of item: padding, border, margin\n dPadding = M.R(M['Inner' + ns3]($itemCur) - dSelf), dPadToBor = M.R(M['Outer' + ns3]($itemCur) - dSelf), dPadToMar = M.R(M['Outer' + ns3]($itemCur, true) - dSelf);\n // Setup size of pagItem when have option: width, height, minWidth, maxWidth...\n var optsMin = opag['min' + ns3], optsMax = opag['max' + ns3];\n if ($.isNumeric(opag[ns2]))\n dSelf = opag[ns2];\n if ($.isNumeric(optsMin) && dSelf < optsMin)\n dSelf = optsMin;\n if ($.isNumeric(optsMax) && dSelf > optsMax)\n dSelf = optsMax;\n // Push all size into array[]\n // Part size is sum -> because size 'self' can change\n p[names[0]].push(dSelf);\n p[names[1]].push(dSelf + dPadding);\n p[names[2]].push(dSelf + dPadToBor);\n p[names[3]].push(dSelf + dPadToMar);\n });\n /**\n * SETUP OTHER SIZE\n * + Size Min - Max of pagItem\n * + Total size of all pagItems\n */\n p[ns + 'Min'] = Math.min.apply(null, p[names[0]]);\n p[ns + 'Max'] = Math.max.apply(null, p[names[0]]);\n p[ns + 'Sum'] = M.Sum(p[names[3]]);\n }", "function calcWeightedRes(cpu, memory, numOfRequests) {\n return cpu * 0.4 + memory * 0.2 + numOfRequests * 0.4;\n}", "get usedSize() {\n\t\treturn this._used.length;\n\t}", "function MemoryGraph(parent) {\n PerformanceGraph.call(this, parent, L10N.getStr(\"graphs.memory\"));\n}", "function calldataSizeAndAllocate(definition, referenceDeclarations, existingAllocations) {\n switch (DecodeUtils.Definition.typeClass(definition)) {\n case \"bool\":\n case \"address\":\n case \"contract\":\n case \"int\":\n case \"uint\":\n case \"fixed\":\n case \"ufixed\":\n case \"enum\":\n return [DecodeUtils.EVM.WORD_SIZE, false, existingAllocations];\n case \"string\":\n return [DecodeUtils.EVM.WORD_SIZE, true, existingAllocations];\n case \"bytes\":\n return [DecodeUtils.EVM.WORD_SIZE, DecodeUtils.Definition.specifiedSize(definition) == null,\n existingAllocations];\n case \"mapping\":\n return [undefined, undefined, existingAllocations];\n case \"function\":\n switch (DecodeUtils.Definition.visibility(definition)) {\n case \"external\":\n return [DecodeUtils.EVM.WORD_SIZE, false, existingAllocations];\n case \"internal\":\n return [undefined, undefined, existingAllocations];\n }\n case \"array\": {\n if (DecodeUtils.Definition.isDynamicArray(definition)) {\n return [DecodeUtils.EVM.WORD_SIZE, true, existingAllocations];\n }\n else {\n //static array case\n const length = DecodeUtils.Definition.staticLength(definition);\n if (length === 0) {\n //arrays of length 0 are static regardless of base type\n return [0, false, existingAllocations];\n }\n const baseDefinition = definition.baseType || definition.typeName.baseType;\n const [baseSize, dynamic, allocations] = calldataSizeAndAllocate(baseDefinition, referenceDeclarations, existingAllocations);\n return [length * baseSize, dynamic, allocations];\n }\n }\n case \"struct\": {\n const referenceId = DecodeUtils.Definition.typeId(definition);\n let allocations = existingAllocations;\n let allocation = allocations[referenceId];\n if (allocation === undefined) {\n //if we don't find an allocation, we'll have to do the allocation ourselves\n const referenceDeclaration = referenceDeclarations[referenceId];\n allocations = allocateStruct(referenceDeclaration, referenceDeclarations, existingAllocations);\n allocation = allocations[referenceId];\n }\n //having found our allocation, if it's not null, we can just look up its size and dynamicity\n if (allocation !== null) {\n return [allocation.length, allocation.dynamic, allocations];\n }\n //if it is null, this type doesn't go in calldata\n else {\n return [undefined, undefined, allocations];\n }\n }\n }\n}", "function size() {\n return n;\n }", "function calculateSizes () {\n // Figure out the parent size minus padding.\n var a = elements[this.a].element;\n var b = elements[this.b].element;\n\n this.size = a[getBoundingClientRect]()[dimension] + b[getBoundingClientRect]()[dimension] + this.aGutterSize + this.bGutterSize;\n this.start = a[getBoundingClientRect]()[position];\n }", "function calculateSizes () {\n // Figure out the parent size minus padding.\n var a = elements[this.a].element;\n var b = elements[this.b].element;\n\n this.size = a[getBoundingClientRect]()[dimension] + b[getBoundingClientRect]()[dimension] + this.aGutterSize + this.bGutterSize;\n this.start = a[getBoundingClientRect]()[position];\n }", "function nodeSize(d) {\n d.state = 0;\n if (d.name.slice(0, 4) != \"bsms\") {\n return 6;\n } else {\n return 15;\n }\n }", "recalculateSizes() {\n let elem = ReactDOM.findDOMNode(this).parentNode;\n this.width = elem.offsetWidth - 30;\n this.divHeight = elem.offsetHeight;\n this.height = this.data.length * 60;\n this.barHeight = (this.height - 50) / this.data.length / 2;\n const minSize = Math.min(this.width, this.divHeight);\n this.textSize = minSize / 30;\n }", "size() {\n return this.rootNode.size(this.storage);\n }", "function calculateSizes () {\n console.log('calculateSizes');\n\n updateName(['_yyparse.s', fs.readFileSync('build/s/_yyparse.s', { encoding: 'utf8' })]);\n\n execSync(\n 'cat ./updateSpinner.s ./build/s/_yyparse.s > ./build/g/_yyparse.s;' +\n 'cl65 -T -t c64 ' +\n '-o ./build/obj2/yyparse.bin ' +\n '-Ln ./build/obj2/yyparse.lbl ' +\n '-C ./yyparse.cfg ./build/g/_yyparse.s'\n );\n\n passPostfix = 'a';\n\n const yyparseSize = Math.max(0x2000, fs.statSync('build/obj2/yyparse.bin').size);\n\n const yyparseStart = 0xC000 - yyparseSize;\n\n const dataSize = fs.statSync('build/data.bin').size;\n\n const dataStart = yyparseStart - dataSize;\n\n const libcSize = fs.statSync('build/libcdata.bin').size;\n\n const libcStart = dataStart - libcSize;\n\n const floatlibSize = fs.statSync('build/floatlibdata.bin').size;\n\n const floatlibStart = libcStart - floatlibSize;\n\n const mainSize = fs.statSync('build/maindata.bin').size;\n\n const mainStart = floatlibStart - mainSize;\n\n const heapSize = mainStart - 0x0800;\n\n remainder -= (yyparseSize + dataSize + libcSize + floatlibSize + mainSize);\n\n execSync(\n \"sed 's/ROMH: file = %O, start = $8000, size = $4000/\" +\n 'ROMH: file = %O, start = $' +\n (yyparseStart.toString(16).toUpperCase()) +\n ', size = $' +\n (yyparseSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' yyparse.cfg > build/yyparsea.cfg\"\n );\n\n execSync(\n \"sed 's/data2.bin\\\\\\\", start = $0800, size = $9800/\" +\n 'data2.bin\\\\\", start = $' +\n (dataStart.toString(16).toUpperCase()) +\n ', size = $' +\n (dataSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' data.cfg > build/dataa.cfg\"\n );\n\n execSync(\n \"sed 's/floatlibdata2.bin\\\\\\\", start = $0800, size = $9800/\" +\n 'floatlibdata2.bin\\\\\", start = $' +\n (floatlibStart.toString(16).toUpperCase()) +\n ', size = $' +\n (floatlibSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' floatlib.cfg > build/floatliba.cfg\"\n );\n\n execSync(\n \"sed 's/libcdata2.bin\\\\\\\", start = $0800, size = $9800/\" +\n 'libcdata2.bin\\\\\", start = $' +\n (libcStart.toString(16).toUpperCase()) +\n ', size = $' +\n (libcSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' libc.cfg > build/libca.cfg\"\n );\n\n execSync(\n \"sed 's/RAM2: file = \\\\\\\"\\\\\\\", start = $0800, size = $9800/\" +\n 'RAM2: file = \\\\\"\\\\\", start = $' +\n (mainStart.toString(16).toUpperCase()) +\n ', size = $' +\n (mainSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' main.cfg > build/maina.cfg\"\n );\n\n execSync(\n \"sed '\" +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' page.cfg > build/pagea.cfg\"\n );\n\n compileFloatLib();\n}", "setPxSizes() {\n var px_per_em = this.getEmSize( this.jqueryMap.$container.get(0) );\n\n this.stateMap.px_per_em = px_per_em;\n this.stateMap.alone_height_px = this.configMap.alone_height_em * px_per_em;\n this.stateMap.other_height_px = this.configMap.other_height_em * px_per_em;\n }", "function calculateLengths() {\n\t this.nodeList.forEach(function (node) {\n\t return node.length = node.parent ? node.height - node.parent.height : 0;\n\t });\n\t this.lengthsKnown = true;\n\t this.treeUpdateCallback();\n\t}", "get length() {\n if (this.isDynamic) {\n return this.placeholderContext.resolve(this.allocation.size);\n }\n else {\n return this.allocation.size;\n }\n }", "get optimalSize() {\n return [200, 32];\n }", "calculatePartSize(size) {\n if (!isNumber(size)) {\n throw new TypeError('size should be of type \"number\"')\n }\n if (size > this.maxObjectSize) {\n throw new TypeError(`size should not be more than ${this.maxObjectSize}`)\n }\n if (this.overRidePartSize) {\n return this.partSize\n }\n var partSize = this.partSize\n for (;;) {\n // while(true) {...} throws linting error.\n // If partSize is big enough to accomodate the object size, then use it.\n if (partSize * 10000 > size) {\n return partSize\n }\n // Try part sizes as 64MB, 80MB, 96MB etc.\n partSize += 16 * 1024 * 1024\n }\n }", "function size() {\n\t return n;\n\t }", "get size() {\n // Return the quad count if if was cached\n let size = this._size;\n if (size !== null) return size;\n\n // Calculate the number of quads by counting to the deepest level\n size = 0;\n const graphs = this._graphs;\n let subjects, subject;\n for (const graphKey in graphs) for (const subjectKey in subjects = graphs[graphKey].subjects) for (const predicateKey in subject = subjects[subjectKey]) size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "function computeNodeBreadths() {\n // var remainingNodes = nodes,\n // nextNodes,\n // x = 0\n\n // var test=1;\n nodes.forEach(function (node) {\n node.x = node.pos * nodeOffset;////pos is in the Json data jixiangyu\n\n //console.log(node.cluster);\n //test++;\n\n node.dx = nodeWidth;\n });\n }", "function getMemUsage() {\n var total = os.totalmem(),\n usage = total - os.freemem(),\n perc = usage / total * 100;\n\n return {\n usage : usage\n , total : total\n , percentage : perc\n };\n}", "function calculateMemoryCost() {\n let extraMemCost = document.getElementById(\"extra-memory-cost\");\n let prevExtraMemCostText = extraMemCost.innerText;\n let newExtraMemCostNumber = parseFloat(prevExtraMemCostText);\n return newExtraMemCostNumber;\n}", "function DataMemory(numberOfMemoryCells) {\n var _ram = new RAM(numberOfMemoryCells);\n var _media = new Media();\n var _tableManager = new TableManager()\n\n this.ram = function() {\n return _ram;\n }\n\n this.media = function() {\n return _media;\n }\n\n this.tableManager = function() {\n return _tableManager;\n }\n\n this.reset = function() {\n _ram.reset();\n _tableManager.reset();\n }\n}", "function size(node) {\n return node.size ? node.size : 1;\n }", "async function topPods(api, metrics, namespace) {\n // Figure out which pod list endpoint to call\n const getPodList = async () => {\n if (namespace) {\n return (await api.listNamespacedPod(namespace)).body;\n }\n return (await api.listPodForAllNamespaces()).body;\n };\n const [podMetrics, podList] = await Promise.all([metrics.getPodMetrics(namespace), getPodList()]);\n // Create a map of pod names to their metric usage\n // to make it easier to look up when we need it later\n const podMetricsMap = podMetrics.items.reduce((accum, next) => {\n accum.set(next.metadata.name, next);\n return accum;\n }, new Map());\n const result = [];\n for (const pod of podList.items) {\n const podMetric = podMetricsMap.get(pod.metadata.name);\n const containerStatuses = [];\n let currentPodCPU = 0;\n let currentPodMem = 0;\n let podRequestsCPU = 0;\n let podLimitsCPU = 0;\n let podRequestsMem = 0;\n let podLimitsMem = 0;\n pod.spec.containers.forEach((container) => {\n // get the the container CPU/Memory container.resources.requests/limits\n const containerCpuTotal = util_1.totalCPUForContainer(container);\n const containerMemTotal = util_1.totalMemoryForContainer(container);\n // sum each container's CPU/Memory container.resources.requests/limits\n // to get the pod's overall requests/limits\n podRequestsCPU = util_1.add(podRequestsCPU, containerCpuTotal.request);\n podLimitsCPU = util_1.add(podLimitsCPU, containerCpuTotal.limit);\n podRequestsMem = util_1.add(podLimitsMem, containerMemTotal.request);\n podLimitsMem = util_1.add(podLimitsMem, containerMemTotal.limit);\n // Find the container metrics by container.name\n // if both the pod and container metrics exist\n const containerMetrics = podMetric !== undefined\n ? podMetric.containers.find((c) => c.name === container.name)\n : undefined;\n // Store the current usage of each container\n // Sum each container to get the overall pod usage\n if (containerMetrics !== undefined) {\n const currentContainerCPUUsage = util_1.quantityToScalar(containerMetrics.usage.cpu);\n const currentContainerMemUsage = util_1.quantityToScalar(containerMetrics.usage.memory);\n currentPodCPU = util_1.add(currentPodCPU, currentContainerCPUUsage);\n currentPodMem = util_1.add(currentPodMem, currentContainerMemUsage);\n const containerCpuUsage = new CurrentResourceUsage(currentContainerCPUUsage, containerCpuTotal.request, containerCpuTotal.limit);\n const containerMemUsage = new CurrentResourceUsage(currentContainerMemUsage, containerMemTotal.request, containerMemTotal.limit);\n containerStatuses.push(new ContainerStatus(containerMetrics.name, containerCpuUsage, containerMemUsage));\n }\n });\n const podCpuUsage = new CurrentResourceUsage(currentPodCPU, podRequestsCPU, podLimitsCPU);\n const podMemUsage = new CurrentResourceUsage(currentPodMem, podRequestsMem, podLimitsMem);\n result.push(new PodStatus(pod, podCpuUsage, podMemUsage, containerStatuses));\n }\n return result;\n}", "get totalSize() {\n return this.length + (this.current ? 1 : 0);\n }", "function size() {\n out = 1;\n for (var dim in dimensions) {\n out *= dimensions[dim].members.length;\n }\n return out;\n }", "function gatherMemory() {\n let memory = process.getProcessMemoryInfo();\n let details =\n 'workingSetSize: ' + memory.workingSetSize +\n ' peakWorkingSetSize: ' + memory.peakWorkingSetSize +\n ' privatesBytes: ' + memory.privatesBytes +\n ' sharedBytes: ' + memory.sharedBytes;\n log.send(logLevels.INFO, details);\n}", "function sizesSum() {\n\t\t\t\t\tif (o.advanced.updateOnSelectorChange === true) {\n\t\t\t\t\t\to.advanced.updateOnSelectorChange = \"*\";\n\t\t\t\t\t}\n\t\t\t\t\tvar total = 0,\n\t\t\t\t\t sel = mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\t\tif (o.advanced.updateOnSelectorChange && sel.length > 0) {\n\t\t\t\t\t\tsel.each(function () {\n\t\t\t\t\t\t\ttotal += this.offsetHeight + this.offsetWidth;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn total;\n\t\t\t\t}", "getRamSize() {\n let kb;\n switch (this.ramSize) {\n case RamSize.RAM_4_KB:\n kb = 4;\n break;\n case RamSize.RAM_16_KB:\n kb = 16;\n break;\n case RamSize.RAM_32_KB:\n kb = 32;\n break;\n case RamSize.RAM_48_KB:\n default:\n kb = 48;\n break;\n }\n return kb * 1024;\n }", "get fullSize() {\n\t\treturn this._free.length + this._used.length;\n\t}", "get gpuMemoryUsageInBytes() {\n return this._gpuMemoryUsageInBytes;\n }", "get gpuMemoryUsageInBytes() {\n return this._gpuMemoryUsageInBytes;\n }", "function nodeSize (d){\n if(d.type == \"member\"){ //edges type\n return d.linkCount ? (d.linkCount + 4) * 1 : 2; // (d.linkCount < 3) ? d.linkCount * 3 : d.linkCount * 1.5;\n } else {\n return d.linkCount ? (d.linkCount + 5) * 0.2 : 2; // d.linkCount ? d.linkCount * 0.2 : 5; //alternatively \"(d.linkCount < 5) ? d.linkCount * 3 : d.linkCount * .3\"\n }\n}", "getDimensions(){\n if (this.node === null) {return;}\n else {\n let nodeWidth = this.node.getBoundingClientRect().width\n let nodeHeight = this.node.getBoundingClientRect().height\n let shouldResize = nodeWidth !== this.props.width ||\n nodeHeight !== this.props.height\n if (shouldResize) {\n this.props.resize(nodeWidth, nodeHeight)\n }\n }\n }", "function _saveMemory () {\n memory = total;\n }", "fileSize () {\n if (this.isDirectory()) {\n // dirs don't have file size\n return 0\n }\n\n let sum = 0\n this.blockSizes.forEach((size) => {\n sum += size\n })\n\n if (this.data) {\n sum += this.data.length\n }\n\n return sum\n }", "get memoryAvailable() {\n return this._memoryAvailable;\n }", "function onPrefixChange(sel) {\n let memorySize = memSizeEl.value;\n let oldMemPre = sizePreEl.oldValue;\n let memoryPre = sizePreEl.value;\n let totalMemSize = 0;\n\n switch (oldMemPre) {\n case 'B':\n totalMemSize = memorySize;\n break;\n case 'K':\n totalMemSize = (memorySize * 1024);\n break;\n case 'M':\n totalMemSize = (memorySize * 1024 * 1024);\n break;\n case 'G':\n totalMemSize = (memorySize * 1024 * 1024 * 1024);\n break;\n }\n\n console.log('total memory size ' + totalMemSize);\n\n switch (memoryPre) {\n case 'B':\n memSizeEl.value = parseInt(totalMemSize, 10);\n break;\n case 'K':\n memSizeEl.value = parseInt((totalMemSize / 1024), 10);\n break;\n case 'M':\n memSizeEl.value = parseInt((totalMemSize / (1024 * 1024)), 10);\n break;\n case 'G':\n memSizeEl.value = parseInt((totalMemSize / (1024 * 1024 * 1024)), 10);\n break;\n }\n\n sizePreEl.oldValue = sizePreEl.value;\n}", "size() {\n let output = 0;\n this.traverse((currentNode) => {\n output++;\n });\n return output;\n }", "get size() {\n // Return the quad count if if was cached\n var size = this._size;\n if (size !== null) return size; // Calculate the number of quads by counting to the deepest level\n\n size = 0;\n var graphs = this._graphs,\n subjects,\n subject;\n\n for (var graphKey in graphs) for (var subjectKey in subjects = graphs[graphKey].subjects) for (var predicateKey in subject = subjects[subjectKey]) size += Object.keys(subject[predicateKey]).length;\n\n return this._size = size;\n }", "static get SIZE() { return 2000000; }", "function totalCells(){\n var rows = countRows();\n var cols = countColumns();\n var size = rows * cols;\n return size;\n}", "getDataValues () {\n const list = $objs.get_list; // getter Obj from current scene\n // lister objet par containerType\n const total_containerType = {};\n Object.keys($systems.classType.containers).forEach(ctype => {\n total_containerType[ctype] = list.filter((o) => { return o.dataValues.b.containerType === ctype });\n });\n const total_dataType = {};\n Object.keys($systems.classType.datas).forEach(dtype => {\n total_dataType[dtype] = list.filter((o) => { return o.dataValues.b.dataType === dtype });\n });\n const total_sheets = {};\n list.forEach(dataObj => {\n total_sheets[dataObj._dataBaseName] = dataObj.dataBase;\n });\n if( this.scene.background.dataObj._dataBaseName ){ // also add bg\n total_sheets[this.scene.background.dataObj._dataBaseName] = this.scene.background.dataObj.dataBase;\n };\n const memoryUsage = (()=>{\n const m = process.memoryUsage();\n Object.keys(m).map((i)=>{ return m[i] = (m[i]/ 1024 / 1024).toFixed(2) });\n return m;\n })();\n return {\n memoryUsage,\n currentScene : this.scene.name,\n savePath : `data/${this.scene.name}.json`,\n total_containerType,\n total_dataType,\n total_sheets,\n totalObjs : list.length,\n };\n }", "function calc_size(bsize) {\n\n var defs = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n var counter = 0;\n\n while(bsize > 1024) {\n bsize /= 1024;\n counter++;\n }\n\n console.log((Math.round(bsize * 100) / 100) + defs[counter]);\n\n}", "get size() {\n if (this.isEmpty)\n return 0;\n let size = this.nextLayer.size;\n for (let chunk of this.chunk)\n size += chunk.value.length;\n return size;\n }", "function calldataSize(definition, referenceDeclarations, allocations) {\n let [size, dynamic] = calldataSizeAndAllocate(definition, referenceDeclarations, allocations); //throw away allocations\n return [size, dynamic];\n}", "function collectMemoryStats() {\n var memUsage = process.memoryUsage();\n metrics.gauge('memory.rss', memUsage.rss);\n metrics.gauge('memory.heapTotal', memUsage.heapTotal);\n metrics.gauge('memory.heapUsed', memUsage.heapUsed);\n metrics.increment('memory.statsReported');\n}", "function populateMemoryStatus(){\n settingsMemoryTotal.innerHTML = Number((os.totalmem()-1000000000)/1000000000).toFixed(1) + 'G'\n settingsMemoryAvail.innerHTML = Number(os.freemem()/1000000000).toFixed(1) + 'G'\n}", "getMpg() {\n return 1000000\n }", "get ramSize() {\n return this.getNumberAttribute('ram_size');\n }", "function logMemory() {\n var memoryPromise = nodeConnection.domains.simple.getMemory();\n memoryPromise.fail(function (err) {\n console.error(\"[brackets-simple-node] failed to run simple.getMemory\", err);\n });\n memoryPromise.done(function (memory) {\n console.log(\n \"[brackets-simple-node] Memory: %d of %d bytes free (%d%)\",\n memory.free,\n memory.total,\n Math.floor(memory.free * 100 / memory.total)\n );\n });\n return memoryPromise;\n }", "get capacity () {return this._p.capacity;}", "function size(d) {\n\n switch (d.nodeType) {\n case \"likerNode\":\n return Math.sqrt(d.size) * 5 || 6;\n case \"taggedNode\":\n return Math.sqrt(d.size) * 5 || 4;\n case \"postNode\":\n return Math.sqrt(d.size) * 5 || 4.5;\n case \"coreNode\":\n return 20;\n case \"year\":\n return Math.sqrt(d.size) / 5 || 8;\n default:\n return Math.sqrt(d.size) * 5 || 4.5;\n }\n }", "async genNodeBase(){\n switch(this.state.size){\n case 3:\n return 21;\n case 2:\n return 13;\n case 1:\n return 8;\n default:\n return 1;\n }\n }", "async genNodeBase(){\n switch(this.state.size){\n case 5:\n return 21;\n case 4:\n return 13;\n case 3:\n return 8;\n case 2:\n return 5;\n case 1:\n return 3;\n default:\n return 1;\n }\n }", "get size() {\n // Return the triple count if if was cached\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of triples by counting to the deepest level\n size = 0;\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "get size() {\n // Return the triple count if if was cached.\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of triples by counting to the deepest level.\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "get size() {\n // Return the triple count if if was cached.\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of triples by counting to the deepest level.\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "nodeSize(node) {\n let size = 1;\n if (!node.children) {\n return size;\n }\n let children = this.getChild(node.children);\n do {\n size++;\n children = children.children\n ? this.getChild(children.children)\n : undefined;\n } while (children);\n return size;\n }", "function totalMemory(_handle, req, res, out) {\n const tag = req.__tag\n const total = {}\n\n function next(...args) {\n totaler.emit(tag, total) // done calculating memory usage\n return out(...args)\n }\n\n // listen for memory usage from each middleware fired in the chain\n recorder.on(tag, (diff) => {\n Object.keys(diff).reduce((totals, key) => {\n const value = diff[key] || 0\n\n // ignore values less than zero - these would indicate that garbage\n // collection occurred, and the memory _after_ the middleware executed\n // is now less than the memory _before_ the middleware was executed.\n // since garbage collection is a global process, it's not possible to\n // determine what the impact was to this one request. therefore,\n // just ignoring - better to over-report memory usage than under report.\n if (value < 0) {\n return totals\n }\n\n // add the value to the total\n return Object.assign(totals, { [key]: (total[key] || 0) + value })\n }, total)\n })\n\n return _handle.call(this, req, res, next)\n }", "function setup(jsonData) {\n var jsonData = BrowserUtils.getProcesses();\n cpus = [];\n mems = [];\n for (item in jsonData) {\n if(jsonData.hasOwnProperty(item)) {\n cpus.push(jsonData[item].cpu);\n mems.push(jsonData[item].memory);\n }\n }\n\n //Create SVG element\n svgCPU = d3.select(\"#cpuContainer\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")\");\n\n svgMem = d3.select(\"#memContainer\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")\")\n\n\n arcCPU = d3.svg.arc()\n .innerRadius(radius - 50)\n .outerRadius(radius);\n\n arcMem = d3.svg.arc()\n .innerRadius(radius - 50)\n .outerRadius(radius);\n\n pathMem = svgMem.selectAll(\"path\")\n .data(vizPieMem(mems))\n .enter()\n .append(\"path\")\n .attr(\"fill\", function(d, i) { return color(i); });\n\n pathCPU = svgCPU.selectAll(\"path\")\n .data(vizPieCPU(cpus))\n .enter()\n .append(\"path\")\n .attr(\"fill\", function(d, i) { return color(i); });\n\n pathCPU.transition()\n .duration(1000)\n .attr(\"d\", arcCPU)\n .each(function(d) { this._current = d; });\n\n pathMem.transition()\n .duration(1000)\n .attr(\"d\", arcMem)\n .each(function(d) { this._current = d; }); // gCPU = svgCPU.selectAll(\".arc\")\n // .data(vizPieCPU(cpus))\n // .enter().append(\"path\");\n // // .attr(\"class\", \"arc\");\n\n // gMem = svgMem.selectAll(\".arc\")\n // .data(vizPieMem(mems))\n // .enter().append(\"path\")\n // .attr(\"class\", \"arc\");\n\n // // Add loading text.\n // gCPU.append(\"text\")\n // .style(\"text-anchor\", \"middle\")\n // .style(\"font-size\",\"24px\")\n // .text(\"Loading...\");\n\n}", "function sizeCost(){\n if(this.size=s){\n return \"7.99\";\n }\n if(this.size=m){\n return \"9.99\"\n}\n if(this.size=l){\n return \"12.99\"\n}\n if(this.size=xl){\n return \"15.99\"\n}\n}", "function abiSizeAndAllocate(dataType, userDefinedTypes, existingAllocations) {\n switch (dataType.typeClass) {\n case \"bool\":\n case \"address\":\n case \"contract\":\n case \"int\":\n case \"uint\":\n case \"fixed\":\n case \"ufixed\":\n case \"enum\":\n return {\n size: Evm.Utils.WORD_SIZE,\n dynamic: false,\n allocations: existingAllocations\n };\n case \"string\":\n return {\n size: Evm.Utils.WORD_SIZE,\n dynamic: true,\n allocations: existingAllocations\n };\n case \"bytes\":\n return {\n size: Evm.Utils.WORD_SIZE,\n dynamic: dataType.kind === \"dynamic\",\n allocations: existingAllocations\n };\n case \"mapping\":\n return {\n allocations: existingAllocations\n };\n case \"function\":\n switch (dataType.visibility) {\n case \"external\":\n return {\n size: Evm.Utils.WORD_SIZE,\n dynamic: false,\n allocations: existingAllocations\n };\n case \"internal\":\n return {\n allocations: existingAllocations\n };\n }\n case \"array\": {\n switch (dataType.kind) {\n case \"dynamic\":\n return {\n size: Evm.Utils.WORD_SIZE,\n dynamic: true,\n allocations: existingAllocations\n };\n case \"static\":\n if (dataType.length.isZero()) {\n //arrays of length 0 are static regardless of base type\n return {\n size: 0,\n dynamic: false,\n allocations: existingAllocations\n };\n }\n const { size: baseSize, dynamic, allocations } = abiSizeAndAllocate(dataType.baseType, userDefinedTypes, existingAllocations);\n return {\n //WARNING! The use of toNumber() here may throw an exception!\n //I'm judging this OK since if you have arrays that large we have bigger problems :P\n size: dataType.length.toNumber() * baseSize,\n dynamic,\n allocations\n };\n }\n }\n case \"struct\": {\n let allocations = existingAllocations;\n let allocation = allocations[dataType.id];\n if (allocation === undefined) {\n //if we don't find an allocation, we'll have to do the allocation ourselves\n const storedType = (userDefinedTypes[dataType.id]);\n if (!storedType) {\n throw new Common.UnknownUserDefinedTypeError(dataType.id, Format.Types.typeString(dataType));\n }\n allocations = allocateStruct(storedType, userDefinedTypes, existingAllocations);\n allocation = allocations[storedType.id];\n }\n //having found our allocation, if it's not null, we can just look up its size and dynamicity\n if (allocation !== null) {\n return {\n size: allocation.length,\n dynamic: allocation.dynamic,\n allocations\n };\n }\n //if it is null, this type doesn't go in the abi\n else {\n return {\n allocations\n };\n }\n }\n case \"tuple\": {\n //Warning! Yucky wasteful recomputation here!\n let size = 0;\n let dynamic = false;\n //note that we don't just invoke allocateStruct here!\n //why not? because it has no ID to store the result in!\n //and we can't use a fake like -1 because there might be a recursive call to it,\n //and then the results would overwrite each other\n //I mean, we could do some hashing thing or something, but I think it's easier to just\n //copy the logic in this one case (sorry)\n for (let member of dataType.memberTypes) {\n let { size: memberSize, dynamic: memberDynamic } = abiSizeAndAllocate(member.type, userDefinedTypes, existingAllocations);\n size += memberSize;\n dynamic = dynamic || memberDynamic;\n }\n return { size, dynamic, allocations: existingAllocations };\n }\n }\n}", "calcTreeDensity () {\n return this.numberOfTrees / this.parkArea;\n }", "calculateFreeSpaceForStorageClass(storageClass){\n return Infinity;\n }", "calculateFreeSpaceForStorageClass(storageClass){\n return Infinity;\n }", "function _resolveNodeSize(node) {\n\t var localItemSize = itemSize;\n\t if (getItemSize) {\n\t localItemSize = getItemSize(node.renderNode, size);\n\t }\n\t if ((localItemSize[0] === true) || (localItemSize[1] === true)) {\n\t var result = context.resolveSize(node, size);\n\t if (localItemSize[0] !== true) {\n\t result[0] = itemSize[0];\n\t }\n\t if (localItemSize[1] !== true) {\n\t result[1] = itemSize[1];\n\t }\n\t return result;\n\t }\n\t else {\n\t return localItemSize;\n\t }\n\t }", "function getTotalPrice(itemNode) {\n var price = getPriceByProduct(itemNode);\n var qty = getQuantityByProduct(itemNode);\n return price * qty;\n}", "function mainmore(){\n Array.SIZE_RATIO = 3;\n let arr = new Array();\n arr.push(3);\n arr.push(5);\n arr.push(15);\n arr.push(19);\n arr.push(45);\n arr.push(10);\n console.log(arr);\n console.log(arr.length);\n console.log(arr._capacity);\n}", "function countNodes() {\r\n\treturn nodesPayload.length;\r\n}", "function mem(callback) {\n\tif (_windows) {\n\t\tcallback(NOT_SUPPORTED);\n\t}\n\n\tvar result = {\n\t\ttotal : os.totalmem(),\n\t\tfree : os.freemem(),\n\t\tused : os.totalmem() - os.freemem(),\n\n\t\tactive : os.totalmem() - os.freemem(),\n\t\tbuffcache : 0,\n\n\t\tswaptotal : 0,\n\t\tswapused : 0,\n\t\tswapfree : 0\n\t};\n\n\tif (_linux) {\n\t\texec(\"free -b\", function(error, stdout) {\n\t\t\tif (!error) {\n\t\t\t\tvar lines = stdout.toString().split('\\n');\n\n\t\t\t\tvar mem = lines[1].replace(/ +/g, \" \").split(' ');\n\t\t\t\tresult.total = parseInt(mem[1]);\n\t\t\t\tresult.free = parseInt(mem[3]);\n\t\t\t\tresult.buffcache = parseInt(mem[5]) + parseInt(mem[6]);\n\t\t\t\tresult.active = result.total - result.free - result.buffcache;\n\n\t\t\t\tmem = lines[3].replace(/ +/g, \" \").split(' ');\n\t\t\t\tresult.swaptotal = parseInt(mem[1]);\n\t\t\t\tresult.swapfree = parseInt(mem[3]);\n\t\t\t\tresult.swapused = parseInt(mem[2]);\n\n\t\t\t}\n\t\t\tcallback(result);\n\t\t});\n\t}\n\tif (_darwin) {\n\t\texec(\"vm_stat | grep 'Pages active'\", function(error, stdout) {\n\t\t\tif (!error) {\n\t\t\t\tvar lines = stdout.toString().split('\\n');\n\n\t\t\t\tresult.active = parseInt(lines[0].split(':')[1]) * 4096;\n\t\t\t\tresult.buffcache = result.used - result.active;\n\t\t\t}\n\t\t\texec(\"sysctl -n vm.swapusage\", function(error, stdout) {\n\t\t\t\tif (!error) {\n\t\t\t\t\tvar lines = stdout.toString().split('\\n');\n\t\t\t\t\tif (lines.length > 0) {\n\t\t\t\t\t\tvar line = lines[0].replace(/,/g, \".\").replace(/M/g, \"\");\n\t\t\t\t\t\tline = line.trim().split(' ');\n\t\t\t\t\t\tfor (var i = 0; i < line.length; i++) {\n\t\t\t\t\t\t\tif(line[i].toLowerCase().indexOf('total') != -1) result.swaptotal = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024;\n\t\t\t\t\t\t\tif(line[i].toLowerCase().indexOf('used') != -1) result.swapused = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024;\n\t\t\t\t\t\t\tif(line[i].toLowerCase().indexOf('free') != -1) result.swapfree = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcallback(result);\n\t\t\t});\n\t\t});\n\t}\n}", "allocate() {\n // allocate memory as per request\n this.allocation[this.processId] = sumArrays(this.allocation[this.processId], this.request)\n\n // check if allocation == max, then free the resources\n if (this.allocation[this.processId].equals(this.max[this.processId])) {\n // increase available resources\n this.available = sumArrays(this.available, this.allocation[this.processId])\n\n // set a fleag for the finished process\n this.finished[this.processId] = true\n\n // set allocation for the finished process to 0\n this.allocation[this.processId].fill(0)\n\n // set max for the finished process to 0\n this.max[this.processId].fill(0)\n }\n\n // decrease available resources\n this.available = subtractArrays(this.available, this.request)\n }", "async calculateTxSize (inputs, outputs, changeAddress, feeRate) {\n const weightTestInput = rpcFormat(inputs, outputs, changeAddress, 0.0005)\n const weightTestRaw = await this.client.createRawTransaction(...weightTestInput)\n const weightTestSigned = await this.client.signRawTransactionWithWallet(weightTestRaw)\n const weightTestTx = await this.client.decodeRawTransaction(weightTestSigned.hex)\n\n const virtualSize = weightTestTx.weight / 4\n return virtualSize\n }", "function getNodeAmount(nodes) {\n var nodeAmount = 0;\n for (var x = 0; x < nodes.length; x++) {\n nodeAmount = nodeAmount + 1;\n }\n return nodeAmount;\n}", "get capacity () {return this._pool.length;}", "async calculateCpuUsage() {\n this.__cpuUsage = await utils.getCpuUsage({ timeout: this.__cpuUsageInterval });\n }", "function realSize(arr) {\n // var suma = 0;\n // arr.forEach(function arrFor(val) {\n // if(typeof val === \"object\"){\n // suma += realSize(val);\n // }else if(typeof val === \"number\"){\n // suma++;\n // }\n\n // });\n\n if(arr.length == 0) return 0;\n // return suma;\n var copy = arr.slice();\n\n //SubTotal: Para arrays internos\n var subTotal;\n\n //Copia de array\n copy.shift();\n if(typeof arr[0] === \"object\"){\n subTotal = realSize(arr[0]);\n return subTotal + realSize(copy);\n }\n\n \n return 1 + realSize(copy);\n}", "get _optPhysicalSize(){return 0===this._viewportHeight?1/0:this._viewportHeight*this._maxPages}", "function kb(bytes) { return bytes / SIZE }", "metricProcessedBytes(props) {\n try {\n jsiiDeprecationWarnings.print(\"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer#metricProcessedBytes\", \"Use ``ApplicationLoadBalancer.metrics.processedBytes`` instead\");\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_MetricOptions(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.metricProcessedBytes);\n }\n throw error;\n }\n return this.metrics.processedBytes(props);\n }", "function getSize(magnitude) {\n return magnitude * 5\n}", "function memory(macbook){\n var v = macbook.cost();\n macbook.cost = function(){\n return v + 75;\n };\n}", "function serializeSizePrefix() {\n // Outpoint Hash 32 bytes + Outpoint Index 4 bytes + Outpoint Tree 1 byte +\n // Sequence 4 bytes.\n return 41;\n}", "function mb(bytes) {\n return kb(bytes) / SIZE;\n}", "function totalcalc() {\n let total = 1299 + rmemory + ssd + deli;\n return total;;\n}", "function measure() {\n\t\t\n\t\t// Call our validate routine and make sure all component properties have been set\n\t\tviz.validate();\n\t\t\n\t\t// Get our size based on height, width, and margin\n\t\tsize = vizuly2.util.size(scope.margin, scope.width, scope.height, scope.parent);\n\t\t\n\t\tscope.size = size;\n\t\t\n\t\t// Tell everyone we are done making our measurements\n\t\tscope.dispatch.apply('measured', viz);\n\t\t\n\t}", "function xxMemThr() { return getQOpt('mem:xxThr');} // threshold above which need to reserve memory", "allocate(size) {\n if (this.head + size > this.memory.length) {\n return null;\n }\n\n let start = this.head;\n\n this.head += size;\n return start;\n }", "function allocate(height, length) {\n\tvar node = new Array(length);\n\tnode.height = height;\n\tif (height > 0) {\n\t\tnode.sizes = new Array(length);\n\t}\n\treturn node;\n}" ]
[ "0.60825574", "0.547923", "0.5438218", "0.54215586", "0.5411552", "0.5401423", "0.53176326", "0.5300492", "0.53000724", "0.53000724", "0.52344966", "0.5232492", "0.52264345", "0.5218635", "0.52157664", "0.5209452", "0.51787233", "0.51787233", "0.517836", "0.51290905", "0.51101005", "0.50994515", "0.5087088", "0.50824624", "0.5059748", "0.50534976", "0.5045949", "0.50423336", "0.50409544", "0.50406265", "0.50270003", "0.5023928", "0.5018999", "0.5015752", "0.5015048", "0.5011571", "0.50097454", "0.5009123", "0.500062", "0.49995473", "0.49981132", "0.49977693", "0.49977693", "0.49974915", "0.4952904", "0.4950309", "0.49375778", "0.49363655", "0.4932266", "0.4911487", "0.4900425", "0.49003676", "0.48899394", "0.4889626", "0.48828918", "0.4880592", "0.487161", "0.48697865", "0.4865789", "0.4863681", "0.48570532", "0.4854504", "0.48483384", "0.4846903", "0.48262274", "0.48198462", "0.48110026", "0.4805432", "0.4805432", "0.48018852", "0.47927698", "0.47882745", "0.47768798", "0.47687873", "0.47670278", "0.47648448", "0.47648448", "0.47594503", "0.47534624", "0.47518745", "0.47462237", "0.47430307", "0.47369272", "0.47354114", "0.47321838", "0.47318402", "0.47274905", "0.47196773", "0.47157657", "0.47145554", "0.47093344", "0.47071683", "0.47069475", "0.47010407", "0.47009578", "0.4695379", "0.46896604", "0.46874493", "0.46795633", "0.46779415" ]
0.60951483
0
Calculation of CPU based on the quantity of nodes and pod consumption estimative.
function calculateBasedCpu() { var qtyAppNode = document.getElementById('qtyAppNode').value; var appNodeCpu = document.getElementById('cpuNodeSize').value; var cpuPodSize = document.getElementById('cpuPodSize').value; var totalAppNodeCpu = appNodeCpu * qtyAppNode; var totalPodPerCpu = totalAppNodeCpu / cpuPodSize; return totalPodPerCpu; //display the result //document.getElementById('ccapacity').innerHTML = "Total pod por CPU: "+totalPodPerCpu; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async calculateCpuUsage() {\n this.__cpuUsage = await utils.getCpuUsage({ timeout: this.__cpuUsageInterval });\n }", "getCpuAvg() {\n const cpus = os.cpus();\n \n let totalIdle = 0;\n let totalTicks = 0;\n\n /**\n * For each CPUs we will loop though \n * and calculate the ticks and add them \n * together as totalTicks\n * \n * and add up all total idel times as totalIdel\n */\n\n for (let i = 0; i < cpus.length; i++) {\n let currentCPU = cpus[i];\n \n for (let t in currentCPU.times) {\n totalTicks += currentCPU.times[t];\n }\n\n totalIdle += currentCPU.times.idle;\n }\n\n return { \n idle: totalIdle / cpus.length, \n total: totalTicks / cpus.length \n }\n }", "get cpuCount() {\n return this.getNumberAttribute('cpu_count');\n }", "function getCpuUsage() {\n return cpu.getCpuUsage();\n}", "function cpuAverage() {\n var totalIdle = 0, totalTick = 0;\n var cpus = os.cpus();\n for(var i = 0, len = cpus.length; i < len; i++) {\n var cpu = cpus[i];\n for(type in cpu.times) {\n totalTick += cpu.times[type];\n } \n totalIdle += cpu.times.idle;\n }\n return {idle: totalIdle / cpus.length, total: totalTick / cpus.length};\n}", "inspectCPU() {\n this.inspectedCPU = true;\n\n let command = this.runCommand('grep \\'model name\\t:\\' /proc/cpuinfo | head -1');\n let CPUModelName = command.replace('model name\\t:', '').trim();\n this.attributes['cpuType'] = CPUModelName;\n\n command = this.runCommand('grep \\'model\\t\\t:\\' /proc/cpuinfo | head -1');\n let CPUModel = command.replace('model\\t\\t: ', '').trim();\n this.attributes['cpuModel'] = CPUModel;\n\n let child = this.runCommand('cat /proc/stat | grep \"^cpu\" | head -1');\n let CPUMetrics = child.replace('\\n', '');\n CPUMetrics = CPUMetrics.replace('cpu ', '');\n CPUMetrics = CPUMetrics.split(\" \");\n\n let metricsNames = ['cpuUsr', 'cpuNice', 'cpuKrn', 'cpuIdle',\n 'cpuIowait', 'cpuIrq', 'cpuSoftIrq', 'vmcpusteal'];\n for (let i = 0; i < metricsNames.length; i++) {\n this.attributes[metricsNames[i]] = parseInt(CPUMetrics[i]);\n }\n\n child = this.runCommand('cat /proc/stat | grep \"ctxt\"');\n let contextSwitches = child.replace('\\n','');\n contextSwitches = contextSwitches.replace('ctxt ', '');\n this.attributes['contextSwitches'] = parseInt(contextSwitches);\n }", "runDelta(){\n this.nowSec = parseInt(Date.now() / 1000);\n let output = [];\n let initialRun = false;\n let majorNumbers = cp.execSync(`lsblk | grep -Ev 'NAME|rom' | awk '{print $2}' | cut -d: -f 1 | sort -u`)\n .toString()\n .split(\"\\n\")\n .filter(a=>a)\n .map((a) => { return this.num(a);});\n let sensor = {\n \"time\": this.nowSec,\n \"disk\": this.readStat('/proc/diskstats'),\n \"stats\": this.readStat('/proc/stat'),\n \"net\": this.readStat('/proc/net/dev'),\n \"arp\": this.readStat('/proc/net/arp')\n };\n \n if(this.CACHE === null ){\n initialRun = true;\n this.CACHE = sensor;// if no cache ( cleared or first run, assume that current data is a cache data )\n }\n let cores = this.num(cp.execSync('nproc')); // get number of cores\n let netInterfaces = cp.execSync(`ls /sys/class/net/ | grep -v lo`).toString().split(\"\\n\").filter(a => a);\n let cacheTime = this.CACHE.time;\n let cacheTimeDiff = this.nowSec - cacheTime;\n cacheTimeDiff = cacheTimeDiff === 0 ? 1 : cacheTimeDiff; // prevent division by zero for intervals less than 1 sec.\n if(initialRun === false)\n {\n // Total CPU\n output.push([\"cpu.user\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 0 /* user */ )]);\n output.push([\"cpu.nice\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 1 /* nice */ )]);\n output.push([\"cpu.system\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 2 /* system */ )]);\n output.push([\"cpu.idle\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 3 /* idle */ )]);\n // each core load\n for (let i = 0; i < cores; i++){\n output.push(['cpu' + i + '.user', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 0 )]);\n output.push(['cpu' + i + '.nice', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 1 )]);\n output.push(['cpu' + i + '.system', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 2 )]);\n output.push(['cpu' + i + '.idle', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 3 )]);\n }\n // Get network speed ( upload / download ) per sec.\n for (let i in netInterfaces) {\n let inet = netInterfaces[i]; // interface name\n output.push([\"net.\" + inet + \".rx\",this.netCalc(this.CACHE.net[inet + ':'][0][0] / cacheTimeDiff , sensor.net[inet + ':'][0][0] / cacheTimeDiff )]);\n output.push([\"net.\" + inet + \".tx\",this.netCalc(this.CACHE.net[inet + ':'][0][8] / cacheTimeDiff , sensor.net[inet + ':'][0][8] / cacheTimeDiff )]);\n }\n // Disks stats\n for(let i in majorNumbers){\n let sensorDriver = sensor.disk[majorNumbers[i]];\n let cacheDriver = this.CACHE.disk[majorNumbers[i]];\n for(let j in sensorDriver){\n output.push([\"disk.\" + sensorDriver[j][1] + '.writespeed',this.format((sensorDriver[j][8] - cacheDriver[j][8]) / 2 / cacheTimeDiff)]);\n }\n }\n\n }\n // ARP changes\n let arpNew = sensor.arp;\n for(let ip in arpNew){\n if(ip === 'ip') continue;\n output.push(['arp.' + this.addresToInt(ip,'.',10),this.addresToInt(arpNew[ip][0][2],':',16)]);\n }\n // Processes\n output.push([\"procs.running\",sensor.stats['procs_running'][0][0]]);\n output.push([\"procs.blocked\",sensor.stats['procs_blocked'][0][0]]);\n // build sensors output\n this.CACHE = sensor;\n this.out(this.prepare(output));\n }", "function cpuAverage() {\n var totalIdle = 0, totalTick = 0;\n var cpus = os.cpus();\n for (var i = 0, len = cpus.length; i < len; i++) {\n var cpu = cpus[i];\n for(type in cpu.times) {\n totalTick += cpu.times[type];\n }\n totalIdle += cpu.times.idle;\n }\n return {idle: totalIdle / cpus.length, total: totalTick / cpus.length};\n}", "function calcWeightedRes(cpu, memory, numOfRequests) {\n return cpu * 0.4 + memory * 0.2 + numOfRequests * 0.4;\n}", "scaleOnCpuUtilization(id, props) {\n return super.doScaleToTrackMetric(id, {\n predefinedMetric: appscaling.PredefinedMetric.ECS_SERVICE_AVERAGE_CPU_UTILIZATION,\n policyName: props.policyName,\n disableScaleIn: props.disableScaleIn,\n targetValue: props.targetUtilizationPercent,\n scaleInCooldown: props.scaleInCooldown,\n scaleOutCooldown: props.scaleOutCooldown,\n });\n }", "function getCpuLoad() {\n return new Promise((resolve, reject) => {\n const start = cpuAverage();\n setTimeout(() => {\n const end = cpuAverage();\n const idleDiff = end.idle - start.idle;\n const totalDiff = end.total - start.total;\n //calc % load\n const percentageLoad = 100 - Math.floor((100 * idleDiff) / totalDiff);\n resolve(percentageLoad);\n }, 100);\n });\n}", "function cpuAverage() {\n\n //Initialise sum of idle and time of cores and fetch CPU info\n var totalIdle = 0, totalTick = 0;\n var cpus = os.cpus();\n\n //Loop through CPU cores\n for(var i = 0, len = cpus.length; i < len; i++) {\n\n //Select CPU core\n var cpu = cpus[i];\n\n //Total up the time in the cores tick\n for(type in cpu.times) {\n totalTick += cpu.times[type];\n }\n\n //Total up the idle time of the core\n totalIdle += cpu.times.idle;\n }\n\n //Return the average Idle and Tick times\n return {idle: totalIdle / cpus.length, total: totalTick / cpus.length};\n}", "function cpuAverage() {\n\n\t//Initialise sum of idle and time of cores and fetch CPU info\n\tvar totalIdle = 0, totalTick = 0;\n\tvar cpus = os.cpus();\n\n\t//Loop through CPU cores\n\tfor (var i = 0, len = cpus.length; i < len; i++) {\n\n\t\t//Select CPU core\n\t\tvar cpu = cpus[i];\n\n\t\t//Total up the time in the cores tick\n\t\tfor (type in cpu.times) {\n\t\t\ttotalTick += cpu.times[type];\n\t\t}\n\n\t\t//Total up the idle time of the core\n\t\ttotalIdle += cpu.times.idle;\n\t}\n\n\t//Return the average Idle and Tick times\n\treturn { idle: totalIdle / cpus.length, total: totalTick / cpus.length };\n}", "getNumberOfCpus() {\n\t return tslib_es6.__awaiter(this, void 0, void 0, function* () {\n\t const result = yield this.rawQuery({\n\t sqlQuery: 'select count(distinct(cpu)) as cpuCount from sched;',\n\t });\n\t return +result.columns[0].longValues[0];\n\t });\n\t }", "function cpuAverage() {\n const cpus = os.cpus();\n //get ms in each mode, but this number is since reboot\n //so get it now and get it in 100ms and compare\n let idleMs = 0;\n let totalMs = 0;\n\n //lope through each core\n cpus.forEach((core) => {\n for (type in core.times) {\n totalMs += core.times[type];\n }\n idleMs += core.times.idle;\n });\n\n return {\n idle: idleMs / cpus.length,\n total: totalMs / cpus.length,\n };\n}", "get idealNodes() {\n return [...this.nodes.values()]\n .filter(node => node.connected)\n .sort((a, b) => {\n const aLoad = a.stats.cpu ? a.stats.cpu.systemLoad / a.stats.cpu.cores * 100 : 0\n const bLoad = b.stats.cpu ? b.stats.cpu.systemLoad / b.stats.cpu.cores * 100 : 0\n return aLoad - bLoad\n })\n }", "function getCores() {\n\treturn os.cpus().length;\n}", "get cpuAvailable() {\n return this._cpuAvailable;\n }", "async function topPods(api, metrics, namespace) {\n // Figure out which pod list endpoint to call\n const getPodList = async () => {\n if (namespace) {\n return (await api.listNamespacedPod(namespace)).body;\n }\n return (await api.listPodForAllNamespaces()).body;\n };\n const [podMetrics, podList] = await Promise.all([metrics.getPodMetrics(namespace), getPodList()]);\n // Create a map of pod names to their metric usage\n // to make it easier to look up when we need it later\n const podMetricsMap = podMetrics.items.reduce((accum, next) => {\n accum.set(next.metadata.name, next);\n return accum;\n }, new Map());\n const result = [];\n for (const pod of podList.items) {\n const podMetric = podMetricsMap.get(pod.metadata.name);\n const containerStatuses = [];\n let currentPodCPU = 0;\n let currentPodMem = 0;\n let podRequestsCPU = 0;\n let podLimitsCPU = 0;\n let podRequestsMem = 0;\n let podLimitsMem = 0;\n pod.spec.containers.forEach((container) => {\n // get the the container CPU/Memory container.resources.requests/limits\n const containerCpuTotal = util_1.totalCPUForContainer(container);\n const containerMemTotal = util_1.totalMemoryForContainer(container);\n // sum each container's CPU/Memory container.resources.requests/limits\n // to get the pod's overall requests/limits\n podRequestsCPU = util_1.add(podRequestsCPU, containerCpuTotal.request);\n podLimitsCPU = util_1.add(podLimitsCPU, containerCpuTotal.limit);\n podRequestsMem = util_1.add(podLimitsMem, containerMemTotal.request);\n podLimitsMem = util_1.add(podLimitsMem, containerMemTotal.limit);\n // Find the container metrics by container.name\n // if both the pod and container metrics exist\n const containerMetrics = podMetric !== undefined\n ? podMetric.containers.find((c) => c.name === container.name)\n : undefined;\n // Store the current usage of each container\n // Sum each container to get the overall pod usage\n if (containerMetrics !== undefined) {\n const currentContainerCPUUsage = util_1.quantityToScalar(containerMetrics.usage.cpu);\n const currentContainerMemUsage = util_1.quantityToScalar(containerMetrics.usage.memory);\n currentPodCPU = util_1.add(currentPodCPU, currentContainerCPUUsage);\n currentPodMem = util_1.add(currentPodMem, currentContainerMemUsage);\n const containerCpuUsage = new CurrentResourceUsage(currentContainerCPUUsage, containerCpuTotal.request, containerCpuTotal.limit);\n const containerMemUsage = new CurrentResourceUsage(currentContainerMemUsage, containerMemTotal.request, containerMemTotal.limit);\n containerStatuses.push(new ContainerStatus(containerMetrics.name, containerCpuUsage, containerMemUsage));\n }\n });\n const podCpuUsage = new CurrentResourceUsage(currentPodCPU, podRequestsCPU, podLimitsCPU);\n const podMemUsage = new CurrentResourceUsage(currentPodMem, podRequestsMem, podLimitsMem);\n result.push(new PodStatus(pod, podCpuUsage, podMemUsage, containerStatuses));\n }\n return result;\n}", "function calculateBasedMem() {\n\t//var theForm = document.forms[\"capacity_form\"];\n var qtyAppNode = document.getElementById('qtyAppNode').value;\n var appNodeMem = document.getElementById('memNodeSize').value;\n var memPodSize = document.getElementById('memPodSize').value;\n var totalAppNodeMem = appNodeMem * qtyAppNode;\n var totalPodPerMem = totalAppNodeMem / memPodSize;\n return totalPodPerMem;\n\t//display the result\n //document.getElementById('ccapacity').innerHTML = \"Total pod por Mem: \"+totalPodPerMem;\n}", "function setup(jsonData) {\n var jsonData = BrowserUtils.getProcesses();\n cpus = [];\n mems = [];\n for (item in jsonData) {\n if(jsonData.hasOwnProperty(item)) {\n cpus.push(jsonData[item].cpu);\n mems.push(jsonData[item].memory);\n }\n }\n\n //Create SVG element\n svgCPU = d3.select(\"#cpuContainer\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")\");\n\n svgMem = d3.select(\"#memContainer\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")\")\n\n\n arcCPU = d3.svg.arc()\n .innerRadius(radius - 50)\n .outerRadius(radius);\n\n arcMem = d3.svg.arc()\n .innerRadius(radius - 50)\n .outerRadius(radius);\n\n pathMem = svgMem.selectAll(\"path\")\n .data(vizPieMem(mems))\n .enter()\n .append(\"path\")\n .attr(\"fill\", function(d, i) { return color(i); });\n\n pathCPU = svgCPU.selectAll(\"path\")\n .data(vizPieCPU(cpus))\n .enter()\n .append(\"path\")\n .attr(\"fill\", function(d, i) { return color(i); });\n\n pathCPU.transition()\n .duration(1000)\n .attr(\"d\", arcCPU)\n .each(function(d) { this._current = d; });\n\n pathMem.transition()\n .duration(1000)\n .attr(\"d\", arcMem)\n .each(function(d) { this._current = d; }); // gCPU = svgCPU.selectAll(\".arc\")\n // .data(vizPieCPU(cpus))\n // .enter().append(\"path\");\n // // .attr(\"class\", \"arc\");\n\n // gMem = svgMem.selectAll(\".arc\")\n // .data(vizPieMem(mems))\n // .enter().append(\"path\")\n // .attr(\"class\", \"arc\");\n\n // // Add loading text.\n // gCPU.append(\"text\")\n // .style(\"text-anchor\", \"middle\")\n // .style(\"font-size\",\"24px\")\n // .text(\"Loading...\");\n\n}", "immediate (cpu) {\n return cpu.pc;\n }", "function getAttachmentHostCPU(hostCore){\n\tif (Array.isArray(hostCore) && hostCore.length > 0) {\n\t\tvar hostCPUString = \"\";\n\t\tvar cpuSumUtilization = 0;\n\t\tvar averageCPUUtilization = 0;\n\n\t\thostCore.forEach((core)=> {\n\t\t\tcpuSumUtilization += core.utilization;\n\t\t});\n\t\taverageCPUUtilization = (cpuSumUtilization / hostCore.length).toFixed(1);\n\t\thostCPUString = `${averageCPUUtilization}%`;\n\t\treturn hostCPUString;\n\t} else return \"unavailable\";\n}", "function Cpu() {\n\n // registers\n\n this.pc = new Register16bit();\n this.sp = new Register8bit();\n this.a = new Register8bit();\n this.x = new Register8bit();\n this.y = new Register8bit();\n this.p = new CpuStatusRegister();\n\n // CPU inside RAM\n\n this.ram = new Memory(64 * 1024); // 64KB\n\n // other devices\n\n this.ppu = null; // set by setPpu()\n this.apu = null; // set by setApu()\n this.pad1 = null; // set by setJoypad1()\n this.pad2 = null; // set by setJoypad2()\n\n // cartridge ROM\n\n this.rom = null; // set by setRom()\n\n // Executing an instruction takes 1, 2, or more cycles.\n // .stallCycle represents the number of cycles left to\n // complete the currently executed instruction.\n\n this.stallCycle = 0;\n}", "updateRegTable(cpu) {\n\t\tthis.pcOutput.innerHTML = cpu.programCounter;\n\t\tthis.ccOutput.innerHTML = cpu.cycleCount;\n\t\tthis.acOutput.innerHTML = cpu.accumulator;\n\t}", "function cpuTemperature(callback) {\n\n return new Promise((resolve, reject) => {\n process.nextTick(() => {\n if (_windows) {\n let error = new Error(NOT_SUPPORTED);\n if (callback) { callback(NOT_SUPPORTED) }\n reject(error);\n }\n\n let result = {\n main: -1.0,\n cores: [],\n max: -1.0\n };\n if (_linux) {\n exec(\"sensors\", function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n let regex = /\\+([^°]*)/g;\n let temps = line.match(regex);\n if (line.split(':')[0].toUpperCase().indexOf('PHYSICAL') != -1) {\n result.main = parseFloat(temps);\n }\n if (line.split(':')[0].toUpperCase().indexOf('CORE ') != -1) {\n result.cores.push(parseFloat(temps));\n }\n });\n if (result.cores.length > 0) {\n let maxtmp = Math.max.apply(Math, result.cores);\n result.max = (maxtmp > result.main) ? maxtmp : result.main;\n }\n if (callback) { callback(result) }\n resolve(result);\n } else {\n exec(\"/opt/vc/bin/vcgencmd measure_temp\", function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0 && lines[0].indexOf('=')) {\n result.main = parseFloat(lines[0].split(\"=\")[1]);\n result.max = result.main\n }\n }\n if (callback) { callback(result) }\n resolve(result);\n });\n\n }\n });\n }\n if (_darwin) {\n if (callback) { callback(result) }\n resolve(result);\n }\n });\n });\n}", "get currentCpuPercent() {\n return this._currentCpuPercent;\n }", "function cores() {\n\t\tvar nc=0,nc1=0;\n\t\tvar vp = janLocObj(\"vFls\");\n\t\tfor (var f=0;f<vp.length;f++) {\n\t\t\tvar ov = vp[f];\n\t\t\tfor (var prop in ov) {\n\t\t\t\tnc++;\n\t\t\t\tvar e = ov[prop]; //new estilo(f+'@'+prop);\n\t\t\t\tfor (var x=0;!vazio(e) && x<e.v.length;x++) {\n\t\t\t\t\tnc1++;\n\t\t\t\t\tif (e.v[x][1].indexOf('#')!=-1) {\n\t\t\t\t\t\tvar c = '#'+substrAtAt(e.v[x][1]+' ','#',' ');\n\t\t\t\t\t\tcoresP(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//alerta(vp.length+'proc cores...'+nc+' '+nc1);\t\t\n\t}", "function getCpuCurrentSpeedSync() {\n\n let cpus = os.cpus();\n let minFreq = 999999999;\n let maxFreq = 0;\n let avgFreq = 0;\n\n if (cpus.length) {\n for (let i in cpus) {\n if (cpus.hasOwnProperty(i)) {\n avgFreq = avgFreq + cpus[i].speed;\n if (cpus[i].speed > maxFreq) maxFreq = cpus[i].speed;\n if (cpus[i].speed < minFreq) minFreq = cpus[i].speed;\n }\n }\n avgFreq = avgFreq / cpus.length;\n return {\n min: parseFloat((minFreq / 1000).toFixed(2)),\n max: parseFloat((maxFreq / 1000).toFixed(2)),\n avg: parseFloat((avgFreq / 1000).toFixed(2))\n }\n } else {\n return {\n min: 0,\n max: 0,\n avg: 0\n }\n }\n}", "function getCpuData () {\r\n fetch('http://exercise.develop.maximaster.ru/service/cpu/')\r\n .then(response => {\r\n let data = response.json();\r\n return data;\r\n })\r\n .then(data => {\r\n if (data === 0) { errorsCounter++; }\r\n addData(data);\r\n })\r\n .catch(error => console.error(error));\r\n\r\n // stats\r\n let percent = Math.floor(100 * errorsCounter / requestsCounter);\r\n requestsStats.innerHTML = requestsCounter++;\r\n errorsPercent.innerHTML = `${percent}%`;\r\n}", "function cpuTemperature(callback) {\n\tif (_windows) {\n\t\tcallback(NOT_SUPPORTED);\n\t}\n\n\tvar result = {\n\t\tmain : -1.0,\n\t\tcores : [],\n\t\tmax : -1.0\n\t};\n if (_linux) {\n\t\tvar regex = /\\+([^°]*)/g;\n\t\texec(\"sensors\", function(error, stdout) {\n\t\t\tif (!error) {\n\t\t\t\tvar lines = stdout.toString().split('\\n');\n\t\t\t\tlines.forEach(function(line) {\n\t\t\t\t\tvar temps = line.match(regex);\n\t\t\t\t\tif (line.split(':')[0].toUpperCase().indexOf('PHYSICAL') != -1) {\n\t\t\t\t\t\tresult.main = parseFloat(temps);\n\t\t\t\t\t}\n\t\t\t\t\tif (line.split(':')[0].toUpperCase().indexOf('CORE ') != -1) {\n\t\t\t\t\t\tresult.cores.push(parseFloat(temps));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (result.cores.length > 0) {\n\t\t\t\t\tvar maxtmp = Math.max.apply(Math, result.cores);\n\t\t\t\t\tresult.max = (maxtmp > result.main) ? maxtmp : result.main;\n\t\t\t\t}\n\t\t\t\tcallback(result)\n\t \t} else {\n\t\t\t\texec(\"/opt/vc/bin/vcgencmd measure_temp\", function(error, stdout) {\n\t\t\t\t\tif (!error) {\n\t\t\t\t\t\tvar lines = stdout.toString().split('\\n');\n\t\t\t\t\t\tif (lines.length > 0 && lines[0].indexOf('=')) {\n\t\t\t\t\t\t\tresult.main = parseFloat(lines[0].split(\"=\")[1]);\n\t\t\t\t\t\t\tresult.max = result.main\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcallback(result)\n\t\t\t\t});\n\n\t\t\t}\n\t\t});\n\t}\n\tif (_darwin) {\n\t\tcallback(result)\n\t}\n}", "loadFactor() {\n return this.elements / this.capacity;\n }", "loadFactor() {\n return this.elements / this.capacity;\n }", "doCPUWork(time) {\n time -= this.quantum;\n this.dequeue();\n let retQueue = this.getQueueType();\n // console.log(\"Queue type:\", retQueue);\n // if (this.queueType === QueueType.CPU_QUEUE) {\n\n // };\n \n // if (currentProcess.cpuTimeNeeded !== 0 || currentProcess.cpuTimeNeeded > 0) {\n // this.doBlockingWork(time);\n // }\n return time;\n }", "_precomputeComputeForWrapper(component) {\n const computations = ReactInterpreter.computations(component);\n const computedValues = this.optimizer.compute(computations);\n this.renderer.notifyAboutCompute(component, computations, computedValues);\n return computedValues;\n }", "function printProcessors() \n{\n\tp = \"\";\n\t\n\tp += window.navigator.hardwareConcurrency;\n\t\n\tdocument.getElementById(\"processors\").innerHTML = p;\n\n\treturn p;\n}", "function stringCPUData(latestCPUEvent) {\n var content = '';\n content += '# HELP os_cpu_used_ratio The ratio of the systems CPU that is currently used (values are 0-1)\\n';\n content += '# TYPE os_cpu_used_ratio gauge\\n';\n content += 'os_cpu_used_ratio ' + latestCPUEvent.system + '\\n';\n content += '# HELP process_cpu_used_ratio The ratio of the process CPU that is currently used (values are 0-1)\\n';\n content += '# TYPE process_cpu_used_ratio gauge\\n';\n content += 'process_cpu_used_ratio ' + latestCPUEvent.process;\n return content;\n}", "inspectCPUDelta() {\n if (this.inspectedCPU) {\n let child = this.runCommand('cat /proc/stat | grep \"^cpu\" | head -1');\n let CPUMetrics = child.replace('\\n', '');\n CPUMetrics = CPUMetrics.replace('cpu ', '');\n CPUMetrics = CPUMetrics.split(\" \");\n\n let metricsNames = ['cpuUsr', 'cpuNice', 'cpuKrn', 'cpuIdle',\n 'cpuIowait', 'cpuIrq', 'cpuSoftIrq', 'vmcpusteal'];\n for (let i = 0; i < metricsNames.length; i++) {\n this.attributes[metricsNames[i] + \"Delta\"] = parseInt(CPUMetrics[i]) - this.attributes[metricsNames[i]];\n }\n\n child = this.runCommand('cat /proc/stat | grep \"ctxt\"');\n let contextSwitches = child.replace('\\n','');\n contextSwitches = contextSwitches.replace('\\t','');\n contextSwitches = contextSwitches.replace('ctxt ', '');\n this.attributes['contextSwitchesDelta'] = parseInt(contextSwitches) - this.attributes['contextSwitches']\n } else {\n this.attributes[\"SAAFCPUDeltaError\"] = \"CPU not inspected before collecting deltas!\";\n }\n }", "function getAttachmentDataCPU(dataCore){\n\tif (Array.isArray(dataCore) && dataCore.length > 0) {\n\t\tvar dataCPUString = \"\";\n\t\tvar dataSumUtilization = 0;\n\t\tvar averageDataCPUUtilization = 0;\n\n\t\tdataCore.forEach((dataCore)=> {\n\t\t\tdataSumUtilization += dataCore.utilization;\n\t\t});\n\t\taverageDataCPUUtilization = dataSumUtilization / dataCore.length;\n\t\tdataCPUString = `${averageDataCPUUtilization}%`;\n\t\treturn dataCPUString;\n\t} else return \"unavailable\";\n}", "function fallbackToNodeJSCheck(){const cores=_os.default.cpus().filter(function(cpu,index){const hasHyperthreading=cpu.model.includes(`Intel`);const isOdd=index%2===1;return!hasHyperthreading||isOdd;});return cores.length;}", "getHealth() {\n let opsTotalHealth = this.operators.reduce((acc, o) => (acc + o.getHealth()), 0);\n let tmpH = this.health + opsTotalHealth / this.operators.length;\n return tmpH < 0 ? 0 : tmpH;\n }", "function utilization(tasks) {\n\treturn _(tasks).map(function(t) { \n\t\treturn t.C / t.T \n\t});\n}", "function updateCpuDisplay() {\n var programCounter = _CPU.PC;\n var hexString = programCounter.toString(16);\n //var pad = \"000\";\n //hexString = \"$\" + pad.substring(0, pad.length - hexString.length) + hexString;\n \n document.getElementById(\"tdProgramCounter\").innerHTML = toHexOutput(hexString, 3);\n document.getElementById(\"tdAccumulator\").innerHTML = toHexOutput(_CPU.AC.toString(16), 2); //parseInt(_CPU.AC, 16);\n document.getElementById(\"tdXRegister\").innerHTML = toHexOutput(_CPU.Xreg.toString(16), 2); //parseInt(_CPU.Xreg, 16);\n document.getElementById(\"tdYRegister\").innerHTML = toHexOutput(_CPU.Yreg.toString(16), 2); //parseInt(_CPU.Yreg, 16);\n document.getElementById(\"tdZFlag\").innerHTML = toHexOutput(_CPU.Zflag.toString(16), 2); //parseInt(_CPU.Zflag, 16);\n}", "compute() {\n let v = {}\n\n // Operational Hours[h / yr]\n const operationalHours = this.params['DAC Capacity Factor'] * HOURS_PER_YEAR\n\n // Planned Capacity Factor\n v['Planned Capacity Factor'] = this.tech['Availability']\n\n // Electric Power Requirement[MW](aka low value case in C1)\n v['Base Energy Requirement [MW]'] = this.baseReq\n\n // calculate battery params now\n if (this.battery) {\n // TODO: check that this is the correct value to pass to the battery computation\n const bat = this.battery.compute(v)\n v = Object.assign(v, bat)\n }\n\n // Plant Size[MW]\n v['Plant Size [MW]'] =\n v['Base Energy Requirement [MW]'] / v['Planned Capacity Factor']\n if (this.battery) {\n v['Plant Size [MW]'] += v['Increased Need [MW]']\n }\n\n // Overnight Cost [M$]\n v['Overnight Cost [M$]'] =\n this.tech['Base Plant Cost [M$]'] *\n (v['Plant Size [MW]'] / this.tech['Plant Size [MW]']) **\n this.tech['Scaling Factor']\n\n // Lead Time Multiplier\n v['Lead Time Multiplier'] = this.leadTimeMult(\n this.tech['Lead Time [Years]'].toFixed(0)\n )\n\n // Capital Cost [M$]\n v['Capital Cost [M$]'] =\n v['Overnight Cost [M$]'] * v['Lead Time Multiplier']\n\n // Total Capital Cost [M$]\n v['Total Capital Cost [M$]'] = v['Capital Cost [M$]']\n if (this.battery) {\n v['Total Capital Cost [M$]'] += v['Battery Capital Cost [M$]']\n }\n\n // Annual Capital Recovery Factor\n const annualCapitalRecoveryFactor = this.recoveryFactor()\n\n // Capital Recovery[$/tCO2eq]\n v['Capital Recovery [$/tCO2eq]'] =\n (v['Total Capital Cost [M$]'] * annualCapitalRecoveryFactor * MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Power Fixed O&M [$/tCO2eq]\n v['Power Fixed O&M [$/tCO2eq]'] =\n (this.tech['Base Plant Annual Fixed O&M [$M]'] *\n (v['Plant Size [MW]'] / this.tech['Plant Size [MW]']) **\n this.tech['Scaling Factor'] *\n MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Power Variable O&M [$/tCO2eq]\n v['Power Variable O&M [$/tCO2eq]'] =\n (this.tech['Variable O&M [$/MWhr]'] *\n v['Plant Size [MW]'] *\n operationalHours) /\n this.params['Scale [tCO2/year]']\n\n // Total Fixed O&M [$/tCO2eq]\n v['Total Fixed O&M [$/tCO2eq]'] = v['Power Fixed O&M [$/tCO2eq]']\n if (this.battery) {\n v['Total Fixed O&M [$/tCO2eq]'] += v['Battery Fixed O&M [$/tCO2eq]']\n }\n\n // Total Variable O&M [$/tCO2eq]\n v['Total Variable O&M [$/tCO2eq]'] = v['Power Variable O&M [$/tCO2eq]']\n if (this.battery) {\n v['Total Variable O&M [$/tCO2eq]'] += v['Battery Variable O&M [$/tCO2eq]']\n }\n\n // Natural Gas Use[mmBTU / tCO2eq]\n const heatRate = this.tech['Final Heat Rate [BTU/kWh]']\n if (heatRate) {\n v['Natural Gas Use [mmBTU/tCO2eq]'] =\n (operationalHours *\n v['Plant Size [MW]'] *\n KW_TO_MW *\n this.tech['Final Heat Rate [BTU/kWh]']) /\n MILLION /\n this.params['Scale [tCO2/year]']\n } else {\n v['Natural Gas Use [mmBTU/tCO2eq]'] = 0.0\n }\n\n // Natural Gas Cost [$/tCO2eq]\n v['Natural Gas Cost [$/tCO2eq]'] =\n v['Natural Gas Use [mmBTU/tCO2eq]'] *\n this.params['Natural Gas Cost [$/mmBTU]']\n\n // Emitted tCO2eq / tCO2\n if (v['Natural Gas Use [mmBTU/tCO2eq]'] > 0) {\n v['Emitted [tCO2/tCO2]'] =\n v['Natural Gas Use [mmBTU/tCO2eq]'] *\n this.tech['Total CO2 eq [lb/mmbtu]'] *\n LB_TO_METRIC_TON *\n (1 - this.tech['Capture Efficiency'])\n } else {\n v['Emitted [tCO2/tCO2]'] = 0\n }\n\n return v\n }", "function cpu_Scores(){\n let cpu_Score_Box = document.querySelector(\"#machineScore\"); \n cpu_score++; \n cpu_Score_Box.textContent = cpu_score; \n}", "static calculateConcurrency() {\n return [...CoapClient.pendingRequestsByMsgID.values()] // find all requests\n .map(req => req.concurrency) // extract their concurrency\n .reduce((sum, item) => sum + item, 0) // and sum it up\n ;\n }", "function computeNodeBreadths() {\n // var remainingNodes = nodes,\n // nextNodes,\n // x = 0\n\n // var test=1;\n nodes.forEach(function (node) {\n node.x = node.pos * nodeOffset;////pos is in the Json data jixiangyu\n\n //console.log(node.cluster);\n //test++;\n\n node.dx = nodeWidth;\n });\n }", "async function buscarComponenetes(gpuMax, gpuMin, cpuMax, cpuMin) {\n\n await gpuMax.get().then((result) => { setInfoGPUmax(result.data()) }\n );\n\n await gpuMin.get().then((result) => { setInfoGPUmin(result.data()) }\n );\n\n await cpuMax.get().then((result) => { setInfoCPUmax(result.data()) }\n );\n\n await cpuMin.get().then((result) => { setInfoCPUmin(result.data()) }\n );\n }", "compute() {\n const v = {}\n const ev = this.electric.compute()\n const tv = this.thermal.compute()\n\n let cv\n let tev\n\n if (this.electric.source == this.thermal.source) {\n cv = this.combinedPowerBlockRequirements(this.electric.source, ev, tv)\n tev = this.totalEnergyBlockCosts(ev, tv, cv)\n } else if (this.electric.source == 'NGCC w/ CCS') {\n tev = this.ngUtilitySection(ev, tv)\n } else {\n throw 'TODO: handle case with mismatched energy sources'\n }\n\n const dv = this.dac.compute()\n\n // Total Capital Cost [M$]\n v['Total Capital Cost [M$]'] =\n tev['Total Capital Cost [M$]'] +\n dv['Capital Cost (including Lead Time) [M$]']\n\n // Capital Recovery [$/tCO2eq]\n v['Capital Recovery [$/tCO2eq]'] =\n (v['Total Capital Cost [M$]'] * this.recoveryFactor() * MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Fixed O&M [$/tCO2eq]\n v['Fixed O&M [$/tCO2eq]'] =\n tev['Fixed O&M [$/tCO2eq]'] + dv['Fixed O&M [$/tCO2eq]']\n\n // Variable O&M [$/tCO2eq]\n v['Variable O&M [$/tCO2eq]'] =\n tev['Variable O&M [$/tCO2eq]'] + dv['Variable O&M [$/tCO2eq]']\n\n // Natural Gas Cost [$/tCO2]\n v['Natural Gas Cost [$/tCO2]'] = tev['Natural Gas Cost [$/tCO2eq]']\n\n // Emitted [tCO2eq/tCO2]\n v['Emitted [tCO2/tCO2]'] = tev['Emitted [tCO2/tCO2]']\n\n const emissionsFactor = this.calcEmissionsFactor(\n tev['Natural Gas Use [mmBTU/tCO2eq]'],\n v['Emitted [tCO2/tCO2]']\n )\n\n // Capital Recovery [$/tCO2eq Net Removed]\n v['Capital Recovery [$/tCO2eq Net Removed]'] =\n v['Capital Recovery [$/tCO2eq]'] / emissionsFactor\n\n // Variable O&M [$/tCO2eq Net Removed]\n v['Variable O&M [$/tCO2eq Net Removed]'] =\n v['Variable O&M [$/tCO2eq]'] / emissionsFactor\n\n // Natural Gas Cost [$/tCO2 Net Removed]\n v['Natural Gas Cost [$/tCO2 Net Removed]'] =\n v['Natural Gas Cost [$/tCO2]'] / emissionsFactor\n\n // Fixed O&M [$/tCO2eq Net Removed]\n v['Fixed O&M [$/tCO2eq Net Removed]'] =\n v['Fixed O&M [$/tCO2eq]'] / emissionsFactor\n\n // Total Cost [$/tCO2]\n v['Total Cost [$/tCO2 Net Removed]'] =\n v['Capital Recovery [$/tCO2eq Net Removed]'] +\n v['Fixed O&M [$/tCO2eq Net Removed]'] +\n v['Variable O&M [$/tCO2eq Net Removed]'] +\n v['Natural Gas Cost [$/tCO2 Net Removed]']\n\n return v\n }", "function set_load(node,contaminant){\n\t/* calculate loads of SERVICES \n\t\tInputs:\n\t\t\t- load [mg/use]\n\t\t\t- uses [uses/day]\n\t\t\t- guests [persons]\n\t\tOuput:\n\t\t\t- load = load*uses [mg/day]\n\t*/\n\t//1: get mg/use\n\tvar mg_per_use=Loads[node].contaminants[contaminant];\n\t//2: get uses per day\n\tvar uses=Loads[node].uses;\n\t//3: calculate load (mg/day)\n\tvar load = mg_per_use * uses;\n\n\t//calc total out flow from node\n\tvar out_flow=0;\n\tConnections.concat(Reuse)\n\t\t.filter(conn=>{return conn.from==node})\n\t\t.forEach(conn=>{out_flow+=conn.flow})\n\n\t//4: set the load (mg/day) for all output connections from node \"node\"\n\tif(out_flow) {\n\t\tConnections.concat(Reuse)\n\t\t\t.filter(function(conn){return conn.from==node})\n\t\t\t.forEach(function(conn){\n\t\t\t\t//normal connections\n\t\t\t\tconn.contaminants[contaminant]=conn.flow*load/out_flow;\n\t\t\t\t//reuse connections have a \"tec\" string defined\n\t\t\t\tif(conn.tec) {\n\t\t\t\t\tvar tech=Technologies.filter(function(t){return t.name==conn.tec})[0];\n\t\t\t\t\tvar removal=tech.removal[contaminant]/100;\n\t\t\t\t\t//console.log(\"Tech: \"+conn.tec+\", \"+contaminant+\"->\"+removal+\"%\");\n\t\t\t\t\tconn.contaminants[contaminant] *= (1-removal);\n\t\t\t\t}\n\t\t\t});\n\t}\n}", "function getLoad(callback) {\n\tvar result = {};\n\tvar loads = os.loadavg().map(function(x) { return x / _cores; } );\n\tresult.avgload = parseFloat((Math.max.apply(Math, loads)).toFixed(2));\n\tresult.currentload = -1;\n\n\tvar cmd = (_darwin) ? \"ps -caxm -o pcpu\" : \"ps axo pcpu\";\n\texec(cmd, function(error, stdout) {\n\t\tif (!error) {\n\t\t\tvar lines = stdout.toString().replace(/,+/g, \".\").split('\\n');\n\t\t\tlines.shift();\n\t\t\tlines.pop();\n\t\t\tresult.currentload = parseFloat(((lines.reduce(function (pv, cv) {\n\t\t\t\treturn pv + parseFloat(cv.trim());\n\t\t\t}, 0)) / _cores).toFixed(2));\n\t\t}\n\t\tcallback(result)\n\t});\n}", "do_calculation( bunch_of_numerical_data)\n {\n var total = 0 ;\n bunch_of_numerical_data.forEach(element => {\n total += element\n });\n return total ;\n }", "function updateCachedValues() {\n\t\t\n\t\tvar flowSum = 0,\n\t\t flowCounter = 0,\n\t\t nodeSum = 0,\n\t\t\tnodeCounter = 0,\n\t\t\ti, j, v, flow, l,\n\t\t \n\t\t // values getting updated\n\t\t\tminFlowLength = Infinity,\n\t\t\tmaxFlowLength = 0,\n\t\t\tminFlowValue,\n\t\t\tmaxFlowValue,\n\t\t\tmeanFlowValue,\n\t\t\tminNodeValue,\n\t\t\tmaxNodeValue,\n\t\t\tmeanNodeValue;\n\t\t\n\t\tif (flows.length < 1) {\n\t\t\tminFlowValue = 0;\n\t\t\tmaxFlowValue = 0;\n\t\t} else {\n\t\t\tminFlowValue = maxFlowValue = flows[0].getValue();\n\t\t}\n\n\t\tfor(i = 0, j = flows.length; i < j; i += 1) {\n\t\t\tflow = flows[i];\n\t\t\tv = flow.getValue();\n\t\t\tif (v < minFlowValue) {\n\t\t\t minFlowValue = v;\n\t\t\t}\n if (v > maxFlowValue) {\n maxFlowValue = v;\n }\n flowSum += v;\n flowCounter += 1;\n l = flow.getBaselineLength();\n if (l > maxFlowLength) {\n maxFlowLength = l;\n }\n if (l < minFlowLength) {\n minFlowLength = l;\n }\n\t\t}\n\t\t\n\t\tmeanFlowValue = flowSum / flowCounter;\n\t\t\n\t\t\n\t\tif(nodes.length < 1) {\n\t\t\tminNodeValue = 0;\n\t\t maxNodeValue = 0;\n\t\t}\n\n\t\tif(nodes.length > 0) {\n\t\t\tminNodeValue = maxNodeValue = nodes[0].value;\n\t\t} else {\n\t\t\tminNodeValue = maxNodeValue = 0;\n\t\t}\n\t\t\n\n\t\tfor (i = 0, j = nodes.length; i < j; i += 1) {\n\t\t\t\n\t\t\tv = nodes[i].value;\n\t\t\t\n\t\t\tif(!v) {\n\t\t\t\tnodes[i].value = 1;\n\t\t\t\tv = nodes[i].value;\n\t\t\t}\n\t\t\t\n\t\t\tif (v < minNodeValue) {\n minNodeValue = v;\n }\n if (v > maxNodeValue) {\n maxNodeValue = v;\n }\n nodeSum += v;\n nodeCounter += 1;\n\t\t}\n\t\tmeanNodeValue = nodeSum / nodeCounter;\n\t\t//minFlowWidth = (settings.maxFlowWidth * settings.minFlowValue / maxFlowValue);\n\t\t\n\t\tsettings.minFlowLength = minFlowLength;\n\t\tsettings.maxFlowLength = maxFlowLength;\n\t\tsettings.minFlowValue = minFlowValue;\n\t\tsettings.maxFlowValue = maxFlowValue;\n\t\tsettings.meanFlowValue = meanFlowValue;\n\t\tsettings.minNodeValue = minNodeValue;\n\t\tsettings.maxNodeValue = maxNodeValue;\n\t\tsettings.meanNodeValue = meanNodeValue;\n\t\tsettings.allFlowsTotalValue = flowSum;\n }", "function getKva(data,nodeGridDevices){\n\tvar consumption = 0;\n\tvar reactive = 0;\n\n\tif(data.active.length <= 2 || data.reactive.length <= 2){\n\t\treturn 0;\n\t}\n\tnodeGridDevices.forEach(nodeGridDevice => {\n\t\tconsumption += data.active[parseInt(nodeGridDevice.identifier)];\n\t \treactive += data.reactive[parseInt(nodeGridDevice.identifier)];\n\t});\n\t\n\tvar kvaConsumption = Math.sqrt(Math.pow(consumption ,2) + Math.pow(reactive,2));\n\treturn kvaConsumption;\n}", "doMath() {\n // Actual capacities\n const runningCap = this.props.workerType.runningCapacity;\n const pendingCap = this.props.workerType.pendingCapacity;\n const maxCap = this.props.workerType.maxCapacity;\n // We want to make sure that if a bar is there that it's visible\n const smallestCapUnit = maxCap * 0.05;\n // Fuzz the percentages to make sure all bars are visible. If we have a\n // state with 0%, we don't fuzz at all. If we have 1-4%, we round to 5%\n // and we don't fuzz above 5%\n const fuzzedRunning = runningCap\n ? Math.max(runningCap, smallestCapUnit)\n : 0;\n const fuzzedPending = pendingCap\n ? Math.max(pendingCap, smallestCapUnit)\n : 0;\n // Determine the number which we should use to figure out our percentages.\n // When we have less than the max configured, we use that setting. When we\n // exceed that amount, we want to sum up all the capacity units\n const count = fuzzedRunning + fuzzedPending;\n const divideBy = Math.max(maxCap, count);\n // Calculate the percentages to use for the bars. These numbers are\n // invalid for other purposes\n const runPer = fuzzedRunning / divideBy;\n const pendPer = fuzzedPending / divideBy;\n\n return {\n r: runPer * 100,\n p: pendPer * 100,\n rc: runningCap,\n pc: pendingCap\n };\n }", "function pollForCPUInfo() {\n chrome.system.cpu.getInfo(function(info) {\n CPU_info = info;\n setTimeout(pollForCPUInfo, POLL_TIME_DELAY);\n });\n}", "function priceCalculation() {\n\n const bestPrice = getValue('primary-price');\n const extraMemory = getValue('extra-memory');\n const extraStorage = getValue('extra-storage');\n const fastDelivery = getValue('extra-delivery');\n const priceTotal = bestPrice + extraStorage + fastDelivery + extraMemory;\n return priceTotal;\n}", "metricConsumedLCUs(props) {\n try {\n jsiiDeprecationWarnings.print(\"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer#metricConsumedLCUs\", \"Use ``ApplicationLoadBalancer.metrics.consumedLCUs`` instead\");\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_MetricOptions(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.metricConsumedLCUs);\n }\n throw error;\n }\n return this.metrics.consumedLCUs(props);\n }", "function startTest() {\n var t = performance.now()\n var mgr = cachedMgr\n compNames = []\n Es = []\n procs = []\n // create a bunch of components\n for (var i=0; i<numCs; ++i) {\n compNames[i] = 'comp_'+String(i)\n var obj = { state: {value:1} }\n obj.state[String(Math.random())] = 1\n mgr.addComponent(compNames[i], obj)\n }\n // create a bunch of entities and randomly add components\n for (var i=0; i<numEs; ++i) {\n var n = (numCs * Math.random())|0\n var toAdd = []\n for (var j=0; j<numCsPerE; ++j) {\n toAdd.push(compNames[(n+j)%numCs])\n }\n Es.push( mgr.createEntity(toAdd) )\n }\n // create a bunch of processes that sum up state properties\n for (var i=0; i<numCs; ++i) {\n var o = {}\n o.name = compNames[i]\n o.update = function(dt) {\n var sum = 0\n var entList = mgr.getComponentsData(this.name)\n var ids = Object.keys(entList)\n for (var j=0; j<ids.length; ++j) {\n sum += entList[ids[j]].value|0\n }\n runningSum += sum|0\n }\n procs.push(o)\n mgr.addProcessor(o)\n }\n // finish up and iterate\n initTime = performance.now() - t\n iterating = true\n runTime = runCt = runningSum = 0\n requestAnimationFrame(iterateTest)\n}", "poll () {\n console.log('Polling'.cyan);\n\n Promise\n .all([\n PS.get(),\n PS.getCPUTime()\n ])\n .then(\n results => {\n try {\n // free mem\n this.sockets.forEach(socket => socket.emit('free mem', os.freemem()));\n\n let [ processes, cpu ] = results;\n\n this.processes = processes;\n console.log(`Got ${processes.length} processes`.green);\n this.broadcast('ps', processes);\n\n let time = cpu.totalTime - this.cpu.totalTime;\n let idle = cpu.idleTime - this.cpu.idleTime;\n\n let load = ( ( time - idle ) / time );\n\n console.log('comparing', cpu, this.cpu, { load });\n\n this.cpu = cpu;\n\n this.cpu.load = load;\n\n console.log('load average', (os.loadavg()[0] / 8 * 100) + load);\n\n this.broadcast('cpu load', (os.loadavg()[0] / 8 * 100) + load);\n\n setTimeout(this.poll.bind(this), 2500);\n }\n catch ( error ) {\n this.emit('error', error);\n }\n },\n error => this.emit('error', error)\n );\n }", "scaleOnMemoryUtilization(id, props) {\n return super.doScaleToTrackMetric(id, {\n predefinedMetric: appscaling.PredefinedMetric.ECS_SERVICE_AVERAGE_MEMORY_UTILIZATION,\n targetValue: props.targetUtilizationPercent,\n policyName: props.policyName,\n disableScaleIn: props.disableScaleIn,\n scaleInCooldown: props.scaleInCooldown,\n scaleOutCooldown: props.scaleOutCooldown,\n });\n }", "calcularCostoPreparacionTotal(){\n let {demanda, loteOptimo, costoDePreparacion} = this.state;\n this.setState({costoDePreparacionTotal: ((Number(demanda)/Number(loteOptimo))*Number(costoDePreparacion)) })\n }", "doCPUWork(time) {\n const process = this.peek(); // peek process\n process.executeProcess(time); // call execute process passing in input time/ time slice\n this.manageTimeSlice(process, time); // call manage time slice to call the bookkeeping of the time\n }", "function totalcalc() {\n let total = 1299 + rmemory + ssd + deli;\n return total;;\n}", "function calculateMemoryCost() {\n let extraMemCost = document.getElementById(\"extra-memory-cost\");\n let prevExtraMemCostText = extraMemCost.innerText;\n let newExtraMemCostNumber = parseFloat(prevExtraMemCostText);\n return newExtraMemCostNumber;\n}", "compute(eVals) {\n const v = {}\n\n // Battery Capacity[MWh]\n v['Battery Capacity [MWh]'] =\n eVals['Base Energy Requirement [MW]'] *\n (HOURS_PER_DAY * (1 - eVals['Planned Capacity Factor']))\n\n // Round Trip Efficiency\n v['Round Trip Efficiency'] = this.tech['Efficiency (Thermal or Round Trip)']\n\n // Battery Capacity Needed[MWh]\n v['Battery Capacity Needed [MWh]'] =\n v['Battery Capacity [MWh]'] / v['Round Trip Efficiency']\n\n // Increased[MWh]\n v['Increased [MWh]'] =\n v['Battery Capacity Needed [MWh]'] - v['Battery Capacity [MWh]']\n\n // Increased Solar / Wind Need\n v['Increased Need [MW]'] =\n v['Increased [MWh]'] / (HOURS_PER_DAY * eVals['Planned Capacity Factor'])\n\n // Battery Capital Cost [M$]\n v['Battery Capital Cost [M$]'] =\n this.tech['Base Plant Cost [M$]'] *\n (v['Battery Capacity Needed [MWh]'] /\n this.tech['Battery Capacity [MWhr]']) **\n this.tech['Scaling Factor']\n\n // Battery Fixed O&M [$/tCO2eq]\n v['Battery Fixed O&M [$/tCO2eq]'] =\n (this.tech['Base Plant Annual Fixed O&M [$M]'] *\n (v['Battery Capacity Needed [MWh]'] /\n this.tech['Battery Capacity [MWhr]']) **\n this.tech['Scaling Factor'] *\n MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Battery Variable O&M [$/tCO2eq]\n v['Battery Variable O&M [$/tCO2eq]'] =\n ((this.tech['Variable O&M [$/MWhr]'] * v['Battery Capacity [MWh]']) /\n this.params['Scale [tCO2/year]']) *\n DAYS_PER_YEAR\n\n return v\n }", "function Config1Register() // ./common/cpu.js:344\n{ // ./common/cpu.js:345\n\t// all fields read only by software // ./common/cpu.js:346\n\tthis.M = 0; // bit 31 // ./common/cpu.js:347\n\tthis.MMUSize = 15; // bits 30:25 // ./common/cpu.js:348\n\tthis.IS = 0; // bits 24:22 // ./common/cpu.js:349\n\tthis.IL = 0; // bits 21:19 // ./common/cpu.js:350\n\tthis.IA = 0; // bits 18:16 // ./common/cpu.js:351\n\tthis.DS = 0; // bits 15:13 // ./common/cpu.js:352\n\tthis.DL = 0; // bits 12:10 // ./common/cpu.js:353\n\tthis.DA = 0; // bits 9:7 // ./common/cpu.js:354\n\tthis.zero = 0; // bits 6:5 // ./common/cpu.js:355\n\tthis.PC = 0; // bit 4, performance counter registers not program counter // ./common/cpu.js:356\n\tthis.WR = 1; // bit 3 // ./common/cpu.js:357\n\tthis.CA = 0; // bit 2 // ./common/cpu.js:358\n\tthis.EP = 1; // bit 1 // ./common/cpu.js:359\n\tthis.FP = 0; // bit 0 // ./common/cpu.js:360\n // ./common/cpu.js:361\n\tthis.asUInt32 = function() // ./common/cpu.js:362\n\t{ // ./common/cpu.js:363\n\t\treturn ((this.M * Math.pow(2,31)) + (this.MMUSize * Math.pow(2,25)) + (this.IS * Math.pow(2,22)) + (this.IL * Math.pow(2,19)) + (this.IA * 65536) + (this.DS * Math.pow(2,13)) + (this.DL * Math.pow(2,10)) + (this.DA * Math.pow(2,7)) + (this.PC * Math.pow(2,4)) + (this.WR * Math.pow(2,3)) + (this.CA * Math.pow(2,2)) + (this.EP * Math.pow(2,1)) + this.FP); // ./common/cpu.js:364\n\t} // ./common/cpu.js:365\n // ./common/cpu.js:366\n\tthis.putUInt32 = function(value) // ./common/cpu.js:367\n\t{ // ./common/cpu.js:368\n\t\treturn; // ./common/cpu.js:369\n\t} // ./common/cpu.js:370\n} // ./common/cpu.js:371", "function cumulativeNps(region, promotion) {\n var promoters = 0;\n var detractors = 0;\n var arrayNps = [];\n var arrayPromoters = [];\n var arrayDetractors = [];\n var arrayPassive = [];\n var totalNps = 0;\n var totalPromoters = 0;\n var totalDetractors = 0;\n var totalPassive = 0;\n var s1 = 0;\n var s2 = 0;\n var s3 = 0;\n var s4 = 0;\n var ratings = data[region][promotion]['ratings'];\n for (var i = 0; i < ratings.length; i++) {\n arrayPromoters[i] = ratings[i]['nps']['promoters'];\n arrayDetractors[i] = ratings[i]['nps']['detractors'];\n arrayPassive[i] = ratings[i]['nps']['passive'];\n arrayNps[i] = ratings[i]['nps']['promoters'] + ratings[i]['nps']['detractors'];\n }\n for (var i = 0; i < arrayNps.length; i++) {\n totalPromoters = totalPromoters + arrayPromoters[i];\n totalDetractors = totalPromoters + arrayDetractors[i];\n totalPassive = totalPromoters + arrayPassive[i];\n totalNps = totalNps + arrayNps[i];\n }\n\n totalNps = parseInt(totalNps / arrayNps.length) + '%';\n totalPromoters = parseInt(totalPromoters / arrayPromoters.length) + '%';\n totalDetractors = parseInt(totalDetractors / arrayDetractors.length) + '%';\n totalPassive = parseInt(totalPassive / arrayPassive.length) + '%';\n\n cumulativeNpsBox.textContent = totalNps;\n cumulativeNpsBox.classList.add('number-box-int');\n promotersBox.textContent = totalPromoters;\n detractorsBox.textContent = totalDetractors;\n passiveBox.textContent = totalPassive;\n\n\n if (arrayNps.length === 2) {\n s1 = arrayNps[0];\n s2 = arrayNps[1];\n } else if (arrayNps.length === 4) {\n s1 = arrayNps[0];\n s2 = arrayNps[1];\n s3 = arrayNps[2];\n s4 = arrayNps[3];\n }\n\n drawNetPromoter(s1, s2, s3, s4);\n}", "function getNodeAmount(nodes) {\n var nodeAmount = 0;\n for (var x = 0; x < nodes.length; x++) {\n nodeAmount = nodeAmount + 1;\n }\n return nodeAmount;\n}", "get parallel() {\n let total = parseInt(this.vars.PERCY_PARALLEL_TOTAL, 10);\n if (!Number.isInteger(total)) total = null;\n\n // no nonce if no total\n let nonce = total && (() => {\n if (this.vars.PERCY_PARALLEL_NONCE) {\n return this.vars.PERCY_PARALLEL_NONCE;\n }\n\n switch (this.ci) {\n case 'travis':\n return this.vars.TRAVIS_BUILD_NUMBER;\n case 'jenkins-prb':\n return this.vars.BUILD_NUMBER;\n case 'jenkins':\n return this.vars.BUILD_TAG?.split('').reverse().join('').substring(0, 60);\n case 'circle':\n return this.vars.CIRCLE_WORKFLOW_ID || this.vars.CIRCLE_BUILD_NUM;\n case 'codeship':\n return this.vars.CI_BUILD_NUMBER || this.vars.CI_BUILD_ID;\n case 'drone':\n return this.vars.DRONE_BUILD_NUMBER;\n case 'semaphore':\n return this.vars.SEMAPHORE_WORKFLOW_ID ||\n `${this.vars.SEMAPHORE_BRANCH_ID}/${this.vars.SEMAPHORE_BUILD_NUMBER}`;\n case 'buildkite':\n return this.vars.BUILDKITE_BUILD_ID;\n case 'heroku':\n return this.vars.HEROKU_TEST_RUN_ID;\n case 'gitlab':\n return this.vars.CI_PIPELINE_ID;\n case 'azure':\n return this.vars.BUILD_BUILDID;\n case 'appveyor':\n return this.vars.APPVEYOR_BUILD_ID;\n case 'probo':\n return this.vars.BUILD_ID;\n case 'bitbucket':\n return this.vars.BITBUCKET_BUILD_NUMBER;\n case 'github':\n return this.vars.GITHUB_RUN_ID;\n }\n })();\n\n return {\n total: total || null,\n nonce: nonce || null\n };\n }", "function setPE(value, opt) {\n // showMsg('debug: setPE(\"'+opt+'\")');\n // get #(cpu)\n var nCPU = $(\"#nbr_cpu_input\").val();\n if (nCPU.length == 0) {\n nCPU = '?#?';\n }\n if (opt == 'serial') {\n // serial case\n setQsubParam('pe_type', '');\n $('#nbr_cpu_input').prop('disabled', true);\n $('#parallel_info_params_span').html('');\n } else {\n setQsubParam('pe_type', '-pe '+opt+' '+nCPU); \n $('#nbr_cpu_input').prop('disabled', false);\n var info = 'echo + NSLOTS = $NSLOTS';\n switch(opt) {\n case 'orte':\n info += ' distributed over:<BR>cat $PE_HOSTFILE<BR>';\n break;\n case 'mpich':\n info += ' distributed over:<BR>sort $TMPDIR/machines | uniq -c<BR>';\n break;\n case 'mthread':\n info += '<BR>';\n break;\n }\n $('#parallel_info_params_span').html(info);\n }\n //* need to adjust memory reservation\n var memory = parseInt($('#memory_input').val());\n petype = $('input[name=pe]:checked').val();\n if (memory > xxMemThr()) {\n var nCPU = $(\"#nbr_cpu_input\").val();\n if (nCPU.length == 0) {\n nCPU = 1;\n }\n var memOpt = '-l h_data='+memory+'G,h_vmem='+memory+'G';\n var totMem = memory; \n if (petype == 'mthread') {\n totMem = memory*nCPU;\n memOpt = '-l mres='+totMem+'G,h_data='+memory+'G,h_vmem='+memory+'G';\n }\n if (petype == 'serial') {\n memOpt = '-l mres='+totMem+'G,h_data='+memory+'G,h_vmem='+memory+'G';\n }\n if (memory > hiMemThr()) {\n memOpt += ',himem';\n }\n setQsubParam('memory_value', memOpt);\n // showMsg('debug: setPE(\"memory_value '+memOpt+'\")');\n }\n}", "function buildspeed(){\n let buildspeed = 0.001*engine.counter('Nworkers');\n let diggerspeed = 1;\n if( engine.perks.lander.diggerspeed )\n diggerspeed = engine.perks.lander.diggerspeed;\n buildspeed += diggerspeed*engine.counter('Ndiggers');\n return check_out_of_resource()*buildspeed;\n}", "function runningReduceInitial() {\n\t\t\treturn {\n\t\t\t\ttotal: 0,\n\t\t\t\tcount: 0,\n\t\t\t\t//average: 0,\n\t\t\t\ttype: 'runningTotal'\n\t\t\t};\n\t\t}", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }", "function doWork(){\n let sum=0;\n for (let index = 0; index < 1000000000; index++) {\n sum+=index;\n }\n console.log('Sum: ',sum);\n return sum;\n}", "function computeTotalNetworkValue(tree, child, parent){\n\n\t//find the probability from going from child to parent\n\t//and parent to child\n\tvar childToParent = tree.getDirectedProbabilityByIds(tree.getNodeIdByLabel(child), tree.getNodeIdByLabel(parent));\n\tvar parentToChild = tree.getDirectedProbabilityByIds(tree.getNodeIdByLabel(parent), tree.getNodeIdByLabel(child));\n\n\t//calculate the value of the network\n\t//gamma of each subtree\n\t//plus the paths starting in the child's subtree and ending\n\t//in the parent's subtree\n\t//plust the paths starting in the parent's subtree and ending\n\t//in the child's subtree\n\tvar childID = tree.getNodeIdByLabel(child);\n\n\tvar totalVal = gammaToParent[childID] + gammaFromParent[childID] +\n\t\talphaToParent[childID]*childToParent*betaFromParent[childID] +\n\t\talphaFromParent[childID]*parentToChild*betaToParent[childID];\n\n\treturn totalVal;\n}", "function updateUi(cpu) {\n let stages = {\n 'if_id': ['ir', 'newPc'],\n 'id_ex': ['ir', 'newPc', 'a', 'b'],\n 'ex_mem': ['ir', 'aluOutput', 'b', 'zero', 'branchAddress'],\n 'mem_wb': ['ir', 'aluOutput', 'lmd'],\n };\n\n $.each(stages, function(stage, fields) {\n fields.forEach(function(field) {\n let elem = $('#' + stage + '-' + field);\n let value = cpu[stage][field];\n elem.text(value);\n });\n });\n\n\tfor(let i = 0; i < 4; i++) {\n\t\t$(\"#R\"+i).text(cpu.registers['$R'+i]);\n\t}\n\n\tfor(let i = 0; i < 4; i++) {\n\t\t$(\"#MEM\"+(i*4)).text(cpu.dataMem[i]);\n\t}\n\n}", "compute() {\n\n}", "function updateTotalCookPerSecChain(){\n updateTotalCookPerSec();\n \n if(dist[item]){\n updateTotalDistribution();\n }\n else{\n updateTotalProduction();\n }\n \n updateTimeToGet();\n updateEfficiency();\n}", "function getNodePerformance() {\n try {\n const perfHooks = dynamicRequire(module, 'perf_hooks') ;\n return perfHooks.performance;\n } catch (_) {\n return undefined;\n }\n }", "compute(operation) {\n const modes = this.getMode()\n const mode_1 = this.getDigitFromRight(modes, 1)\n const mode_2 = this.getDigitFromRight(modes, 2)\n const mode_3 = this.getDigitFromRight(modes, 3)\n const param_1 = this.program[this.PC+1]\n const param_2 = this.program[this.PC+2]\n const param_3 = this.program[this.PC+3]\n\n const value_1 = this.getValue(mode_1, param_1)\n const value_2 = this.getValue(mode_2, param_2)\n const ans_index = this.getIndex(param_3, mode_3)\n switch (operation) {\n case 1:\n this.program[ans_index] = value_1 + value_2\n break;\n case 2:\n this.program[ans_index] = value_1 * value_2\n break;\n case 7:\n this.program[ans_index] = (value_1 < value_2) ? 1 : 0\n break;\n case 8:\n this.program[ans_index] = (value_1 === value_2) ? 1 : 0\n break;\n default:\n return;\n }\n this.PC += 4\n }", "function computer(val){\n var forChart = chartNumber(val)\n var makeChartRow = chart(forChart)\n return reduceComputer(makeChartRow)\n}", "function getNodePerformance() {\n\t try {\n\t const perfHooks = dynamicRequire(module, 'perf_hooks') ;\n\t return perfHooks.performance;\n\t } catch (_) {\n\t return undefined;\n\t }\n\t}", "async fetchTotalSupply() {\n return Number(200000000);\n }", "function computeIO() {\n\n // correct link orientation\n setLinkOrientation();\n\n // reset values\n for (var i = 0, n = nodes.length; i < n; i++) {\n nodes[i].entries = 0;\n nodes[i].exits = 0;\n }\n\n // set values\n for (i = 0, n = links.length; i < n; i++) {\n if (getTipoNo(links[i].source) != 'QE' && getTipoNo(links[i].target) != 'QE') {\n\n // sum cable count regardless of type\n var count = countCablesInLink(links[i]);\n links[i].source.exits += count;\n links[i].target.entries += count;\n }\n }\n}", "function calculateResourcePlenty() {\n for (i = 0; i < positions.length; i++) {\n var sum = 0;\n for (x = 0; x < positions[i].tiles.length; x++) {\n sum += positions[i].tiles[x].dotWeight\n }\n positions[i].resourcePlentyScore = sum\n }\n}", "function fix_num_cores() {\n // let node_type_input = $('#batch_connect_session_context_node_type');\n let num_cores_input = $('#batch_connect_session_context_num_cores');\n\n if(num_cores_input.val() === '') {\n return;\n }\n\n // set_ppn_by_node_type(node_type_input, num_cores_input);\n}", "function computeItemNode() {\n items.forEach(function (item) {\n item.node.forEach(function (node) {\n var node_id = node;\n node = {};\n node.cluster = nodes[node];\n })\n item.start.node_id = item.start.node;\n item.start.node = nodes[item.start.node_id];\n })\n\n }", "function test6() {\n\tcpuThing();\n\tcpuThing();\n\tcpuThing();\n}", "function calculateHardwareSubtotals(){\n //in case these don't exist, just return array of 0's\n try{\n const {\n plan: planQuantity, wifiAddon: wifiAddonQuantity,\n faste: fasteAgentQuantity, wifi: wifiAgentQuantity\n } = readUserSelectedQuantities();\n\n //hardware\n const fasteAgentCharges = findStripePriceById(STRIPE_ID.skus.faste.id) * fasteAgentQuantity;\n const wifiAgentCharges = findStripePriceById(STRIPE_ID.skus.wifi.id) * wifiAgentQuantity;\n //subtotals\n const hardwareSubtotal = fasteAgentCharges + wifiAgentCharges;\n\n return [fasteAgentCharges, wifiAgentCharges, hardwareSubtotal];\n }catch(e){\n console.warn(\"This warning is expected: \", e);\n return [0, 0, 0];\n }\n }", "async getClusterCount () {\n if (!this.aliyun) {\n return 1\n }\n\n const info = await this.redis.info()\n const prefix = 'nodecount:'\n const isClusterMode = info.indexOf(prefix) > -1\n\n if (isClusterMode) {\n const line = info.split('\\n').find(item => item.indexOf(prefix) > -1)\n if (line) {\n const clusterCount = Number(line.replace(prefix, ''))\n return clusterCount\n }\n }\n return 1\n }", "_overallPercentageCompute(items,active){if(typeof items!==typeof void 0){this.$.progress.classList.add(\"transiting\");return 100*(active/(items.length-1))}return 0}", "function getPaletaCores() {\n\t\t\t\n\t\t\tvar cores = [{\n\t\t\t\t\tnome: \"Amarelo\",\n\t\t\t\t\tcodigo: \"f8ec42\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Azul Marinho\",\n\t\t\t\t\tcodigo: \"232749\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Azul Royal\",\n\t\t\t\t\tcodigo: \"3366ff\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Bege\",\n\t\t\t\t\tcodigo: \"fff5de\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Pink\",\n\t\t\t\t\tcodigo: \"ea257f\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Branco\",\n\t\t\t\t\tcodigo: \"ffffff\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Amarelo\",\n\t\t\t\t\tcodigo: \"f8ec42\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Preto\",\n\t\t\t\t\tcodigo: \"000000\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Coral\",\n\t\t\t\t\tcodigo: \"d53b52\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Verde Abacate\",\n\t\t\t\t\tcodigo: \"d3db7b\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Verde Turquesa\",\n\t\t\t\t\tcodigo: \"00a6a6\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Vermelho\",\n\t\t\t\t\tcodigo: \"d32433\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Pink Fluorescente\",\n\t\t\t\t\tcodigo: \"ff66ff\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Laranja Fluorescente\",\n\t\t\t\t\tcodigo: \"ff6666\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Verde Fluorescente\",\n\t\t\t\t\tcodigo: \"dfff69\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Azul Royal Fluorescente\",\n\t\t\t\t\tcodigo: \"3366ff\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Azul\",\n\t\t\t\t\tcodigo: \"24a2fd\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Verde\",\n\t\t\t\t\tcodigo: \"35ac75\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Verde Escuro\",\n\t\t\t\t\tcodigo: \"00584b\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Cinza\",\n\t\t\t\t\tcodigo: \"939393\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Laranja\",\n\t\t\t\t\tcodigo: \"e38724\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tnome: \"Rosa\",\n\t\t\t\t\tcodigo: \"e66187\",\n\t\t\t\t\tselecionada: false\n\t\t\t\t}\n\t\t\t];\n\t\t\t\n\t\t\treturn cores;\n\t\t}", "function calcTotalPrice(){\n var itemContainer = this.closest(\"div\"); \n var quantity = itemContainer.querySelector(\".quantity-input\").value; \n var ppu = itemContainer.querySelector(\".ppu\").innerHTML; \n var totalPrice = itemContainer.querySelector(\".total-price\"); \n totalPrice.innerHTML = (quantity*ppu).toFixed(2)+\"\"\n}", "compute()\n {\n //we update our input values\n super.compute();\n\n if(this.needsRecompute)\n {\n //actual node work\n this.ios['oColor'].value = lerpColor(this.ios['iColor1'].value,this.ios['iColor2'].value,this.ios['iMix'].value);\n this.needsRecompute = false;\n }\n }", "compute(){\n let computation\n //converting strings to number for computation\n const prev = parseFloat(this.previousOperand)\n const current = parseFloat(this.currentOperand)\n //to check if numbers were actually inputed before any computation\n if (isNaN(prev) || isNaN(current)) return\n switch (this.operation) {\n case '+' :\n computation = prev + current\n break\n case '-' :\n computation = prev - current\n break\n case '×' :\n computation = prev * current\n break\n case '÷' :\n computation = prev / current\n break\n default:\n return\n }\n this.toReset = true,\n this.currentOperand = computation\n this.operation = undefined\n this.previousOperand = ''\n }", "function getTotalPrice(itemNode) {\n var price = getPriceByProduct(itemNode);\n var qty = getQuantityByProduct(itemNode);\n return price * qty;\n}", "function cfnLaunchTemplateCpuOptionsPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnLaunchTemplate_CpuOptionsPropertyValidator(properties).assertSuccess();\n return {\n CoreCount: cdk.numberToCloudFormation(properties.coreCount),\n ThreadsPerCore: cdk.numberToCloudFormation(properties.threadsPerCore),\n };\n}", "#cpuFireAttack() {\n let p2 = this.players[1];\n let status = -1;\n let shotsFired = 0;\n const stuckThreshold = 10;\n let row;\n let col;\n while (status === -1) {\n [row, col] = this.#cpuAttackDetermineCoordinates(p2);\n \n status = p2.attack(this.players[0], row, col);\n \n if(shotsFired > stuckThreshold) {\n shotsFired = 0;\n p2.resetCPUBehaviors();\n }\n\n shotsFired++;\n }\n\n let attackedCell = \n document.querySelector(`.p1.gameboard .selectable[data-row=\"${row}\"][data-col=\"${col}\"]`)\n attackedCell.classList.add(\"attacked\");\n\n switch(status) {\n case 1: {\n console.log(\"CPU scores a hit!\");\n attackedCell.classList.add(\"hit\");\n\n let shipId = attackedCell.dataset.ship.split(\"player-ship\")[1];\n\n let shipSunk = this.players[0].gameboard.isShipSunk(shipId);\n if (shipSunk) {\n document.querySelector(`.p1.gameboard .ship-name[data-ship=\"player-ship${shipId}\"]`)\n .classList.add(\"destroyed\");\n console.log(\"CPU sank that ship!\");\n }\n\n // The CPU has made its first successful hit against a ship! \n if (p2.cpuBehavior === CPU_STATE.random\n && p2.cpuFirstSuccessfulHit.row === null\n ) {\n p2.cpuFirstSuccessfulHit.row = row;\n p2.cpuFirstSuccessfulHit.col = col;\n p2.cpuBehavior = CPU_STATE.found;\n // The CPU has made a second successful hit while in found mode!\n } else if (p2.cpuBehavior === CPU_STATE.found\n && p2.cpuSecondSuccessfulHit.row === null\n ) {\n p2.cpuSecondSuccessfulHit.row = row;\n p2.cpuSecondSuccessfulHit.col = col;\n p2.cpuBehavior = CPU_STATE.focused;\n } else {\n // focused mode behaviors -- revert to random whe sunk.\n if (p2.cpuBehavior === CPU_STATE.focused) {\n // only keep updating the second hit.\n p2.cpuSecondSuccessfulHit.row = row;\n p2.cpuSecondSuccessfulHit.col = col;\n }\n // in focused mode... lay down some attacks.\n // if a ship was sunk, then reset to random.\n if (shipSunk) {\n p2.resetCPUBehaviors();\n }\n }\n break;\n }\n case 0:\n console.log(\"CPU misses!\");\n attackedCell.classList.add(\"miss\");\n\n if (p2.cpuBehavior === CPU_STATE.focused) {\n console.log(\"Since CPU was focused, it'll swap directions starting from the first hit.\");\n p2.cpuFocusInvert = true;\n }\n break;\n }\n\n this.#p1turn = true;\n this.#determineIfGameOver();\n }", "function DrawCPUChart()\n{\n // create/delete rows \n if (cpuTable.getNumberOfRows() < aggrDataPoints.length)\n { \n var numRows = aggrDataPoints.length - cpuTable.getNumberOfRows();\n cpuTable.addRows(numRows);\n } else {\n for(var i=(cpuTable.getNumberOfRows()-1); i >= aggrDataPoints.length; i--)\n {\n cpuTable.removeRow(i); \n }\n }\n \n // Populate data table with time/cpu data points. \n for(var i=0; i < cpuTable.getNumberOfRows(); i++)\n {\n //if(parseFloat(aggrDataPoints[i].cpu) < 500) continue;\n cpuTable.setCell(i, 0, new Date(parseInt(aggrDataPoints[i].timestamp)));\n cpuTable.setCell(i, 1, parseFloat(aggrDataPoints[i].cpu));\n }\n\n // Draw line chart.\n chartOptions.title = 'CPU Usage (%)';\n cpuChart.draw(cpuView, chartOptions); \n}" ]
[ "0.67683554", "0.64406323", "0.62723964", "0.6034224", "0.6014722", "0.59824187", "0.597318", "0.5917256", "0.5902481", "0.5895085", "0.58676404", "0.5846269", "0.5712935", "0.5691643", "0.55996555", "0.55874866", "0.5482893", "0.5474179", "0.5424992", "0.54225546", "0.54020125", "0.539421", "0.533407", "0.5322434", "0.5206814", "0.5202573", "0.5188913", "0.51816696", "0.5104939", "0.5064146", "0.5060934", "0.50536937", "0.50536937", "0.50164807", "0.50103927", "0.5006056", "0.49808064", "0.49695563", "0.49347967", "0.49101716", "0.488299", "0.48806217", "0.48805022", "0.48676014", "0.48486468", "0.48454753", "0.48418024", "0.48010778", "0.47666368", "0.4731693", "0.47246444", "0.47107783", "0.4704735", "0.47020108", "0.46949005", "0.4692899", "0.4690096", "0.46900287", "0.46783763", "0.46757147", "0.46690193", "0.46664116", "0.46642905", "0.46602643", "0.4653524", "0.46507066", "0.46408987", "0.46338746", "0.4632971", "0.4631174", "0.4622312", "0.46004432", "0.45936963", "0.45920378", "0.45855603", "0.45826343", "0.45801455", "0.45741734", "0.4567625", "0.45639312", "0.45557833", "0.45531103", "0.45516688", "0.45504996", "0.4544663", "0.45435816", "0.45387822", "0.45370573", "0.45250314", "0.4518498", "0.45116076", "0.451118", "0.45057386", "0.45056337", "0.44974512", "0.44933748", "0.44904673", "0.44828078", "0.44795182", "0.44730082" ]
0.7328461
0
Remove form from screen
function removeForm() { const form = document.querySelector('#dino-compare'); form.style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFormFromScreen() {\n const form = document.getElementById('dino-compare');\n form.innerHTML = '';\n }", "removeForm() {\n if (this.$formContainer === null) {\n return;\n }\n\n delete this.formSaveAjax;\n // Allow form widgets to detach properly.\n Drupal.detachBehaviors(this.$formContainer.get(0), null, 'unload');\n this.$formContainer\n .off('change.quickedit', ':input')\n .off('keypress.quickedit', 'input')\n .remove();\n this.$formContainer = null;\n }", "forget() {\n if (this.mode === 'addSection') {\n delete cd.g.addSectionForm;\n } else {\n delete this.target[CommentForm.modeToProperty(this.mode) + 'Form'];\n }\n removeFromArrayIfPresent(cd.commentForms, this);\n saveSession();\n navPanel.updateCommentFormButton();\n }", "removeForm() {\n let index = FORMSET_BODY.children.length -1;\n let child = FORMSET_BODY.children[index];\n\n if (child) {\n FORMSET_BODY.removeChild(child);\n }\n\n FORMSET.querySelector('[name=\"form-TOTAL_FORMS\"]').value = index;\n this.updateButton();\n }", "function removeFormUI(obj){\r\n var p = jQuery(obj).hasClass('.postbox')? obj : jQuery(obj).parents('.postbox')\r\n var name = jQuery(p).attr('data-form-name')\r\n removeForm(name,function(){\r\n var id = jQuery(p).attr('id')\r\n local_forms = _.reject(local_forms,function(i){\r\n return i.id == id;\r\n });\r\n if(jQuery(p).hasClass('data') && !jQuery(p).hasClass('respo')){ \r\n jQuery(p).find('.local-copy').addClass('server')\r\n jQuery(p).find('.form-time').html('')\r\n jQuery(p).find('.form-edit-icons').html('<a class=\"view-form form-download\" data-action=\"download\" title=\"Import\" href=\"\"></a>')\r\n jQuery(p).find('#importformhold').removeClass('open')\r\n jQuery(p).find('#importformhold').stop().animate({height:0}); \r\n }else{\r\n jQuery(p).stop().animate({height:0,opacity:0},300,function(){\r\n jQuery(p).remove();\r\n }) \r\n }\r\n },function(){\r\n log('Error occured, could not delete form') \r\n })\r\n}", "function removeForm() {\n $(\"#orderFrom\").remove();\n}", "function delAdditForm(event) {\n event.target.parentNode.remove();\n}", "function removeForm() {\n var sumbitBtn = document.getElementById('sumbitBtn');\n var fontUser = document.getElementById('fontUser');\n var fontUserTwo = document.getElementById('fontUserTwo');\n var fontLock = document.getElementById('fontLock');\n var formName = document.getElementById('name');\n var formPassword = document.getElementById('password');\n var formEmail = document.getElementById('email');\n\n sumbitBtn.parentNode.removeChild(sumbitBtn);\n formName.parentNode.removeChild(formName);\n formPassword.parentNode.removeChild(formPassword);\n formEmail.parentNode.removeChild(formEmail);\n fontUser.parentNode.removeChild(fontUser);\n fontUserTwo.parentNode.removeChild(fontUserTwo);\n fontLock.parentNode.removeChild(fontLock);\n document.getElementById(\"msg\").innerHTML = \"Account created!\";\n }", "function hideForm() {\n\t\tthat.state.formShow = false;\n\t}", "function clearUserForm() {\n $(\"#userForm\").css(\"display\", \"none\");\n }", "function fnClearForm() {\n elSwForm.reset();\n }", "function wipeForm() {\n selectExists = document.getElementById(\"select\");\n selectExists.parentNode.removeChild(selectExists);\n submitExists = document.getElementById(\"submitInstance\");\n submitExists.parentNode.removeChild(submitExists);\n checkboxExists = document.getElementById(\"langCheckbox\");\n checkboxExists.parentNode.removeChild(checkboxExists);\n labelExists = document.getElementById(\"checkboxLabel\");\n labelExists.parentNode.removeChild(labelExists);\n}", "setUpRemoveForm() {\n REMOVE.addEventListener('click', (e) => {\n e.preventDefault();\n this.removeForm();\n });\n }", "function exitNewBookForm() {\n form.reset()\n form.style.visibility = 'hidden'\n}", "function removeContent() {\n formDiv.innerHTML = '';\n}", "function onRemoveRegistrationPanel() {\n thisPresenter.destroy();\n }", "function htmltableCloseUiForm(){\n\t$(\"#edit-form\").hide();\t\n\t$(\"#table-form\").children().remove();\n\thtmltableUi_globalId=null;\n\thtmltableUi_globalRow=null;\n\thtmltableUi_globalFormData=null;\n}", "function cancel() {\n props.dispatch({\n type: 'CLEAR_FORM',\n });\n $(\"#registration\").hide();\n $(\"#login\").show();\n }", "function clear_roles_form () {\n $.modal.close();\n $('.roles-row').remove();\n}", "function revealInputForm() {\n $(this).find('form').removeClass('hidden');\n }", "function hide() {\n let elem = document.getElementById('tutorialScreen');\n elem.parentNode.removeChild(elem);\n\n}", "function closeForm() {\n\n const fullForm = document.getElementById('form-content');\n console.log(fullForm);\n\n fullForm.reset();\n \n const form = document.querySelector('.form-group');\n form.style.display = 'none';\n}", "componentWillUnmount() {\n\n this.props.removeForm(this.props.id);\n }", "function closeFormButton() {\n clearFields();\n $('#add-section').hide();\n $('.show-form-btn').show();\n}", "function removeButton(){\n\t$('#start').remove();\n\taddSubmitButton();\n}", "destroy() {\n this.panel.remove();\n }", "static clear() {\n libraryForm.reset()\n }", "function clearForms() {\n //.reset() is a built in form method\n form.reset();\n}", "function destroy() {\n // clear up our FieldChecker controller instance\n // ... this will dynamically remove itself from our parent FormChecker\n fieldChecker.destroy();\n }", "function clearForm(){\n var form = FormApp.openById(FORMID);\n var items = form.getItems().length;\n Logger.log(form.getItems())\n for(i=0;i<form.getItems().length;i++){\n Logger.log(form.deleteItem(0))\n }\n }", "function clear_roles_form () {\n $.modal.close();\n //$('#roles-picker').slideUp('slow', function() {\n // Clear all the role form fields.\n $('.roles-row').remove();\n //});\n}", "function exitForm() {\n $('#contactForm').hide();\n}", "function _remove()\n {\n dialog.remove();\n }", "function DeleteField() {\n myInfoWindow.close();\n myField.setMap(null);\n ShowDrawingTools(true);\n}", "function onRemoveAddressBookPanel() {\n thisPresenter.destroy();\n }", "hideCreateForm() {\n this.changeFormMode(this.FORM_MODES.LIST);\n }", "removeFormGroup(dir) {\n this._cleanUpFormContainer(dir);\n }", "function hideForm() {\n $scope.formDisplay = false;\n }", "function destroyStartPage(){\n titleScreen.remove(); // removes titleScreen html\n startButton.removeEventListener('click', handleStartClick);// removes button from screen\n }", "function clearForm()\n {\n var form = document.getElementById('userForm');\n form.reset();\n }", "function closeForm() {\n document.getElementById(\"myForm\").style.display = \"none\"; \n}", "function clearFields() {\n document.getElementById('former').remove();\n}", "function closeCreateUserForm() {\n document.getElementById(\"createUserForm\").style.display = \"none\";\n}", "function limpiarFormularioRegistrar(form){\n\t\t$(form)[0].reset();\n\t}", "destroy() {\n if (this.mode === 'reply') {\n this.target.subitemList.remove('replyForm');\n } else {\n this.$outermostElement.remove();\n }\n\n this.operations\n .filter((op) => !op.isClosed)\n .forEach(this.closeOperation.bind(this));\n this.forget();\n\n /**\n * Has the comment form been {@link module:CommentForm#destroy destroyed}.\n *\n * @type {boolean}\n */\n this.isDestroyed = true;\n }", "function clearForm() {\n // clear the inputs.\n this.name = ''\n this.note = ''\n\n // Material Lite isn't reactive, so we're going to manually remove the css class so our label re-appear YUCK\n document.getElementById('studyCardNameInput').classList.remove('is-dirty')\n document.getElementById('studyCardNoteInput').classList.remove('is-dirty')\n}", "function hideRegForm()\r\n\t{\r\n\t\t$(\".formDiv\").hide();\r\n\t\t$(\".registerSuccessClass\").hide();\r\n\t\t$(\".backDiv\").css(\"display\",\"none\");\r\n\t\tresetAll();\r\n\r\n\t}", "function deleteMenu() {\n randomize_button.remove();\n submit_num.remove();\n num_stars_input.remove();\n submit_num_planets.remove();\n num_planets_input.remove();\n if (set_stars != null) {\n set_stars.remove();\n }\n if (preset_binary != null) {\n preset_binary.remove();\n }\n if (tatooine != null) {\n tatooine.remove();\n }\n deleteInputInterface();\n}", "function clearForm() {\n $(':reset').click(_event => {\n console.log('clearForm was clicked');\n // $('#js-state').addClass('hide'); // might be useful when state list collapse is implemented\n $('#js-state li').removeClass();\n })\n}", "function closeForm() {\n document.getElementById(\"myForm\").style.display = \"none\";\n document.getElementById(\"post-start\").style.display = \"none\";\n document.getElementById(\"post-start-title\").style.display = \"none\";\n document.getElementById(\"delete\").disabled = false;\n document.getElementById(\"add\").disabled = false;\n document.getElementById(\"upload\").disabled = false;\n}", "function dialogOff() {\n document.getElementById(\"overlay\").style.display = \"none\";\n let form = document.getElementById(\"insertForm\");\n form.reset();\n}", "removeFormGroup(dir) {\n this._cleanUpFormContainer(dir);\n }", "removeFormGroup(dir) {\n this._cleanUpFormContainer(dir);\n }", "removeFormGroup(dir) {\n this._cleanUpFormContainer(dir);\n }", "function remove_settings_dialog() {\r\n remove(div);\r\n }", "function clearOutForms(){\n $(\".insert-movie-cards\").html(\"\");\n $(\"#edit_movie_name\").val(\"\");\n $(\"#edit_rating\").val(\"\");\n $(\"#movie_name\").val(\"\");\n $(\"#rating\").val(\"\");\n}", "function removeScreenViewButton(){\r\n if(getElementById(\"viewScreenShareButton\")){\r\n let elem = getElementById(\"viewScreenShareButton\");\r\n elem.parentElement.removeChild(elem);\r\n }\r\n return;\r\n}", "destroyTitleScreen() {\n\t\tlet titleScreen = document.querySelector(\".titleScreen\");\n\t\ttitleScreen.parentNode.removeChild(titleScreen);\n\t}", "function limpiar_vent_gen(){\n contenGen.getForm().reset();\n ventGen.hide();\n}", "function delete_input_panel() {\n let p = document.getElementById('user-input-panel');\n if (p !== null) {\n p.parentNode.remove(p);\n }\n}", "function showForm(){\n form.reset();\n background.classList.add(\"transparent\")\n addBookForm.classList.remove(\"form--hidden\");\n }", "removeResource(evt) {\n evt.preventDefault();\n let button = $(evt.target);\n this.view.attr(\"hidden\", \"\"); // do not show the block\n this.destroyed = true\n this.registry.showSaveNote();\n }", "function removeSubmitButton(){\r\n var submitButton = document.getElementById(\"handIN\");\r\n if( submitButton != undefined){\r\n submitButton.parentElement.removeChild(submitButton);\r\n }\r\n}", "function clearForm()\n{\n\tlet forms = document.getElementsByTagName('form');\n\n\twhile(forms.length > 0)\n\t{\n\t\tforms[0].parentNode.removeChild(forms[0]);\n\t}\n}", "function deleteCreation(id){\n $(\"#currentCreation\").remove();\n $(\"#making\").slideUp(\"slow\");\n var widget=GetWidget(id);\n var idPanel= widget.panel;\n var panel=GetPanel(idPanel) \n panel.deleteElement(widget)\n}", "function clearForm(){\n\n //Find all my form values and clear them!\n $(\".control\").val('');\n\n //Mark icons as not important\n UI.$btnImportant.removeClass(\"fas\");\n UI.$btnImportant.addClass('far');\n important = false;\n\n UI.$btnAlert.removeClass('fas');\n UI.$btnAlert.addClass(\"far\");\n alert = false;\n}", "remove() {\n this.parent.removeFrame(this);\n }", "_remove() {\n this.backdrop.remove();\n this.modal.remove();\n Utils.removeClass(document.body, 'modal-mode');\n }", "function exitEditBookForm() {\n editForm.reset()\n editForm.style.visibility = 'hidden'\n allowPointerEvents()\n}", "remove() {\n BaseElement.controller.remove(this);\n this.root.remove();\n }", "function clearFormContents(){\r\n\t\t\r\n\t\t $('#results').empty();\r\n\t\t $(\"#wmrFormElement\")[0].reset();\r\n\t\t\t// Set Filing Status drop down to disabled until a well formed SSN is entered\r\n\t\t\t$('select').selectmenu('disable');\t\r\n\t\t\t// Set expected refund text box to disabled until a well formed SSN is entered\r\n\t\t\t$('#er').attr(\"disabled\", \"disabled\");\r\n\t\t\t// Disable submit button until required form elements are ready\r\n\t\t\t$('#submit').button('disable'); \r\n\t\t $(\"#formElements\").parent().show();\t\t \r\n\t\t \r\n\t\t //Fix Sticky button\r\n\t\t $(\".clearFormContents\").removeClass( $.mobile.activeBtnClass ); \r\n\t}", "function clearTeamForm (){\n vm.Team = {};\n defaultPlayers();\n }//end of function clearTeamForm", "function closeForm() {\n $('.add-parent-popup').hide();\n $('.overlay').hide();\n clearFields();\n $('#pin-message').hide();\n}", "function clearSearchForm() {\n \"use strict\";\n setFormHairType(\"short\");\n setFormTraits(\"\");\n}", "function lc_removePreferencesForm(evt){\r\n if(evt){\r\n // if Cancel button is pressed\r\n lc_Prefs.debug = evt.target.form.elements.namedItem('debug').checked;\r\n evt.stopPropagation();\r\n }\r\n document.getElementsByTagName('head').item(0)\r\n .removeChild(document.getElementById(\"lc_pref_style\"));\r\n document.body.removeChild(document.getElementById(\"lc_preferencesBox\"));\r\n // enable the link checking keys\r\n document.addEventListener(\"keypress\", lc_StartChecks, true);\r\n}", "removeFormGroup(dir) { }", "removeFormGroup(dir) { }", "removeFormGroup(dir) { }", "removeFormGroup(dir) { }", "function clearStuff() {\n // TODO change the design so this makes more sense, just removes the node with the content id\n // remove selectAccountForm\n var stuff = document.getElementById('selectAccountForm');\n stuff.parentNode.removeChild(stuff);\n // removes content node\n var content = document.getElementById('content');\n content.parentNode.removeChild(content);\n}", "function view () {\n $('div.employeeList').removeClass('hidden');\n // $('form.addForm').addClass('hidden');\n var forms = document.querySelectorAll('form');\n if (forms[0] != undefined) {\n document.body.removeChild(forms[0]);\n }\n toggleActive('View');\n}", "remove() {\n\t\tthis.outerElement.style.display = \"none\";\n\t\tthis.removed = true;\n\t}", "function deleteWelcome() {\n document.getElementById(\"welcome\").style.display = \"none\";\n document.getElementById(\"game\").style.display = \"block\";\n document.getElementById(\"name\").style.display = \"flex\";\n document.getElementById(\"form\").style.display = \"flex\";\n }", "function handleClick() {\n \t\t\tstage.removeChild(messageField);\n \t\t\trestart();\n\t}", "function deleteFormSection($formSection) {\n\tvar formItems = $formSection.closest('.formSection').find('.formItem');\n\tresetFormItem(formItems);\n\twindow.selectedFormItems = window.selectedFormItems.not(formItems);\n\tformItems.removeClass('selected').appendTo('#editorFieldList');\n\tsortFieldList();\n\t$formSection.closest('.formSection').fadeOut(300,function() { $(this).remove(); });\n\n\twindow.layoutChanged = true;\n}", "detach() {\n\t\tif (this.panel) {\n\t\t\tthis.panel.destroy();\n\t\t}\n\t}", "function unSetEvsForm(){\n\tlet addButton = document.getElementById(\"showEvsButton\");\n\t\n\tlet evsFieldSet = document.getElementsByClassName(\"evs\")[0];\n\twhile (evsFieldSet.firstChild) {\n \t\tevsFieldSet.firstChild.remove()\n\t}\n\n\taddButton.innerHTML = \"Ajouter des evenements ▼\";\n\taddButton.setAttribute(\"data-bs-toggle\", \"modal\");\n\taddButton.click();\n\n\n}", "removeLoadingScreen() {\n\t\tconst dummy = document.querySelector('.LoadingScreen')\n\t\tif (!dummy) {\n\t\t\treturn\n\t\t}\n\t\tdummy.parentNode.removeChild(dummy)\n\t}", "dispose() {\n\t\tthis.input.parentNode.removeChild(this.input);\n\t\trenko.monoUpdate.removeAction(this.updateID);\n\t}", "function clearForm() {\n var formValue = document.getElementById('new-item');\n\n formValue.value = '';\n}", "removeElement(){\n // TODO alert() if want to remove the current form element \n this.props.handleDelete(this.state.id);\n }", "function closeForm() {\n document.getElementById(\"msgForm\").style.display = \"none\";\n}", "removeFake() {\n if (this.textarea) {\n document.body.removeChild(this.textarea);\n this.textarea = null;\n }\n }", "function hideForm1() {\n $('.form-1').hide();\n }", "function ocultar_section_formas(){\n\n document.getElementById(\"section-formas\").style.display = \"none\";\n }", "removeControls() {\n const win = osWindow.getById(WIN_ID);\n osWindow.close(win);\n }", "function StepBackForm(from, to) {\n $(\"#question\" + from).hide();\n $(\"#question\" + to).fadeIn(300);\n\n $(formInUse)[0].reset();\n }", "function removeAlimento() {\n for(i=0; i<4; i++) {\n if($(this).parent().attr(\"id\") == \"form\"+i) {\n nr = i;\n }\n }\n $(this).remove();\n soma(nr);\n}", "clearForm() {\n this.clearFormSubject.next(true);\n }", "function clearOrderForm() {\n currentOrder = {};\n fillOrder({});\n fillOrderItemList({});\n $('#buttonDelete').hide();\n $('#buttonCreate').hide();\n $('#buttonSave').hide();\n}" ]
[ "0.810475", "0.75761366", "0.71618485", "0.7082091", "0.7013428", "0.6915914", "0.6882819", "0.6719752", "0.6582965", "0.65381867", "0.6485931", "0.64838356", "0.6465963", "0.64475906", "0.64359534", "0.64168155", "0.6416033", "0.6414364", "0.64049774", "0.6392198", "0.6379118", "0.63530636", "0.632837", "0.63267714", "0.6312841", "0.6302737", "0.6289193", "0.62885743", "0.6284907", "0.62837195", "0.62779945", "0.6272816", "0.6266732", "0.62609756", "0.62571025", "0.6235356", "0.62248635", "0.6209899", "0.6203246", "0.61889035", "0.61803824", "0.61651903", "0.61508554", "0.6146693", "0.6145956", "0.6140204", "0.6139438", "0.6137961", "0.6133498", "0.61303675", "0.61179054", "0.6112157", "0.6112157", "0.6112157", "0.6108599", "0.61018676", "0.6090981", "0.60907954", "0.6077713", "0.606817", "0.6052484", "0.6049647", "0.6045406", "0.6035716", "0.6034687", "0.6028786", "0.6027247", "0.60200876", "0.6017649", "0.60131955", "0.60065883", "0.6005242", "0.6004765", "0.60042727", "0.600375", "0.60007715", "0.60007715", "0.60007715", "0.60007715", "0.59928966", "0.5992309", "0.59876794", "0.5985299", "0.5982213", "0.59814423", "0.597966", "0.59791595", "0.59774756", "0.59754574", "0.59745216", "0.59665275", "0.5965504", "0.59618884", "0.595901", "0.59556156", "0.59454304", "0.5943662", "0.5933797", "0.59337246", "0.59335595" ]
0.7465148
2
On button click, prepare and display infographic
function compare() { // Async call getDinoJson(); // Sync call getHumanData.human(); removeForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displayInfo() {\n clear(dogInfo())\n\n let image = document.createElement('img')\n image.src = this.image\n\n let h2 = document.createElement('h2')\n h2.innerText = this.name\n\n let button = document.createElement('button')\n button.innerText = this.buttonText()\n button.id = `toggle${this.id}`\n \n dogInfo().appendChild(image)\n dogInfo().appendChild(h2)\n dogInfo().appendChild(button)\n }", "function DisplayInfo(){\n\t$(\"#content\").html('');\n\t\n\t$(\"#content\").append(\"<div class='page-header'><h1>\"+Language[\"Hints\"]+\"</h1></div>\");\n\tif (Debug)\n\t\tAddWarning();\n\t$(\"#content\").append(Language[\"WelcomeText\"]);\n\t$(\"#content\").append(\"<a id='startTestButton' class='btn btn-primary btn-lg' role='button'>\"+Language[\"StartTest\"]+\"</a>\");\n\t$(\"#content\").fadeIn();\n\t$(\"#startTestButton\").click(function(){\n\t\tLoadQuestion(-1);\n\t});\n;}", "function showInformation() {\n information.style.display='block';\n events.style.display='none';\n sights.style.display='none';\n informationButton.className = 'categoryButton selected material-icons';\n eventsButton.className = 'categoryButton material-icons';\n sightsButton.className = 'categoryButton material-icons';\n}", "function populateInformationModal() {\n\t// add text to the label\n\tvar category = allViews[activeView];\n\t// trim the heading \"TissueSpecific\" if necessary\n\tif (category.substr(0,14) == \"TissueSpecific\") {\n\t\tcategory = category.substr(14);\n\t}\n\t$('#informationLabel').text(category+\" Information\"); \n\t\n\t// now put info text in body\n\t$('#informationBody').html(allInfoFiles[activeView]);\n\t\n}", "function informationHandler(event)\n\t\t{\n\t\t\tg.informe();\n\t\t\thideButtons(this);\n\t\t}", "function setup_showInfo() {\n\tdocument.getElementById(\"basic\").style.display = \"none\";\n\tdocument.getElementById(\"create\").style.display = \"none\";\n\tdocument.getElementById(\"source\").style.display = \"none\";\n\tdocument.getElementById(\"info\").style.display = \"block\";\n}", "function display() {\n\n doSanityCheck();\n initButtons();\n}", "renderInformationAdditional() {\n document.getElementsByClassName('pk-name')[0].innerHTML = this.pokemonSelected.Name;\n document.getElementsByClassName('pk-image')[0].setAttribute('src', pathImages + this.pokemonSelected.Image);\n /** Load Information Additional.**/\n document.getElementsByClassName('pk-description-no')[0].innerHTML = this.pokemonSelected.Data.Position;\n document.getElementsByClassName('pk-description-level')[0].innerHTML = this.pokemonSelected.Data.Level;\n document.getElementsByClassName('pk-description-type')[0].innerHTML = this.pokemonSelected.Data.Type;\n document.getElementsByClassName('pk-description-ability')[0].innerHTML = this.pokemonSelected.Data.Ability;\n document.getElementsByClassName('pk-description-height')[0].innerHTML = this.pokemonSelected.Data.Height;\n document.getElementsByClassName('pk-description-weight')[0].innerHTML = this.pokemonSelected.Data.Weight;\n }", "function Main() {\n\n\n /*bio info*/\n bio = FillInformation('bio');\n AddDisplay('bio', bio);\n bio.display();\n\n /*work info*/\n work = FillInformation('work');\n AddDisplay('work', work);\n work.display();\n\n /*projects info*/\n projects = FillInformation('projects');\n AddDisplay('projects', projects);\n projects.display();\n\n /*Eductaion info*/\n education = FillInformation('education');\n AddDisplay('education', education);\n education.display();\n\n /*Map Addition*/\n //$('#mapDiv').append(internationalizeButton);\n $('#mapDiv').append(googleMap);\n\n}", "pushIntoInfo(data) {\n if (data.response.venue) {\n const object = data.response.venue;\n\n let rating = \"there is no information\";\n if (object.rating !== undefined) rating = object.rating;\n const html = `\n <img src=\"${object.bestPhoto.prefix}300x200${\n object.bestPhoto.suffix\n }\" alt=\"${object.name}\" tabindex=\"0\">\n <div style=\"color: #${\n object.ratingColor\n };\" tabindex=\"0\"><b>Rating:</b> ${rating}</div>\n <div class=\"#selectedLocation\" tabindex=\"0\"><b>Address:</b> ${\n object.location.formattedAddress[0]\n }</div>\n <div tabindex=\"0\"><b>Likes:</b> ${object.likes.count}</div>\n <a href=\"${\n object.canonicalUrl\n }\" target=\"_blank\">Look at this on FourSquare</a>`;\n document.getElementById(`info${object.id}`).innerHTML = html;\n document.getElementById(`infos`).classList.add(\"unvisible\");\n } else {\n const html = `<div> Unable to load information from FourSquare (${\n data.meta.errorDetail\n })</div>`;\n document.getElementById(`infos`).innerHTML = html;\n document.getElementById(`infos`).classList.remove(\"unvisible\");\n }\n }", "function renderInfo() {\n /** Get state */\n if (!wave.getState()) {\n return;\n }\n var state = wave.getState();\n \n /** Retrieve topics */\n var topics = toObject(state.get('topics','[]'));\n var votes = toObject(state.get('votes','[]'));\n \n /** Add topics to the canvas */\n var html = \"\";\n for (var i = 0; i < topics.length; i++){\n var id = \"topic\"+i;\n html += '<div class=\"topic\"><h4> ' + topics[i] + '</h4></div>';\n }\n document.getElementById('body').innerHTML = html;\n \n /** Create \"Add topic\" button to the footer */\n html += '<input type=\"text\" id=\"textBox\" value=\"\"/><button id=\"addInput\" onclick=\"addInput()\">Add Topic</button>';\n document.getElementById('footer').innerHTML = html;\n \n /** Adjust window size dynamically */\n gadgets.window.adjustHeight();\n}", "function build_protein_info_panel(data, div) {\n div.empty();\n var protein = data.controller.get_current_protein();\n div.append(protein['description']);\n div.append(\"<br>----<br>\");\n div.append(dict_html(protein['attr']));\n}", "function displaySelected() {\n console.log(\"response text\", this.responseText);\n var response = JSON.parse( this.responseText );\n console.log( response );\n\n // DOM final results\n var displayAt = document.querySelector('#show-detail');\n\n var title = document.createElement(\"h1\");\n title.innerHTML = response.name;\n displayAt.appendChild(title);\n\n var image = document.createElement(\"img\");\n image.src = response.image.medium;\n displayAt.appendChild(image);\n\n var summary = document.createElement(\"p\");\n summary.innerHTML = response.summary;\n displayAt.appendChild(summary);\n\n}", "function moreInfo() {\n $(document).ready(function () {\n $(\".info\").click(function (e) {\n let coin = $(e.target).prev().text();\n let div = $(e.target).parent();\n getInfo(coin, div);\n });\n });\n}", "displayInfo() {\n this.getTime();\n $('#modalTitle').html(`${this.name}`);\n $('#modalInfo').html(\n `<li>Current Time: &nbsp; ${this.time}</li><li>Latitude: &nbsp; ${this.latitude}</li><li>Longitude: &nbsp; ${this.longitude}</li><li>Distance from your location: &nbsp; ${this.distance}km</li>`\n );\n $('#wikiInfo').removeClass('show');\n $('#forecastInfo').removeClass('show');\n $('#weatherInfo').removeClass('show');\n $('#generalInfo').addClass('show');\n $('#infoModal').modal();\n }", "function moreInfo(e) {\n e.preventDefault();\n var color = document.getElementById(\"lost\").style.backgroundColor;\n id = $(this).closest('.individual').attr('id');\n\n // display or hide information in span\n if (clicked == 0) {\n $(\"#\" + id + \" span\").css('display', 'block');\n $(\"#\" + id + \" button\").html(\"<i class='fa fa-angle-up'></i>\");\n clicked = 1;\n } else {\n $(\"#\" + id + \" span\").css('display', 'none');\n $(\"#\" + id + \" button\").html(\"<i class='fa fa-angle-down'></i>\");\n clicked = 0;\n }\n}", "function showDetails() {\n _('infoDiv').innerHTML = infoText;\n _('infoPanel').style.display = 'block';\n}", "function generate() {\n // Generate 'Hot' Button\n $(\"#mustafar-btn\").empty();\n var nextHotBtn = $(\"<button>\");\n nextHotBtn.addClass('waves-effect waves-light btn-large mustafar-btn')\n nextHotBtn.attr(\"data-Hvalue\", person);\n nextHotBtn.text(\"MUSTAFAR\");\n $(\"#mustafar-btn\").html(nextHotBtn); \n\n // Generate 'Cold' Button\n $(\"#hoth-btn\").empty();\n var nextColdBtn = $(\"<button>\");\n nextColdBtn.addClass('waves-effect waves-light btn-large hoth-btn ')\n nextColdBtn.attr(\"data-Cvalue\", person);\n nextColdBtn.text(\"HOTH\");\n $(\"#hoth-btn\").html(nextColdBtn); \n\n // Function to deliver images and character info\n getImage(person); \n charInfo(person); \n}", "onButtonClick() {\n var shaderData = gShaderToy.exportToJSON(),\n banner = this.createBanner(shaderData.info);\n\n shaderData.renderpass.forEach(function(pass) {\n if (pass.name === 'Image') {\n pass.code = banner + pass.code;\n }\n });\n\n window.localStorage.setItem(LOCALSTORAGE_SHADER_FORK_KEYNAME, JSON.stringify(shaderData));\n gShaderToy.mNeedsSave = false;\n window.location.href = 'https://www.shadertoy.com/new';\n }", "function showButton(){\r\n\tvar type = e.target.feature.properties.scoring\r\n\t if (type >= 90) {\r\n\t\treturn document.getElementById(\"fiche1\").style.display='block',\r\n\t\tdocument.getElementById(\"fiche1body\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\", \r\n\t\tdocument.getElementById(\"fiche2\").style.display='none', \r\n\t\tdocument.getElementById(\"fiche3\").style.display='none',\r\n\t\tdocument.getElementById(\"nbpersonne1\").innerHTML = ((feature.properties.shape_area)*3.5/127).toFixed(0); \r\n\t } \r\n\t else if (type >= 70) {\r\n\t\treturn document.getElementById(\"fiche2\").style.display='block',\r\n\t\tdocument.getElementById(\"fiche2body\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\", \r\n\t\tdocument.getElementById(\"fiche1\").style.display='none', \r\n\t\tdocument.getElementById(\"fiche3\").style.display='none',\r\n\t\tdocument.getElementById(\"nbpersonne2\").innerHTML = ((feature.properties.shape_area)*2.5/127).toFixed(0); \r\n\t } \r\n\t else {\r\n\t\treturn document.getElementById(\"fiche3\").style.display='block',\r\n\t\tdocument.getElementById(\"fiche3body\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\", \r\n\t\tdocument.getElementById(\"fiche1\").style.display='none', \r\n\t\tdocument.getElementById(\"fiche2\").style.display='none',\r\n\t\tdocument.getElementById(\"nbpersonne3\").innerHTML = ((feature.properties.shape_area)*1.5/127).toFixed(0); \r\n\t }\r\n }", "function menuClick(clickedButton){\n let informaatio;\n \n switch (clickedButton){\n case 'Seura':\n informaatio = '<p>Osu!</p>'+\n '<p>Seuramme on Jyväskylässä toimiva Kyukushin-karate seura. Seuramme on osa IKO Kyokushinkaikan organisaatiota (IKO Matsui), jonka pääpaikka Suomessa on'+\n ' Turku, ja päävalmentaja Rebwar Shekhi.</p><br>'+\n '<img id= \"logoMain\" src= \"images/kankun.jpg\">';\n break;\n case 'Kyokushin Karate':\ninformaatio = '<p class= \"infoText\">Kyokushin on korealaissyntyisen Sosai Masutatsu Oyaman vuonna 1964 kehittämä karaten tyylisuunta. Se on eräs maailman suurimmista karaten tyylisuunnista. Kyokushin-tyylin ominaispiirteitä ovat kova ja realistinen harjoittelu, sparraus, sekä täydellä kontaktilla käytävät knockdown-ottelut, joissa myös reisiin kohdistuvat alapotkut ovat sallittuja. Lajilla on harrastajia yli 12 miljoonaa yli sadassa maassa. Kyokushinkai tarkoittaa ’’Lopullisen totuuden koulukuntaa/järjestöä’’. Se kuuluu maailmalla viiden suosituimman karatetyylin joukkoon. Kyokushin-karateen kuuluvat erilaiset lyönnit, potkut, tartunnat ja kaadot sekä nivellukot. Kyokushin karate poikkeaa muista karaten tyylisuunnista ottelu- ja harjoitussovelluksiltaan, olemalla suoraviivaisempi, intensiivisempi ja kovempi harjoitusmenetelmiltään. Kyokushin-karate tunnetaankin maailmanlaajuisesti vahvimpana karatena kovien treenimetodien, vaativien vyökokeiden ja täyskontaktiotteluidensa ansiosta.</p>'+\n'<p class= \"infoText\">Kyokushin karatessa vaalitaan vahvasti karaten perinteitä. Kihonia (perustekniikkaa) ja kataa (muotoja) harjoitellaan paljon. Myös ottelu- sekä välineharjoittelu ovat tärkeässä osassa. Kyokushin karatessa pyrkimys on säilyttää alkuperäisen karaten kolme perusasiaa: kihon, kata ja kumite sekä näiden erilaiset sovellukset.</p>'+\n'<p class= \"infoText\">Tyypillinen Kyokushin-karateharjoitus alkaa perustekniikalla ja loppuu otteluharjoitukseen. Perustekniikka pidetään koko karaten perustana. Perustekniikkaa harjoitellaan niin kihon muodossa rivissä kuin kihon ido-geiko muodossa liikkuen ja suorittaen ennalta määrättyjä liikesarjoja. Perustekniikkaa tehdessä jokaisen harjoittelijan pitäisi aina ajatella jokainen lyönti, torjunta ja potku viimeisenä. Harrastajien ja lajin keskeisiä mottoja onkin ”Osu no seishin” – periksiantamattomuus paineen alla tai ”Älä koskaan luovuta”.</p><p><i>teksti: wikipedia</i></p>'\n break;\n case 'Ajankohtaista':\n console.log('clicked: ', clickedButton);\n break;\n case 'Treenit ja liity mukaan':\n informaatio = '<p>Treenaamme tällä hetkellä sekä sisällä että ulkona.'+\n' Treenien määrä järjestyy sen mukaan, miten porukalla on intoa, eli '+ \n'vaikkapa jokapäivä, tai kerran viikossa.</p>'+ /*\n'<p>Treeniaikamme Halssilan koululla: <br> Maanantaisin: 20:00 - 21:30<br>Keskiviikkoisin: 20:45 - 21:45<br> Torstaisin: 20:30 - 22:00<br><br>'+ */\n'<p>Päävastuullisena valmentajana Jyväskylässä toimii Sami Kinnunen. Turku Open Kyokushin Tournament 2019. Kumite (ottelu), sekä Kata (liikesarja) voittaja. EM-kisa 2019 kumiten hopeamitalisti.<br>'+\n'Samia avustavat myös muut ohjaajat. Vyökokeet järjestää ja vyöt myöntää päävalmentajamme Rebwar Sekhi, 4-dan Shihan. </p>'+\n'<p>Jos haluat mukaan, niin ota yhteyttä Samiin (p.040 962 1851 tai finjutsu(a)hotmail.com). Aikaisempaa kokemusta ei'+ \n' vaadita ja kaikki ovat tervetulleita.</p>'+\n'<a href=\"https://www.facebook.com/567391464/videos/10156368917901465/?id=567391464\" target=\"_blank\"</a>Valmentaja Samin EM-kisaottelu. Sami vasemmalla. (facebook video)'; \n //window.location = \"https://thenewgame.glitch.me/skirmish\"; \n break;\n case 'Ota yhteyttä':\n informaatio = `Polaris Kyokushinkaikan organization Jyväskylä <br><br>\n Valmentaja Sami Kinnunen, 0409621851 finjutsu(a)hotmail.com <br>\n Nettisivuvastaava Petri Räsänen, rasanen.petri(a)gmail.com<br><br>\n <a href= \"https://www.facebook.com/profile.php?id=100011536548315\" target=\"_blank\">Facebook sivustomme</a>`;\n break; \n case 'Dojo kun':\ninformaatio = '<p class= \"infoText\">Dojo kun, eli dojo vala on tiivistelmä mihin kyokushin pyrkii, kovan harjoittelun kautta. Dojo kunin on'+ ' kirjoittanut Sosai Oyama, Eiji Yoshikawan (Miyamoto Musashi kirjan kirjoittaja), avustuksella. <br><br>'+\n'Englanniksi:<br><br>'+\n\n'We will train our hearts and bodies<br>'+\n'for a firm unshaking spirit.<br><br>'+\n\n'We will pursue the true meaning of the Martial Way,<br>'+\n'so that in time our senses may be alert.<br><br>'+\n\n'With true vigour,<br>'+\n'we will seek to cultivate a spirit of self denial.<br><br>'+\n\n'We will observe the rules of courtesy,<br>'+\n'respect our superiors,<br>'+\n'and refrain from violence.<br><br>'+\n\n'We will follow our religious principles,<br>'+\n'and never forget the true virtue of humility.<br><br>'+\n\n'We will look upwards to wisdom and strength,<br>'+\n'not seeking other desires.<br><br>'+\n\n'All our lives, through discipline of karate,<br>'+\n'we will seek to fulfil the true meaning of the<br>'+\n'Kyokushin Way.<br><br>'+\n\n'Japaniksi:<br><br>'+\n\n'Hitotsu, ware ware wa, shinshin o renmashi kakko fubatsu no shingi o kiwameru koto.<br><br>'+\n\n'Hitotsu, ware ware wa,bu no shinzui o kiwame, ki ni hasshi, kan ni bin naru koto.<br><br>'+\n\n'Hitotsu, ware ware wa, shitsujitsu goken o mot-te, jiko no seishin o kanyo suru koto.<br><br>'+\n\n'Hitotsu, ware ware wa, reisetsu o omonji, chojo o keishi, sobo no furumai o tsutsushimu koto.<br><br>'+\n\n'Hitotsu, ware ware wa, shinbutsu o totobi, kenjo no bitoku o wasurezaru koto.<br><br>'+\n\n'Hitotsu, ware ware wa, chisei to tairyoku to o kojo sase, koto ni nozonde ayamatazaru koto.<br><br>'+\n\n'Hitotsu, ware ware wa, shogai no shugyo o karate no michi ni tsuji, Kyokushin no michi o matto suru koto.<br><br></p>';\n break; \n case 'Vyökoe syllabus':\n informaatio = '<a href=\"IKO-Technical-Syllabus-2011_vyökoevaatimukset_Turku.rtf\" download>Lataa tästä vyökoevaatimukset. </a>';\n break; \n case 'Linkit':\n informaatio = `<p>\n<a href=\"http://www.kyokushinkaikan.org/en/index.html\" target=\"_blank\"</a>Virallinen liiton sivusto</p><p>\n<a href=\"http://www.kyokushinturku.fi/\" target=\"_blank\"</a>Kyokushin Turku</p>\n<p>`;\n break; \n default: console.log('menuClick: not found clickedButton', clickedButton); \n }\n info1.innerHTML = informaatio;\n}", "function displayToolInfoEvent() {\r\n\t$(\".mif-question\").click(function(){\r\n\r\n\t\tevent.stopPropagation(); //Stops more onclick-events from triggering\r\n\r\n\t\tvar url = \"about/\" + $(this).parents(\"[data-info]\").data(\"info\");\r\n\t\tvar toolTitle = $(this).parent().find(\".tile-label\").text();\r\n\t\t$(\"#help-title\").text(toolTitle);\r\n\r\n\t $.get(url, function(respnose) {\r\n\t $(\"#tool-help-info\").html(respnose);\r\n\t\t});\r\n\r\n\t $(\"#tool-help\").modal(); //Opening the Help-modal\r\n\r\n\t});\r\n}", "function addInfoToDOM() {\n let title = \"<p id='quest-title'>\" + questTitle + \"</p>\";\n $(\"#quest-title-container\").append(title);\n let description = \"<p id='quest-description'>Your Quest:<br />\" + questDescription + \"</p>\";\n $(\"#quest-description-container\").append(description);\n let bitmoji = \"<img src='\" + bitmojiURL + \"'>\";\n $(\".image-container\").append(bitmoji);\n getBitmojiBackground();\n let instructions = \"<a id='quest-instructions' onclick='showVideo(this)'\" +\n \"data-bs-toggle='modal' data-bs-target='#videoViewer'>Instructions</a>\";\n $(\"#quest-instructions-container\").append(instructions);\n let info = \"<a id='quest-information' onclick='showVideo(this)'\" +\n \"data-bs-toggle='modal' data-bs-target='#videoViewer'>More Information</a>\";\n $(\"#quest-information-container\").append(info);\n}", "function detailInfo() {\n document.getElementsByClassName(\"detail\")[0].innerHTML += vehicle1.clickInfo();\n}", "function displayComic(data) {\n\t\t \t$('.title').text(data.title);\n\t\t\t\t$('.month').text(data.month);\n\t\t\t\t$('.day').text(data.day);\n\t\t\t\t$('.year').text(data.year);\n\t\t\t\t$('.image').html('<img src=\"' + data.img + '\"/>');\n\t\t\t\t$('.alt').text(data.alt);\n\t\t\t} // end displayComic function", "function fillInfo() {\n nameLabel.innerHTML = cocktail[0];\n cocktailInfoLabel.innerHTML = cocktailInfo;\n}", "clickDisplay(){\n\n if(!this.__modelSelect.isSelectedModelReady()){\n alert(\"You Need To Choose A Ready Model First!!!\");\n return;\n }\n\n let idSelected = this.__modelSelect.getSelectedModel();\n if(idSelected == -1){\n alert(\"You Need To Choose Model First!!!\");\n return;\n }\n\n if(this.__resultData == null ) {\n alert(\"You Need To Upload A Result Data First!!!\");\n return;\n }\n\n //gets the anomaly from server (the response would display the resualt)\n this.__clientController.getAnomaly(idSelected, this.__resultData);\n }", "function generateInfo(){\r\n document.getElementById(\"co1\").innerHTML+=\"<center><img src=\"+datajson.graphql.user.profile_pic_url+\" style='border-radius: 75px; width: 150px; height: 150px;'><br><h3>Username: \"+datajson.graphql.user.username+\"</h3><br><h4>\"+datajson.graphql.user.biography+\"</h4><br><h3>Full Name: \"+datajson.graphql.user.full_name+\"</h3><hr><h3>Followers: \"+datajson.graphql.user.edge_followed_by.count+\"&nbsp&nbsp&nbsp&nbsp Following: \"+datajson.graphql.user.edge_follow.count+\"</h3><br><a class='btn btn-primary disabled' href='saved.html' role='button'>Saved Media</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class='btn btn-primary' href='login.html' role='button'>Log Out</a></center>\"\r\n}", "function visualise(){\r\n//sets the background to grey to hide any text that was previously on it\r\n background(80);\r\n\r\n//creates a button that calls the function priceDraw when pressed\r\n visPrice = createButton('Prices');\r\n visPrice.position(10,630);\r\n visPrice.size(100,30);\r\n visPrice.mousePressed(priceDraw);\r\n\r\n//creates a button that calls the function quanDraw when pressed\r\n visQuan = createButton('Quantity');\r\n visQuan.position(10,600);\r\n visQuan.size(100,30);\r\n visQuan.mousePressed(quanDraw);\r\n\r\n//hides the other buttons so they don't interfere\r\n listButtons.hide();\r\n graphButton.hide();\r\n visButton.hide();\r\n }", "function toggleInfo() {\n if (infoContainer.style.display === 'none') {\n infoContainer.style.display = 'block';\n infoBtn.innerText = 'Less Info';\n infoContainer.innerText = info;\n } else {\n infoContainer.style.display = 'none';\n infoBtn.innerText = 'More Info';\n infoContainer.innerText = '';\n }\n }", "function buttonClick() {\n\tvar id = event.target.id;\n\tswitch(id) {\n\tcase \"Load\":\n\t\tbtRead.disabled = false;\n\t\tloadParams();\n\tbreak;\n\tcase \"Read\":\n\t\tbtStart.disabled = false;\n\t\treadParams();\n\tbreak;\n\tcase \"Start\":\n\t\tif(btStart.innerHTML == \"Start\") {\n\t\t\tbtLoad.disabled = true;\n\t\t\tbtRead.disabled = true;\n\t\t\tbtInfo.disabled = true;\n\t\t\tbtStart.innerHTML = \"Stop\";\n\t\t\tproc = setInterval(simulate, Tproc);\n\t\t} else {\n\t\t\tbtLoad.disabled = false;\n\t\t\tbtRead.disabled = false;\n\t\t\tbtInfo.disabled = false;\n\t\t\tbtStart.innerHTML = \"Start\";\n\t\t\tclearInterval(proc);\n\t\t}\n\tbreak;\n\tcase \"Info\":\n\t\tvar info = \"\";\n\t\tinfo += \"cppcmf.js\\n\";\n\t\tinfo += \"Charged particle in perpendicular \";\n\t\tinfo += \"constant magnetic field\\n\";\n\t\tinfo += \"Sparisoma Viridi\\n\";\n\t\tinfo += \"https://github.com/dudung/butiran.js\\n\"\n\t\tinfo += \"Load load parameters\\n\";\n\t\tinfo += \"Read read parameters\\n\";\n\t\tinfo += \"Start start simulation\\n\";\n\t\tinfo += \"Info show this messages\\n\";\n\t\tinfo += \"\\n\";\n\t\taddText(info).to(taOut);\n\tbreak;\n\tdefault:\n\t}\n}", "function populatepage(){\n \n document.getElementById('signedNamePlace').innerHTML = \"User: \";\n document.getElementById('signedName').innerHTML = username;\n document.getElementById('firstbtn').style.visibility = \"visible\";\n document.getElementById('simplebtn').style.visibility = \"visible\";\n}", "onButtonClick() {\n var shaderData = gShaderToy.Save(),\n banner = this.createBanner(shaderData.info);\n\n shaderData.renderpass.forEach(function(pass) {\n if (pass.name === 'Image') {\n pass.code = banner + pass.code;\n }\n });\n\n window.localStorage.setItem(\n LOCALSTORAGE_SHADER_FORK_KEYNAME,\n JSON.stringify(shaderData)\n );\n gShaderToy.mNeedsSave = false;\n window.location.href = 'https://www.shadertoy.com/new';\n }", "function displayResults() {\n\n $('.btn').focus();\n $('#top-result').fadeIn();\n $('.container__outside--output').fadeIn();\n $('#map').html('<img src=' + mapUrl + '>');\n $('#result').text(venue.name);\n $('#location').text(venue.address);\n $('#url').html('<a href=\"' + venue.url + '\" target=\"_blank\">Vist website</a>');\n $('#category').html('<img src=\"' + venue.icon + '64.png\">');\n \n }", "function visDetaljer(u) {\n this[\"button\"+u].onclick = function() {\n document.getElementById(\"detaljer\").innerHTML = \"<div id=\\\"storSkrift\\\">\" + obj.entries[u].plassering + \"<br><br></div>Adresse: \" + obj.entries[u].adresse + \"<br><br>Pris: \" + obj.entries[u].pris + \"<br><br> <b>Åpningstider:</b> <hr>Hverdager: \" + obj.entries[u].tid_hverdag + \"<br>Lørdager \" + obj.entries[u].tid_lørdag + \"<br>Søndager: \" + obj.entries[u].tid_søndag + \"<hr>Egnet for rullestol: \" + obj.entries[u].rullestol + \"<br>Stellerom: \" + obj.entries[u].stellerom + \"<br> Kun pissoir: \" + obj.entries[u].pissOnly;\n\n };\n}", "function displayInfo(){\n $('#car-view').empty();\n var topic = $(this).attr('data-name');\n var queryURL = 'https://api.giphy.com/v1/gifs/search?q=' + topic + '&api_key=jVz8LzEOLKTNPSj1tux4I40dP1PX6Pbg&limit=10';\n\n // AJAX call to GET information \n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n // If no information on topics is found, the alert the user\n if (response.pagination.total_count == 0) {\n alert('Sorry, there are no Gifs for this topic');\n var itemindex = topics.indexOf(topic);\n // otherwise display button\n if (itemindex > -1) {\n topics.splice(itemindex, 1);\n renderButtons();\n }\n }\n \n // Save response from API call (JSON) to a variable results\n var results = response.data;\n for (var j = 0; j < results.length; j++){\n // Create new Div\n var newTopicDiv = $(\"<div class='car-name'>\");\n // Save responses from API into variables and add to DOM\n // GIF Rating\n var pRating = $('<p>').text('Rating: ' + results[j].rating.toUpperCase());\n // GIF Title\n var pTitle = $('<p>').text('Title: ' + results[j].title.toUpperCase());\n // GIF URL\n var gifURL = results[j].images.fixed_height_still.url; \n var gif = $('<img>');\n gif.attr('src', gifURL);\n gif.attr('data-still', results[j].images.fixed_height_still.url);\n gif.attr('data-animate', results[j].images.fixed_height.url);\n gif.attr('data-state', 'still');\n gif.addClass ('animate-gif');\n // Appending info \n newTopicDiv.append(pRating);\n newTopicDiv.append(pTitle);\n newTopicDiv.append(gif);\n // Putting the saved info to new div\n $('#car-view').prepend(newTopicDiv);\n } \n });\n }", "function displayResult() {\n\t\t\t\t\t\n \t\t\t\tdocument.getElementById(\"dispResult\").innerHTML = getHeadline[0] + '<button>Save</button><br/>' + getHeadline[1]\n\t\t\t\t\t+ '<button>Save</button><br/>' + getHeadline[2]+ '<button>Save</button><br/>' + getHeadline[3]+ '<button>Save</button><br/>' + getHeadline[4]\n\t\t\t\t\t+ '<button>Save</button><br/>' + getHeadline[5]+ '<button>Save</button><br/>' + getHeadline[6]+ '<button>Save</button><br/>' + getHeadline[7]\n\t\t\t\t\t+ '<button>Save</button><br/>' + getHeadline[8]+ '<button>Save</button><br/>' + getHeadline[9] + '<button>Save</button>';\n\t\t\t\t\t\n\t\t\t\t}", "function whenClicked()\r\n{\r\n\r\n $('#trackbtn').button('loading');\r\n getUserLocation();\r\n\r\n}", "function showAttraction(json) {\n $('#events-panel').hide();\n $('#attraction-panel').show();\n $('#profile-alert').hide();\n\n $('#card-go-back').click(function() {\n getEvents(page);\n });\n \n $('#tm-purchase').click(function() {\n url = json.url\n // alert(url)\n window.open(url)\n });\n \n $('#add-events-profile').click(function() {\n // $('#alert-profile').show();\n alert('Added to Profile');\n })\n \n \n\n $('#attraction h3').first().text(json.name);\n $('#attraction img').first().attr('src', json.images[0].url);\n $('#classification').text(json.classifications[0].segment.name + \" - \" + json.classifications[0].genre.name + \" - \" + json.classifications[0].subGenre.name);\n $('#description'.text(json.description));\n}", "function renderInfo(data){\n\n console.log(data);\n\n //display title\n title.innerHTML = data.name;\n\n //display image\n image.src = data.image.url;\n image.alt=\"Image not found\";\n \n //display favourite\n if(favList!==null && favList.includes(id)){\n fav.innerHTML = '<i id=\"heart-icon\" class=\"fas fa-heart\"></i>';\n }\n else{\n fav.innerHTML = '<i id=\"heart-icon\" class=\"far fa-heart\"></i>';\n }\n\n //display powerstats\n for(var i in data.powerstats){\n document.getElementById(i).innerHTML = data.powerstats[i];\n }\n\n //display biography\n for(var i in data.biography){\n document.getElementById(i).innerHTML = data.biography[i];\n }\n\n //display appearance\n for(var i in data.appearance){\n document.getElementById(i).innerHTML = data.appearance[i];\n }\n\n //display work\n for(var i in data.work){\n document.getElementById(i).innerHTML = data.work[i];\n }\n\n //display connections\n for(var i in data.connections){\n document.getElementById(i).innerHTML = data.connections[i];\n }\n}", "function displayButton() {\r\n var p = $('<p />').attr('id', 'imdbscout_button');\r\n p.append($('<button>Load links</button>').css({'background-color':'#F5C518', 'color':'blue', 'font-weight':'bold'}).click(function() {\r\n $('#imdbscout_button').remove();\r\n if (onSearchPage) {\r\n performSearch();\r\n } else {\r\n performPage();\r\n }\r\n }));\r\n if (onSearchPage) {\r\n $('#sidebar').prepend(p);\r\n } else if ($('[class^=SubNav__SubNavContainer]').length) {\r\n $('[class^=SubNav__SubNavContainer]').append(p);\r\n // reference\r\n } else if ($('.titlereference-header').length) {\r\n $('.titlereference-header').append(p);\r\n }\r\n}", "displayInfo() {\n let imageContainer = document.querySelector(\"#image-container\");\n let thumbnailEl = document.createElement(\"img\");\n thumbnailEl.setAttribute(\"src\", this.thumbnailImg)\n imageContainer.append(thumbnailEl);\n let artistNameDiv = document.querySelector(\"#artist-name\");\n artistNameDiv.textContent = this.name;\n let artistInfoDiv = document.querySelector(\"#profile-info\");\n artistInfoDiv.textContent = this.profileInfo;\n\n }", "function displayInitialSample(){\n\t\t//probably call it when starwars is clicked\n\t\tclearInfo();\n\t\t$spanInfo.html(\"<h4><b>Sample piece of data from each class on the API</b></h4>\");\n\t\t// $spanInfo.append(\"<h4 class='label label-info lb-md'>Starships, Vehicles, Species, Films, Planets, People</h4>\");\n\t\t$spanInfo.append(\"<table class='table tableHeaderHome label-default lb-sm'><th>Starships</th><th>Vehicles</th><th>Species</th><th>Films</th><th>Planets</th><th>People</th></table>\");\n\t\t$table.show();\n\t\t//print out the sample 1 per each.\n\t\tgenerateStarships(2);//no values on 1\n\t\tgenerateVehicles(4);//no values on first 3\n\t\tgenerateSpecies(1);\n\t\tgenerateFilms(1);\n\t\tgeneratePlanets(1);\n\t\tgeneratePeople(1);\t\t\t\t\t\t\n\t}", "function extrabutton() {\r\n try {\r\n if (!stat.internet || stat.notFound || isTutorialOn[0] || stat.scripts.chartjs === 1) {\r\n return;\r\n }\r\n if (!channel.id) {\r\n tutorial(0);\r\n } else if (stat.scripts.chartjs === 0) {\r\n stat.scripts.chartjs = 1;\r\n loading('showextra');\r\n getScript('https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.js', function () {\r\n getViews(function () {\r\n createCharts();\r\n stat.scripts.chartjs = 2;\r\n extrabutton();\r\n });\r\n getMisc();\r\n });\r\n } else if (!stat.extra) {\r\n changeText('showextra', 'Show Stats');\r\n fx('showextra').fadeOut();\r\n fx('hideextra').fadeIn();\r\n doc.i('extraContent').style.display = 'block';\r\n \r\n channel.live.seconds = -1;\r\n stat.extra = true;\r\n } else if (stat.extra) {\r\n fx('showextra').fadeIn();\r\n fx('hideextra').fadeOut(100);\r\n doc.i('extraContent').style.display = 'none';\r\n\r\n chartStore[0].data.labels = [];\r\n chartStore[0].data.datasets[0].data = [];\r\n chartStore[0].update();\r\n\r\n stat.extra = false;\r\n }\r\n } catch (err) {\r\n if (stat.developmentMode) throw 'extrabutton:' + err;\r\n }\r\n}", "function instruction() {\n // show how many votes player get\n player1Info = \"Donkey's votes: \" + donkey.vote + \" bonus:\" + donkey.bonus + \" total:\" + donkey.result;\n player2Info = \"Elephant's votes: \" + elephant.vote + \" bonus:\" + elephant.bonus + \" total:\" + elephant.result;\n textSize(20);\n fill(195, 181, 255, 255);\n text(\"Get 450 votes or beat your rival to win!\", windowWidth / 2, 40);\n text(player1Info, windowWidth / 2, 70); // display donkey information\n text(player2Info, windowWidth / 2, 100); // display elephant information\n\n}", "function showInfo(data) {\n\t$(\"#qrContent p\").text(data);\n}", "showInfo() {\n let saturnInfo;\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n push();\n // Saturn infos\n saturnInfo = createGraphics(280, 250);\n saturnInfo.fill(green.r, green.g, green.b);\n saturnInfo.background(20, 220);\n saturnInfo.textSize(10);\n saturnInfo.textFont(globalFont);\n saturnInfo.textAlign(LEFT);\n saturnInfo.text(this.info, 10, 20, 260, 250);\n texture(saturnInfo);\n\n // Calling the superclass Planet.js' showInfo method\n super.showInfo();\n pop();\n }\n }\n }", "function displaysButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var btn = $(\"<button class='gifBtn'>\");\n btn.attr(\"data-name\", topics[i]);\n btn.text(topics[i]);\n $(\"#buttons-view\").append(btn)\n\n }\n }", "function ansClicked (eventData) {\n\tlet buttonInformation = eventData;\n\tlet ansClicked = buttonInformation.target.textContent;\n\tinsertDisplay(ansClicked);\n\t\n}", "function showInfo() {\n $('#user-name').text(curUser.first_name + ' ' + curUser.last_name);\n $('#first-name').text(curUser.first_name);\n $('#last-name').text(curUser.last_name);\n $('#email').text(curUser.email);\n $('#phone').text(curUser.phone_number);\n }", "function buildInfoScreen() {\n\n //Explaining what this game is\n x = width / 2;\n y = 150 * progScale;\n s = \" is a platformer created by Lee Thibodeau (myself).\\nIt was programmed in JavaScript using the P5.js library \\nto help display visuals. I created this game to\\n entertain myself with a project and my friends with\\n varying degrees of challenge.\";\n let textDescription = new DisplayText(x, y, 0, 0, s);\n textDescription.textSize = 30 * progScale;\n allObjects.push(textDescription);\n \n //Bolded \"CUBE\"\n x = 100 * progScale;\n y = 75 * progScale;\n s = \"CUBE\";\n let textCubeBold = new DisplayText(x, y, 0, 0, s);\n textCubeBold.textSize = 30 * progScale;\n textCubeBold.textFont = fontBold;\n allObjects.push(textCubeBold);\n \n //Website Note\n x = width / 2;\n y = 350 * progScale;\n s = \"View the project's creation process on my website:\";\n let textWebsiteNote = new DisplayText(x, y, 0, 0, s);\n textWebsiteNote.textSize = 30 * progScale;\n allObjects.push(textWebsiteNote);\n \n //website link (button)\n w = 900 * progScale;\n h = 60 * progScale;\n x = (width / 2) - w / 2;\n y = 380 * progScale;\n let url = \"https://www.leethibodeau.com/cube\";\n let goToWebsite = function() {\n window.open(url, \"_blank\") //open webpage in new tab\n };\n let btnWebsite = new Button(x, y, w, h, goToWebsite);\n btnWebsite.displayText = url;\n btnWebsite.strokeWeight = 0;\n btnWebsite.fillColor = color(0, 0, 0, 0); //transparent\n btnWebsite.hoverColor = color(0, 0, 0, 0); //transparent\n btnWebsite.textSize = 35 * progScale;\n btnWebsite.textColor = color(0, 0, 255);\n btnWebsite.textHoverColor = color(255, 0, 255); //transparent\n btnWebsite.textFont = fontBold;\n allObjects.push(btnWebsite);\n \n //GitHub Note\n x = width / 2;\n y = 500 * progScale;\n s = \"View the project's code and development history on GitHub:\";\n let textGitHubNote = new DisplayText(x, y, 0, 0, s);\n textGitHubNote.textSize = 30 * progScale;\n allObjects.push(textGitHubNote);\n \n //GitHub link (button)\n w = 800 * progScale;\n h = 60 * progScale;\n x = (width / 2) - w / 2;\n y = 530 * progScale;\n url = \"https://github.com/Leefeet/CUBE\"\n let goToGitHub = function() {\n window.open(url, \"_blank\") //open webpage in new tab\n };\n let btnGitHub = new Button(x, y, w, h, goToGitHub);\n btnGitHub.displayText = url;\n btnGitHub.strokeWeight = 0;\n btnGitHub.fillColor = color(0, 0, 0, 0); //transparent\n btnGitHub.hoverColor = color(0, 0, 0, 0); //transparent\n btnGitHub.textSize = 35 * progScale;\n btnGitHub.textColor = color(0, 0, 255);\n btnGitHub.textHoverColor = color(255, 0, 255); //transparent\n btnGitHub.textFont = fontBold;\n allObjects.push(btnGitHub);\n \n //Clearing record information\n x = (width / 2) - (width / 5);\n y = 700 * progScale;\n s = \"This game uses LocalStorage to save your\\nlevel records and progress. If you want\\nto clear and reset your records and\\nprogress, click the button below:\";\n let textDeleteRecords = new DisplayText(x, y, 0, 0, s);\n textDeleteRecords.textSize = 25 * progScale;\n allObjects.push(textDeleteRecords);\n \n //// Hidden Text underneath clear button\n // When records are cleared, show clear confirmation and disable the clear button\n x = (width / 2) - (width / 5);\n y = 900 * progScale;\n s = \"Records Cleared!\";\n let textRecordsCleared = new DisplayText(x, y, 0, 0, s);\n textRecordsCleared.textSize = 30 * progScale;\n textRecordsCleared.textColor = color(255, 0, 0);\n textRecordsCleared.textFont = fontBold;\n textRecordsCleared.isVisible = false;\n allObjects.push(textRecordsCleared);\n \n //Clear Records Button\n w = 350 * progScale;\n h = 60 * progScale;\n x = (width / 2) - (width / 5) - w / 2;\n y = 800 * progScale;\n let btnClearRecords; //declaring now so it can be included in function\n let clearRecords = function() {\n buildClearRecordsWarning(btnClearRecords, textRecordsCleared); //Showing confirmation screen\n };\n btnClearRecords = new Button(x, y, w, h, clearRecords);\n btnClearRecords.displayText = \"Clear Records\";\n btnClearRecords.strokeWeight = 0;\n btnClearRecords.fillColor = color(255, 0, 0);\n btnClearRecords.hoverColor = color(255/2, 0, 0);\n btnClearRecords.textSize = 35 * progScale;\n btnClearRecords.textColor = color(0, 0, 0);\n allObjects.push(btnClearRecords);\n \n //Main Menu button\n w = 450 * progScale;\n h = 60 * progScale;\n x = (width / 2) + (width / 4) - w / 2;\n y = 850 * progScale;\n let backToMenu = function() {\n clearGameObjects(); //clearing menu\n buildMainMenu(); //building the main menu\n };\n let btnMenu = new Button(x, y, w, h, backToMenu);\n btnMenu.displayText = \"Back to Main Menu\";\n btnMenu.strokeWeight = 0;\n btnMenu.fillColor = color(0, 255, 0);\n btnMenu.hoverColor = color(0, 255/2, 0);\n btnMenu.textSize = 35 * progScale;\n btnMenu.textColor = color(0, 0, 0);\n allObjects.push(btnMenu);\n \n}", "function setDetailButton(arrayNo, getLocation){ // by numbering the buttons we can target them one by one\n var detailsBtn = document.getElementsByClassName('view-details')[0];\n detailsBtn.addEventListener('click', function(){writeModal(arrayNo, getLocation);}, false);\n // This function gives a counter to the event listeners so they inject the corresponding data into the DOM\n } // Invoked at line 124", "function buttonClick(event) {\n\n //Finds each button to give them variable names\n let firstButton = document.getElementById('btnOne');\n let secondButton = document.getElementById('btnTwo');\n\n //Checks if first button is clicked to add content\n if (event === firstButton) {\n $(\".pack-first\").html(`\n <p>€350 for one day hire<br>\n Drone and Pilot<br>\n Includes digital copies of all shots<br>\n Available nationwide\n </p>\n `);\n\n //Hides relevant button as not needed\n $('#btnOne').hide(1000);\n\n //Checks if second button clicked to add content\n } else if (event === secondButton) {\n $(\".pack-second\").html(`\n <p>€150 for one day hire<br>\n Drone only<br>\n Includes digital copies of all shots<br>\n Insurance included<br>\n Collection only\n </p>\n `);\n\n //Hides relevant button as not needed\n $('#btnTwo').hide(1000);\n }\n}", "function showDetails(){\n console.log(\"btn clicked!\");\n\n // Show details\n if(!visible){\n // Show details class on click\n UI.$secForm.removeClass('hide');\n UI.$btnShow.html( hideIcon + 'Hide Details');\n\n // change boolean\n visible = true;\n }\n else{ //Hide details\n UI.$secForm.addClass('hide');\n UI.$btnShow.html(showIcon + 'Show Details');\n\n // change boolean\n visible = false;\n }\n}", "function divs(objeto) {\r\n\r\n var newDiv = $(\"<div class='noticia'></div>\")\r\n $(newDiv).html(\"<h3>\" + \" <a href=\" + objeto.url + \" target=_blank>\" + objeto.title + \"</a>\" + \"</h3>\" + \"<br>\" + \"<br>\" + \"<img src=\" + objeto.urlToImage + \">\" + \"<p>\" + objeto.description + \"</p>\" + \"<br>\");\r\n\r\n $(newDiv).append($('<button>').attr(\"class\", \"boton\").text(\"+info\").click(function () {\r\n info(objeto)\r\n }));\r\n\r\n $(\"#container\").append(newDiv)\r\n}", "function click() {\n\n setName('Ram')\n setAge(21)\n // console.log(\"button clicked\")\n console.log(name,age)\n }", "function updateDisplay(info) {\n\n display.innerHTML = info;\n\n }", "function displayData() {\n displayUserInfo();\n displayRecipes();\n console.log(\"before\", chosenPantry)\n}", "function detail_result(json_parse) {\n\n document.getElementsByClassName('panel')[0].className = \"panel panel-default show\"\n document.getElementsByClassName('panel-heading')[0].innerHTML = '<strong>' + json_parse.Title + '</strong><br/>(' + json_parse.Released + ')'\n document.getElementsByClassName('panel-body')[0].innerHTML = '<div class=\"detail_holder\">' +\n '<div><strong>Genre:</strong>&nbsp;&nbsp;' + json_parse.Genre + '</div>' +\n '<div><strong>Starring:</strong>&nbsp;&nbsp;' + json_parse.Actors + '</div>' +\n '<div>' + json_parse.Plot + '</div>' +\n '</div>'\n \n \n \n}", "function afterClick() {\n let nameOfcard = this.id;\n id(\"start-btn\").classList.remove(\"hidden\");\n qs(\"#p1 .name\").id = nameOfcard;\n let getinfo = URL_POKE + \"?pokemon=\" + nameOfcard;\n fetch(getinfo)\n .then(checkStatus)\n .then((resp) => resp.json())\n .then((resp) => getCard(resp, \"#p1\"))\n .catch(console.error);\n }", "function showInfo(data) {\n console.log(data);\n var display = $('div#tabletop-display')\n \n var openButton =$('<span>')\n\t\t\t\t.addClass (\"btn btn-default btn-maroon openAll\")\n\t\t\t\t.text(\"Show All Descriptions\")\n\t\t\t\t.appendTo(display);\n\t\t\t\t\n\t\tvar closeButton =$('<span>')\n\t\t\t\t.addClass (\"btn btn-default btn-maroon closeAll\")\n\t\t\t\t.text(\"Hide All Descriptions\")\n\t\t\t\t.appendTo(display);\t\t\n \n \n\tvar items = [];\n\t$.each( data, function( key, value ) {\n\t\t\n\t\tvar div = $('<div>')\n\t\t\t.addClass('org');\n\t\t\t\n\t\tif (value.description) {\n\t\t\n\t\tvar title = $('<span>')\n\t\t\t.addClass('ui-menu-item')\n\t\t\t.addClass('org-title')\n\t\t\t.addClass('details-control')\n\t\t\t.attr('role', 'menuitem')\n\t\t\t.text(value.name)\n\t\t\t.appendTo(div);\t\n\t\t\t\n\t\tvar orgDesc = $('<div>')\n\t\t\t.addClass('org-desc');\n\t\t\t\n\t\tvar orgText =$('<p>')\n\t\t\t.text(value.description)\n\t\t\t.appendTo(orgDesc);\n\t\t\t\n\t\torgDesc.appendTo(div);\n\t\t\n\t\t}\n\t\telse {\n\t\t\tvar title = $('<span>')\n\t\t\t.addClass('details-control')\n\t\t\t.addClass('empty')\n\t\t\t.text(value.name)\n\t\t\t.appendTo(div);\t\n\t\t}\n\t\t\t\n\t\tif (value.url) {\n\t\t\tvar button =$('<span>')\n\t\t\t\t.addClass (\"btn btn-default btn-maroon\");\n\t\t\n\t\t\tvar orgLink = $('<a>')\n\t\t\t\t.addClass (\"org-link-law\")\n\t\t\t\t.attr (\"href\", value.url)\n\t\t\t\t.text (value.name)\n\t\t\t\t.appendTo(button);\n\t\t\t\t\n\t\t\tbutton.appendTo(orgDesc);\t\n\t\t\t\n\t\t}\n\t\t\t\n\t\tdiv.appendTo(display);\n \t\n });\n \n $(\".org-title\")\n\t\t.click(function(){\n\t\t\t$(this)\n\t\t\t\t.toggleClass(\"open\")\n\t\t\t\t.next(\".org-desc\")\n\t\t\t\t.slideToggle(200);\n return false;\n\t\t});\t\n\t\t\n\t$(\".openAll\")\n\t\t.click(function(){\n\t\t\t$(\".org-title\")\n\t\t\t\t.addClass(\"open\")\n\t\t\t\t.next(\".org-desc\")\n\t\t\t\t.slideDown(200);\n return false;\n\t\t});\t\n\t\t\n\t$(\".closeAll\")\n\t\t.click(function(){\n\t\t\t$(\".org-title\")\n\t\t\t\t.removeClass(\"open\")\n\t\t\t\t.next(\".org-desc\")\n\t\t\t\t.slideUp(200);\n return false;\n\t\t});\t\n \n }", "function circleDetail(lon, lat, url, imageAlt, title, subTitle, address) {\n images = \"<a href = 'http://www.ahextechnologies.com'>\\n\\\n <img src='\" + url + \"' alt='\" + imageAlt + \"' height='220' width='220'></a>\";\n //$(\"#dialog p\").html(\"I am plotted at \" + lon + \" , \" + lat);\n $(\"#dialog p.dialog-title\").html(title);\n $(\"#dialog p.dialog-subtitle\").html(subTitle);\n $('#dialog p.dialog-address').html('<b>Address : </b>' + address);\n $(\"#dialog .pointImage\").html(images);\n $(function() {\n $(\"#dialog\").dialog();\n });\n }", "generateDetailsLabel() {\n var id = generateId();\n var html = \"<div id='\" + id + \"'><table class='details-table st-mgr-tab'><tbody><tr><td>Verwendeter Algorithmus</td><td>\" + this.algorithm + \"</td></tr><tr><td>Berechnungsdauer</td><td>\" + this.duration + \" ms</td></tr><tr><td>Gesamtes Containervolumen</td><td class='after-m3'>\" + Styler.styleCubicM(this.container.getTotalVolume()) + \"</td></tr><tr><td>Davon besetztes Volumen</td><td class='after-m3'>\" + Styler.styleCubicM(this.container.getUsedVolume()) + \"</td></tr><tr><td>Davon ungenutztes Volumen</td><td class='after-m3'>\" + Styler.styleCubicM(this.container.getUnUsedVolume()) + \"</td></tr><tr><td>Enthaltene Paletten</td><td>\" + this.container.goods.length + \"</td></tr><tr><td>Länge des Containers</td><td class='after-m'>\" + Styler.styleM(this.container.length) + \"</td></tr><tr><td>Höhe des Containers</td><td class='after-m'>\" + Styler.styleM(this.container.height) + \"</td></tr><tr><td>Breite des Containers</td><td class='after-m'>\" + Styler.styleM(this.container.width) + \"</td></tr></tbody></table>\";\n html += \"<canvas id='current-load'></canvas>\";\n html += \"<button class='button' data-target='download-solution' data-index='0'><i class='material-icons icon'>save_alt</i>Lösung herunterladen (.json)</button><button class='button' data-target='export-solution' data-index='1'><i class='material-icons icon'>reply</i>Lösung exportieren (.csv)</button><button class='button' data-target='go-back' data-index='0'><i class='material-icons icon'>arrow_back</i>Zurück zur Eingabe</button></div>\";\n return {\n html: html,\n id: id\n };\n }", "function clickActivate() {\r\n populateInfoWindow(this, largeInfowindow);\r\n }", "function ShowTVShowInfo(id)\n{\n $.ajax\n ({\n url: 'jsonfargo.php?action=info&media=tvshows' + '&id=' + id,\n async: false,\n dataType: 'json',\n success: function(json)\n { \n var btnname, pattern;\n var buttons = \"\"; \n var aInfo = [{left:\"Episodes:\", right:json.media.episode},\n {left:\"Aired:\", right:json.media.premiered},\n {left:\"Genre:\", right:json.media.genre},\n {left:\"Studio:\", right:json.media.studio},\n {left:\"Year:\", right:json.media.year},\n {left:\"Rating:\", right:json.media.rating},\n {left:\"Path:\", right:json.media.path}]; \n \n // Show info.\n ShowInfoTable(aInfo);\n \n // Change space size for tv show info and fanart.\n $(\"#info_left\").css(\"margin-right\", 395); // 460\n $(\"#info_right\").toggleClass(\"fanart_space\", true).toggleClass(\"cover_space\", false);\n \n // Show fanart.\n $(\"#info_fanart img\").error(function(){\n $(this).attr('src', 'images/no_fanart.jpg');\n })\n .attr('src', json.params.fanart + '/' + json.media.fanart + '.jpg')\n .css(\"width\", 385);\n \n // Show plot.\n $(\"#info_plot\").text(\"Plot\");\n $(\"#info_plot_text\").html(json.media.plot).slimScroll({\n height:'120px',\n color:'gray',\n alwaysVisible:true\n });\n \n // Hide close button and add button (TheTVDB, AniDB).\n if (json.media.imdbnr)\n {\n $(\"#info_box .close\").hide();\n \n pattern = /thetvdb/; \n if(pattern.exec(json.media.imdbnr)) {\n btnname = \"TheTVDB\";\n }\n else {\n btnname = \"AniDB\";\n }\n \n buttons += '<button type=\"button\" class=\"url\" value=\"' + json.media.imdbnr + '\">' + btnname + '</button>';\n \n $(\"#info_box .button\").append(buttons);\n }\n else {\n $(\"#info_box .close\").show(); \n }\n \n // Show popup.\n ShowPopupBox(\"#info_box\", \"<div>\" + json.media.title + \"</div>\");\n SetState(\"page\", \"popup\"); \n } // End succes.\n }); // End Ajax. \n}", "function infoTour (public_pict, audience, tour_pict, tour, age, timing, step) {\r\n $(\"#tour-picture\").empty();\r\n $(\"#tour-title > h4\").text(audience);\r\n $(\"#tour-title > h3\").text('parcours ' + tour);\r\n $(\"#tour-picture\").append('<img class=\"icon8-size mr-1\" src=\"public/images/icon8/' + public_pict + '.png\" alt=\"' + audience + '\"/>');\r\n $(\"#tour-picture\").append('<img class=\"icon8-size mr-1\" src=\"public/images/icon8/' + tour_pict + '.png\" alt=\"' + tour + '\"/>');\r\n $(\"#tour-age\").text(age);\r\n $(\"#tour-timing\").text(timing);\r\n $(\"#tour-step\").text(step);\r\n}", "function openModal(e) {\r\n // console.log(\"e.target.id: \", e.target.id)\r\n fetch(`${url}/${e.target.id}`)\r\n .then(res => res.json())\r\n .then(res => {\r\n let info = res.results[0]\r\n console.log(info)\r\n let name = info.name\r\n let fullName = info.biography['full-name'] \r\n let alterEgos = info.biography['alter-egos'] \r\n let occupations = info.work.occupation\r\n let intelligence = info.powerstats.intelligence\r\n let strength = info.powerstats.strength\r\n let speed = info.powerstats.speed \r\n let affiliations = info.connections[\"group-affiliation\"]\r\n\r\n infoName.innerText = name;\r\n infoFullName.innerText = `Full Name: ${fullName}`;\r\n\r\n let infoOccupations = document.createElement(\"p\")\r\n infoOccupations.innerHTML = `<strong>Occupations:</strong> ${occupations}` \r\n infoStats.appendChild(infoOccupations)\r\n\r\n let infoIntelligence = document.createElement(\"p\")\r\n infoIntelligence.innerHTML = `<strong>Intelligence: </strong> ${intelligence} / 100`\r\n infoStats.appendChild(infoIntelligence)\r\n\r\n let infoStrength = document.createElement(\"p\")\r\n infoStrength.innerHTML = `<strong>Strength: </strong> ${strength} / 100`\r\n infoStats.appendChild(infoStrength)\r\n\r\n let infoSpeed = document.createElement(\"p\")\r\n infoSpeed.innerHTML = `<strong>Speed: </strong> ${speed} / 100`\r\n infoStats.appendChild(infoSpeed)\r\n\r\n infoAffiliations.innerText = affiliations\r\n\r\n modal.style.display = 'block';\r\n })\r\n .catch(err => {\r\n console.log(\"Error: \", err)\r\n })\r\n\r\n \r\n}", "function showFullDetails(clicked,pgDetails){\n console.log(pgDetails);\n var div = '<div style=\"width:96%;margin-left:2%;margin-right:1%;margin-top:2%;background-color:#333;color:white;font-size:18px;\"><legend align=\"center\" style=\"color:white;\">'+pgDetails[clicked].name+'</legend>';\n div += '<div style=\"margin-left:2%;\"><label>Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+pgDetails[clicked].address+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>city&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+pgDetails[clicked].city+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>Mobile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+pgDetails[clicked].mobile+'</span></div>';\n if(pgDetails[clicked].Sharing == \"accomodationOnly\"){\n var type = \"Accomodation Only\";\n }else{\n var type = \"Food and Accomodation\";\n }\n div += '<div style=\"margin-left:2%;\"><label>Accomodation Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+type+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>Sharings Available&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>';\n var share =\"\";\n for(var i=0;i<pgDetails[clicked].pgFor.length;i++){\n if(pgDetails[clicked].pgFor[i] == \"more5\"){\n share += \"More than 5\";\n }else{\n share += pgDetails[clicked].pgFor[i]; \n share += \",\";\n }\n\n }\n div += share+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>Facility Available&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>';\n \n var facility = \"\";\n for(var j=0;j<pgDetails[clicked].facility.length;j++){\n facility += pgDetails[clicked].facility[j];\n if(j != pgDetails[clicked].facility.length-1){\n facility += \", \";\n }\n \n }\n div += facility+'</span></div>';\n div += '</div>';\n var ratings = '<div style=\"width:96%;margin-left:2%;margin-right:1%;margin-top:2%;background-color:#333;color:white;font-size:18px;\">';\n ratings += '<legend style=\"color:white;\"><span style=\"margin-left:2%;\">User Ratings</span></legend>';\n //ratings += '<div style=\"margin-left:2%;\"><span>Food&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class=\"rating\" id=\"food\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"3.6\"></span></div>';\n ratings += '<div style=\"margin-left:2%;\"><label style=\"float:left;\">Food &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"food\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"3.6\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br><div style=\"margin-left:2%;\"><label style=\"float:left;\">Parking Facility &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"parking\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"4.2\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br><div style=\"margin-left:2%;\"><label style=\"float:left;\">Hygiene &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"hygiene\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"4\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br><div style=\"margin-left:2%;\"><label style=\"float:left;\">Overall Rating of PG &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"pgRating\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"4.3\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br></div>';\n //ratings += '</div>';\n \n $(\"#thumbnails\").append(div);\n $(\"#thumbnails\").append(ratings); \n \n $(\"#food\").rating();\n $(\"#parking\").rating();\n $(\"#hygiene\").rating();\n $(\"#pgRating\").rating();\n \n }", "function int() {\n // Get the saved information from local storage\n var savedCities = JSON.parse(localStorage.getItem(\"citiesList\"));\n\n $(\"<button>\").html(savedCities);\n \n if (savedCities !== null) {\n citiesList = savedCities;\n }\n // Calls render buttons function to\n renderButtons();\n }", "function addButtons() {\n\t$ans.append('<button class=\"toInfo\">' + 'Click here to learn more!' + '</button>');\n\t$ans.append('<button class=\"tryAgain\">' + 'Click here to try again!' + '</button>');\t\n\t}", "function displayInfo(info={}){\n modelInfo.innerHTML = \"\"\n\n let h1 = document.createElement('h1')\n h1.innerText = `Hello ${info.name}`;\n\n let email = document.createElement('p')\n email.innerText = `Email: ${info.email}`;\n\n let choice = document.createElement('p')\n choice.innerText = `Watching choice: ${info.choice}`;\n\n let color = document.createElement('p')\n color.innerText = `Color: ${info.color}`;\n\n let movie = document.createElement('p')\n movie.innerText = `Movie Rating: ${info.movie}`;\n\n let book = document.createElement('p')\n book.innerText = `Book Genre: ${info.book}`;\n\n let terms = document.createElement('p')\n terms.innerText = `👍 : ${\n info.terms \n ? \"You have accepted the terms and conditions\"\n : \"You have NOT accepted the terms and conditions\"\n }`;\n\n\n modelInfo.append(h1, email, choice, color, movie, book, terms)\n}", "function Procedure_button(main, str){\n\n\t//creat button, set class\n\tvar btn = document.createElement(\"button\");\n\tbtn.classList.add(\"ui\", \"circular\",\"icon\",\"button\",\"procedure\",\n\t\t\t\t\t main.stepObject.length.toString());\n\tbtn.setAttribute ('id', \"ui circular icon button procedure \" + \n\t\t\t\t\t main.stepObject.length.toString())\n\t//set button string\n\tvar t = document.createTextNode(str);\n\tbtn.appendChild(t);\n\t\n //add button to Web\n document.getElementById(\"Procedure_List\").appendChild(btn);\n\n //record scene object\n RecordObjects(main);\n main.stepNumber += 1;\n\n //set the click action\n btn.addEventListener(\"click\", function(){\n\n \t//if is the last step, create the step button\n\t if(main.lastStep == true){\n\t \tmain.lastStep = false;\n\t \tProcedure_button(main, main.stepOperationName);\n\t }\n\n\t //console.log(btn.classList[5]);\n\t buttonClicked(main, btn.classList[5]);\n\t main.stepNumber = btn.classList[5];\n\t main.stepOperationName = btn.firstChild.nodeValue;\n\n\t //Initialise the model button\n\t main.processor.executeDesign(\"MODEL_ALIGN\", \"initial\");\n\t main.processor.executeDesign(\"MODEL_PAINTING\", \"initial\");\n main.processor.executeDesign(\"MODEL_WRAP\", \"initial\");\n main.processor.executeDesign(\"MODEL_ROTATION\", \"initial\");\n main.processor.executeDesign(\"MODEL_ADDBETWEEN\", \"initial\");\n main.processor.executeDesign(\"MODEL_CUT\", \"initial\");\n main.processor.executeDesign(\"MODEL_ADD\", \"initial\");\n\t //show the control buttons\n\t if(btn.firstChild.nodeValue != 'Initial')\n\t \t$('#parameter_control_tool_' + btn.firstChild.nodeValue).show();\t \n\n\t});\n\t\n}", "function showInfo(btn, label, zoom, latlng) {\n $('#click-info').html(btn + zoom);\n\n if (regionSelectedLayer.tilelayer) {\n // bind popup to layer\n regionSelectedLayer.popup = L.popup()\n .setLatLng(latlng)\n .setContent(\"<span class='infoPopup'>\" + label + \"</span>\")\n .openOn(map.lmap);\n } else {\n // console.log(\"regionSelectedLayer.tilelayer undef\");\n }\n }", "function infoClicked() {\n\n\tappInfo = document.getElementById(\"appInfo\");\n\tsectionValue = document.getElementById(\"user-section\").value;\n\trowValue = document.getElementById(\"user-row\").value;\n\tseatValue = document.getElementById(\"user-seat\").value;\n\tappCredits = document.getElementById(\"appCredits\");\n\t\n\n\n\tvar appCreditsString = \"PixelPusher is a crowd-sourced media display \"\n\t\t\t\t\t\t+ \"app created</br>in Spring, 2015 by the AddHawk development team.\"\n\t\t\t\t\t\t+ \"</br></br>Developers:</br>Michael Peter</br>Christopher Wood</br>\"\n\t\t\t\t\t\t+ \"Dillon Gresham</br>Connor Hoene\";\n\tappCredits.innerHTML = \"<div id='appCredits'></br>\" + appCreditsString + \"</div>\";\n\n\tif (sectionValue != -1 && rowValue != -1 && seatValue != -1) {\n\t\t//NOTE:\n\t\t//putting the div tags in the inner html gives the double border look, which i like.\n\t\tappInfo.innerHTML = \"<div id='appInfo' name='appInfo'><u>Your current seat is:</u></br>Section: \"\n\t\t\t\t\t\t\t+ sectionValue + \"</br>Row: \" + rowValue + \"</br>Seat Number: \"\n\t\t\t\t\t\t\t+ seatValue + \"</div>\";\n\t}\n\telse {\n\t\tappInfo.innerHTML = \"<div id='appInfo' name='appInfo'><u>Your current seat is:</u></br>Section: \"\n\t\t\t\t\t\t\t+ \"</br>Row: \" + \"</br>Seat Number: \"\n\t\t\t\t\t\t\t+ \"</div>\";\n\t}\n\n\tif (appInfo.style.display == \"none\") {\n\n\t\tvar topMargin = -10;\n\t\tvar transparency = 0;\n\t\tappInfo.style.display = \"block\";\n\t\tappCredits.style.display = \"block\";\n\n\n\t\tvar v = setInterval( function () {\n\n\t\t\ttopMargin++;\n\t\t\ttransparency = transparency + 0.1;\n\t\t\tappInfo.style.marginTop = topMargin + \"px\";\n\t\t\tappCredits.style.marginTop = topMargin + \"px\";\n\t\t\tappInfo.style.opacity = transparency;\n\t\t\tappCredits.style.opacity = transparency;\n\n\t\t\tif (topMargin == 10) {\n\t\t\t\tclearInterval(v);\n\t\t\t}\n\t\t}, 10);\n\t}\n\telse {\n\t\tvar topMargin = 10;\n\t\tvar transparency = 1;\n\n\t\tvar v = setInterval( function () {\n\n\t\t\ttopMargin--;\n\t\t\ttransparency = transparency - 0.1;\n\t\t\tappInfo.style.marginTop = topMargin + \"px\";\n\t\t\tappCredits.style.marginTop = topMargin + \"px\";\n\t\t\tappInfo.style.opacity = transparency;\n\t\t\tappCredits.style.opacity = transparency;\n\n\t\t\tif (topMargin == 0) {\n\t\t\t\tclearInterval(v);\n\t\t\t\tappInfo.style.display = \"none\";\n\t\t\t\tappCredits.style.display = \"none\";\n\t\t\t}\n\t\t}, 10);\n\t}\n\n}", "function loadInfo() {\r\n\t\tvar info = JSON.parse(this.responseText);\r\n\t\tdocument.getElementById(\"title\").innerHTML = info.title;\r\n\t\tdocument.getElementById(\"author\").innerHTML = info.author;\r\n\t\tdocument.getElementById(\"stars\").innerHTML = info.stars;\r\n\t}", "function displayInfo(element) {\n const container = document.getElementById('container');\n const divInfo = createAndAppend('div', container, {\n id: 'leftSide',\n class: 'left-div whiteframe',\n });\n // Table info\n createAndAppend('table', divInfo, { id: 'table' });\n const table = document.getElementById('table');\n createAndAppend('tbody', table, { id: 'tbody' });\n function createTableRow(label, description) {\n const tableR = createAndAppend('tr', table);\n createAndAppend('td', tableR, { text: label, class: 'label' });\n createAndAppend('td', tableR, { text: description });\n }\n\n createTableRow('Repository: ', element.name);\n createTableRow('Description: ', element.description);\n createTableRow('Forks : ', element.forks);\n const newDate = new Date(element.updated_at).toLocaleString();\n createTableRow('Updated: ', newDate);\n }", "function displayData() {\n\n $(\"#peopleButtons\").empty();\n\n \n for (var i = 0; i < people.length; i++) {\n\n var x = $(\"<button>\");\n x.addClass(\"person\");\n x.attr(\"data-name\", people[i]); \n x.text(people[i]);\n $(\"#peopleButtons\").append(x);\n }\n }", "function displayExperiment(data){\n\n\t$('#msform').addClass('hidden');\n\t//checks to see if experiment is complete\n\tif (data.status === ' Complete') {\n\t\t$('#edit').addClass('hidden');\n\t\t$('#dme').addClass('hidden');\n\t};\n\n\n\t$('.title').text(data.title);\n\t$('.author').text(data.author);\n\t$('.created').text(data.created);\n\t$('.background').text(data.background);\n\t$('.purpose').text(data.purpose);\n\t$('.procedure').text(data.procedure);\n\t$('.mce').html(data.results.text);\n\n\tif(data.results.drawing.length >= 0){\n\t\t$(\"<img>\", {\n\t \t\"src\":data.results.drawing,\n\t \t// added `width` , `height` properties to `img` attributes\n\t \t\"width\": \"250px\", \"height\": \"250px\"})\n\t\t.appendTo(\".drawing\");\n\n\t} else {\n\t\t$('.drawing').text('No images Drawn');\n\t};\n\n\t$('.molecule').text(data.results.molecule);\n\t$('.conclusion').html(data.conclusion);\n\t$('.id').text(data.id);\n}", "function displayButton() {\n const sel1 = W.selectionManager.getSelectedFeatures();\n\n if (sel1.length > 0) {\n if(sel1[0].model.type == 'venue') {\n $('#MyclosedVenueContainer').css('display', 'block');\n } else {\n $('#MyclosedVenueContainer').css('display', 'none');\n }\n }else {\n $('#MyclosedVenueContainer').css('display', 'none');\n }\n }", "function disp_info(d) {\n //console.log(d);\n materialInfo.html(getMaterialInfo(d))\n .attr(\"class\", \"panel_on\");\n }", "function info() {\n\tseperator();\n\tOutput('<span>>info:<span><br>');\n\tOutput('<span>Console simulator by Mario Duarte https://codepen.io/MarioDesigns/pen/JbOyqe</span></br>');\n}", "function display(resultat) {\n Erase();\n let blocButton = document.createElement(\"restitution\");\n blocButton.innerText = boutonSelectionne;\n document.getElementById(\"restitution\").appendChild(blocButton);\n\n let blocValue = document.createElement(\"restitution\");\n blocValue.innerText = \"Mesure relevée: \" + resultat.type;\n document.getElementById(\"restitution\").appendChild(blocValue);\n\n let blocData = document.createElement(\"restitution\");\n blocData.innerText = resultat.value + \" \" + resultat.unit;\n document.getElementById(\"restitution\").appendChild(blocData);\n\n let blocDate = document.createElement(\"restitution\");\n FormateDate(resultat.measureDate);\n blocDate.innerText = \"date et heure du relevé: \" + dateDisplay;\n document.getElementById(\"restitution\").appendChild(blocDate);\n}", "function detailview()\r\n {\r\n document.getElementById(\"detail\").innerHTML=\"\";\r\n var ppp = \"\";\r\n var namelist = \"<table class='table table-hover'><tr> <th>cropid</th><th>cropname</th><th>produce(kg)</th><th>requirement(kg)</th></tr>\";\r\n ppp = ppp+ namelist;\r\n for(var i=0;i<sublist.length;i++)\r\n {\r\n // ppp += \"<li>\" +sublist[i]+ \"</li>\";\r\n var namelist = \"<tr> <td>\"+ \r\n sublist[i][0] +\"</td><td>\"+ \r\n sublist[i][1] +\"</td><td>\"+\r\n sublist[i][2] +\"</td><td>\"+ \r\n sublist[i][3] +`</td><td><button class=\"btn btn-primary btn-lg\" onclick='EDITONE(${sublist[i][4]}, ${sublist[i][0]})'>EDIT</button></td></tr>`\r\n ppp = ppp+namelist; \r\n }\r\n var namelist = \"</table>\";\r\n ppp = ppp+namelist;\r\n finalview[b++] = ppp;\r\n }", "function about() {\n $(\"#hidden\").html(\"\");\n $(\"#mainActivity\").html(\"We are supported with generous donations from viewers like you, and the CSUMB big animal shipping company!\");\n}", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-li-1\").text(\"Generation: \" + data.generation.name)\n $(\".modal-li-2\").text(\"Effect: \" + data.effect_changes[0].effect_entries[1].effect)\n $(\".modal-li-3\").text(\"Chance: \" + data.effect_entries[1].effect)\n $(\".modal-li-4\").text(\"Bonus Effect: \" + data.flavor_text_entries[0].flavor_text)\n }", "function displayMovieInfo() {\n\n // YOUR CODE GOES HERE!!! HINT: You will need to create a new div to hold the JSON.\n\n }", "displayResults(type) {\n const data = new Data();\n const portfolioResultsContainer = document.querySelector('#portfolioResultsContainer');\n\n\n data.fetchProjects(type)\n .then(data => {\n let html = ``;\n\n /* Loops then prepends newly fetched projects so that new projects stays in the top */\n data.forEach(project => {\n if(project.type_slug == type){\n html = `${this.UI.makeProjectCards(project)} ${html}`;\n }\n });\n\n portfolioResultsContainer.innerHTML = html;\n\n /* Bind a click to each info buttons */\n const viewButtons = document.querySelectorAll('.viewButton');\n\n /* Loops over info buttons */\n viewButtons.forEach(button => {\n button.addEventListener('click', (e) => {\n e.preventDefault();\n const projectId = e.target.id;\n\n /* Fetches one project only */\n /* Checks if Modal type is info */\n const singleProject = data.find(element => element.id === projectId);\n this.modal.openModalInfo(singleProject);\n\n\n });\n });\n \n\n })\n .catch(err => console.log(err));\n\n }", "function displayUserInfo() {\n $(\"#comm-user-content\").fadeToggle(500 , 'linear');\n $('#comm-user-info').fadeToggle(500, 'linear');\n if (infoDisplay) {\n $('#viewInfoBtn').html('View Info');\n infoDisplay = false;\n } else {\n $('#viewInfoBtn').html('View Content');\n infoDisplay = true;\n }\n}", "function displayVoyage(ajaxResponse)\n{\n\tvar data;\n\tvar text = '';\n\tvar textL = '';\n\tvar textD = '';\n\tvar textd = '';\n\tvar textC = '';\n\tvar textR = '';\n\tvar textP = '';\n\tvar textI = '';\n\tvar button = '';\n\n\t//document.getElementById('voyage-section').innerHTML = ajaxResponse;\n\t//$('#voyage-section').html(ajaxResponse); // JQuery .html remplace tout .append ajoute\n\t// PARSE json response\n\tdata = JSON.parse(ajaxResponse);\n\n\t$('#voyage-section').html();\n\tfor (var i=0; i < data.length ; i++) {\n\n\t\tvar libelle =data[i].libelle;\n\t\tvar description = data[i].description;\n\t\tvar duree = data[i].duree;\n\t\tvar cout = data[i].cout;\n\t\tvar ref = data[i].ref;\n\t\tvar pays = data[i].code_pays;\n\n\t\ttextL = '<h2>'+libelle+'</h2>';\n\t\ttextD = '<p>'+\"Description du voyage: \"+description+\".\"+'</p>';\n\t\ttextd = '<p>'+\"Durée: \"+duree+\" jours\"+'<p>';\n\t\ttextC = '<p>'+\"Prix: \"+cout+\" euros\"+'</p>';\n\t\ttextP = '<p>'+\"Localisation: \"+pays+'</p>';\n\t\ttextR = '<p>'+\"Référence: \"+ref+'</p>';\n\t\t//textI = '<img src=\"'+data[i].image+'\" style=\"margin:10px;height: 200px;\">';\n\t\tbutton = '<a href= \"#detailsModal\" ><button onclick=\"affichevoyage('+ref+')\" style=\"margin=20px\" ' +\n\t\t\t'class=\"btn btn-primary btn-xl text-uppercase js-scroll-trigger\" ' +\n\t\t\t'data-toggle=\"modal\" data-target=\"#detailsModal\">'+\"Détails\"+'</button></a>'\n\n\t\ttext = '<div class=\"row\"><div class=\"column voyage\" style=\"background-color: #eeeeee; margin: 20px;width: 300px\">' +\n\t\t\t''+textL +textD + textC + button +'</div></div>';\n\n\n\t\t$('#voyage-section').append(text);\n\n\t}\n\n// Affichage des réservations\n}", "function aboutGame(){\n\tvar temp=\"\";\n\tvar img=\"\";\n\tvar Title=\"\";\n\t/// if we clicked on about the game formate about game text \n\tif(this.id === 'abutBtn'){\n\t\ttemp =window.gameInformation['abutBtn'];\n\t\timg='\\rrecources\\\\AF005415_00.gif';\n\t\tTitle=\" Game General Information \";\n\n\t}////// if we clicked on about the game formate about auther text \n\telse if(this.id === 'abouMe'){\n\t\ttemp =window.gameInformation['abouMe'];\n\t\timg='\\rrecources\\\\viber_image_2019-09-26_23-29-08.jpg';\n\t\tTitle=\" About The Auther\";\n\t}// formatting Text For Instructions\n\telse if(this.id === 'Instructions')\n\t{\n\t\ttemp =window.gameInformation['Instructions'];\n\t\timg='\\rrecources\\\\keyboard-arrows-512.png';\n\t\tTitle=\" Instructions\";\n\t}\n\n\t// create the dialog for each button alone\n\tcreatDialog(Title , temp ,img,300 );\n\t\n}", "function clickDemarrer() {\n\tif (loading) {\n\t\treturn;\n\t}\n\tdocument.getElementById(\"btnDemarrer\").display = \"none\"; \n\tlancerChapitre(1);\n}", "function oneBookInfo(){\r\n\t\tif(this.status == SUCCESS){\r\n\t\t\tvar info = JSON.parse(this.responseText);\r\n\t\t\tvar title = info.title;\r\n\t\t\tdocument.getElementById(\"title\").innerHTML = title;\r\n\t\t\tvar author = info.author;\r\n\t\t\tdocument.getElementById(\"author\").innerHTML = author;\r\n\t\t\tvar stars = info.stars;\r\n\t\t\tdocument.getElementById(\"stars\").innerHTML = stars;\r\n\t\t}\r\n\t}", "function currentView(currentvol) {\n console.log(currentvol);\n document.getElementById(\"volcano\").innerHTML = currentvol.Name;\n document.getElementById(\"country\").innerHTML = currentvol.Country;\n document.getElementById(\"vei\").innerHTML = currentvol.VEI;\n document.getElementById(\"type\").innerHTML = currentvol.Type;\n document.getElementById(\"lat\").innerHTML = currentvol.Latitude;\n document.getElementById(\"long\").innerHTML = currentvol.Longitude;\n document.getElementById(\"year\").innerHTML = currentvol.Year;\n document.getElementById(\"descp\").innerHTML = currentvol.Desc;\n\n document.getElementById(\"infobar\").style.display = \"initial\";\n document.getElementById(\"flip\").style.display = \"initial\";\n}", "function displayInfo(e, book){\n \n e.preventDefault()\n let show = document.getElementById('show-panel')\n show.innerHTML = ''\n let name = document.createElement('h3')\n name.innerText = book.title\n let img = document.createElement(\"img\")\n img.src = book.img_url\n let p = document.createElement('p')\n\n p.innerText = book.description\n let ul = document.createElement('ul')\n ul.id = book.id\n let fans = getUsers(book, book.users, ul)\n let btn = createButton(book)\n btn.id = book.id\n btn.addEventListener('click', (e) => postUser(e, book))\n \n show.append(name, img, p, btn, fans)\n}", "function displayInfo(html) {\n infoElement.innerHTML = html;\n show(infoElement);\n}", "function showInfo(layer) {\n if (layer.id == \"info_pipe\"){\n //For default layer pipeline\n document.getElementById(\"inf_title\").innerHTML = \"tuberia\";\n document.getElementById(\"inf_id\").innerHTML = \"Layer ID: tfm:tuebria\";\n document.getElementById(\"inf_abs\").innerHTML = \"Abstract: Red de aguas\";\n document.getElementById(\"inf_cp\").innerHTML = \"Contact Person: Claudius Ptolomaeus\";\n document.getElementById(\"inf_org\").innerHTML = \"Organization: The ancient geographes INC\";\n document.getElementById(\"inf_email\").innerHTML = \"Email: [email protected]\";\n document.getElementById(\"inf_phone\").innerHTML = \"Telephone: \";\n document.getElementById(\"inf_ac\").innerHTML = \"Access Constraints: NONE\";\n document.getElementById(\"inf_wms\").innerHTML = \"WMS: http://localhost:8080/geoserver/wms?service=wms&version=1.3.0&request=GetCapabilities\";\n document.getElementById(\"inf_legend\").innerHTML = \"Legend:<br><img src='http://localhost:8080/geoserver/tfm/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&STRICT=false&style=Diametros'>\";\n return;\n }\n if (layer.id == \"info_comm\"){\n //For default layer comments\n document.getElementById(\"inf_title\").innerHTML = \"comments\";\n document.getElementById(\"inf_id\").innerHTML = \"Layer ID: tfm:comments\";\n document.getElementById(\"inf_abs\").innerHTML = \"Abstract: Comments of the interest points\";\n document.getElementById(\"inf_cp\").innerHTML = \"Contact Person: Claudius Ptolomaeus\";\n document.getElementById(\"inf_org\").innerHTML = \"Organization: The ancient geographes INC\";\n document.getElementById(\"inf_email\").innerHTML = \"Email: [email protected]\";\n document.getElementById(\"inf_phone\").innerHTML = \"Telephone: \";\n document.getElementById(\"inf_ac\").innerHTML = \"Access Constraints: NONE\";\n document.getElementById(\"inf_wms\").innerHTML = \"WMS: http://localhost:8080/geoserver/wms?service=wms&version=1.3.0&request=GetCapabilities\";\n document.getElementById(\"inf_legend\").innerHTML = \"Legend:<br><img src='http://localhost:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=tfm:comments'> Comment\";\n return;\n }\n //The position in the array info, is the same of the layer id,\n //because is ordered it is only necessary fill the data\n document.getElementById(\"inf_title\").innerHTML = info[layer.id][0];\n document.getElementById(\"inf_id\").innerHTML = \"Layer ID: \"+info[layer.id][1];\n document.getElementById(\"inf_abs\").innerHTML = \"Abstract: \"+info[layer.id][2];\n document.getElementById(\"inf_cp\").innerHTML = \"Contact Person: \"+info[layer.id][3];\n document.getElementById(\"inf_org\").innerHTML = \"Organization: \"+info[layer.id][4];\n document.getElementById(\"inf_email\").innerHTML = \"Email: \"+info[layer.id][5];\n document.getElementById(\"inf_phone\").innerHTML = \"Telephone: \"+info[layer.id][6];\n document.getElementById(\"inf_ac\").innerHTML = \"Access Constraints: \"+info[layer.id][7];\n document.getElementById(\"inf_wms\").innerHTML = \"WMS: \"+info[layer.id][8];\n document.getElementById(\"inf_legend\").innerHTML = \"Legend:<br><img style='max-width:100%' src='\"+info[layer.id][9]+\"'>\";\n}", "function setup_showCreate() {\n\tdocument.getElementById(\"basic\").style.display = \"none\";\n\tdocument.getElementById(\"create\").style.display = \"block\";\n\tdocument.getElementById(\"source\").style.display = \"none\";\n\tdocument.getElementById(\"info\").style.display = \"none\";\n}", "function showingInfoAndSavingInStorage(infoFromApi, thisButton) {\n\n let infoAboutTheCoin;\n const cardId = $(thisButton).attr('id');\n const marketPrice = infoFromApi.market_data.current_price;\n\n //checking if the coin have marketPrice.\n if (marketPrice.usd === undefined) {\n console.log(\"Im here\");\n infoAboutTheCoin =\n `<div class=\"infoCard\" id=\"${cardId}-info\">\n <div class=\"card card-body\">\n We Don't have the current Price at this moment,<br>\n Please try again later Ty for the understanding :) <br>\n <image class=\"img-fluid\" src=${infoFromApi.image.small} />\n </div>\n </div>`;\n } else {\n infoAboutTheCoin =\n `<div class=\"infoCard\" id=\"${cardId}-info\">\n <div class=\"card card-body\">\n ILS: ${marketPrice.ils}₪, <br>\n USD: ${marketPrice.usd}$, <br>\n Euro: ${marketPrice.eur}€, <br>\n <image class=\"img-fluid\" src=${infoFromApi.image.small} />\n </div>\n </div>`;\n }\n\n $(thisButton).parent().append(infoAboutTheCoin);\n setSessionStorage(cardId, infoAboutTheCoin);\n}", "function createViewBtn() {\r\n //hide and display necessary display boxes \r\n viewChartsButton.addEventListener('click', () => {\r\n listBox.style.display = \"none\";\r\n companyInfoBox.style.display = 'none';\r\n ammBox.style.display = \"none\";\r\n mapBox.style.display = \"none\";\r\n stockBox.style.display = \"none\";\r\n\r\n chartBox.style.display = \"block\";\r\n speakBox.style.display = \"block\";\r\n financialsBox.style.display = \"block\"\r\n });\r\n }", "function prepareToShow() {}", "function handleInfoIcon(){\n\tif(SOUNDS_MODE){\n\t\taudioClick.play();\t\n\t}\n\t\n\tTi.API.info('Show About screen');\n\t\n\tmtbImport(\"about.js\");\n\tbuildAboutView();\n\tviewAbout.animate(anim_in);\n}" ]
[ "0.6723959", "0.65339196", "0.6478391", "0.645503", "0.6427861", "0.6356751", "0.62749684", "0.62307644", "0.6226864", "0.62153983", "0.6205258", "0.6145078", "0.6138057", "0.61349994", "0.61347896", "0.6117146", "0.60669357", "0.6055199", "0.6041539", "0.6032471", "0.60243845", "0.6019077", "0.6010348", "0.6007145", "0.6002194", "0.5996385", "0.5979813", "0.596928", "0.5967394", "0.5966581", "0.59662956", "0.59556913", "0.59402275", "0.5934129", "0.5933544", "0.59218425", "0.59146386", "0.59117955", "0.5907218", "0.58986086", "0.5896265", "0.589506", "0.58881813", "0.58838755", "0.5882406", "0.58803546", "0.5879338", "0.58723813", "0.58691835", "0.5866464", "0.58630073", "0.58581793", "0.5856923", "0.5856295", "0.58556193", "0.5853344", "0.58512443", "0.5850485", "0.5849318", "0.58471894", "0.5842632", "0.5833285", "0.58298486", "0.5813959", "0.5813693", "0.58129144", "0.57980984", "0.5797887", "0.5793149", "0.57913", "0.57887954", "0.5785966", "0.57851493", "0.5783227", "0.57785386", "0.5777205", "0.57748705", "0.5765163", "0.5758781", "0.57582545", "0.5753583", "0.57498217", "0.574953", "0.57406515", "0.5736451", "0.5735836", "0.57334214", "0.57320964", "0.57282746", "0.57201296", "0.57194513", "0.57158846", "0.57150674", "0.57106173", "0.57094073", "0.57080925", "0.57054806", "0.5704266", "0.5700986", "0.56946594", "0.56944543" ]
0.0
-1
Return the rect we'll want to transition towards, if known.
get _animationTargetRect() { return ppixiv.app.getRectForMediaId(this.parent._wantedMediaId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getEndPosition() {\n const radius = (this.tunnelWidth - 1) / 2\n if (this.direction === 'NORTH') {\n return { x: this.x + radius, y: this.y }\n } else if (this.direction === 'SOUTH') {\n return { x: this.x + radius, y: (this.y + this.height) - 1 }\n } else if (this.direction === 'EAST') {\n return { x: (this.x + this.width) - 1, y: this.y + radius }\n } else if (this.direction === 'WEST') {\n return { x: this.x, y: this.y + radius }\n }\n return null\n }", "function getOffset (fromRect, toRect) {\n if (fromRect.height < toRect.height)\n return (fromRect.height - toRect.height) / 2\n\n return 0;\n}", "get rect() {\n return {\n x: this.x - this.width / 2,\n y: this.y - this.height / 2,\n width: this.width,\n height: this.height,\n };\n }", "adhereToRect(rect) {\n if (!util.containsPoint(rect, this)) {\n this.x = Math.min(Math.max(this.x, rect.x), rect.x + rect.width);\n this.y = Math.min(Math.max(this.y, rect.y), rect.y + rect.height);\n }\n return this;\n }", "function hb_rect(self,value) {\n switch (value) {\n case 0: return self.pos[0] - self.width/2;\n case 1: return self.pos[1] - self.height;\n case 2: return self.pos[0] + self.width/2;\n case 3: return self.pos[1];\n }\n }", "get rect() {\n\t\treturn this.rect$.slice(0, 4);\n\t}", "function rectangle(){\nforward(60);\nright(90);\nforward(30);\nright(90);\nforward(60);\nright(90);\nforward(30);\nright(90);\nforward(60);\n}", "function getRect(widget) {\n return rectProperty.get(widget);\n}", "get _positionRect() {\n if (!this._positionRectMemo && this.positionTarget) {\n this._positionRectMemo = this.positionTarget.getBoundingClientRect();\n }\n\n return this._positionRectMemo;\n }", "function rectangle2(size){\n forward(60);\n right(90);\n forward(size);\n right(90);\n forward(60);\n right(90);\n forward(size);\n \n}", "function getRectCenter(rect){return{left:(rect.left+rect.right)/2,top:(rect.top+rect.bottom)/2};}", "calcReward()\n {\n var dx = this.player.x - this.target.x;\n var dy = this.player.y - this.target.y;\n\n return -Math.sqrt(dx * dx + dy * dy);\n }", "get rectValue() {}", "constrainTo(_rect) {\n if (this.x < _rect.left) {\n this.x = _rect.left;\n }\n if (this.y < _rect.top) {\n this.y = _rect.top;\n }\n if (this.x > _rect.right) {\n this.x = _rect.right;\n }\n if (this.y > _rect.bottom) {\n this.y = _rect.bottom;\n }\n return this;\n }", "get rect():Object {\n\t\treturn this._rect = this._rect || new XY.Rect(this.origin.x, this.origin.y, this._width, this._height);\n\t}", "get rect$() {\n\t\treturn this._r;\n\t}", "function _moveRectangleInDirection(rect, moveDistance, direction) {\n var xModifier = 0;\n var yModifier = 0;\n switch (direction) {\n case RectangleEdge.top:\n yModifier = moveDistance * -1;\n break;\n case RectangleEdge.left:\n xModifier = moveDistance * -1;\n break;\n case RectangleEdge.right:\n xModifier = moveDistance;\n break;\n case RectangleEdge.bottom:\n yModifier = moveDistance;\n break;\n }\n return _moveTopLeftOfRectangleToPoint(rect, { x: rect.left + xModifier, y: rect.top + yModifier });\n }", "function _moveRectangleInDirection(rect, moveDistance, direction) {\n var xModifier = 0;\n var yModifier = 0;\n switch (direction) {\n case RectangleEdge.top:\n yModifier = moveDistance * -1;\n break;\n case RectangleEdge.left:\n xModifier = moveDistance * -1;\n break;\n case RectangleEdge.right:\n xModifier = moveDistance;\n break;\n case RectangleEdge.bottom:\n yModifier = moveDistance;\n break;\n }\n return _moveTopLeftOfRectangleToPoint(rect, { x: rect.left + xModifier, y: rect.top + yModifier });\n }", "get targetPosition() {}", "getExit(position, direction) {\n const pos = {x: position.x, y: position.y}\n if (direction === 'NORTH') {\n pos.y = this.y - 1\n } else if (direction === 'SOUTH') {\n pos.y = this.y + this.height\n } else if (direction === 'WEST') {\n pos.x = this.x - 1\n } else {\n pos.x = this.x + this.width\n }\n return pos\n }", "function getRelativeRect(child, parent) {\n return _objectSpread2(_objectSpread2({}, getRelativePosition(child, parent)), {}, {\n width: child.width,\n height: child.height\n });\n}", "getRect() {\n this.rect = this.el.getBoundingClientRect();\n }", "getDirectionToTarget() \n {\n let angle = Phaser.Math.Angle.BetweenPoints(this.position, this.target);\n angle = (UtilFunctions.radiansToDegrees(angle) + 202.5)%360;\n const direction = Math.abs(Math.ceil(angle/45)); //transform radian angle to direction\n //return direction;\n return UtilFunctions.getDirectionToObject(this.position, this.target);\n }", "function translateToRect(_rect) {\r\n var that = {};\r\n\r\n // convert konva rect/image to an object that contains x, y, width and height\r\n var rect = _rect.attrs || _rect;\r\n that.left = rect.x,\r\n that.right = rect.x + rect.width,\r\n that.top = rect.y,\r\n that.bottom = rect.y + rect.height;\r\n\r\n return that;\r\n }", "_getStartEnd(rect) {\n return (this._dir && this._dir.value === 'rtl') ? rect.right : rect.left;\n }", "getRect() {\n if (this.rect != null)\n return this.rect;\n var posx = this.gameObject.position.x - this.width;\n var posy = this.gameObject.position.y + this.height;\n return new Rect(posx, posy, this.width * 2, this.height * 2, this.gameObject.rotation, Math.sin(this.gameObject.rotation), Math.cos(this.gameObject.rotation), this.gameObject.position, false, \"rgba(0, 255, 0, 1)\");\n }", "getWalkFromDirection(){\n switch(this.getDirection()){\n // Down\n case 0:\n this.getStart().setX(this.getOffset());\n this.getRoot().setX(this.getOffset());\n\n for(let y = 0; y < 3; y ++){\n for(let x = -1; x < 2; x++){\n this.getWalk().setValue(new Vector2f(x + 1, y), y - Math.abs(x) + 1 + ((Math.random() - 0.5) / 2))\n }\n }\n break;\n\n // Up\n case 1:\n this.getStart().setY(this.getOffset());\n this.getRoot().setY(this.getOffset());\n\n for(let y = 0; y < 3; y ++){\n for(let x = -1; x < 2; x++){\n this.getWalk().setValue(new Vector2f(y, x + 1), y - Math.abs(x) + 1 + ((Math.random() - 0.5) / 2))\n }\n }\n break;\n\n // Left\n case 2:\n this.getStart().setX(this.getArea().getX()).setY(this.getOffset());\n this.getRoot().setX(this.getArea().getX()).setY(this.getOffset());\n\n for(let y = 0; y < 3; y ++){\n for(let x = -1; x < 2; x++){\n this.getWalk().setValue(new Vector2f(2 - y, x + 1), y - Math.abs(x) + 1 + ((Math.random() - 0.5) / 2))\n }\n }\n break;\n\n // Right\n case 3:\n this.getStart().setX(this.getOffset()).setY(this.getArea().getY());\n this.getRoot().setX(this.getOffset()).setY(this.getArea().getY());\n\n for(let y = 0; y < 3; y++){\n for(let x = -1; x < 2; x++){\n this.getWalk().setValue(new Vector2f(x + 1, 2 - y), y - Math.abs(x) + 1 + ((Math.random() - 0.5) / 2))\n }\n }\n break;\n }\n }", "function getRelativeRect(child, parent) {\n\t return _extends({}, getRelativePosition(child, parent), {\n\t width: child.width,\n\t height: child.height\n\t });\n\t}", "function getRect(element, traits, fastRect) {\n var exactRect,\n display = traits.normDisplay,\n WIDE_ELEMENT_TO_BODY_RATIO = 0.7;\n\n // Use exact approach for:\n // * inline-block, because it lies about height when media is inside\n // * wide blocks, because they lie about width when there is a float\n if (display === 'inline-block' ||\n (display ==='block' && fastRect.width > bodyWidth * WIDE_ELEMENT_TO_BODY_RATIO)) {\n exactRect = mhpos.getContentsRangeRect(element);\n return $.extend({}, exactRect); // Replace the width\n }\n\n return fastRect;\n }", "function rectangle(y,x){\n right(90)\n forward(y);\n right(90);\n forward(x);\n right(90)\n forward(y)\n right(90)\n forward(x)\n}", "get adjustedY() { return this.y - this.originY }", "getRects() {\n if (!this.moving) { return this.clientRects; }\n else { return this.DOMcontainer.getBoundingClientRect(); }\n }", "function makeOffsetRect() {\n return { top: NaN, left: NaN, width: NaN, height: NaN };\n}", "function getRectCenterOffset(rect) {\n return { x: rect.width / 2, y: rect.height / 2 };\n }", "getCurrentRect(canvasRect) {\n let clientRect = this.nativeElement.getBoundingClientRect();\n return {\n bottom: this._currentPosition[1] + clientRect.height + ((canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) || 0),\n left: this._currentPosition[0] + ((canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) || 0),\n height: clientRect.height,\n width: clientRect.width,\n right: this._currentPosition[0] + clientRect.width + ((canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) || 0),\n top: this._currentPosition[1] + ((canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) || 0)\n };\n }", "getActualRectangle() {\n return __awaiter(this, void 0, void 0, function* () {\n const actRect = yield this.getRectangle();\n const density = this._args.device.deviceScreenDensity;\n if (this._args.isIOS) {\n if (density) {\n actRect.x *= density;\n actRect.y *= density;\n actRect.width *= density;\n actRect.height *= density;\n }\n else {\n utils_1.logError(\"Device's density is undefined!\");\n }\n }\n return actRect;\n });\n }", "function currentBounds(){var cntr=element?element.parent():null;var parent=cntr?cntr.parent():null;return parent?self.clientRect(parent):null;}", "straightMoveObj() {\n let obj;\n this.color === 'white'\n ?\n obj = { x : 0, y : 1 }\n :\n obj = { x : 0, y : -1 }\n return obj;\n }", "_getOriginBasedOnOption() {\n const itemHeight = this._getItemHeight();\n const optionHeightAdjustment = (itemHeight - this._triggerRect.height) / 2;\n const originY = Math.abs(this._offsetY) - optionHeightAdjustment + itemHeight / 2;\n return `50% ${originY}px 0px`;\n }", "top() {return this.y - this.h + 'px';}", "get rel() {\n\tvar rev;\n\tvar xy;\n\t\n\trev = this._get_ac_rev();\n\txy = _pnt_transform(this.orig.x, this.orig.y, rev);\n\n\treturn {x: xy[0], y: xy[1]};\n }", "function getrect(elemsec)\n{\n const secposition =elemsec.getBoundingClientRect();\n return (secposition.top); \n}", "rectRoom(input) {\n const ROW = input.row;\n const COL = input.col;\n const DIR = input.dir;\n }", "function move2(rect){\n\t\tvar temp = rect.id;\n\t\tvar temp2 = temp.split(\"-\");\n\t\tvar row = parseInt(temp2[0]);\n\t\tvar col = parseInt(temp2[1]);\n\t\tvar dx = parseInt(emptyrow - row);\n\t\tvar dy = parseInt(emptycol - col);\n\t\tif(dx == 0){\n\t\t\tvar oldY = parseInt(window.getComputedStyle(rect).top);\n\t\t\trect.style.top = oldY + 100 * dy + \"px\";\n\t\t\temptycol = emptycol - dy;\n\t\t}else{\n\t\t\tvar oldX = parseInt(window.getComputedStyle(rect).left);\n\t\t\trect.style.left = oldX + 100 * dx + \"px\";\n\t\t\temptyrow = emptyrow - dx;\n\t\t}\n\t\tvar newrow = row + dx;\n\t\tvar newcol = col + dy;\n\t\trect.id = newrow + \"-\" + newcol;\n\t}", "function getOffset() {\n if (innerHeight < 600 || innerWidth < 1000) {\n return 105;\n }\n else {\n return 55;\n }\n}", "constrain() {\n if(this.pos.x + this.r > this.constrainX){ //if x_over\n this.pos.x = this.constrainX - this.r;\n }else if(this.pos.x - this.r < -this.constrainX){ //if x_under\n this.pos.x = -this.constrainX + this.r;\n }\n\n if(this.pos.y + this.r > this.constrainY){//if y_over\n this.pos.y = this.constrainY - this.r;\n }else if(this.pos.y - this.r < -this.constrainY){//if y_under\n this.pos.y = -this.constrainY + this.r;\n }\n\n }", "getBounds() {\n return this.state[CIRCLE].getBounds()\n }", "getRectangle() {\n return __awaiter(this, void 0, void 0, function* () {\n const location = yield this.location();\n const size = yield this.size();\n const rect = { x: location.x, y: location.y, width: size.y, height: size.x };\n return rect;\n });\n }", "pointingTowards(creature){\r\n let dX = creature.x - this.x;\r\n let dY = creature.y - this.y;\r\n // The \"strongest\" delta gets strength 2, the weakest one\r\n let dXPower = (Math.abs(dX) >= Math.abs(dY)) ? 2 : 1;\r\n let dYPower = (Math.abs(dY) >= Math.abs(dX)) ? 2 : 1;\r\n switch (this.direction) {\r\n case 0: return -dYPower * Math.sign(dY);\r\n case 90: return dXPower * Math.sign(dX);\r\n case 180: return dYPower * Math.sign(dY);\r\n case 270: return -dXPower * Math.sign(dX);\r\n }\r\n }", "function rect_rect (one,two) {\n var h = Math.max(one.hw + two.hw - Math.abs(one.x - two.x),0),\n v = Math.max(one.hh + two.hh - Math.abs(one.y - two.y),0);\n if (h<=margin || v<=margin) {\n return 0;\n }\n else {\n var res = (h < v) ? {x:(h+margin)*Math.sign(one.x-two.x),y:0} : {x:0,y:(v+margin)*Math.sign(one.y-two.y)};\n return res;\n }\n}", "getUp(pos){\n const x = pos[0];\n const y = pos[1]-1;\n return [x,y];\n }", "_getOriginRect() {\n const origin = this._origin;\n if (origin instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ElementRef\"]) {\n return origin.nativeElement.getBoundingClientRect();\n }\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n const width = origin.width || 0;\n const height = origin.height || 0;\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width\n };\n }", "function coord_CurrentRightDown (x,y,h,w)\n {\n var mapCoord = {};\n \n mapCoord[1] = (y + h -1)/ h;\n mapCoord[0] = (x + w -1) / w;\n \n mapCoord[0] = Math.floor(mapCoord[0]-1);\n mapCoord[1] = Math.floor(mapCoord[1]-1);\n \n return mapCoord; \n }", "get hitBox() {\n return {\n left: this.x - this.width / 2,\n top: this.y - this.height / 2,\n right: this.x + this.width / 2,\n bottom: this.y + this.height / 2,\n };\n }", "_validateMove(dx, trackOriginX, trackWidth, ref) {\n const x = dx - trackOriginX;\n const onTrack = (relX) => {\n const upperBound = relX >= trackWidth ? trackWidth : relX;\n return relX <= 0 ? 0 : upperBound;\n };\n if (!ref) {\n return {};\n }\n const lthumb = this.refs.minRange;\n const rthumb = this.refs.maxRange;\n let oRef = ref;\n if (lthumb.x === rthumb.x) {\n if (x > rthumb.x) {\n oRef = this._overriddenThumb = rthumb;\n ref.confirmMoveTo(ref.x);\n }\n else if (x < lthumb.x) {\n oRef = this._overriddenThumb = lthumb;\n ref.confirmMoveTo(ref.x);\n }\n }\n let valX;\n if (oRef === lthumb) {\n valX = x >= rthumb.x ? rthumb.x : onTrack(x);\n }\n else if (oRef === rthumb) {\n valX = x <= lthumb.x ? lthumb.x : onTrack(x);\n }\n return { newRef: oRef, x: this._snap(valX) };\n }", "function rect1(rectX, rectY){\n rect(rectX, rectY, rectXX, rectYY, 20);\n\t}", "function R(){var e=s.getBoundingClientRect(),n=\"offset\"+[\"Width\",\"Height\"][t.ort];return 0===t.ort?e.width||s[n]:e.height||s[n]}", "function posToRel(t) {\n /* jshint validthis:true */\n return (t - this.barTopLimit) / k.call(this);\n }", "function clipRectByRect(targetRect, rect) {\n var x = mathMax(targetRect.x, rect.x);\n var x2 = mathMin(targetRect.x + targetRect.width, rect.x + rect.width);\n var y = mathMax(targetRect.y, rect.y);\n var y2 = mathMin(targetRect.y + targetRect.height, rect.y + rect.height); // If the total rect is cliped, nothing, including the border,\n // should be painted. So return undefined.\n\n if (x2 >= x && y2 >= y) {\n return {\n x: x,\n y: y,\n width: x2 - x,\n height: y2 - y\n };\n }\n}", "get above(){\n return Coord.QRT(this._q,this._r,this._t+1);\n }", "boundedMove(move, bound) {\n this.x += move.x;\n this.y += move.y;\n if (this.x < bound.left) {\n this.x = bound.left;\n }\n if (this.x > bound.right) {\n this.x = bound.right;\n }\n if (this.y < bound.top) {\n this.y = bound.top;\n }\n if (this.y > bound.down) {\n this.y = bound.down;\n }\n }", "function _moveRectangleToAnchorRectangle(rect, rectSide, rectPercent, anchorRect, anchorSide, anchorPercent, gap) {\n if (gap === void 0) { gap = 0; }\n var rectTargetPoint = _getPointOnEdgeFromPercent(rect, rectSide, rectPercent);\n var anchorTargetPoint = _getPointOnEdgeFromPercent(anchorRect, anchorSide, anchorPercent);\n var positionedRect = _movePointOnRectangleToPoint(rect, rectTargetPoint, anchorTargetPoint);\n return _moveRectangleInDirection(positionedRect, gap, anchorSide);\n }", "function _moveRectangleToAnchorRectangle(rect, rectSide, rectPercent, anchorRect, anchorSide, anchorPercent, gap) {\n if (gap === void 0) { gap = 0; }\n var rectTargetPoint = _getPointOnEdgeFromPercent(rect, rectSide, rectPercent);\n var anchorTargetPoint = _getPointOnEdgeFromPercent(anchorRect, anchorSide, anchorPercent);\n var positionedRect = _movePointOnRectangleToPoint(rect, rectTargetPoint, anchorTargetPoint);\n return _moveRectangleInDirection(positionedRect, gap, anchorSide);\n }", "targetDirection() {\n if (this.currentValue === this.targetValue) {\n return states.IDLING;\n } else if (this.currentValue >= this.targetValue) {\n return states.CLOSING;\n } else {\n return states.OPENING;\n }\n }", "moveForward() {\n switch (this.position.heading) {\n case \"N\":\n return (this.position = { ...this.position, y: this.position.y + 1 });\n case \"E\":\n return (this.position = { ...this.position, x: this.position.x + 1 });\n case \"S\":\n return (this.position = { ...this.position, y: this.position.y - 1 });\n case \"W\":\n return (this.position = { ...this.position, x: this.position.x - 1 });\n default:\n return this.position;\n }\n }", "function currentBounds() {\n var cntr = element ? element.parent() : null;\n var parent = cntr ? cntr.parent() : null;\n\n return parent ? self.clientRect(parent) : null;\n }", "function currentBounds() {\n var cntr = element ? element.parent() : null;\n var parent = cntr ? cntr.parent() : null;\n\n return parent ? self.clientRect(parent) : null;\n }", "function currentBounds() {\n var cntr = element ? element.parent() : null;\n var parent = cntr ? cntr.parent() : null;\n\n return parent ? self.clientRect(parent) : null;\n }", "function S(){var e=le.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?e.width||le[t]:e.height||le[t]}", "FindTarget(pt, dir){\n switch(dir){\n case MoveDirection.NW:\n return Object.freeze({ r: pt.r - 1, c: pt.c - 1 });\n case MoveDirection.NE:\n return Object.freeze({ r: pt.r - 1, c: pt.c + 1 });\n case MoveDirection.SE:\n return Object.freeze({ r: pt.r + 1, c: pt.c + 1 });\n case MoveDirection.SW:\n return Object.freeze({ r: pt.r + 1, c: pt.c - 1 });\n }\n }", "function getBounds(elem) {\n\t\tif (elem.find('.motion-path').length) {\n\t\t\telem.find('.motion-path').css({ 'display': 'none' })\n\t\t}\n\t\t\n\t\t//var bounds = elem.get(0).getBoundingClientRect();\n\t\tvar bounds = elem.get(0).getBBox();\n\t\t\n\t\tif (elem.find('.motion-path').length) {\n\t\t\telem.find('.motion-path').css({ 'display': '' })\n\t\t}\n\t\t\n\t\tif (elem.is('[data-width]')) {\n\t\t\tbounds.width = parseInt(elem.attr('data-width'));\n\t\t}\n\t\t\n\t\treturn bounds;\n\t}", "getFuturePosition(action){\n\t\tlet x = this.x;\n\t\tlet y = this.y;\n\n\t\tif(action.direction) {\n\t\t\tswitch (this.orientation) {\n\t\t\t\tcase Orientation.UP:\n\t\t\t\t\ty -= action.direction;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Orientation.DOWN:\n\t\t\t\t\ty += action.direction;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Orientation.LEFT:\n\t\t\t\t\tx -= action.direction;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Orientation.RIGHT:\n\t\t\t\t\tx += action.direction;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y\n\t\t};\n\t}", "function checkRectHeight() {\n if (rectangle.uCornerY < 0) {\n state = `level up`\n } else {\n state = `simulation`\n }\n}", "function currentBounds() {\n var cntr = element ? element.parent() : null;\n var parent = cntr ? cntr.parent() : null;\n\n return parent ? self.clientRect(parent) : null;\n }", "getEpSquare(moveOrSquare) {\n if (!moveOrSquare) return undefined;\n if (typeof moveOrSquare === \"string\") {\n const square = moveOrSquare;\n if (square == \"-\") return undefined;\n let res = [];\n square.split(\",\").forEach(sq => {\n res.push(V.SquareToCoords(sq));\n });\n return res;\n }\n // Argument is a move:\n const move = moveOrSquare;\n const [sx, sy, ex] = [move.start.x, move.start.y, move.end.x];\n if (this.getPiece(sx, sy) == V.PAWN && Math.abs(sx - ex) >= 2) {\n const step = (ex - sx) / Math.abs(ex - sx);\n let res = [\n {\n x: sx + step,\n y: sy\n }\n ];\n if (sx + 2 * step != ex) {\n //3-squares move\n res.push({\n x: sx + 2 * step,\n y: sy\n });\n }\n return res;\n }\n return undefined; //default\n }", "_makeRelativeSnap() {\n let [x, y] = this._makeRelative.apply(this, arguments);\n\n let grid = this.context.getGrid();\n if (grid) {\n let roundX = round(this.scale.toStepsX(x), grid);\n let roundY = round(this.scale.toStepsY(y), grid);\n x = this.scale.toDistanceX(roundX);\n y = this.scale.toDistanceY(roundY);\n }\n\n return [x, y];\n }", "static findScreenUpDirection( camera, renderer, end ) {\n\n\t\tend = end || new Vector3();\n\t\tlet start = v3tmp;\n\n\t\tUtils.screenCoordsToWorld( { x: 100, y: 200 }, camera, renderer, start );\n\t\tUtils.screenCoordsToWorld( { x: 100, y: 100 }, camera, renderer, end );\n\n\t\treturn end.sub( start ).normalize();\n\n\t}", "function obtenerPosInicialY(){\n return (parseFloat(ball.style.top)*tablero.clientHeight/100);\n}", "function calcOrigin(source, target) {\n var origin = 0.5;\n var sourceLength = useMotionValue.calcLength(source);\n var targetLength = useMotionValue.calcLength(target);\n if (targetLength > sourceLength) {\n origin = popmotion.progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = popmotion.progress(source.min, source.max - targetLength, target.min);\n }\n return popmotion.clamp(0, 1, origin);\n}", "function clipRectByRect(targetRect, rect) {\n\t var x = mathMax$4(targetRect.x, rect.x);\n\t var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width);\n\t var y = mathMax$4(targetRect.y, rect.y);\n\t var y2 = mathMin$4(targetRect.y + targetRect.height, rect.y + rect.height); // If the total rect is cliped, nothing, including the border,\n\t // should be painted. So return undefined.\n\t\n\t if (x2 >= x && y2 >= y) {\n\t return {\n\t x: x,\n\t y: y,\n\t width: x2 - x,\n\t height: y2 - y\n\t };\n\t }\n\t }", "function moveActiveRectangle(x, y) {\n if (active == null)\n return;\n\n x = x - activatedX; // from the new coordinates subtract the original\n y = y - activatedY; // activation difference.\n positionRectangle(active, x, y);\n}", "function getBadlyRomanticArrowMonster() {\n return (0, _property.get)(\"romanticTarget\");\n}", "function down() {\n rectangle.style.marginTop = \"100px\";\n}", "function upward(){\n bird.css('top', parseInt(bird.css('top')) - 10);\n }", "function encloseRightState(){\n if(shipY < 0){\n shipY = 0;\n }\n if(shipY > height - 50){\n shipY = height - 50;\n }\n if(shipX > width - 40){\n shipX = width - 40;\n }\n}", "function getRelativePosition(e, el) {\n div = document.getElementById(\"scene\");\n dim = div.getBoundingClientRect();\n x = Math.floor( ((e.clientX - dim.left) / pw) / level);\n y = Math.floor(((e.clientY - dim.top) / pw) / level);\n}", "function getOffsetRect(node) {\n return {\n top: node.offsetTop,\n left: node.offsetLeft,\n width: node.offsetWidth,\n height: node.offsetHeight,\n };\n}", "get begin() {\n if (this._positions.anchor < this._positions.focus) {\n return this._positions.anchor\n }\n\n return this._positions.focus\n }", "function getRelativePosition(node,axis){if(node.style[leading[axis]]!==undefined){return getPosition(node,leading[axis]);}return-getPosition(node,trailing[axis]);}", "function getPosition(rect) {\r\n return {\r\n \"top\" : window.scrollY + Math.round(rect.top),\r\n \"right\" : Math.round(rect.left + rect.width),\r\n \"bottom\" : window.scrollY + Math.round(rect.top + rect.height),\r\n \"left\" : Math.round(rect.left),\r\n \"leftCenter\" : Math.round(rect.left + rect.width/2)\r\n };\r\n }", "getStartingPosition() {\n const left = this.generateRandomPosition();\n\n // If the `left` value lies in the restricted range, then top cannot lie there.\n // This prevents streak generation with a certain radius from the center. (imporves aesthetic appeal)\n const restrictiveFlag =\n (left > Streak.positionLimits[this.attributes.type].lower) &&\n (left < Streak.positionLimits[this.attributes.type].upper)\n ;\n const top = this.generateRandomPosition(restrictiveFlag);\n\n return { left, top };\n }", "function getCorner(rect, num) {\n // console.log('Corner')\n // console.log('Case ' + num );\n const shift = svgWindowDifference();\n\n switch (num) {\n case 1:\n return [rect.x + shift, rect.y];\n case 2:\n return [rect.right + shift, rect.y];\n case 3:\n return [rect.x + shift, rect.bottom];\n case 4:\n return [rect.right + shift, rect.bottom];\n default:\n console.log(\"Unknown Corner Number\");\n }\n\n}", "mDiff(r) {\n\t\tvar orig = new Vector (r.origin.x - this.origin.x - this.width,\n\t\tr.origin.y - this.origin.y - this.height);\n \treturn new Rect(orig, this.width + r.width, this.height + r.height);\n\t}", "function activateRectangle(x, y) {\n active = null;\n\n if (rectA.isPointInRectangle(x, y) && rectB.isPointInRectangle(x, y)) {\n if (lastActive != rectB) {\n active = rectA;\n } else {\n active = rectB;\n }\n } else if (rectA.isPointInRectangle(x, y)) {\n active = rectA;\n } else if (rectB.isPointInRectangle(x, y)) {\n active = rectB;\n }\n\n if (active != null) {\n activatedX = x - active.left;\n activatedY = y - active.top;\n }\n}", "get upperBound(){\n\t\treturn -this.height /2;\n\t}", "_getRect(x, y) {\n return new Rect(x - this.width, y + this.height, this.width * 2, this.height * 2, this.gameObject.rotation, Math.sin(this.gameObject.rotation), Math.cos(this.gameObject.rotation), this.gameObject.position, false, \"rgba(0, 255, 0, 1)\");\n }", "moveUp() {\n this.y>0?this.y-=83:false;\n }", "function getOffsetRectangle(parent, elem) {\n return offsetRectangle(\n topLeftCorner(parent.getBoundingClientRect()),\n elem.getBoundingClientRect()\n );\n}", "function _moveEdge(rect, edge, newValue) {\n var difference = _getEdgeValue(rect, edge) - newValue;\n rect = _setEdgeValue(rect, edge, newValue);\n rect = _setEdgeValue(rect, edge * -1, _getEdgeValue(rect, edge * -1) - difference);\n return rect;\n}", "function _moveEdge(rect, edge, newValue) {\n var difference = _getEdgeValue(rect, edge) - newValue;\n rect = _setEdgeValue(rect, edge, newValue);\n rect = _setEdgeValue(rect, edge * -1, _getEdgeValue(rect, edge * -1) - difference);\n return rect;\n}" ]
[ "0.57610255", "0.57414514", "0.5710045", "0.570407", "0.5690902", "0.56481826", "0.5636718", "0.5471735", "0.54362524", "0.54191005", "0.5416372", "0.53913856", "0.5387716", "0.5386074", "0.5365105", "0.536001", "0.5349921", "0.5349921", "0.53157014", "0.53098994", "0.5300958", "0.5286923", "0.5282404", "0.5276552", "0.52675605", "0.52648443", "0.52573824", "0.5256368", "0.52488816", "0.52326286", "0.5214653", "0.5206842", "0.519494", "0.518379", "0.51827097", "0.51730967", "0.5165687", "0.5156826", "0.5145776", "0.51436836", "0.51380545", "0.5129342", "0.5126639", "0.51249737", "0.5119002", "0.510186", "0.50945187", "0.5089174", "0.50702685", "0.5070096", "0.5067769", "0.5066972", "0.5065969", "0.5060935", "0.5060802", "0.50578094", "0.5055055", "0.5048786", "0.5047647", "0.50412655", "0.50397563", "0.5036419", "0.5036419", "0.502993", "0.5029618", "0.50284106", "0.50284106", "0.50284106", "0.5021348", "0.50172746", "0.50153446", "0.5009394", "0.50005084", "0.4994176", "0.4991659", "0.49872193", "0.4986294", "0.49862456", "0.4985788", "0.4972154", "0.49648717", "0.49442905", "0.49364397", "0.49338856", "0.49321952", "0.49316135", "0.49294332", "0.49292675", "0.49276587", "0.49237746", "0.49178544", "0.4917305", "0.49169588", "0.49163327", "0.4913965", "0.4904316", "0.49021035", "0.49012494", "0.48951566", "0.48951566" ]
0.54065996
11
The screen was set active or inactive.
activate({cause}) { // Run the show animation if we're not shown, or if we're currently hiding. if(!this.dragger.visible || !this.dragger.isAnimatingToShown) { // Skip the animation if this is a new page load rather than a transition from // something else. let transition = cause != "initialization"; this.dragger.show({transition}); // If we're transitioning scrollSearchToThumbnail will be called when the transition // finishes. That won't happen if we're not transitioning, so do it now. if(!transition) this.scrollSearchToThumbnail(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onActiveScreenChanged_() {}", "function changeScreen(screen) {\n activeScreen = screen;\n}", "setInactive () {\n\t\tthis._active = false;\n\t\tthis.$element.removeClass('screenlayer-active');\n\t}", "setActive () {\n\t\tthis._active = true;\n\t\tthis.$element.addClass('screenlayer-active');\n\t}", "function setLastScreenState(state)\n {\n if(state != lastScreenState){\n lastScreenState = state;\n\n // ボタン状態を更新する。\n if(screenModeControl){\n screenModeControl.updateState();\n }\n // バーを自動的に隠すかどうかを設定する。\n if(controlBarObj){\n controlBarObj.setAutoHideMode(state != SCREEN_NORMAL);\n }\n }\n }", "function setScreenLocked(value){\r\n\tscreenLocked = value;\r\n\tif (screenLocked && hatsForm){\r\n\t\tdisableHhostForm(hatsForm);\r\n\t}\r\n\tupdateStatusWindow();\r\n}", "function displayNightChoice() {\r\n screens.removeClass('active');\r\n nightScreen.addClass('active');\r\n}", "is_on_screen() {\n\t\tif (this.x > gameSettings['screen_x'] - gameSettings['scale'] ||\n\t \t\tthis.y > gameSettings['screen_y'] - gameSettings['scale'] ||\n\t \t\tthis.x < 0 || this.y < 0) {\n\t\t\tgameSettings['is_alive'] = false;\n\t\t} else {\n\t\t\tgameSettings['is_alive'] = true;\n\t\t}\n\t}", "function onWentActive() {\n currentStatus = previousStatus;\n editStatusOverlaysAndSendUpdate();\n }", "function setCurrentScreen( newScreenKey ) { return hwc.setCurrentScreen(newScreenKey);\t}", "function winOrLoseScreen(){\n if (!win){\n GameOverGraphic()\n BGM.pause()\n } else {\n youWinGraphic()\n BGM.pause()\n }\n }", "function screenRegistered (screen) {\n return session.isScreenActive(screen);\n}", "function changeScreen(){\n if (state === `menu`){\n state = `main`;\n }\n else if (state === `end`){\n state = `menu`;\n count = 0;\n }\n }", "function screenOn() {\n clearTimeout(screenOff);\n lcd.bgColor(\"ffffff\");\n screenOff = setTimeout(function() {\n lcd.bgColor(\"000000\");\n }, 10000);\n }", "function showEndscreen() {\n state.set({\n endscreen_showing: true\n });\n}", "_onScreenTouch() {\n let state = this.state;\n const time = new Date().getTime();\n const delta = time - state.lastScreenPress;\n\n if ( delta < 300 ) {\n // this.methods.toggleFullscreen();\n }\n\n state.lastScreenPress = time;\n\n this.setState( state );\n }", "function _getActiveScreens(res) {\n pageMap.activeScreenArray = res.result;\n }", "function idle(){\n\t\treturn M.status == 'idle';\n\t}", "function showScreen(id) {\n var activeScreen = $('#game .screen.active')[0],\n screen = $(id)[0];\n\n if (activeScreen) {\n dom.removeClass(screen, 'active');\n }\n\n dom.addClass(screen, 'active');\n }", "function IsActive()\n{\n\treturn m_active;\n}", "function showScreen(id) {\n //\n // Remove the active state from all screens. There should only be one...\n let active = document.getElementsByClassName('active');\n for (let screen = 0; screen < active.length; screen++) {\n active[screen].classList.remove('active');\n }\n //\n // Tell the screen to start actively running\n screens[id].run();\n //\n // Then, set the new screen to be active\n document.getElementById(id).classList.add('active');\n }", "function state() {\r\n\r\n for(var key in views) {\r\n views[key].stage.visible = false;\r\n }\r\n\r\n character.visible = false;\r\n\r\n switch(CURR_STATE) {\r\n case STATES.TITLE_SCREEN:\r\n showView(views.title);\r\n break;\r\n\r\n case STATES.CREDITS_SCREEN: \r\n showView(views.credits);\r\n break;\r\n\r\n case STATES.PRESENT_LAB:\r\n showView(views.staticHUD);\r\n showView(views.presentLab);\r\n character.visible = true;\r\n break;\r\n }\r\n\r\n for(var key in views) {\r\n views[key].visible = views[key].stage.visible;\r\n }\r\n\r\n for(var key in keybinds) {\r\n if (keybinds[key].isDown) {\r\n keybinds[key].press();\r\n }\r\n }\r\n}", "function checkOffscreenBlue() {\n if (isOffscreen(circle1)) {\n state = `ignored`;\n }\n }", "function startGame() {\n gameScreen=1;\n}", "function getCurrentScreen() { return hwc.getCurrentScreen(); }", "function _getActive() { // store once last interaction\n if (DF.thisAction !== DF.lastAction) {\n DF.lastAction = DF.thisAction;\n API.update();\n }\n }", "lostActiveStatus(_newActiveControl) {\n return true;\n }", "function setActivity() {\n\tclient.user.setActivity('over rigby.space', { type: 'WATCHING' })\n\t .then(presence => {})\n\t .catch(console.error);\n}", "function power(){ \r\n\tif(screenOn === false){\r\n\t\tscreenOn = true;\r\n\t\t$(\"#lockscreen\").attr(\"style\", \"display: block;\"); /*shows lockscreen wallpaper*/\r\n\r\n\t\tconsole.log(screenOn, \"Screen is on\");\r\n\t}else{ //turns off phone screen\r\n\t\thome();\r\n\t\tscreenOn = false;\r\n\t\tscreenLocked = true;\r\n\t\t$(\"#screen\").attr(\"style\", \"background-color: #222;\"); /*makes screen color black*/\r\n\t\t$(\"#lockscreen\").attr(\"style\", \"display: none;\"); /*Hides lockscreen wallpaper*/\r\n\t\t$(\"#normal-screen\").attr(\"style\", \"display: none;\"); /*hides normal screen wallpaper*/\r\n\t\t$(\"#notification-box\").css(\"display\", \"none\"); //hides notification box\r\n\t\tfxLockScreen.play(); //plays lock screen sound\r\n\r\n\t\tconsole.log(screenOn, \"Screen is off\");\r\n\t}\r\n}", "hideAllScreens() {\n this.activeScreen = Screen.NONE;\n }", "function toggleUI(param) {\r\n\tset('V[screenMODE]',param.l_mode);\r\n}", "setActive (isActive) {\n return null;\n }", "isActive() {\r\n return this.gameActive;\r\n }", "get active() { return this._isActive; }", "function setSimulationActiveState(active) {\n if(active) {\n $(\"#startButton\").attr(\"data-running\",\"true\").removeClass(\"btn-success\").addClass(\"btn-danger\").text(\"Stop\");\n $(\"#optionsButton\").attr(\"disabled\",\"\");\n startSimulation();\n }\n else {\n $(\"#startButton\").attr(\"data-running\",\"false\").removeClass(\"btn-danger\").addClass(\"btn-success\").text(\"Start\");\n $(\"#optionsButton\").removeAttr(\"disabled\");\n clearInterval(moveAgentsRandomly);\n }\n }", "function setStatus(msg)\n{\n\tisStatusIdle = 0;\n\tif(msg == '' || msg == null || msg == undefined)\n\t{\n\t\tisStatusIdle = 1;\n\t\tmsg = \"Idle.\";\n\t}\n\tdocument.getElementById('statusMessage').innerHTML = msg;\n}", "function Win(){\n\t\tif (p1lives == 0){\n\t\t\tscreen = 8;\n\t\t}else if(p2lives == 0){\n\t\t\tscreen = 8;\n\t\t}\n\t}", "function setActivity( newActivity ){\n active = newActivity;\n\n Broadcaster.sendMessage({\n action: \"sync:activitystatechanged\"\n });\n }", "getScreenSelected() {\n return this.screensSelected;\n }", "function isScreen(screenLabel) {\n return currentBreakpoint() == screenLabel;\n }", "function Start()\n{\n\tblueSailLockedImage.SetActive (blueSailLocked);\n}", "SetActiveRoom(rmName){\r\n\t\tthis.prevActiveRoom = this.activeRoom;\r\n\t\tthis.activeRoom = rmName;\r\n\t\tthis._updateCallbacks()\r\n\t}", "function userIsActive() {\n\t\t\tsettings.userActivityEvents = false;\n\t\t\t$document.off( '.wp-heartbeat-active' );\n\n\t\t\t$('iframe').each( function( i, frame ) {\n\t\t\t\tif ( isLocalFrame( frame ) ) {\n\t\t\t\t\t$( frame.contentWindow ).off( '.wp-heartbeat-active' );\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfocused();\n\t\t}", "function shareScreenChanged(ifToShare, ifToLocalShare) {\n isScreenSharing = ifToShare;\n isLocalScreenSharing = ifToLocalShare;\n $('#screen-btn').removeClass('disabled selected');\n if (ifToShare) {\n if (ifToLocalShare) {\n $('#screen-btn').addClass('selected disabled');\n } else {\n $('#screen-btn').addClass('disabled');\n }\n $('#galaxy-btn,#monitor-btn').addClass('disabled');\n } else {\n if (subscribeType === SUBSCRIBETYPES.FORWARD) {\n $('#galaxy-btn,#monitor-btn').removeClass('disabled');\n }\n $('#video-panel').removeClass('screen');\n }\n}", "function CameraUI_UpdateCameraState(bActive)\n{\n\t//has controller?\n\tif (__CONTROLLER)\n\t{\n\t\t//notify controller\n\t\tthis.POINT = __CONTROLLER.notifyCameraState(bActive);\n\t\t//we want to activate it and we dont have a valid start point?\n\t\tif (!this.POINT)\n\t\t{\n\t\t\t//use ours\n\t\t\tthis.POINT = { x: __POPUP_MENU_CREATION_POINT.x, y: __POPUP_MENU_CREATION_POINT.y };\n\t\t}\n\t}\n}", "onScreen(screen) {\n return Util.noop('TripUI.onScreen()', screen);\n }", "allowActiveStatus(_prevActive) {\n return true;\n }", "setActive() {\n GameManager.activeGame = this;\n }", "set isActive(value) {\n if (this._mdcComponent) {\n this._mdcComponent.isActive = value;\n }\n }", "function whoIsActive() { // Player.js (179) if (move)\n if (player1Active) {\n activePlayer = 2;\n notActivePlayer = 1;\n setActivePlayer(player2, player1, powerDiv2); // Info.js (21) Set attributes to the active player to use them by replacing weapon\n setActiveBoard(notActivePlayer, activePlayer); //Info.js (27) Add a class for a playerDiv of the active player to display current information about game flow\n displayMessageOnBoard(activePlayer); // Info.js (32) Display random message on active player's div\n } else {\n activePlayer = 1; \n notActivePlayer = 2;\n setActivePlayer(player1, player2, powerDiv1);\n setActiveBoard(notActivePlayer, activePlayer,);\n displayMessageOnBoard(activePlayer);\n }\n\n}", "function Interpreter_SetShowInactive(bSetShowInactive)\n{\n\t//by default: nothing happened\n\tvar bRes = false;\n\t//did we change anything?\n\tif (this.ShowInactive != bSetShowInactive)\n\t{\n\t\t//we will make changes\n\t\tbRes = true;\n\t\t//update state\n\t\tthis.ShowInactive = bSetShowInactive;\n\t\t//and reload the state\n\t\t__SIMULATOR.StateManager.Reload();\n\t}\n\t//return true if we made changes\n\treturn bRes;\n}", "get active () {\n\t\treturn this._active;\n\t}", "function setCurrentScreen(gtagFunction, analyticsId, screenName, options) {\r\n if (options && options.global) {\r\n gtagFunction(GtagCommand.SET, { 'screen_name': screenName });\r\n }\r\n else {\r\n gtagFunction(GtagCommand.CONFIG, analyticsId, {\r\n update: true,\r\n 'screen_name': screenName\r\n });\r\n }\r\n}", "function setCurrentScreen(gtagFunction, analyticsId, screenName, options) {\r\n if (options && options.global) {\r\n gtagFunction(GtagCommand.SET, { 'screen_name': screenName });\r\n }\r\n else {\r\n gtagFunction(GtagCommand.CONFIG, analyticsId, {\r\n update: true,\r\n 'screen_name': screenName\r\n });\r\n }\r\n}", "is_active() {\n\t\t\treturn this.active\n\t\t}", "function draw_presentsScreen() {\n \tif ( defaultFalse( currentPart.presents ) ) \t\n \t\tpresentsScreen.show();\n \telse \n \t\tpresentsScreen.hide();\n }", "function checkStatus() {\n checkWin();\n checkLose();\n }", "function PushScreen (scr)\r\n{\r\n\tif (scr == \"game\")\r\n\t{\r\n\t\tgame_Init();\r\n\t}\r\n\r\n\tscreen = scr;\r\n\tconsole.log (\"Started screen \" + scr);\r\n}", "function setStatus(value){\n\tlocalStorage.setItem(\"activate\", value);\n}", "function setStatus() {\n let randomStatus = status[Math.floor(Math.random() * status.length)];\n client.user.setPresence({ game: randomStatus });\n }", "function showScreen(screenId){\n\t\tvar dom=jewel.dom,\n\t\t $=dom.$,\n\t\t activeScreen=$(\"#game .screen.active\")[0],\n\t\t screen=$(\"#\"+screenId)[0];\n\t\tif(!jewel.screens[screenId]){\n\t\t\talert(\"this module is not implemented yet!\");\n\t\t\treturn;\n\t\t}\n\t\tif(activeScreen){\n\t\t\tdom.removeClass(activeScreen,\"active\");\n\t\t}\n\t\tdom.addClass(screen,\"active\");\n\t\tjewel.screens[screenId].run();\n\t}", "get active() {\n\t\treturn this._active;\n\t}", "get active() {\n\t\treturn this._active;\n\t}", "get active() {\n\t\treturn this._active;\n\t}", "get isActive () {\n\t\treturn this._active === true;\n\t}", "function focused() {\n\t\t\tsettings.userActivity = time();\n\n\t\t\t// Resume if suspended\n\t\t\tsettings.suspend = false;\n\n\t\t\tif ( ! settings.hasFocus ) {\n\t\t\t\tsettings.hasFocus = true;\n\t\t\t\tscheduleNextTick();\n\t\t\t}\n\t\t}", "get active() {\n\t\treturn this.__active;\n\t}", "activate() {\n this.active = true;\n }", "setActiveState(active) {\n // If (cast) active value has changed:\n if (!!this._isActive !== active) {\n // Update to the new value.\n this._isActive = active;\n // Fire the appropriate activation event.\n if (active) {\n this.onActivate.emit();\n }\n else {\n this.onDeactivate.emit();\n }\n }\n // Regardless, emit a change to `isActive`, so [(isActive)] works correctly.\n this.isActiveChange.emit(active);\n }", "function screenFlash() {\n\t\tbooFlash = !booFlash;\t\t\n\t\tif ( booFlash ) {\n\t\t\t$(\"#alarm\").css(\"background\",\"orange\");\t\n\t\t} else {\n\t\t\t$(\"#alarm\").css(\"background\",\"red\");\t\n\t\t}\n\t\tif ( booFault ) {\t\t\n\t\t\tsetTimeout(screenFlash,500);\n\t\t}\n\n\t}", "setActive(bool) {\n if (bool != undefined) {\n this.active = bool;\n }\n }", "function isSCActive(){\n\t\t\n\t\treturn(typeof SC != \"undefined\");\t\n\t}", "get active() {\n\t\tconst value = this.getAttribute('active');\n\t\tif (value !== null) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function gameWinState() {\n crazySpace.update();\n }", "function leftScreen() {\n if (adRan == false) {\n alert(\"Don\\'t leave yet!\\nIf you refer a friend or family member you can get 50% off!\")\n adRan = true;\n }\n}", "setActive() {\n GameManager.activeGame = this;\n }", "function toggleScreens(data) {\n switch (data.screenName) {\n case 'daily-log':\n setActiveScreen(<DailyLog />)\n break;\n case \"msg-board\":\n setActiveScreen(<MessageBoard />)\n break;\n case \"log-summary\":\n setActiveScreen(<DailyLogDisplay text={data.text} />)\n break;\n default:\n setActiveScreen(<UnderConstruction />)\n }\n }", "function setStatus() {\n let randomStatus = status[Math.floor(Math.random() * status.length)];\n bot.user.setPresence({game: randomStatus});\n }", "function inactive() {\n $html.removeClass('active');\n }", "function setActive(){\n\t//remove active from previous cue\n\t//set current cue to active\n}", "function screen() {\r\n var y = document.getElementById(\"game\");\r\n if (hunger > 0 && health > 0 && happiness > 0) {\r\n y.style.display = \"block\";\r\n } else if (hunger === 0 || health === 0 || happiness === 0) {\r\n y.style.display = \"none\";\r\n }\r\n }", "setMobileActive(active) {\n this.setAppDataItem(\"mobileActive\", active);\n }", "get active() {\n return this._active;\n }", "get active() {\n return this._active;\n }", "get active() {\n return this._active;\n }", "get active() {\n return this._active;\n }", "status() {\n return this.pause?'Paused':'Active';\n }", "isScreenSharing() {}", "function monitor(){\n\t\t\twakeWatch.unbind(wakeEvents, wake).bind(wakeEvents, wake);\n\t\t\tvar myCookie = e2.getCookie('lastActiveWindow');\n\t\t\tif (e2.now() - lastActive > e2.sleepAfter * 60000 ||\n\t\t\t\t(!e2.isChatterlight && myCookie && myCookie != windowId)) zzz('sleep');\n\t\t}", "function clearActive() {\n activeString = '';\n activeNum = undefined;\n displayActive();\n }", "function Update()\n{\nif (Input.GetKeyDown(KeyCode.U))\n\t{\n\t\tblueSailLocked = false;\n\t\tblueSailLockedImage.SetActive (blueSailLocked);\n\t}\n}", "async function pickNewMode(xScreen){\n const activeMode = xScreen.modes.find(m => m.current);\n const newMode = xScreen.modes.find(m => m.width !== activeMode.width || m.height !== activeMode.height);\n console.log(`Setting new mode on display (${xScreen.output}): ${newMode.width}x${newMode.height}`);\n await exec(`xrandr --output ${xScreen.output} --mode ${newMode.width}x${newMode.height}`)\n console.log(`Display mode changed`);\n}", "onFullScreenChanged () {}", "function setActiveRoll() {\n rolls.forEach(({ classList }) => {\n classList.remove(\"is-active\");\n });\n const focusedEl = document.activeElement;\n focusedEl.closest(\".roll\").classList.add(\"is-active\");\n }", "async function setWalkAsActive() {\n try {\n // Store walk ID\n await AsyncStorage.setItem(\"isWalkActive\", \"true\");\n\n dispatch({\n type: \"SET_WALK_ACTIVE\",\n isWalkActive: \"true\",\n });\n } catch (error) {\n console.error(\"Error in setIsWalkActive(): \" + error);\n }\n }", "offscreen() {\n if (this.xSky < -this.w) {\n return true;\n } else {\n return false;\n }\n }", "function logicScreens(openScreen){\r\n switch(openScreen) {\r\n case 'studentPay': \r\n visible_div(\"studentPay\");\r\n esconde_div(\"teacherPay\");\r\n break;\r\n case 'teacherPay':\r\n visible_div(\"teacherPay\");\r\n esconde_div(\"studentPay\");\r\n break;\r\n default: \r\n \r\n }\r\n \r\n}", "function camIsCheating()\n{\n\treturn __camCheatMode;\n}", "_getIsActiveState() {\n return this.Driver.IsActive;\n }", "function updateScreen() {\n document.getElementById('screen').innerHTML = activeNumber;\n}", "setActiveClass2() {\n this.statusClass1 = 'not-active';\n this.statusClass2 = 'active';\n }" ]
[ "0.74071354", "0.66647243", "0.66076165", "0.65237576", "0.6340045", "0.62961864", "0.62043893", "0.6174892", "0.61645514", "0.6091437", "0.6084864", "0.58559227", "0.5828769", "0.5827496", "0.5820854", "0.5780353", "0.5772206", "0.5749203", "0.5732877", "0.56980854", "0.5693649", "0.5681146", "0.5669855", "0.56513953", "0.56287205", "0.5619654", "0.5598216", "0.5570041", "0.55667305", "0.55556947", "0.5552925", "0.5542821", "0.5533129", "0.5525547", "0.550799", "0.5502424", "0.5495875", "0.5491433", "0.54861605", "0.5482036", "0.54813004", "0.5480507", "0.5479317", "0.5474957", "0.5417987", "0.5417143", "0.54031354", "0.53966874", "0.53897035", "0.5388223", "0.5381307", "0.5372422", "0.5368088", "0.5368088", "0.5363893", "0.53459674", "0.5344841", "0.53413725", "0.5340381", "0.5334719", "0.53251463", "0.53246105", "0.53246105", "0.53246105", "0.53144693", "0.5306557", "0.53038347", "0.52941614", "0.5283433", "0.52829754", "0.52818847", "0.52753365", "0.5271324", "0.5266074", "0.5265822", "0.5261134", "0.5261097", "0.52589107", "0.52483916", "0.5239267", "0.5238978", "0.52378786", "0.5219552", "0.5219552", "0.5219552", "0.5219552", "0.5212796", "0.5208389", "0.520755", "0.5200763", "0.5198733", "0.5198035", "0.5197163", "0.5195217", "0.51886916", "0.51873636", "0.5183862", "0.5182589", "0.51810217", "0.5180039", "0.5162775" ]
0.0
-1
Return a promise that resolves when there's no animation running, or null if no animation is active.
get waitForAnimationsPromise() { return this.dragger.finished; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isAnyAnimationRunning() {\n for (const action in this._animationActions) {\n if (this._animationActions[action].isRunning()) {\n return true;\n }\n }\n return false;\n }", "get current_animation() { return (this.is_playing() ? this.playback.assigned : '') }", "function checkAnimation() {\n var $elem = $('.progress-bar');\n\n // If the animation has already been started\n if ($elem.hasClass('start')) return;\n\n if (isElementInViewport($elem)) {\n // Start the animation\n $elem.addClass('start');\n }\n}", "hasAnimations() {\n\n return !!Object.keys(this.__animations).length;\n\n }", "function checkAnimation() {\n\t var $elem = $('.slide-intro');\n\n\t // If the animation has already been started\n\n\t if (isElementInViewport($elem)) {\n\t // Start the animation\n\t\t\t$('.easing').css('opacity', '1');\n\t\t\t$('.easing').css('transform', 'none');\n\t }\n\t if(isElementInViewport(slides)) {\n\t \ttop.css('opacity', '0');\n\t } else {\n\t \ttop.css('opacity', '1');\n\t }\n\t}", "function checkAnimation() {\n var $elem = $('.timer');\n\n // If the animation has already been started\n if ($elem.hasClass('start')) return;\n\n if (isElementInViewport($elem)) {\n // Start the animation\n $elem.addClass('start');\n }\n}", "isAnimating() {\n return this.animations.length &&\n this.animations.some((anim) => anim.blocksGameLoop());\n }", "function checkAnimation() {\r\n var $elem = $('.bar .level');\r\n\r\n // If the animation has already been started\r\n if ($elem.hasClass('start')) return;\r\n\r\n if (isElementInViewport($elem)) {\r\n // Start the animation\r\n $elem.addClass('start');\r\n }\r\n}", "function checkAnimationComplete(){\t\n\tvar targetName = '';\n\tfor(n=0;n<animation_arr.length;n++){\n\t\tif($.pukiAnimation[animation_arr[n].name].visible){\n\t\t\ttargetName = animation_arr[n].name;\n\t\t}\n\t}\n\t\n\tvar _currentframe = $.pukiAnimation[targetName].currentFrame;\n\tvar _lastframes = $.pukiData[targetName].getAnimation($.pukiAnimation[targetName].currentAnimation).frames;\n\t_lastframes = _lastframes[_lastframes.length-1];\n\t\n\tif(_currentframe == _lastframes){\n\t\treturn true;\t\n\t}else{\n\t\treturn false;\t\n\t}\n}", "get animation() {\n\t\treturn this.nativeElement ? this.nativeElement.animation : undefined;\n\t}", "get animation() {\n\t\treturn this.nativeElement ? this.nativeElement.animation : undefined;\n\t}", "getAreGamesInProgressPromise(){\n return this.GetPromise('/v3/nfl/stats/{format}/AreAnyGamesInProgress');\n }", "get assigned_animation() { return this.playback.assigned }", "function WaitForAnimation() {\r\n if (animating) {\r\n setTimeout(\"WaitForAnimation()\", 50);\r\n return;\r\n }\r\n ActionAfterAnimation();\r\n}", "isAnimating() {\n return animationFrame > 1;\n }", "function waitForNextFrame() {\n const timeAtStart = document.timeline.currentTime;\n return new Promise(resolve => {\n (function handleFrame() {\n if (timeAtStart === document.timeline.currentTime) {\n window.requestAnimationFrame(handleFrame);\n } else {\n resolve();\n }\n }());\n });\n}", "function checkAnimation() {\n var $elem = $('.path');\n\n if (isElementInViewport($elem)) {\n // Start the animation\n $elem.addClass('start');\n } else {\n $elem.removeClass('start');\n }\n}", "_playAnimation() {\n if (this._animationLast === undefined && this._animationQueue.length > 0) {\n this._animationLast = this._animationCurrent;\n this._animationCurrent = this._animationQueue.shift();\n console.log(\"New: \" + this._animationCurrent.name);\n this._animationCurrent.runCount = 0;\n }\n this._serviceAnimation(this._animationCurrent, true);\n this._serviceAnimation(this._animationLast, false);\n if (this._animationLast && this._animationLast.cleanup) {\n this._animationLast.animation.stop();\n this._animationLast.animation = undefined;\n this._animationLast = undefined;\n }\n }", "function checkAnimation(elem) {\n var $elem = $(elem);\n\n // If the animation has already been started\n if ($elem.hasClass('animated')) return;\n\n if (isElementInViewport($elem)) {\n // Start the animation\n $elem.addClass('animated fadeInUp');\n }\n}", "async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this._queue.size === 0) {\n return;\n }\n\n return new Promise(resolve => {\n const existingResolve = this._resolveEmpty;\n\n this._resolveEmpty = () => {\n existingResolve();\n resolve();\n };\n });\n }", "function whichAnimationEvent() {\n \"use strict\";\n var i,\n el = document.createElement('div'),\n animations = {\n 'animation': 'animationend',\n 'OAnimation': 'oanimationend', // oAnimationEnd in very old Opera\n 'MozAnimation': 'animationend',\n 'WebkitAnimation': 'webkitAnimationEnd'\n };\n\n for (i in animations) {\n if (animations.hasOwnProperty(i) && el.style[i] !== undefined) {\n return animations[i];\n }\n }\n}", "async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveEmpty;\n this._resolveEmpty = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveEmpty;\n this._resolveEmpty = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async wait() {\n this.waitingAnimationFinish = true;\n await Utils.delay(1000);\n this.waitingAnimationFinish = false;\n }", "whichAnimationEvent(){\n let el = document.createElement(\"fakeelement\")\n let t\n\n const animations = {\n \"animation\" : \"animationend\",\n \"OAnimation\" : \"oAnimationEnd\",\n \"MozAnimation\" : \"animationend\",\n \"WebkitAnimation\": \"webkitAnimationEnd\"\n }\n\n for (t in animations){\n if (el.style[t] !== undefined){\n return animations[t]\n }\n }\n }", "get animationPositionError() {}", "async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this._pendingCount === 0 && this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveIdle;\n this._resolveIdle = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this._pendingCount === 0 && this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveIdle;\n this._resolveIdle = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this._pendingCount === 0 && this._queue.size === 0) {\n return;\n }\n\n return new Promise(resolve => {\n const existingResolve = this._resolveIdle;\n\n this._resolveIdle = () => {\n existingResolve();\n resolve();\n };\n });\n }", "if (m_bInitialAnim) { return; }", "get has_keyframe () {\n let res = false;\n this.frames.each((f) => {\n res = res || f.is_keyframe;\n });\n return res;\n }", "idle() {\n return (0, _waitFor.default)(() => this.length === 0, {\n timeout: 2 * 60 * 1000 // 2 minutes\n\n });\n }", "animationReadyToClose() {\n if (this.animationEnabled()) {\n // set default view visible before content transition for close runs\n if (this.getDefaultTabElement()) {\n const eleC = this.getDefaultTabElement() ? this.getDefaultTabElement().querySelector(ANIMATION_CLASS) :\n this.getDefaultTabElement().querySelector(ANIMATION_CLASS);\n if (eleC) {\n eleC.style.position = 'unset';\n eleC.classList.remove('hide');\n }\n }\n }\n }", "function checkAnimation(elem) {\n //If the element has already animated, do nothing\n if (elem.hasClass('start')) {\n return;\n }\n //If the element is in the view, begin css animation\n if (isElementInView(elem)) {\n elem.addClass('start');\n }\n}", "function animationReady(revealContent) {\n if (continueAnimation) {\n if (angular.isDefined(revealContent)) continueAnimation = revealContent;\n continueAnimation.run(continueAnimation.args);\n continueAnimation = false;\n } else if (angular.isDefined(revealContent)) continueAnimation = revealContent;\n else continueAnimation = true;\n }", "function whichAnimationEvent(){\n var t,\n el = document.createElement(\"fakeelement\");\n\n var animations = {\n \"animation\" : \"animationend\",\n \"OAnimation\" : \"oAnimationEnd\",\n \"MozAnimation\" : \"animationend\",\n \"WebkitAnimation\": \"webkitAnimationEnd\"\n }\n\n for (t in animations){\n if (el.style[t] !== undefined){\n return animations[t];\n }\n }\n}", "function animate(duration, callback) {\n var disposed = false;\n // TODO use performance.now() ?\n var startTime = Date.now();\n function loop(now) {\n if (!disposed) {\n var diff = now - startTime;\n if (diff >= duration) {\n callback(1);\n }\n else {\n _utils_AsyncPending__WEBPACK_IMPORTED_MODULE_6__[\"nextFrame\"](loop);\n callback(diff / duration);\n }\n }\n }\n _utils_AsyncPending__WEBPACK_IMPORTED_MODULE_6__[\"nextFrame\"](loop);\n return new _utils_Disposer__WEBPACK_IMPORTED_MODULE_3__[\"Disposer\"](function () {\n disposed = true;\n });\n}", "function isAnimate(obj){\r\n\t\treturn obj.is(\":animated\") ? false : true;\r\n\t}", "function whichAnimationEvent() {\n var t,\n el = document.createElement(\"fakeelement\");\n\n var animations = {\n animation: \"animationend\",\n OAnimation: \"oAnimationEnd\",\n MozAnimation: \"animationend\",\n WebkitAnimation: \"webkitAnimationEnd\",\n };\n\n for (t in animations) {\n if (el.style[t] !== undefined) {\n return animations[t];\n };\n };\n }", "get waiting()\n {\n return this.queueLength === 0;\n }", "function showAnimationInitProgress() {\n return _config && _config.showAnimationInitProgress ? true : false;\n }", "getFrame(t) {\nvar NF, f, frame, resolved, was_complete;\n//-------\n// Allow for the possibility that the frame seqeuence is extended\n// while we are scanning it. In the case where our search apparently\n// hits the sequence limit this means (a) that we should check\n// whether new frames have been added, and (b) that we shouldn''t\n// terminate the animation until we know that it is complete.\n// If I knew more about modern browsers' scheduling, I might realise\n// that this is unnecessarily complicated, or perhaps alternatively\n// that it is not complicated enough to be safe.\nresolved = false;\nwhile (!resolved) {\nwas_complete = this.isComplete;\nNF = this.fCount;\nf = this.getFrameIndex(t, NF);\nresolved = f !== NF || was_complete || NF === this.fCount;\nif (--this.traceMax > 0) {\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Resolved: ${resolved} f=${f} NF=${NF} fCount=${this.fCount}`);\n}\n}\n}\n// Find result frame\n// Rather than terminate the animation, stick at the last available\n// frame, pending the arrival of possible successors -- via\n// @extendSigns() -- or the indication that there will never be\n// any successors -- via @setCompleted.\nreturn frame = f !== NF ? (this.fIncomplete = 0, this.setFrameAt(f)) : this.isComplete ? null : (this.fIncomplete++, this.fIncomplete < 5 ? typeof lggr.debug === \"function\" ? lggr.debug(\"getFrame: at end of incomplete animation\") : void 0 : void 0, this.setFrameAt(NF - 1));\n}", "function whichAnimationEvent(){\n var t;\n var fake = document.createElement('fakeelement');\n var animations = {\n 'animation':'animationend',\n 'OAnimation':'oAnimationEnd',\n 'MozAnimation':'animationend',\n 'WebkitAnimation':'webkitAnimationEnd'\n };\n\n for (t in animations) {\n if (fake.style[t] !== undefined) {\n return animations[t];\n }\n }\n}", "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }", "qEmpty() {\n return this.queue.empty();\n }", "function checkAnimation() {\r\n \r\n\r\n if (isElementInViewport($('.bars'))) {\r\n var $elem = $('.bar');\r\n // Start the animation\r\n $elem.addClass('animate-bar');\r\n }\r\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function whichStartAnimationEvent() {\n var t,\n el = document.createElement(\"fakeelement\")\n\n var animations = {\n \"animation\" : \"animationstart\",\n \"OAnimation\" : \"oAnimationStart\",\n \"MozAnimation\" : \"animationstart\",\n \"WebkitAnimation\": \"webkitAnimationStart\"\n }\n\n for (t in animations){\n if (el.style[t] !== undefined){\n return animations[t]\n }\n }\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "function showAnimationLoadProgress() {\n return _config && _config.showAnimationLoadProgress ? true : false;\n }", "function getAnimationAutoStart() {\n return _config && _config.animationAutoStart ? true : false;\n }", "function testAnimation(element) {\n if ( !element.hasClass('anim-running') &&\n Utils.isInView(element, {topoffset: offset})) {\n element\n .addClass('anim-running');\n\n setTimeout(function() {\n element\n .addClass('anim-done')\n .animo( { animation: animation, duration: 0.7} );\n }, delay);\n\n }\n }", "function testAnimation(element) {\n if ( !element.hasClass('anim-running') &&\n Utils.isInView(element, {topoffset: offset})) {\n element\n .addClass('anim-running');\n\n setTimeout(function() {\n element\n .addClass('anim-done')\n .animo( { animation: animation, duration: 0.7} );\n }, delay);\n\n }\n }", "function wait()\n{\n\tsetTimeout(() => \n\t{\n\t\tif (activeAnimations < maximumAnimations)\n\t\t{\n\t\t\tsetTimeout(() => {\n\t\t\t\tanimateNext();\n\t\t\t}, 100);\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsetTimeout(() => {\n\t\t\t\twait();\n\t\t\t}, 100);\n\t\t}\n\t}, 100);\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n }", "exists() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.element() === null ? false : true;\n });\n }", "function getAnimating() {\r\n return animating;\r\n}", "function loadAnims(){\n\tlog(\"load \" + animations.length + \" animations\");\t\n\tif(animations.length>0){\t\n\t\tyepnope([{\n\t\t\tload: animations,\n\t\t\tcallback: function (url, result, key) {\n\t\t\t\tprogress(\"loaded: \" + url);\n\t\t\t},\n\t\t\tcomplete: function(){\n\t\t\t\tlog(\"loading animations complete\"); \n\t\t\t\tstartNemoScript();\n\t\t\t}\n\t\t}]);\n\t}else{\n\t\tstartNemoScript();\n\t}\n}", "isEmpty() {\n return this.queue.size() === 0;\n }", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}", "function renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}" ]
[ "0.5722611", "0.55922925", "0.5585994", "0.5545919", "0.5495163", "0.5403856", "0.5263135", "0.5252508", "0.5245202", "0.5202926", "0.5202926", "0.51895094", "0.5163437", "0.5151894", "0.51438594", "0.5086871", "0.5049114", "0.503145", "0.50097895", "0.5008574", "0.50067025", "0.49994797", "0.49994797", "0.4988032", "0.49843973", "0.49834964", "0.49359334", "0.49359334", "0.49147186", "0.48626986", "0.48584566", "0.48012444", "0.47975105", "0.4787149", "0.47803798", "0.47803304", "0.4747889", "0.47361034", "0.47321716", "0.47129145", "0.4705978", "0.46937636", "0.46894476", "0.46813852", "0.46693555", "0.4668156", "0.46660873", "0.46660873", "0.46660873", "0.46660873", "0.46660873", "0.46660873", "0.46660873", "0.46660873", "0.46660873", "0.46660873", "0.46660873", "0.46660873", "0.4649116", "0.46439332", "0.46277237", "0.4625773", "0.46235058", "0.46235058", "0.46057934", "0.46043715", "0.45957038", "0.45787948", "0.4570861", "0.45610037", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688", "0.45488688" ]
0.613387
0
Scroll the thumbnail onscreen in the search view if the search isn't currently visible.
scrollSearchToThumbnail() { if(this.isAnimating || !this.parent.active || this.dragger.position < 1) return; ppixiv.app.scrollSearchToMediaId(this.parent.dataSource, this.parent._wantedMediaId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSearchResult() {\n pixabayApi\n .fetchImages()\n .then(dataArray => galleryCardTpl(dataArray))\n .then(markup => {\n markupRender(markup, galleryListRef);\n // The condition to prevent the page from scrolling on the very first batch of images\n if (pixabayApi.pageNumber > 2) {\n // Method window.scrollTo() did not work quite the way I expected, so I used another method mentioned in MDN\n window.scrollBy({\n // The page is scrolled by the height of the window minus the height of the search bar\n top: window.innerHeight - 110,\n behavior: 'smooth',\n });\n }\n if (pixabayApi.isLastPage) {\n loadMoreBtnApi.hide();\n } else {\n loadMoreBtnApi.show();\n loadMoreBtnApi.enable();\n }\n })\n .catch(er => {\n loadMoreBtnApi.hide();\n showError(er);\n });\n}", "function readyToSearchScrollPosition() {\n window.scrollTo({\n top: scrollAnchor.offsetTop,\n left: 0,\n behavior: 'auto',\n });\n }", "function hsClickScroll()\n {\n var imageOffset = self.getOffsetRect(this).top; \n var clientOffset = (docElement.clientHeight-hs.maxHeight) / 2;\n window.scrollTo(0,imageOffset-clientOffset);\n }", "function readyToSearchScrollPosition() {\n window.scrollTo({\n 'top': scrollAnchor.offsetTop,\n 'left': 0,\n 'behavior': 'auto',\n });\n }", "function scrollToShowThumbnail(n) {\n var selector = 'li[data-index=\"' + n + '\"]';\n var thumbnail = thumbnails.querySelector(selector);\n if (thumbnail)\n thumbnail.scrollIntoView();\n}", "function _forwardThumbnailScroll() {\n\t\tif (thumbindex < 0) {\n\t\t\tstopSlideshow();\n\n\t\t\tvar\n\t\t\t\tvw = _safeWidth(thumbsBar),\n\t\t\t\ttw = _safeWidth(thumbs);\n\t\t\tvar pos = _getRTLPosition(thumbs); // current left offset of thumbs ribbon w.r.t. left edge of viewer\n\t\t\tvar minpos = vw - tw; // maximum negative value permitted as left offset w.r.t. left edge of viewer\n\n\t\t\tif (tw + pos < vw) { // right end of ribbon is to the right of right edge of viewer\n\t\t\t\t_updateThumbnailNavigation();\n\t\t\t} else {\n\t\t\t\tvar target = {};\n\t\t\t\ttarget[rtlpos] = minpos;\n\t\t\t\tthumbs.animate(target, -4 * (minpos - pos), 'linear', _updateThumbnailNavigation);\n\t\t\t}\n\t\t}\n\t}", "searchPrev(){\n this.searchIndex--;\n this.searchMovie();\n this.$nextTick(function(){\n scrollRight(\"search_display\");\n });\n }", "seekTo() {\n this.dragging = false;\n this.props.seekTo(this.slider.current.value * this.props.mediaLength);\n this.props.hideThumbnail();\n }", "function jumpToPosition(){\n flexImages3.scrollIntoView({behavior: \"smooth\", block: 'center',inline: 'center'});\n}", "function configureSearchMouseScrolling()\n{\n //simulated touch (ie. mouse) dragging for results\n document.getElementById('search-results')\n .addEventListener('mousedown', mousedownForSearchResults, false);\n \n document.getElementById('search-results')\n .addEventListener('mousemove', mousemoveForSearchResults, false);\n \n document.getElementById('search-results')\n .addEventListener('mouseup', mouseupForSearchResults, false);\n}", "function updateScreenshotScroll() {\r\n if (!isMobile) { \r\n $('#screenshots').slimScroll(slimOptionsContent); \r\n }\r\n}", "function _stopThumbnailScroll() {\n\t\tthumbs.stop();\n\t\t_updateThumbnailNavigation();\n\t}", "goTop() {\n refs.galleryList.scrollIntoView({\n block: \"start\",\n behavior: \"smooth\",\n });\n }", "function setScroll() {\n\t\t$(document).on(\"click\", \"#prevThumb\", function() {\n\t\t\tvar leftPos = $(\"#imageWrapper\").scrollLeft();\n\n\t\t\tif ($(\"#imageWrapper\").scrollLeft() > \"0\") {\n\t\t\t\t$(\"#imageWrapper\").animate({scrollLeft: leftPos - 500}, 300);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\t$(document).on(\"click\", \"#nextThumb\", function() {\n\t\t\tvar leftPos = $(\"#imageWrapper\").scrollLeft();\n\n\t\t\tif (leftPos < $(\"#imageWrapper\")[0].scrollWidth) {\n\t\t\t\t$(\"#imageWrapper\").animate({scrollLeft: leftPos + 500}, 300);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t});\n\t}", "function setScroll() {\n\t\t$(document).on(\"click\", \"#prevThumb\", function() {\n\t\t\tvar leftPos = $(\"#imageWrapper\").scrollLeft();\n\n\t\t\tif ($(\"#imageWrapper\").scrollLeft() > \"0\") {\n\t\t\t\t$(\"#imageWrapper\").animate({scrollLeft: leftPos - 500}, 300);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\t$(document).on(\"click\", \"#nextThumb\", function() {\n\t\t\tvar leftPos = $(\"#imageWrapper\").scrollLeft();\n\n\t\t\tif (leftPos < $(\"#imageWrapper\")[0].scrollWidth) {\n\t\t\t\t$(\"#imageWrapper\").animate({scrollLeft: leftPos + 500}, 300);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t});\n\t}", "function edgtfSearchWindowTop() {\n\n searchOpener.click( function(e) {\n e.preventDefault();\n\n var yPos = 0;\n if($('.title').hasClass('has_parallax_background')){\n yPos = parseInt($('.title.has_parallax_background').css('backgroundPosition').split(\" \")[1]);\n }\n\n if ( searchForm.height() == \"0\") {\n $('.edgtf-search-slide-window-top input[type=\"text\"]').focus();\n //Push header bottom\n edgtf.body.addClass('edgtf-search-open');\n $('.title.has_parallax_background').animate({\n 'background-position-y': (yPos + 50)+'px'\n }, 150);\n } else {\n edgtf.body.removeClass('edgtf-search-open');\n $('.title.has_parallax_background').animate({\n 'background-position-y': (yPos - 50)+'px'\n }, 150);\n }\n\n $(window).scroll(function() {\n if ( searchForm.height() != '0' && edgtf.scroll > 50 ) {\n edgtf.body.removeClass('edgtf-search-open');\n $('.title.has_parallax_background').css('backgroundPosition', 'center '+(yPos)+'px');\n }\n });\n\n searchClose.click(function(e){\n e.preventDefault();\n edgtf.body.removeClass('edgtf-search-open');\n $('.title.has_parallax_background').animate({\n 'background-position-y': (yPos)+'px'\n }, 150);\n });\n\n });\n }", "function _rewindThumbnailScroll() {\n\t\tif (thumbindex < 0) {\n\t\t\tstopSlideshow();\n\n\t\t\tvar target = {};\n\t\t\ttarget[rtlpos] = 0;\n\t\t\tthumbs.animate(target, -4 * _getRTLPosition(thumbs), 'linear', _updateThumbnailNavigation); // \"left\" (or \"right\" for RTL) is always a negative number\n\t\t}\n\t}", "scrollHitIntoView() {\n this.requestUpdate().then(() => {\n const selected = this.renderRoot.querySelector(\n '.web-search-popout__link--active',\n );\n selected.scrollIntoView({block: 'nearest'});\n this.dispatchEvent(new CustomEvent('resultselect', {detail: {selected}}));\n });\n }", "function initSearchButton(){\n\n\tif($j('.search_slides_from_window_top').length){\n\t\t$j('.search_slides_from_window_top').click(function(e){\n\t\t\te.preventDefault();\n\n\t\t\tif($j('html').hasClass('touch')){\n\t\t\t\tif ($j('.qode_search_form').height() == \"0\") {\n\t\t\t\t\t$j('.qode_search_form input[type=\"text\"]').onfocus = function () {\n\t\t\t\t\t\twindow.scrollTo(0, 0);\n\t\t\t\t\t\tdocument.body.scrollTop = 0;\n\t\t\t\t\t};\n\t\t\t\t\t$j('.qode_search_form input[type=\"text\"]').onclick = function () {\n\t\t\t\t\t\twindow.scrollTo(0, 0);\n\t\t\t\t\t\tdocument.body.scrollTop = 0;\n\t\t\t\t\t};\n\t\t\t\t\t$j('.header_top_bottom_holder').css('top','50px');\n\t\t\t\t\t$j('.qode_search_form').css('height','50px');\n\t\t\t\t\t$j('.content_inner').css('margin-top','50px');\n\t\t\t\t\tif($scroll < 34){ $j('header.page_header').css('top','0'); }\n\t\t\t\t} else {\n\t\t\t\t\t$j('.qode_search_form').css('height','0');\n\t\t\t\t\t$j('.header_top_bottom_holder').css('top','0');\n\t\t\t\t\t$j('.content_inner').css('margin-top','0');\n\t\t\t\t\tif($scroll < 34){ $j('header.page_header').css('top',-$scroll);}\n\t\t\t\t}\n\n\t\t\t\t$j(window).scroll(function() {\n\t\t\t\t\tif ($j('.qode_search_form').height() != \"0\" && $scroll > 50) {\n\t\t\t\t\t\t$j('.qode_search_form').css('height','0');\n\t\t\t\t\t\t$j('.header_top_bottom_holder').css('top','0');\n\t\t\t\t\t\t$j('.content_inner').css('margin-top','0');\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t$j('.qode_search_close').click(function(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$j('.qode_search_form').css('height','0');\n\t\t\t\t\t$j('.header_top_bottom_holder').css('top','0');\n\t\t\t\t\t$j('.content_inner').css('margin-top','0');\n\t\t\t\t\tif($scroll < 34){ $j('header.page_header').css('top',-$scroll);}\n\t\t\t\t});\n\n\t\t\t} else {\n\t\t\t\tif($j('.title').hasClass('has_fixed_background')){\n\t\t\t\t\tvar yPos = parseInt($j('.title.has_fixed_background').css('backgroundPosition').split(\" \")[1]);\n\t\t\t\t}else { \n\t\t\t\t\tvar yPos = 0;\n\t\t\t\t}\n\t\t\t\tif ($j('.qode_search_form').height() == \"0\") {\n\t\t\t\t\t$j('.qode_search_form input[type=\"text\"]').focus();\n\t\t\t\t\t$j('.header_top_bottom_holder').stop().animate({top:\"50px\"},150);\n\t\t\t\t\t$j('.qode_search_form').stop().animate({height:\"50px\"},150);\n\t\t\t\t\t$j('.content_inner').stop().animate({marginTop:\"50px\"},150);\n\t\t\t\t\tif($scroll < 34){ $j('header.page_header').stop().animate({top:0},150); }\n\t\t\t\t\t$j('.title.has_fixed_background').animate({\n\t\t\t\t\t\t'background-position-y': (yPos + 50)+'px'\n\t\t\t\t\t}, 150);\n\t\t\t\t} else {\n\t\t\t\t\t$j('.qode_search_form').stop().animate({height:\"0\"},150);\n\t\t\t\t\t$j('.header_top_bottom_holder').stop().animate({top:\"0px\"},150);\n\t\t\t\t\t$j('.content_inner').stop().animate({marginTop:\"0\"},150);\n\t\t\t\t\tif($scroll < 34){ $j('header.page_header').stop().animate({top:-$scroll},150);}\n\t\t\t\t\t$j('.title.has_fixed_background').animate({\n\t\t\t\t\t\t'background-position-y': (yPos - 50)+'px'\n\t\t\t\t\t}, 150);\n\t\t\t\t}\n\n\t\t\t\t$j(window).scroll(function() {\n\t\t\t\t\tif ($j('.qode_search_form').height() != \"0\" && $scroll > 50) {\n\t\t\t\t\t\t$j('.qode_search_form').stop().animate({height:\"0\"},150);\n\t\t\t\t\t\t$j('.header_top_bottom_holder').stop().animate({top:\"0px\"},150);\n\t\t\t\t\t\t$j('.content_inner').stop().animate({marginTop:\"0\"},150);\n\t\t\t\t\t\t$j('.title.has_fixed_background').css('backgroundPosition', 'center '+(yPos)+'px');\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t$j('.qode_search_close').click(function(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$j('.qode_search_form').stop().animate({height:\"0\"},150);\n\t\t\t\t\t$j('.content_inner').stop().animate({marginTop:\"0\"},150);\n\t\t\t\t\t$j('.header_top_bottom_holder').stop().animate({top:\"0px\"},150);\n\t\t\t\t\tif($scroll < 34){ $j('header.page_header').stop().animate({top:-$scroll},150);}\n\t\t\t\t\t$j('.title.has_fixed_background').animate({\n\t\t\t\t\t\t'background-position-y': (yPos)+'px'\n\t\t\t\t\t}, 150);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\t\n\t//search type - search_slides_from_header_bottom\n if($j('.search_slides_from_header_bottom').length){\n\n $j('.search_slides_from_header_bottom').click(function(e){\n\n e.preventDefault();\n\n if($j('.qode_search_form_2').hasClass('animated')) {\n $j('.qode_search_form_2').removeClass('animated');\n $j('.qode_search_form_2').css('bottom','0');\n } else {\n $j('.qode_search_form input[type=\"text\"]').focus();\n $j('.qode_search_form_2').addClass('animated');\n var search_form_height = $j('.qode_search_form_2').height();\n $j('.qode_search_form_2').css('bottom',-search_form_height);\n\n }\n\n $j('.qode_search_form_2').addClass('disabled');\n $j('.qode_search_form_2 input[type=\"submit\"]').attr('disabled','disabled');\n if(($j('.qode_search_form_2 .qode_search_field').val() !== '') && ($j('.qode_search_form_2 .qode_search_field').val() !== ' ')) {\n $j('.qode_search_form_2 input[type=\"submit\"]').removeAttr('disabled');\n $j('.qode_search_form_2').removeClass('disabled');\n }\n else {\n $j('.qode_search_form_2').addClass('disabled');\n $j('.qode_search_form_2 input[type=\"submit\"]').attr('disabled','disabled');\n }\n\n $j('.qode_search_form_2 .qode_search_field').keyup(function() {\n if(($j(this).val() !== '') && ($j(this).val() != ' ')) {\n $j('.qode_search_form_2 input[type=\"submit\"]').removeAttr('disabled');\n $j('.qode_search_form_2').removeClass('disabled');\n }\n else {\n $j('.qode_search_form_2 input[type=\"submit\"]').attr('disabled','disabled');\n $j('.qode_search_form_2').addClass('disabled');\n }\n });\n\n\n $j('.content, footer').click(function(e){\n e.preventDefault();\n $j('.qode_search_form_2').removeClass('animated');\n $j('.qode_search_form_2').css('bottom','0');\n });\n\n });\n }\n\n //search type - search covers header\n if($j('.search_covers_header').length){\n\n $j('.search_covers_header').click(function(e){\n\n e.preventDefault();\n if($j(\".search_covers_only_bottom\").length){\n var headerHeight = $j('.header_bottom').height();\n }\n else{\n if($j(\".fixed_top_header\").length){\n var headerHeight = $j('.top_header').height();\n }else{\n var headerHeight = $j('.header_top_bottom_holder').height();\n }\n }\n\n\t\t\t$j('.qode_search_form_3 .form_holder_outer').height(headerHeight);\n\n if($j(\".search_covers_only_bottom\").length){\n $j('.qode_search_form_3').css('bottom',0);\n $j('.qode_search_form_3').css('top','auto');\n }\n\t\t\t$j('.qode_search_form_3').stop(true).fadeIn(600,'easeOutExpo');\n\t\t\t$j('.qode_search_form_3 input[type=\"text\"]').focus();\n\n\n\t\t\t$j(window).scroll(function() {\n if($j(\".search_covers_only_bottom\").length){\n var headerHeight = $j('.header_bottom').height();\n }\n else{\n if($j(\".fixed_top_header\").length){\n var headerHeight = $j('.top_header').height();\n }else{\n var headerHeight = $j('.header_top_bottom_holder').height();\n }\n }\n\t\t\t\t$j('.qode_search_form_3 .form_holder_outer').height(headerHeight);\n\t\t\t});\n\n\t\t\t$j('.qode_search_close, .content, footer').click(function(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$j('.qode_search_form_3').stop(true).fadeOut(450,'easeOutExpo');\n\t\t\t});\n\n\t\t\t$j('.qode_search_form_3').blur(function(e){\n\t\t\t\t\t$j('.qode_search_form_3').stop(true).fadeOut(450,'easeOutExpo');\n\t\t\t});\n });\n }\n\t\t\n//search type - fullscreen search\n if($j('.fullscreen_search').length){\n\t\t//search type Circle Appear\n\t\tif($j(\".fullscreen_search_holder.from_circle\").length){\n\t\t\t$j('.fullscreen_search').on('click',function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tif($j('.fullscreen_search_overlay').hasClass('animate')){\n\t\t\t\t\t$j('.fullscreen_search_overlay').removeClass('animate');\n\t\t\t\t\t$j('.fullscreen_search_holder').css('opacity','0');\n\t\t\t\t\t$j('.fullscreen_search_close').css('opacity','0');\n\t\t\t\t\t$j('.fullscreen_search_close').css('visibility','hidden');\n\t\t\t\t\t$j('.fullscreen_search').css('opacity','1');\n\t\t\t\t\t$j('.fullscreen_search_holder').css('display','none');\n\t\t\t\t} else {\n\t\t\t\t\t$j('.fullscreen_search_overlay').addClass('animate');\n\t\t\t\t\t$j('.fullscreen_search_holder').css('display','block');\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t$j('.fullscreen_search_holder').css('opacity','1');\n\t\t\t\t\t\t$j('.fullscreen_search_close').css('opacity','1');\n\t\t\t\t\t\t$j('.fullscreen_search_close').css('visibility','visible');\n\t\t\t\t\t\t$j('.fullscreen_search').css('opacity','0');\n\t\t\t\t\t},200);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\t$j('.fullscreen_search_close').on('click',function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t$j('.fullscreen_search_overlay').removeClass('animate');\n\t\t\t\t$j('.fullscreen_search_holder').css('opacity','0');\n\t\t\t\t$j('.fullscreen_search_close').css('opacity','0');\n\t\t\t\t$j('.fullscreen_search_close').css('visibility','hidden');\n\t\t\t\t$j('.fullscreen_search').css('opacity','1');\n\t\t\t\t$j('.fullscreen_search_holder').css('display','none');\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t//search type Fade Appear\n\t\tif($j(\".fullscreen_search_holder.fade\").length){\n\t\t\t$j('.fullscreen_search').on('click',function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tif($j('.fullscreen_search_holder').hasClass('animate')) {\n\t\t\t\t\t$j('body').removeClass('fullscreen_search_opened');\n\t\t\t\t\t$j('.fullscreen_search_holder').removeClass('animate');\n\t\t\t\t\t$j('body').removeClass('search_fade_out');\n\t\t\t\t\t$j('body').removeClass('search_fade_in');\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$j('body').addClass('fullscreen_search_opened');\n\t\t\t\t\t$j('body').removeClass('search_fade_out');\n\t\t\t\t\t$j('body').addClass('search_fade_in');\n\t\t\t\t\t$j('.fullscreen_search_holder').addClass('animate');\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\t$j('.fullscreen_search_close').on('click',function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t$j('body').removeClass('fullscreen_search_opened');\n\t\t\t\t$j('.fullscreen_search_holder').removeClass('animate');\n\t\t\t\t$j('body').removeClass('search_fade_in');\n\t\t\t\t$j('body').addClass('search_fade_out');\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\t//Text input focus change\n\t\t$j('.fullscreen_search_holder .search_field').focus(function(){\n\t\t\t$j('.fullscreen_search_holder .field_holder .line').css(\"width\",\"100%\");\n\t\t});\n\t\t\n\t\t$j('.fullscreen_search_holder .search_field').blur(function(){\n\t\t\t$j('.fullscreen_search_holder .field_holder .line').css(\"width\",\"0\");\n\t\t});\n\t\t\n\t\t//search close button - setting its position vertically\n\t\t$j(window).scroll(function() {\n\t\t\tvar bottom_height = $j(\".page_header .header_bottom\").height();\n\t\t\tif($j(\".page_header\").hasClass(\"sticky\")){\n\t\t\t\t$j(\".fullscreen_search_holder .side_menu_button\").css(\"height\",bottom_height);\n\t\t\t\t$j(\".fullscreen_search_holder .close_container\").css(\"top\",\"0\");\n\t\t\t} else if($j(\".page_header\").hasClass(\"fixed\")){ \n\t\t\t\t$j(\".fullscreen_search_holder .side_menu_button\").css(\"height\",bottom_height);\n\t\t\t} else {\n\t\t\t\t$j(\".fullscreen_search_holder .side_menu_button\").css(\"height\",\"\");\n\t\t\t\t$j(\".fullscreen_search_holder .close_container\").css(\"top\",\"\");\n\t\t\t}\n\t\t});\n }\n\n if($j('.qode_search_submit').length) {\n $j('.qode_search_submit').click(function(e) {\n e.preventDefault();\n e.stopPropagation();\n\n var searchForm = $j(this).parents('form').first();\n\n searchForm.submit();\n });\n }\n\t\n}", "function mousemoveForSearchResults(event)\n{\n //console.log('mousemove event on scrollable');\n \n if(!global_mouseButtonDown)\n {\n return false; //do nothing if the mouse button isn't pressed down\n //false is ok to return?\n }\n \n doVerticalDragScrolling(this, event.clientY);\n \n event.preventDefault();\n}", "searchNext(){\n this.searchIndex++;\n this.searchMovie();\n this.$nextTick(function(){\n scrollLeft(\"search_display\");\n });\n }", "function handleSubmit(event) {\n event.preventDefault();\n console.log(\"Searching\");\n let userSearch = event.target.elements.search.value;\n getPhotos(userSearch);\n largeGallery.scrollIntoView({\n behavior: \"smooth\"\n });\n}", "function handleScroll () {\n\n movePopupToTarget(instance);\n }", "function onSearch(keyword) {\n renderSearchInput(keyword);//if user clicked and not typed\n keyword = keyword.toLowerCase().trim();\n setImgsForDisplay(keyword);\n const images = getImages();\n const isNothingFound = images.every(img => img.isHidden);\n if (isNothingFound) setAllImgsForDisplay();\n renderImgs();\n}", "function scrollImageList() {\n var imageLink = $('#annotate_image_link_' + gImageId);\n var list = $('#image_list');\n\n var offset = list.offset().top;\n var linkTop = imageLink.offset().top;\n\n // link should be (roughly) in the middle of the element\n offset += parseInt(list.height() / 2);\n\n list.scrollTop(list.scrollTop() + linkTop - offset);\n }", "prev(){\n // if is something in search input use search items array\n if (this.searchInput.select) {\n this.page.curSearch--\n this.searchItems()\n // else use discover items array\n } else {\n this.page.cur--\n this.discoverItems()\n }\n // scroll to top\n this.scrollToTop(300)\n }", "function ticketSelectScroll(ticket_number){\n $('#search_results-hub').slideUp(\"fast\");\n $('#search_field').css('border-radius','10px 10px 10px 10px');\n //scroll the right box div\n console.log(`Scrolling to: ${ticket_number}`)\n //$('#right-box-hub').animate({scrollTop: $(`#ticket_row_${ticket_number}`).offset().top}, 1000);\n var elmnt = document.getElementById(`ticket_row_${ticket_number}`);\n elmnt.scrollIntoView({behavior: \"smooth\", block: \"nearest\"}); \n selectTicket(ticket_number);\n}", "function configureSearchTouchScrolling()\n{\n document.getElementById('search-results')\n .addEventListener('touchstart', touchstartForSearchResults, false);\n \n document.getElementById('search-results')\n .addEventListener('touchmove', touchmoveForSearchResults, false);\n \n document.getElementById('search-results')\n .addEventListener('touchend', touchendForSearchResults, false); //even adding this doesn't stop the \"drag event missed\" warnings\n}", "scrollToFilter() {\n const targetPositionX = dom.filterContainer.offsetTop;\n setTimeout(() => {\n animatedScrollTo({\n to: targetPositionX + 15,\n easing: easeInOutBack,\n duration: 3 * this.transitionTime,\n });\n }, this.transitionTime);\n }", "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}", "function handleSearchV2() {\n $(\".blog-topbar .search-btn\").on(\"click\", function() {\n if (jQuery(\".topbar-search-block\").hasClass(\"topbar-search-visible\")) {\n jQuery(\".topbar-search-block\").slideUp();\n jQuery(\".topbar-search-block\").removeClass(\"topbar-search-visible\");\n } else {\n jQuery(\".topbar-search-block\").slideDown();\n jQuery(\".topbar-search-block\").addClass(\"topbar-search-visible\");\n }\n });\n $(\".blog-topbar .search-close\").on(\"click\", function() {\n jQuery(\".topbar-search-block\").slideUp();\n jQuery(\".topbar-search-block\").removeClass(\"topbar-search-visible\");\n });\n jQuery(window).scroll(function() {\n jQuery(\".topbar-search-block\").slideUp();\n jQuery(\".topbar-search-block\").removeClass(\"topbar-search-visible\");\n });\n }", "function scroll_unit() {\n\t\tvar top = ($('.unit-wrap').offset().top - 35);\n\t\tvar bottom = ($('.quality').offset().top - 35);\n\n\t\tif($(window).scrollTop() > top){\n\t\t\t\t$(\".unit-pager\").addClass('is-visible');\n\t\t}\n\t\tif($(window).scrollTop() > bottom){\n\t\t\t$(\".unit-pager\").removeClass('is-visible');\n\t\t}\n\t\tif($(window).scrollTop() < top){\n\t\t\t$(\".unit-pager\").removeClass('is-visible');\n\t\t}\n\t}", "render(){ \n return (\n <div className=\"App\">\n <Above Search = {this.Search} />\n \n <Content images= {this.state} addImg={this.Scroll} />\n\n \n \n </div>\n );\n }", "function work() {\n var scrollPos = $(\".case-studies\").offset().top - 80;\n TweenLite.to(window, 2, {scrollTo: {y: scrollPos}, ease: Power2.easeOut});\n }", "function scrollOver(){\n var current = $galleryDoc.docById();\n var scrollAmount;\n if (current.length){\n scrollAmount = current.position().left - current.parent().width()/2 + current.innerWidth()/2;\n }else{\n return;\n }\n\n current.addClass('current-document');\n $galleryDoc.embedViewport.find('.gallery').animate({\n scrollLeft: scrollAmount\n }, 200);\n }", "search(e){\n \n\t e.preventDefault();\n\t let input = document.querySelector('#photo-search');\n\t let term = input.value;\n\t \n\t if(term.length > 2){\t\t \n\t\t input.classList.add('searching');\n\t\t this.container.classList.add('loading');\n\t\t this.search_term = term;\n\t\t this.is_search = true;\n\t\t this.doSearch(this.search_term);\t\t \n\t } else {\t\t \n\t\t input.focus();\t\t \n\t }\n\t \n }", "function updateForSearchVisible() {\n /* Prevent accidental scrolling of the body, prevent page layout jumps */\n let scrolledBodyWidth = document.body.offsetWidth;\n document.body.style.overflow = 'hidden';\n document.body.style.paddingRight = (document.body.offsetWidth - scrolledBodyWidth) + 'px';\n\n document.getElementById('search-input').value = '';\n document.getElementById('search-input').focus();\n document.getElementById('search-results').style.display = 'none';\n document.getElementById('search-notfound').style.display = 'none';\n document.getElementById('search-help').style.display = 'block';\n}", "componentDidUpdate() {\n scrollToComponent(this.results, { offset: 0, align: \"top\", duration: 500, ease: \"out-circ\" });\n }", "function touchmoveForSearchResults(event)\n{\n //console.log('touchmove');\n \n touchobj = event.changedTouches[0]; //reference first touch point for this event\n \n doVerticalDragScrolling(this, touchobj.clientY);\n \n event.preventDefault();\n}", "scroll() {\r\n window.onscroll = () => {\r\n let bottomOfWindow = document.documentElement.scrollTop + window.innerHeight >= (document.documentElement.offsetHeight - 200);\r\n if (bottomOfWindow) {\r\n this.page++\r\n if(this.searchedTitle === \"\"){\r\n this.searchPopular()\r\n } else if(this.genreSelected === \"All\"){\r\n this.searchFilm()\r\n this.searchTv()\r\n } else if(this.genreSelected === \"Films\") {\r\n this.searchFilm()\r\n } else {\r\n this.searchTv()\r\n }\r\n }\r\n };\r\n }", "function onImageSearch(event) {\n event.preventDefault();\n\n pixabayApi.query = searchFormRef.elements.query.value;\n\n clearGallery(galleryListRef);\n pixabayApi.resetPage();\n\n showSearchResult();\n\n searchFormRef.reset();\n}", "function _focusSearch() {\n setTimeout(function() {\n _$search.focus();\n }, CFG.TIME.DELAY);\n }", "function thumbnailFocus(e) {\n const thumbFront = document.querySelector('.thumb-front');\n thumbFront.focus();\n}", "function scrollToCenter(){\n\t\t\t\t\tvar pw = $zoomContain.width();\n\t\t\t\t\tvar ph = $zoomContain.height();\n\t\t\t\t\tvar w = targetImg.offsetWidth;\n\t\t\t\t\tvar h = targetImg.offsetHeight;\n\t\t\t\t\t$zoomContain[ 0 ].scrollLeft = ( w / 2 ) - ( pw / 2 );\n\t\t\t\t\t$zoomContain[ 0 ].scrollTop = ( h / 2 ) - ( ph / 2 );\n\t\t\t\t}", "function scrollToNextPage() {\n gallery_scroller.scrollBy({\n left: gallery_item_size,\n top: 0,\n behavior: 'smooth'\n });\n// updateBtns()\n}", "function scroll() {\n var id = $stateParams.rid;\n if (id && _.find(vm.reviews, ['id', id])) {\n $timeout(function () {\n scrollToReview(id);\n });\n }\n }", "onListScroll() {\n\t\t\tvar n = Util.$('results-container');\n\t\t\tif ( (n.clientHeight + n.scrollTop) >= (n.scrollHeight -50) ) {\n\t\t\t\tthis._pageHandler.nextPage()\n\t\t\t\t\t.then(response => {\n\t\t\t\t\t\tif (response) {\n\t\t\t\t\t\t\tthis.showNextPage(response);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\n\t\t}", "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 }", "function catalogLinkScroll() {\n // Get link wrapper\n var catalogLinkWrapper = $('#edit-name--2');\n // Get horizontal position of currently selected link\n var scrollPosition = $('#edit-name--2--wrapper a.bef-link--selected').position().left;\n // Get current scroll position\n var currentScrollPosition = catalogLinkWrapper.scrollLeft();\n // Get current width of wrapper container\n var containerWidth = catalogLinkWrapper.width();\n // Set new scroll position to half of wrapper width\n var scrollPosition = (scrollPosition + currentScrollPosition) - (containerWidth/2);\n // Set horizontal scroll position to show letter\n $('#edit-name--2').scrollLeft(scrollPosition);\n // Scroll the bar automatically to show that item\n catalogLinkWrapper.animate({'scrollLeft': scrollPosition});\n }", "function touchstartForSearchResults(event)\n{\n //console.log('touchstart');\n \n touchobj = event.changedTouches[0]; //reference *first* touch point\n \n startVerticalDragScrolling(this, touchobj.clientY);\n \n event.preventDefault(); //prevent default tap behavior\n}", "function handleSearchV1() {\n jQuery('.header-v5 .search-button').click(function () {\n jQuery('.header-v5 .search-open').slideDown();\n });\n\n jQuery('.header-v5 .search-close').click(function () {\n jQuery('.header-v5 .search-open').slideUp();\n });\n\n jQuery(window).scroll(function(){\n if(jQuery(this).scrollTop() > 1) jQuery('.header-v5 .search-open').fadeOut('fast');\n });\n }", "function onShowSearchResultPanel() {\n mediator.getView('searchResult');\n }", "function resnap() {\n\t\twebslides.currentSlide.scrollIntoView();\n\t}", "function UpdateScrollThumbs()\n{\n UpdateVerticalScrollVisual();\n UpdateHorizontalScrollVisual();\n}", "function fullscreenBioScrolling() {\r\n\t\t\t\t\t$('.nectar_team_member_overlay .inner-wrap').mousewheel(function (event, delta) {\r\n\t\t\t\t\t\tthis.scrollTop -= (delta * 30);\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function qodeOnWindowScroll() {\n\t qodeInitNewsShortcodesPagination().scroll();\n }", "function busqueda(response, searchText){ \r\n if (response.data.length > 0){ \r\n searchResault.innerHTML = `<input id='textSearch' type='search' placeholder='${searchText}'>` \r\n console.log (response)\r\n let arrayFiltrado = response.data \r\n for (let i =0 ; i<16 ; i++){\r\n let gif = document.createElement(\"img\")\r\n gif.classList.add(\"vacia\")\r\n gif.src = arrayFiltrado[i].images.original.url\r\n searchResault.appendChild(gif)\r\n } \r\n searchResault.classList.remove(\"gifHide\")\r\n searchResault.scrollIntoView()\r\n }\r\n}", "function mkdfCompareHolderScroll(){\n var compareHolderScroll = $('.mkdf-re-compare-holder .mkdf-re-compare-holder-scroll');\n if(compareHolderScroll.length){\n compareHolderScroll.perfectScrollbar({\n wheelSpeed: 0.6,\n suppressScrollX: true\n });\n }\n }", "search(){\n this.data = [];\n this.input = this.$refs.input.value;\n this.$refs.input.value = \"\";\n fetch(\"https://itunes.apple.com/search?limit=6&term=\"+this.input+\"&country=US&kind=song&media=music&entity=musicTrack\")\n .then(res => res.json())\n .then(data => {\n this.data = data.results;\n })\n .catch(err => alert(err));\n this.$refs.scroll.scrollIntoView({\n behavior: 'smooth'\n });\n }", "function showAndScrollToLatestArticles() {\n shownArticlesCount = 0;\n $(\"#articleKeywordCategoryId\").val(\"\"); //get all articles of all categories\n $(\"#latestArticles\").hide(1000);\n $(\"#latestArticles\").html(\"\");\n showLatestArticles();\n $([document.documentElement, document.body]).animate({\n scrollTop: $(\"#latestArticlesSection\").offset().top\n }, 1000);\n}", "function mousedownForSearchResults(event)\n{\n //console.log('mousedown event on scrollable');\n \n global_mouseButtonDown = true; //set global\n \n startVerticalDragScrolling(this, event.clientY);\n \n event.preventDefault(); //prevent default click behaviour (ie. select text or whatever)\n}", "function _thumbnailSlide() {\n\t\tstopSlideshow();\n\n\t\tvar target = {};\n\t\ttarget[rtlpos] = -_getRTLPosition(thumbs.children().eq(thumbindex));\n\t\tthumbs.animate(target, 'fast', 'linear', _updateThumbnailNavigation);\n\n\t\treturn false;\n\t}", "async nextResultsPage() {\n if (this.state.numHits > 10) {\n let newOffset = this.state.searchOffset + 10;\n this.setState({ searchOffset: newOffset });\n\n if (this.state.searchOffset + 10 > this.state.numHits) {\n this.setState({ searchOffset: this.state.numHits - 10 });\n }\n\n const rez = await this.search();\n this.setState({ searchResults: rez });\n }\n }", "doSearch(term){\n \n let self = this;\n let type = 'term';\n this.page = 1; // reset page num\n \n\t let url = `${API.search_api}${API.app_id}${API.posts_per_page}&page=${this.page}&query=${this.search_term}`;\t \n\t \n\t // Search by ID\n\t // allow users to search by photo by prepending id:{photo_id} to search terms\n\t let search_type = term.substring(0, 3);\t \n\t if(search_type === 'id:'){\t\t \n\t\t type = 'id';\n\t\t term = term.replace('id:', '');\n \t url = `${API.photo_api}/${term}${API.app_id}`; \t \n\t }\n\n let input = document.querySelector('#photo-search');\n \n\t fetch(url)\n\t .then((data) => data.json())\n .then(function(data) { \n \n // Term Search\n if(type === 'term'){\n\t \n \t self.total_results = data.total;\n \t \n \t // Check for returned data\n \t self.checkTotalResults(data.results.length);\n \t \n \t // Update Props\n \t self.results = data.results;\n \t self.setState({ results: self.results }); \t \n\t \n\t }\n\t \n\t // Search by photo ID\n\t if(type === 'id' && data){\n \t \n \t // Convert return data to array \t \n \t let photoArray = []; \t \n \t \n \t if(data.errors){ // If error was returned\n\t \t \n\t \t self.total_results = 0; \n\t \t self.checkTotalResults('0');\n\t \t \n\t \t } else { // No errors, display results\n\t\t \t \n\t \t photoArray.push(data);\n\t \t \n\t \t self.total_results = 1; \t \n\t \t self.checkTotalResults('1');\n\t \t \n \t }\n \t \n \t self.results = photoArray;\n \t self.setState({ results: self.results });\n }\n\t \n\t input.classList.remove('searching');\t\n\t \t\t \n\t })\n\t .catch(function(error) {\n console.log(error);\n self.isLoading = false;\n });\n\t\t \n }", "async prevResultsPage() {\n let newOffset = this.state.searchOffset - 10;\n\n if (newOffset < 0) {\n this.setState({ searchOffset: 0 });\n } else {\n this.setState({ searchOffset: newOffset });\n }\n\n const rez = await this.search();\n\n this.setState({ searchResults: rez });\n }", "function scrollToResults() {\n $([document.documentElement, document.body]).animate({\n scrollTop: $(\"#results\").offset().top\n }, 700);\n}", "function initThumbScroll(){\n //console.log(\"initThumbScroll\");\n var trigger = $('.reload_action_left');\n trigger.each(function(i, el){\n $(el).bind('click',function(){\n $('body,html').animate({scrollTop : 0});\n });\n });\n}", "function setupScrollVideoTray() {\n var itemWidth = parseInt($('.video-thumb').css('width'), 10);\n var trayWidth = tray.width();\n var itemsPerSection = Math.round(trayWidth/itemWidth)-1;\n\n $('#ca-container').contentcarousel({scroll:itemsPerSection});\n }", "function runSearch() {\n ps.search()\n .then(function(rsp) {\n if(rsp.stat === \"fail\") {\n ps.showError(rsp);\n }\n else if (rsp.stat === \"ok\") {\n ps.paging = rsp.photos;\n ps.parseSearchResults();\n }\n });\n }", "function onScrollHandle() {\n \n var scrollt = $(document).scrollTop();\n if (scrollt > 50) {\n \t $(\".input\").css(\"padding\", \"10px 0px 10px 10px\");\n }\n else {\n \t$(\".input\").css(\"padding\", \"20px 0px 20px 20px\");\n }\n\n var scrollt = $(document).scrollTop();\n if (scrollt > 50) {\n \t $(\".btn-search\").css(\"top\", \"30px\");\n }\n else {\n \t$(\".btn-search\").css(\"top\", \"40px\");\n }\n\n \n }", "function ScrollPosition() {}", "function loadPhotosBasedOnSearchInput() {\n var tags = searchTextElement.value;\n // Add new page to browser history\n window.history.pushState(null, null, \"?tags=\" + tags);\n loadPhotos(tags);\n }", "function doGeneralImageSearch() {\n\n}", "function scrollToStartHandler() {\n scrollTo({top: 0, behavior: 'smooth'});\n}", "showSearchContainer(e) {\n e.preventDefault();\n this.setState({\n showingSearch: !this.state.showingSearch,\n searchTerm: '',\n searchResults: {items: [], total: 0}\n });\n }", "startSearch() {\n if (!this._isEnabled) {\n return;\n }\n this.showLoading();\n }", "function startVerticalDragScrolling(elementToScroll, eventClientY)\n{\n //console.log('initialise scrolling');\n \n var theStyle = window.getComputedStyle(elementToScroll);\n \n global_scrollDivTop = parseInt(theStyle.top); //get 'top' value of box\n global_scrollStartY = parseInt(eventClientY); // get x coord of touch point\n \n global_scrollDivHeight = parseInt(theStyle.height); //get 'height' value of box\n \n //work out height of #search-results versus height of results\n //pane (which is .japxlate_app.height - #search-form.height)\n global_scrollWindowHeight =\n parseInt(\n window.getComputedStyle(\n document.querySelector('.japxlate_app')\n ).height, 10) -\n \n parseInt(\n window.getComputedStyle(\n document.querySelector('#search-form')\n ).height);\n}", "function scrollToShowMe(oid) {\n obj = document.getElementById(oid);\n if (obj != null) {\n obj.scrollIntoView(true);\n obj.focus();\n }\n}", "_ensureVisible(scrollTarget) {\n const that = this;\n\n if (that._minimized) {\n return;\n }\n\n const mode = that.mode;\n let parent, scrollButtons;\n\n if (mode !== 'tree' && scrollTarget.parentElement !== that.$.mainContainer) {\n if (scrollTarget.dropDownHeight === null) {\n return;\n }\n\n parent = scrollTarget.parentElement;\n scrollButtons = [parent.container.children[0], parent.container.children[2]];\n }\n else {\n parent = that.$.mainContainer;\n scrollButtons = [that.$.scrollButtonNear, that.$.scrollButtonFar];\n }\n\n if (parent === that.$.mainContainer &&\n (that.dropDownAppendTo === null && that.mode !== 'tree' && !that.$mainContainer.hasClass('simple') ||\n !parent.$.hasClass('scroll-buttons-shown') && that.overflow !== 'hidden')) {\n return;\n }\n\n const parentBoundingRect = parent.getBoundingClientRect(),\n scrollTargetBoundingRect = scrollTarget.getBoundingClientRect();\n\n if (mode === 'tree') {\n that._ensureVisibleTreeMode(scrollTarget, scrollTargetBoundingRect, parent, parentBoundingRect, 0);\n return;\n }\n\n function setTargetScrollValue(scrollValue, scrollDimension, dimension) {\n let targetScrollValue = scrollTarget.firstElementChild[dimension] + scrollValue - parent[dimension];\n\n if (targetScrollValue < 0) {\n targetScrollValue = scrollValue;\n }\n\n parent['scroll' + scrollDimension] = targetScrollValue;\n }\n\n function scrollTo(scrollDimension, dimension) {\n let scrollValue = scrollTarget['offset' + scrollDimension],\n oldParentDimension = parent[dimension];\n\n if (scrollDimension === 'Top' && parent !== that.$.mainContainer && !scrollButtons[0].$.hasClass('jqx-hidden')) {\n scrollValue -= scrollButtons[0][dimension];\n }\n\n setTargetScrollValue(scrollValue, scrollDimension, dimension);\n that._updateScrollButtonVisibility(parent, scrollDimension === 'Left', scrollButtons);\n\n if (oldParentDimension !== parent[dimension]) {\n setTargetScrollValue(scrollValue, scrollDimension, dimension);\n }\n }\n\n if ((parent === that.$.mainContainer && mode === 'horizontal') &&\n (parentBoundingRect.left > scrollTargetBoundingRect.left || parentBoundingRect.right < scrollTargetBoundingRect.right)) {\n scrollTo('Left', 'offsetWidth');\n }\n else if (parentBoundingRect.top > scrollTargetBoundingRect.top || parentBoundingRect.bottom < scrollTargetBoundingRect.bottom) {\n scrollTo('Top', 'offsetHeight');\n }\n }", "listNext() {\n document.body.scroll({ top: 0, left: 0, behavior: 'smooth' });\n this.listPage++;\n if (this.searchInput) {\n var input = document.getElementById(\"searchInput\").value;\n if (input.length != 0) {\n this.main.class().filter(input, this.listPage, this.listOrder, this.listDesc);\n return;\n }\n }\n this.main.class().list(this.listPage, this.listOrder, this.listDesc);\n }", "function doScroll(to) {\n autoScrolled = true;\n\n if (to > -1) {\n var pos = $suggestionBox.find('li:eq(' + to + ')').position().top -\n $suggestionBox.find('li:eq(0)').position().top;\n }\n\n // find scroll position at to and set scroll bars to it\n var scrollTo = (to > -1) ? pos : 0;\n $suggestionBox.scrollTop(scrollTo);\n }", "function scrolldiv() {\n window.scroll(0, findPosition(matches[i]));\n }", "function updateSetSearchPic() {\n if (!isSearchPic) {\n setIsSearchPic(true);\n }\n setIsUploadPic(false);\n }", "_scrollSpy() {\n const currentScrollPosition = scrollPosition();\n if (currentScrollPosition.top > this.props.scrollStart) {\n if (!this.state.isVisible) {\n this.setState({ isVisible: true });\n }\n } else {\n if (this.state.isVisible) {\n this.setState({ isVisible: false });\n }\n }\n }", "function resetView(type)\n{\n //If we want to whow the picture horizontally\n if(type==\"List\")\n {\n //Remove the overflow and set the width to 300px - the width of the pictures\n $('#wrapper').css('overflow','visible');\n $('#content').css('width','300px');\n\n //remove the currently displayed images\n $('img').remove();\n var contentDiv = document.getElementById('content');\n\n //Display the 4 images of the search\n for (var i = 0; i < 4; i++) {\n var result = results[i];\n var newImg = document.createElement('img');\n\n //get the source of the image\n newImg.src=result.unescapedUrl;\n newImg.width=300;\n newImg.height=200;\n \n //Add the image to the div\n contentDiv.appendChild(newImg);\n }\n\n //Show the google brand\n google.search.Search.getBranding('branding');\n }\n \n //If we want to show the images vertically\n else if (type==\"Scroll\")\n {\n //Set the overflow to scroll and the width to 4*width of an image\n $('#wrapper').css('overflow','scroll');\n $('#content').css('width','1200px');\n\n //Remove and display the images in the same way as above\n $('img').remove();\n var contentDiv = document.getElementById('content');\n results = imageSearch.results;\n for (var i = 0; i < 4; i++) {\n var result = results[i];\n var newImg = document.createElement('img');\n $('img').css('display','inline');\n newImg.src=result.unescapedUrl;\n newImg.width=300;\n newImg.height=200;\n \n contentDiv.appendChild(newImg);\n }\n google.search.Search.getBranding('branding');\n}\n }", "function scroll() {\n var myElement = $(\"#heede_wrapper\");\n\n var interactiveWatcher = scrollMonitor.create(myElement, {\n top: -RH,\n bottom: -0.5 * RH\n });\n\n interactiveWatcher.enterViewport(function() {\n setTimeout(function(){\n if (playing === false) {\n playing = true;\n $(\"#play\").addClass(\"active\");\n // console.log(\"playing on scroll\");\n play();\n };\n }, 3000);\n\n });\n interactiveWatcher.exitViewport(function() {\n playing = false;\n $(\"#play\").removeClass(\"active\");\n play();\n });\n }", "function updateScroll(){if(!elements.li[0])return;var height=elements.li[0].offsetHeight,top=height*ctrl.index,bot=top+height,hgt=elements.scroller.clientHeight,scrollTop=elements.scroller.scrollTop;if(top<scrollTop){scrollTo(top);}else if(bot>scrollTop+hgt){scrollTo(bot-hgt);}}", "function showHighlightImage(hl) {\n hl.jqImg.removeClass('hidden');\n var seekBarBoundingRect = $seekBar[0].getBoundingClientRect();\n var seekBarWidth = $seekBar.width();\n var controlBarBoundingRect = $controlBar[0].getBoundingClientRect();\n var offset = seekBarBoundingRect.left - controlBarBoundingRect.left;\n hl.jqImg.css('left', (hl.position / videoData.duration) * seekBarWidth + offset - hl.jqImg.width() / 2);\n hl.jqImg.css('top', 0 - hl.jqImg.height() - 5);\n }", "function showOppSearchedArea(target) {\n if (!window.mapImg) {\n window.mapImg = searchGrid.grabImageData();\n var area = $(target).text().substr(5, 2);\n if (area) searchGrid.drawOppSearchArea(area);\n }\n}", "listPrev() {\n document.body.scroll({ top: 0, left: 0, behavior: 'smooth' });\n this.listPage--;\n if (this.listPage < 1) this.listPage = 1;\n if (this.searchInput) {\n var input = document.getElementById(\"searchInput\").value;\n if (input.length != 0) {\n this.main.class().filter(input, this.listPage, this.listOrder, this.listDesc);\n return;\n }\n }\n this.main.class().list(this.listPage, this.listOrder, this.listDesc);\n }", "function displayNewSearchResults(event) {\n let searchTerm = event.target.value;\n let currentSearch = giphy[\"query\"][\"q\"];\n if (searchTerm !== currentSearch && searchTerm !== \"\") {\n giphy[\"query\"][\"q\"] = searchTerm;\n updateOffset(true);\n update();\n }\n}", "function scroll_check(ev,tag){\n\n\tdrag_manager.scroll_value = tag.scrollTop;\n\n\tfolder_positions_find();\n\n}", "function _forwardThumbnailSlide() {\n\t\tif (thumbindex >= 0 && thumbindex+1 < anchors.size()) {\n\t\t\tthumbindex++;\n\t\t\t_thumbnailSlide();\n\t\t}\n\t}", "onKeyDownInternal() {\n // tslint:disable-next-line:max-line-length\n let inputElement = document.getElementById(this.viewer.owner.containerId + '_option_search_text_box');\n inputElement.blur();\n let text = inputElement.value;\n if (text === '') {\n return;\n }\n if (text.length >= 1 && this.searchIcon.classList.contains('e-de-op-search-icon')) {\n this.searchIcon.classList.add('e-de-op-search-close-icon');\n this.searchIcon.classList.remove('e-de-op-search-icon');\n }\n let height = this.isOptionsPane ? 215 : 292;\n let resultsContainerHeight = this.viewer.owner.getDocumentEditorElement().offsetHeight - height;\n this.clearSearchResultItems();\n this.viewer.owner.searchModule.clearSearchHighlight();\n let pattern = this.viewer.owner.searchModule.textSearch.stringToRegex(text, this.findOption);\n let endSelection = this.viewer.selection.end;\n let index = endSelection.getHierarchicalIndexInternal();\n this.results = this.viewer.owner.searchModule.textSearch.findAll(pattern, this.findOption, index);\n let results = this.results;\n if (isNullOrUndefined(results)) {\n this.viewer.renderVisiblePages();\n }\n if (results != null && results.length > 0) {\n if ((this.focusedElement.indexOf(this.navigateToPreviousResult) === -1) && this.isOptionsPane) {\n this.focusedElement.push(this.navigateToPreviousResult);\n }\n if ((this.focusedElement.indexOf(this.navigateToNextResult) === -1) && this.isOptionsPane) {\n this.focusedElement.push(this.navigateToNextResult);\n }\n this.viewer.owner.searchModule.navigate(this.results.innerList[this.results.currentIndex]);\n this.viewer.owner.searchModule.highlight(results);\n this.viewer.owner.searchModule.addFindResultView(results);\n // if (this.isOptionsPane) {\n this.resultsListBlock.style.display = 'block';\n this.resultsListBlock.style.height = resultsContainerHeight + 'px';\n this.resultContainer.style.display = 'block';\n let list = this.viewer.owner.findResultsList;\n let text = '';\n this.clearFocusElement();\n this.resultsListBlock.innerHTML = '';\n for (let i = 0; i < list.length; i++) {\n text += list[i];\n }\n this.resultsListBlock.innerHTML = text;\n for (let i = 0; i < this.resultsListBlock.children.length; i++) {\n this.focusedElement.push(this.resultsListBlock.children[i]);\n }\n let lists = this.resultsListBlock.children;\n let currentIndex = this.results.currentIndex;\n // tslint:disable-next-line:max-line-length\n this.messageDiv.innerHTML = this.localeValue.getConstant('Result') + ' ' + (currentIndex + 1) + ' ' + this.localeValue.getConstant('of') + ' ' + this.resultsListBlock.children.length;\n let listElement = this.resultsListBlock.children[currentIndex];\n if (listElement.classList.contains('e-de-search-result-item')) {\n listElement.classList.remove('e-de-search-result-item');\n listElement.classList.add('e-de-search-result-hglt');\n listElement.children[0].classList.add('e-de-op-search-word-text');\n }\n this.navigateToNextResult.focus();\n this.focusedIndex = 6;\n this.getMessageDivHeight();\n // } else {\n //this.focusedIndex = 4;\n // }\n }\n else {\n this.messageDiv.innerHTML = this.localeValue.getConstant('No matches');\n this.resultContainer.style.display = 'block';\n this.resultsListBlock.style.display = 'none';\n this.clearFocusElement();\n this.resultsListBlock.innerHTML = '';\n }\n }", "function startslides() {\n\tif(imgSearch) {\n\t\timgSearch.startSlides();\n\t}\n}", "function startSearch(play) {\n $(\"#status\").html(\"\");\n bwtView.grid.hideRanks();\n var next = query[queryPosition];\n bwtView.query.setActive(queryPosition);\n range = bwtIndex.start(next);\n if (range === null) {\n searchFailed();\n }else {\n queryPosition = queryPosition - 1;\n if (play)\n bwtView.grid.setRange(range.start, range.end, delayedAdvance);\n else\n bwtView.grid.setRange(range.start, range.end);\n }\n}", "async scrollIntoView() {\n await this.assertConnectedElement();\n await this.evaluate(async (element) => {\n element.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'instant',\n });\n });\n }", "function containScroll() {\n\n var targetX = startX + deltaX;\n var targetY = startY + deltaY;\n\n if (targetY < 0)\n deltaY += -targetY;\n else {\n var containerVisibleHeight = focus ? focus.clientHeight : root.innerHeight;\n var containerRealHeight = focus ? focus.scrollHeight : document.body.scrollHeight;\n if (targetY + containerVisibleHeight > containerRealHeight)\n deltaY -= targetY + containerVisibleHeight - containerRealHeight;\n }\n\n if (targetX < 0)\n deltaX += -targetX;\n else {\n var containerVisibleWidth = focus ? focus.clientWidth : root.innerWidth;\n var containerRealWidth = focus ? focus.scrollWidth : document.body.scrollWidth;\n if (targetX + containerVisibleWidth > containerRealWidth)\n deltaX -= targetX + containerVisibleWidth - containerRealWidth;\n }\n\n }", "scrollTo() {\n window.scroll({\n top: this.getCurrSlide().offsetTop,\n left: 0,\n behavior: 'smooth'\n })\n }", "function search(size){\n var q = _.map(size, function(d){ return Math.ceil(d / 10) * 10;});\n var result = _(grid).filter({'w':q[0], 'h':q[1]}).value();\n\n if(result.length){\n appendResult(result[0]);\n searchTry=0;\n }else if (searchTry < 100){\n // try a new search\n searchTry++;\n var newSize = [ Math.abs(size[0]) - 10, Math.abs(size[1] + 10)];\n search(newSize);\n }else{\n appendResult(_(grid).shuffle().first()); // get random part\n }\n }" ]
[ "0.6421427", "0.6204483", "0.6203048", "0.6193864", "0.6105691", "0.60230446", "0.5922342", "0.5897609", "0.58785486", "0.5838355", "0.58358186", "0.5810879", "0.5798874", "0.5772602", "0.5772602", "0.56912094", "0.5662592", "0.56622535", "0.5646828", "0.56360835", "0.563576", "0.5629378", "0.5624748", "0.5600705", "0.55832005", "0.55674803", "0.54963845", "0.5492895", "0.5478536", "0.5456841", "0.54546374", "0.54377896", "0.5428177", "0.5428039", "0.5376889", "0.53726983", "0.5352336", "0.5346297", "0.53322244", "0.53306174", "0.53225476", "0.5290592", "0.52880067", "0.52863663", "0.52850354", "0.52769065", "0.52717066", "0.5271014", "0.5261024", "0.52588344", "0.5245687", "0.5232663", "0.52325577", "0.52260107", "0.52220607", "0.5220833", "0.52166724", "0.5208363", "0.5203645", "0.5200712", "0.5195057", "0.5176584", "0.5172436", "0.5169096", "0.5164457", "0.5157422", "0.5156597", "0.5147583", "0.51417226", "0.51246786", "0.5123718", "0.51228327", "0.51160514", "0.5114971", "0.51117504", "0.51106197", "0.51078486", "0.5105545", "0.50970155", "0.50853324", "0.5079909", "0.507848", "0.5072586", "0.5071229", "0.5070545", "0.50705373", "0.506915", "0.50648886", "0.5061803", "0.50617224", "0.5060528", "0.50524944", "0.505135", "0.5041543", "0.5040145", "0.50388587", "0.5033419", "0.5032358", "0.50318456", "0.50283974" ]
0.8229058
0
========================== Load Modules End ==============================================
function glogin(loginDetail) { return superAdminService.glogin(loginDetail) .then(function (result) { let token =result.token; if(token == null){ token = randomstring.generate(5); } let str = result.email + ":" + result.id + ":" + result.role + ":" + token; //Encoded key result.key = base64.encode(str); return result; }).catch(function (err) { resHndlr.sendError(res, err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_loadModules() {\n const modules = includeAll({\n dirname: this.loadPath,\n filter: this.filter\n });\n\n Object.keys(modules).forEach(module => {\n const moduleName = module.toLowerCase()\n .replace(\"_\", \"\")\n .replace(\"-\", \"\")\n .replace(this.type, \"\");\n\n const key = inflect.singularize(moduleName);\n\n if (!modules[key]) {\n modules[key] = modules[module];\n\n delete modules[module];\n }\n });\n\n return modules;\n }", "[LOAD_MODULES](state, modules) {\n state.modules = modules;\n }", "function loadmodules(modules){\n\t\tfor(i in modules){\n\t\t\tload(\"fx:\"+modules[i]+\".js\");\n\t\t}\n\t}", "function _onModulesLoaded() {\n\t checkModules.call(this, projectGlobal.modules, onAllInit);\n\t}", "function initModules() {\n model_store = new Soapify.model_store();\n vc_navbar = new Soapify.viewcontroller_navbar();\n vc_info = new Soapify.viewcontroller_info();\n vc_map = new Soapify.viewcontroller_map(model_store);\n vc_contact = new Soapify.viewcontroller_contact();\n }", "load (context, actions) {\n console.log(`Loading module ${this.name} finished`)\n }", "initModules() {\n for (let i = 0; i < this.modules.length; i++) {\n this.modules[i].init(this);\n }\n }", "function load(modules) {\n\tmodules.keys().forEach(function(path){\n\t\tmodules(path);\n\t});\n}", "function startLoad()\n\t{\n\t\t\tif(startedLoading)\n\t\t\t{\n\t\t\t\tlogger.debug('ND-node startLoad called more than once');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstartedLoading=true;\n\n\t\t\tcoreModules.forEach(function (moduleName){\n\t\t\t\tmoduleLoaders.push(moduleLoader.getLoader(getCoreModulePath(moduleName)));\n\t\t\t});\n\t\t\tmoduleLoaders.push(moduleLoader.getLoader({instance:logger,moduleName:'$logger'}));\n\t\t\tmoduleLoaders.push(moduleLoader.getLoader({instance:newBackendInstance,moduleName:'$backend'}));\n\n //var modules=getModulesAndDependencies(modulePaths);\n moduleLoaders=moduleLoader.getSortedByDepends(moduleLoaders);\n\n\t\t\tvar modulePromises={};\n\n //we will augment each module in modules with .instance - a member containg a promise returning its instance\n moduleLoaders.forEach(\n \t\t\tfunction(moduleLoader)\n \t\t\t{\n\t\t\t\t\t\t//we init each module instance promise then create it when all dependcies are ready\n\t\t\t\t\t\tmodulePromises[moduleLoader.name]=new BBPromise(function (resolve){\n\t\t var args=\n\t\t _.map(moduleLoader.dependencies,\n\t\t function(name){ return modulePromises[name];}\n\t\t );//concat all dependencies\n\n\t\t\t\t\t\t\t\t\tresolve(BBPromise.all(args).then(//all dependencies have ben created - create this module now\n\t\t\t function(argValues)\n\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\tlogger.debug('Creating an instance of '+moduleLoader.name);\n\t\t\t\t\t\t\t\t\t\t\tvar factoryRet=moduleLoader.factory.apply(newBackendInstance,argValues);\n\t\t\t\t\t\t\t\t\t\t\tif(!factoryRet)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tloadedModules[moduleLoader.name]={};\n\t\t\t\t\t\t\t\t\t\t\t\treturn BBPromise.resolve({});\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn BBPromise.resolve(factoryRet).then(function(instResolved)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tloadedModules[moduleLoader.name]=instResolved;\n\t\t\t\t\t\t\t\t\t\t\t\treturn instResolved;\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t }\n\t\t\t ));\n\t\t\t\t\t\t});\n \t\t\t}\n\t\t\t);\n\n //wait for all loading to complete and update status\n return BBPromise.all(_.values(modulePromises)).then(\n function()\n {\n logger.debug('finished loading modules');\n finishedLoading=true;\n }\n );\n\n\t}", "function preloadModules (oData) {\n\n\t\t// prealod the modules from the live-edited src\n\t\tsap.ui.require.preload(oData.src);\n\n\t\t// require the init module\n\t\tsap.ui.require([oData.moduleNameToRequire]);\n\t}", "loadModules() {\n const modulePath = this._urlParams.get('modulePath');\n const filePath = this._urlParams.get('filePath');\n let partitions = this._urlParams.get('partition');\n let split = parseInt(this._urlParams.get('split'), 10);\n\n split = isNaN(split) ? 1 : split;\n\n if (partitions === undefined) {\n partitions = [1];\n } else if (!Array.isArray(partitions)) {\n partitions = [partitions];\n }\n\n super.loadModules();\n\n if (modulePath || filePath) {\n this._testModules = filterTestModules(\n this._testModules,\n modulePath,\n filePath\n );\n }\n\n this._testModules = splitTestModules(this._testModules, split, partitions);\n this._testModules.forEach((moduleName) => {\n super.require(moduleName);\n super.unsee(moduleName);\n });\n }", "function initialize_modules() {\n let modules = [];\n /* read all modules from modules directory */\n let files = fs.readdirSync(\"./modules\");\n for (file of files) {\n const mod = require(\"./modules/\" + file);\n for (event in mod.hooks) {\n client.on(event, mod.hooks[event]);\n }\n modules.push(mod);\n }\n bot.modules = modules;\n}", "function load()\n{\n setupParts();\n\tbgn();\n}", "function load () {\n const modules = registerModules(api)\n\n api.modules = modules\n\n return Promise.resolve(modules)\n }", "load(){\n\n\t\tfor(var moduleName in this.ControllerManifest){\n\n\t\t\tLog.info(\"Loading app module {}\", moduleName);\n\n\t\t\tvar thisModuleManifest = this.ControllerManifest[moduleName];\n\t\t\t\n\t\t\tvar moduleFileName = thisModuleManifest.file || $.concat(\".\", moduleName + \"Module\", \"js\");\n\t\t\tvar ModuleObject = false;\n\n\t\t\ttry{\n\t\t\t\tModuleObject = require(__CONFIG.paths.modules + \"/\" + moduleFileName);\n\t\t\t}catch(e){\n\t\t\t\tLog.error(\"Can't include file of module {}\", moduleName, e);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._validatePayloadSchema(moduleName, this.ControllerManifest[moduleName].methods);\n\t\t\tthis.Prototypes[moduleName.toLowerCase()] = {\n\t\t\t\tobject : ModuleObject,\n\t\t\t\tmanifest : this.ControllerManifest[moduleName]\n\t\t\t}\t\t\t\n\t\t}\n\t\tLog.info(\"__________________________ INITIALISED. APP RUNNING. __________________________ \");\n\t}", "function Pop3ModuleLoader() {\n try {\n this.loadModule();\n } catch (e) {\n Cu.reportError(e);\n }\n}", "function Module(){}", "function Module(){}", "registerModules() {\n const { modules } = this.options;\n\n if (Object.keys(modules).length) {\n Object.keys(modules).forEach((moduleName) => {\n const module = modules[moduleName];\n const hasPromisse = typeof module.then === 'function';\n\n // Loaded module\n if (!hasPromisse) {\n this.registerModuleRoutes(module.routes);\n this.registerModuleStore(moduleName, module.store);\n\n return;\n }\n\n // Load lazy modules\n module.then((moduleLoaded) => {\n const { routes, store } = moduleLoaded.default;\n\n this.registerModuleRoutes(routes);\n this.registerModuleStore(moduleName, store);\n });\n });\n }\n }", "function load()\n{\n\tsetupParts();\n\t\n\tmain();\n}", "function allModulesLoaded() {\n this.flexipRef.imageLoadSource(config.image);\n}", "async loadModule() {\n const { state, actx } = this;\n try {\n await actx.audioWorklet.addModule(`worklet/${state.processor.module}.js`);\n this.setState({ moduleLoaded: true, status: null });\n console.log(`loaded module ${state.processor.module}`);\n } catch (e) {\n this.setState({ moduleLoaded: false });\n console.log(`Failed to load module ${state.processor.module}`);\n }\n }", "function LoadModules()\n{\n bundle = srGetStrBundle(\"chrome://pippki/locale/pippki.properties\");\n secmoddb = Components.classes[nsPKCS11ModuleDB].getService(nsIPKCS11ModuleDB);\n window.crypto.enableSmartCardEvents = true;\n document.addEventListener(\"smartcard-insert\", onSmartCardChange, false);\n document.addEventListener(\"smartcard-remove\", onSmartCardChange, false);\n\n RefreshDeviceList();\n}", "function loadModules (server, dbConnection, callback) {\n\tvar modules = require('./user/api')\n\n\t//this will run the init function in the user/api.js\n\tmodules.init(server, dbConnection)\n\n\tcallback(null, { status: 'success' })\n}", "function drupalgap_load_modules() {\n try {\n var module_types = ['contrib', 'custom'];\n // We only need to load contrib and custom modules because core modules are\n // already included in the binary.\n $.each(module_types, function(index, bundle) {\n // Let's be nice and try to load any old drupalgap.modules declarations\n // in developers settings.js files for a while, but throw a warning to\n // encourage them to update. This code can be removed after a few\n // releases to help developers get caught up without angering them.\n if (\n drupalgap.modules &&\n drupalgap.modules[bundle] &&\n drupalgap.modules[bundle].length != 0\n ) {\n $.each(drupalgap.modules[bundle], function(index, module) {\n if (module.name) {\n var msg = 'WARNING: The module \"' + module.name + '\" defined ' +\n 'in settings.js needs to be added to ' +\n 'Drupal.modules[\\'' + bundle + '\\'] instead! See ' +\n 'default.settings.js for examples on the new syntax!';\n console.log(msg);\n Drupal.modules[bundle][module.name] = module;\n }\n });\n }\n $.each(Drupal.modules[bundle], function(index, module) {\n // Determine module directory.\n dir = drupalgap_modules_get_bundle_directory(bundle);\n module_base_path = dir + '/' + module.name;\n // Add module .js file to array of paths to load.\n module_path = module_base_path + '/' + module.name + '.js';\n modules_paths = [module_path];\n // If there are any includes with this module, add them to the\n // list of paths to include.\n if (module.includes != null && module.includes.length != 0) {\n $.each(module.includes, function(include_index, include_object) {\n modules_paths.push(\n module_base_path + '/' + include_object.name + '.js'\n );\n });\n }\n // Now load all the paths for this module.\n $.each(modules_paths,\n function(modules_paths_index, modules_paths_object) {\n jQuery.ajax({\n async: false,\n type: 'GET',\n url: modules_paths_object,\n data: null,\n success: function() {\n //console.log('Loaded module: ' + modules_paths_object);\n },\n dataType: 'script',\n error: function(xhr, textStatus, errorThrown) {\n alert('Failed to load module! (' + module.name + ')');\n }\n });\n }\n );\n });\n });\n // Now invoke hook_install on all modules, including core.\n module_invoke_all('install');\n }\n catch (error) { console.log('drupalgap_load_modules - ' + error); }\n}", "function moduleDidStartLoad() {\n appendToEventLog('Begin module loading');\n}", "loadGlobals() {\n // TODO: Make Private\n log('Loading Global Commands...');\n this.loadDirectory(path.join(__dirname, 'global/commands'), true);\n log('Loading Global Plugins...');\n this.loadDirectory(path.join(__dirname, 'global/plugins'), true);\n }", "function loadModules(modulesToLoad) { // 4416\n assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array'); // 4417\n var runBlocks = [], moduleFn; // 4418\n forEach(modulesToLoad, function(module) { // 4419\n if (loadedModules.get(module)) return; // 4420\n loadedModules.put(module, true); // 4421\n // 4422\n function runInvokeQueue(queue) { // 4423\n var i, ii; // 4424\n for (i = 0, ii = queue.length; i < ii; i++) { // 4425\n var invokeArgs = queue[i], // 4426\n provider = providerInjector.get(invokeArgs[0]); // 4427\n // 4428\n provider[invokeArgs[1]].apply(provider, invokeArgs[2]); // 4429\n } // 4430\n } // 4431\n // 4432\n try { // 4433\n if (isString(module)) { // 4434\n moduleFn = angularModule(module); // 4435\n runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); // 4436\n runInvokeQueue(moduleFn._invokeQueue); // 4437\n runInvokeQueue(moduleFn._configBlocks); // 4438\n } else if (isFunction(module)) { // 4439\n runBlocks.push(providerInjector.invoke(module)); // 4440\n } else if (isArray(module)) { // 4441\n runBlocks.push(providerInjector.invoke(module)); // 4442\n } else { // 4443\n assertArgFn(module, 'module'); // 4444\n } // 4445\n } catch (e) { // 4446\n if (isArray(module)) { // 4447\n module = module[module.length - 1]; // 4448\n } // 4449\n if (e.message && e.stack && e.stack.indexOf(e.message) == -1) { // 4450\n // Safari & FF's stack traces don't contain error.message content // 4451\n // unlike those of Chrome and IE // 4452\n // So if stack doesn't contain message, we create a new string that contains both. // 4453\n // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. // 4454\n /* jshint -W022 */ // 4455\n e = e.message + '\\n' + e.stack; // 4456\n } // 4457\n throw $injectorMinErr('modulerr', \"Failed to instantiate module {0} due to:\\n{1}\", // 4458\n module, e.stack || e.message || e); // 4459\n } // 4460\n }); // 4461\n return runBlocks; // 4462\n } // 4463", "function initModules() {\n\n /**\n * Instantiate moduleDispatcher to init Modules\n * @type {moduleDispatcher}\n */\n new moduleDispatcher({\n Library : codex\n });\n\n /**\n * CodeX Special\n *\n * Availiable options:\n * position {String} (optional) — toolbar position on screen\n * 'top-left', 'bottom-right', 'bottom-left', 'top-right'\n * blockId {String} (optional) — toolbar wrapper\n * lang {String} (optional) — language 'ru' or 'en'. (default: 'ru')\n */\n codex.special.init({\n blockId: 'js-contrast-version-holder'\n });\n\n /**\n * Stylize custom checkboxes\n */\n codex.checkboxes.init();\n\n /**\n * Init approval buttons\n */\n codex.content.approvalButtons.init();\n\n /**\n * Enable textarea autoresizer\n */\n codex.autoresizeTextarea.init();\n\n /**\n * Activate scroll-up button\n */\n codex.scrollUp.init('js-layout-holder');\n\n /**\n * Client is ready\n */\n codex.core.log('Initialized', 'CodeX', 'info');\n\n /**\n * Initiate branding preload\n */\n codex.branding.init();\n\n /**\n * Initiate pages sharing\n */\n codex.sharer.init();\n\n }", "function LoadModules(module)\n{\n\t// Exclude hidden folders\n\tif (module.charAt(0) != '.')\n\t{\n\t\t// We don't want to include ourselves again\n\t\tif (module != 'globalise')\n\t\t{\n\t\t\t// Just double check it doesn't already exist\n\t\t\tif (typeof global[module] == 'undefined')\n\t\t\t{\n\t\t\t\t// Require the module and load what it\n\t\t\t\t// exports into the global scope\n\t\t\t\tglobal[module] = require(module);\n\t\t\t}\n\t\t}\n\t}\n}", "async loadLegacyModule(moduleInfo) {\n if (!moduleInfo) {\n if (this.config.debug) console.error('[OWD] Module info is not valid.')\n\n return false\n }\n\n // check dependencies\n if (!this.areDependenciesSatisfied(moduleInfo.dependencies)) {\n if (this.config.debug) console.error(\n `Dependencies of ${moduleInfo.name} are not satisfied.\\n` +\n JSON.stringify(moduleInfo.dependencies)\n )\n\n return false\n }\n\n // load all window components\n if (Array.isArray(moduleInfo.windows)) {\n this.registerModuleComponentWindows(moduleInfo, moduleInfo)\n }\n\n // register store to Vuex\n if (moduleInfo.store) {\n // load src/modules/<module-name>/store.js\n const moduleStore = loadModuleFileStore(moduleInfo)\n // load config/<module-name>/config.json\n const moduleStoreConfig = loadModuleFileStoreConfig(moduleInfo)\n\n this.registerLegacyModuleStore(moduleInfo, moduleStore, moduleStoreConfig)\n }\n\n // register commands to OWD global terminal commands\n if (moduleInfo.commands) {\n // load src/modules/<module-name>/commands.js\n const commandsLoader = loadModuleFileCommands(moduleInfo)\n\n if (commandsLoader) {\n // initialize commands\n const moduleCommands = commandsLoader({\n store: this.store,\n terminal: this.terminal\n })\n\n this.registerLegacyModuleCommands(moduleCommands)\n }\n }\n }", "loadDependencies(){\n\n }", "function loadMyModules(){\n var module = $('#' + appendModuleOrder);\n\n // APPEND PARENT DIVS\n $('.container').append('<section id=\"' + appendModuleOrder + '\" class=\"module ' + appendModuleName + ' posX-' + myModulePosX + ' ' + 'posY-' + myModulePosY + ' ' + 'col-' + myModuleCol + ' ' + 'row-' + myModuleRow + ' ' + appendModuleHighlight + '\"></section>');\n\n // IF MODULE EXISTS RUN TEXT FUNCTION TO APPEND TEXT\n if($('#' + appendModuleOrder).length) {\n appendText();\n\n // IF MODULE H1 TEXT EXISTS RUN MEDIA FUNCTION\n if($('#' + appendModuleOrder).find('h1').length) {\n myMediaFunction();\n\n // IF MEDIA FUNCTION IS FINSIHED RUN RE-ORDER function\n if(p = true) {\n window[appendModuleName]();\n } else {\n alert('Please refresh your page');\n }\n\n } else {\n alert('Please refresh your page');\n }\n } else {\n alert('Please refresh your page');\n }\n\n\n }", "function initializeModules()\n{\n var i = 0;\n var len = ws_modules.length;\n var context =\n {\n server : server,\n require : require\n };\n for(i = 0; i < len; i++)\n {\n \tws_modules[i].init(context, config);\n }\n}", "constructor() {\n super();\n\n this.generateModules();\n }", "initModulesDynamic() {\n if (this.isDynamicInitialized) {\n return;\n }\n for (let i = 0; i < this.modules.length; i++) {\n this.modules[i].initDynamic(this);\n }\n this.isDynamicInitialized = true;\n }", "loadAllModules(ids) {\n return Promise.all(\n ids.map(id => this.loadModule(id))\n );\n }", "function init_modules() {\n $('.placeholder:not(.initialised)').each(function() {\n $(this).addClass('initialised');\n var delay = $(this).data('delay');\n if (delay === undefined) {\n get_module($(this).data('module'), {\n poll: $(this).data('poll')\n });\n } else {\n var module = $(this).data('module');\n var poll = $(this).data('poll');\n setTimeout(function() {\n get_module(module, {\n poll: poll\n });\n }, delay * 1000);\n }\n });\n }", "function load() {\n\t\n\t//If ModuleCount is located within localstorage, do the following, ifelse, set the number of modules to zero (ie empty)\n\tif ('ModuleCount' in localStorage) {\n \t\n var numberOfModule = localStorage.getItem('ModuleCount');\n countOfModules = numberOfModule;\n\t} else {\n \tvar numberOfModule = 0;\n\t}\n\tvar counterr = 1;\n\n\t//Call the appendModule function with the module name. This is itirated through depending on how many modules are in local storage.\n\tfor(i = 0; i < numberOfModule; i++) {\n\tvar Module_Name = localStorage.getItem(\"Module\"+counterr);\n\tcounterr++;\n\tappendModule(Module_Name);\n\tconsole.log(\"Found Module : \" + Module_Name);\n\t}\n\n\tconsole.log(\"Number of Modules in local storage \" + countOfModules);\n\n}", "loadAll() {\n\tlet rooms = require(\"./rooms/*.js\", { mode: 'list' });\n\tfor (let i of rooms) {\n\t console.log(\"room-loader: adding room \"+i.module);\n\t this.add(i.module);\n\t}\n }", "loadModulesTasks () {\n let self = this\n\n // get all active modules\n self.api.modules.modulesPaths.forEach(modulePath => {\n // build the task folder path for the current module\n let tasksFolder = `${modulePath}/tasks`\n\n // load task files\n this.api.utils.recursiveDirectoryGlob(tasksFolder).forEach(f => self.loadFile(f))\n })\n }", "async registerModules() {\n const { modules } = this.options;\n\n for (let index = 0; index < Object.keys(modules).length; index += 1) {\n const name = Object.keys(modules)[index];\n const module = modules[name];\n\n // eslint-disable-next-line no-await-in-loop\n await module.then((loadedModule) => {\n const { routes, store } = loadedModule.default;\n this.registerModuleRoutes(routes);\n this.registerModuleStore(name, store);\n });\n }\n }", "function _onAllJsIncludesDone() {\n\t\tinitNavigationMode();\n//\t\tSitoolsDesk.loadPreferences(this);\n\n\t\tthis.fireEvent('modulesLoaded');\n\t}", "function loadAddons() {\n\tvar modules = getActiveAddonModules(),\n\t\tmodule, options, option, i;\n\n\tfor (i = 0; i < modules.length; i += 1) {\n\t\toptions = modules[i].split(':');\n\n\t\tif (options.length > 1) {\n\t\t\tmodule = options.shift();\n\t\t} else {\n\t\t\t// no options\n\t\t\tmodule = options[0];\n\t\t}\n\n\t\tif (options[0].indexOf('private') !== -1) {\n\t\t\tif (typeof core.modules !== 'object') {\n\t\t\t\tcore.modules = {};\n\t\t\t}\n\t\t\tcore.modules[module] = loadModule(module + '/' + module, 'addon');\n\t\t} else {\n\t\t\tRax.log('loading addon module...', module);\n\t\t\tRax.modules[module] = loadModule(module + '/' + module, 'addon');\n\t\t}\n\t}\n\n}", "loadModules(modules={}) {\n for(let [name, module={}] of Object.entries(modules)) {\n const {actions={}} = module\n this.actions[name] = {...actions}\n }\n }", "loadModule(moduleInfo) {\n const moduleClass = require('@/../src/modules/' + moduleInfo.name + '/index')\n\n if (moduleClass && typeof moduleClass.default === 'function') {\n const moduleInstance = new moduleClass.default({\n // context\n moduleInfo: moduleInfo,\n terminal: this.terminal,\n store: this.store\n })\n\n if (moduleInstance) {\n // load all module window components\n if (Array.isArray(moduleInfo.windows)) {\n this.registerModuleComponentWindows(moduleInfo, moduleInstance)\n }\n\n return moduleInstance\n }\n\n return false\n }\n }", "lateLoad() {\n\n }", "_loadModules(modules) {\n for (var module of modules) {\n // A single provider (class or function).\n if (isFunction(module)) {\n this._loadFnOrClass(module);\n continue;\n }\n\n throw new Error('Invalid module!');\n }\n }", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function moduleDidLoad() {\n common.hideModule();\n }", "function NntpModuleLoader() {\n try {\n this.loadModule();\n } catch (e) {\n Cu.reportError(e);\n }\n}", "init() {\n this.loadModules();\n this.cacheDOM();\n this.attachEvents();\n this.stickFooterToBottom();\n }", "function init() {\n console.log( \"init\" );\n\n initExampleModule();\n //initScrollTo();\n //initCarouselModules();\n }", "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from window\n window.tools = {} || window.tools;\n window.tools._log = _log;\n window.tools._addNavigation = _addNavigation;\n } catch (error) {\n console.log(error);\n }\n\n }", "function onModuleEditorLoad() {\n\tif (globals.editMode) {\n\t\tsetEditCode(globals.moduleCode);\n\t}\n}", "load(callback) {\n $.getJSON(`/screen/${this.id}/data`, (data) => {\n switch (data.layout) {\n case 'default':\n this.layout = this.layouts.default.layout;\n break;\n default:\n this.layout = this.layouts.default.layout;\n break;\n }\n for (const mods of data.modules) {\n this.modules.push(mods);\n }\n callback();\n });\n }", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function loadModule() {\n return Promise.resolve({\n on: function(name, callback) {\n addon.port.on(name, callback);\n },\n emit: function(name, data) {\n addon.port.emit(name, data);\n }\n });\n}", "function learnModules() {\n const sth=require('./app.js').something;\n \n console.log(sth);\n \n }", "function moduleDidLoad() {\n naclModule = document.getElementById(pluginId);\n onLoadCallback();\n }", "function createModules() {\n\t\tvar moduleElements = document.documentElement.querySelectorAll(\"[data-module]\"), moduleName = \"\";\n\t\tif (moduleElements.length) {\n\t\t\t// If this page requires any modules to be created, attempt to comply for each of them\n\t\t\tvar i = 0, length = moduleElements.length;\n\t\t\tfor (; i < length; i++) {escape\n\t\t\t\tmoduleName = moduleElements[i].getAttribute(\"data-module\");\n\t\t\t\tif (BISDT.modules[moduleName]) {\n\t\t\t\t\t// If this module does actually exist, create it\n\t\t\t\t\tif (!activeModules[moduleName]) activeModules[moduleName] = [];\n\t\t\t\t\tactiveModules[moduleName].push(new BISDT.modules[moduleName].Controller(moduleElements[i]));\n\t\t\t\t} else {\n\t\t\t\t\tif (window.console && console.warn) console.warn(\"Found a module request for '\" + moduleName + \"', but no module with that name exists.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function loadDemos() {\n // const files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))\n // files.forEach((file) => {\n // console.log('require file path:' + file)\n // require(file)\n // })\n\n require(path.join(__dirname, 'sugr/consolemanager.js'));\n require(path.join(__dirname, 'sugr/main.js'));\n require(path.join(__dirname, 'sugr/dialog.js'));\n}", "function Module() {\r\n}", "load() {\r\n\r\n }", "load() {\n\n }", "reloadAllModules() {\r\n console.info(\"Reloading all modules.\")\r\n\r\n this.client.removeAllListeners()\r\n this.commands = {}\r\n this.modules = {}\r\n\r\n this.loadAllModules()\r\n this.configureClient()\r\n }", "function setupModule() {\n controller = mozmill.getBrowserController();\n nodeCollector = new domUtils.nodeCollector(controller.window.document);\n \n tabs.closeAllTabs(controller);\n}", "function checkModules(modules, callback) {\n var errorModules = [];\n Ext.each(projectGlobal.modules, function (module) {\n var moduleName = module.name;\n \n var xtype = module.xtype; \n var func = xtype + \".openModule\";\n try {\n if (!Ext.isEmpty(xtype) && Ext.isFunction(eval(func))) {\n eval(func);\n }\n \n } catch (err) {\n errorModules.push(moduleName);\n }\n }, this);\n if (!Ext.isEmpty(errorModules)) {\n var moduleNames = \"\";\n Ext.each(errorModules, function (moduleName) {\n moduleNames += \"<br/> - \" + moduleName;\n });\n var msg = String.format(i18n.get(\"label.cannotLoadModules\"), moduleNames);\n Ext.Msg.alert(i18n.get(\"label.warning\"), msg, function () {\n onAllInit.call(this);\n }, this);\n var window = Ext.MessageBox.getDialog(i18n.get(\"label.warning\"));\n var pos = window.getPosition();\n pos[1] = pos[1] - 200;\n window.setPosition(pos);\n }\n else {\n onAllInit.call(this);\n }\n }", "async function load() {\n await Datas.Settings.read();\n await Datas.Systems.read();\n //RPM.gameStack.pushTitleScreen();\n //RPM.datasGame.loaded = true;\n Manager.GL.initialize();\n Manager.GL.resize();\n Manager.Stack.requestPaintHUD = true;\n}", "constructor() {\n super(moduleDirectory);\n }", "function load()\n{\n dashcode.setupParts();\n loadVersionString();\n loadUserAppKey();\n}", "function startLoading() {\n logger.debug('Starting runtime init')\n\n if(!Module['preRun']) Module['preRun'] = [];\n\n Module['locateFile'] = () => {\n return './vendor/pocketsphinx.wasm';\n };\n\n Module['onRuntimeInitialized'] = () => {\n var SUCCESS = Module.ReturnType.SUCCESS,\n BAD_STATE = Module.ReturnType.BAD_STATE,\n BAD_ARGUMENT = Module.ReturnType.BAD_ARGUMENT,\n RUNTIME_ERROR = Module.ReturnType.RUNTIME_ERROR;\n RETURNTYPES = {\n SUCCESS : 'SUCCESS',\n BAD_STATE: 'BAD_STATE',\n BAD_ARGUMENT: 'BAD_ARGUMENT',\n RUNTIME_ERROR: 'RUNTIME_ERROR'\n }\n\n logger.debug('Runtime initialized')\n dispatch({success: true})\n };\n\n importScripts('./vendor/pocketsphinx.js');\n}", "function ou_domReady () {\n //New LH menu navigation - show on ALL pages in course\n if(initCourseId) {\n if(initModuleId) {\n //we're on Modules page with link to specific module - let's hide other Modules'\n var otherModuleDivs = document.querySelectorAll('div.context_module:not([data-module-id=\"'+initModuleId+'\"])'); //should only be one!; //should only be one!\n Array.prototype.forEach.call(otherModuleDivs, function(otherModuleDiv){\n otherModuleDiv.style.display = 'none'; \n });\n }\n ou_getModules(initCourseId);\n }\n }", "function ou_domReady () {\n //New LH menu navigation - show on ALL pages in course\n if(initCourseId) {\n if(initModuleId) {\n //we're on Modules page with link to specific module - let's hide other Modules'\n var otherModuleDivs = document.querySelectorAll('div.context_module:not([data-module-id=\"'+initModuleId+'\"])'); //should only be one!; //should only be one!\n Array.prototype.forEach.call(otherModuleDivs, function(otherModuleDiv){\n otherModuleDiv.style.display = 'none'; \n });\n }\n ou_getModules(initCourseId);\n }\n }", "function module_load(mod){\n if (mod.status >= STATUS.LOADING) {\n return;\n }\n var deps = module_resolve_deps(mod);\n mod.status = STATUS.LOADING;\n module_pass(mod);\n // If module has entries not be passed, call onload\n if (mod._entry.length) {\n module_complete(mod);\n return;\n }\n // both async or sync load\n var _queues = _.Queue(null, function(){});\n _.each(deps, function(id, m){\n _queues.next(function(next){\n if (m.status < STATUS.FETCHING) {\n var _fetch = function() {\n if (!distModule.async) {\n return module_fetch(m, next);\n }\n module_fetch(m);\n };\n if (m.dependencies && m.dependencies.length) {\n module_use(m.dependencies, _fetch, m.uri);\n } else {\n _fetch();\n }\n }\n else if (m.status === STATUS.SAVED) {\n module_load(m);\n }\n next();\n });\n });\n _queues.start();\n // module_use(deps, function(){\n // }, mod.uri);\n}", "function LoadModule(menu) {\n\tthis.menu = menu;\n\t// this.menu.requestParams = GetUrlRequestParamsObject(menu.url)\n}", "function __onLoad() {\n\tLOADED=true;\n}", "function initializeModules() {\r\n\r\n\t\t\t\t//Hide the full content divs\r\n\t\t\t\tmodules.find(\"div.full\").hide();\r\n\t\t\t\t\r\n\t\t\t\t//Apply link styling to the li summary and hide the summary anchors\r\n\t\t\t\tmodules.find(\"div.summary\").css(\"cursor\", \"pointer\").find(\"a\").hide();\r\n\t\t\t\t\r\n\t\t\t\t//Apply absolute positioning to the modules instead of floating them\r\n\t\t\t\tmodules.css({\r\n\t\t\t\t\tfloat: \"none\",\r\n\t\t\t\t\tposition: \"absolute\",\r\n\t\t\t\t\tbottom: 0\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tmodules.each(function(i) {\r\n\r\n\t\t\t\t\tvar startingLeftPosition = (summaryFullWidth + 2 + summaryMargin) * i; //The 2 is for border width\r\n\t\t\t\t\tvar smallLeftPosition = (summarySmallWidth + 2 + summaryMargin) * i;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar fullLeft = (summarySmallWidth + summaryMargin + 2) * i; //Calculates the left position of the module when it would be fully open\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Initialize the data for this particular module\r\n\t\t\t\t\tmoduleData[i] = {\r\n\t\t\t\t\t\tanimating: false, //whether or not this particular module is currently animating\r\n\t\t\t\t\t\tatInitialState: true, //whether or not this particular module is currently in it's initial state\r\n\t\t\t\t\t\tatSmallSummaryState: false, //whether or not this item is currently in small summary state\r\n\t\t\t\t\t\tsummaryVisible: true, //whether or not the summary is visible\r\n\t\t\t\t\t\tsummaryImageVisible: true, //whether or not the summary image is visible\r\n\t\t\t\t\t\titemResized: false, //whether or not the item has been re-sized\r\n\t\t\t\t\t\tfullContentVisible: false, //whether or not the full content layer is visible\r\n\t\t\t\t\t\tfullContentShadowsAdded: false, //whether or not the full content layer has had drop-shadows applied\r\n\t\t\t\t\t\tstartingLeftPosition: startingLeftPosition, //the starting left position of this module in its initial state\r\n\t\t\t\t\t\tsmallSummaryLeftPosition: smallLeftPosition, //the base left position of the module when it's in small summary state\r\n\t\t\t\t\t\tfullLeftPosition: fullLeft, //the base left position of the module when it's at its fully open state\r\n\t\t\t\t\t\tlastCalledAnimation: \"shrink\", //the last animation type to happen\r\n\t\t\t\t\t\telem: $(this) //the jQuery object for this module\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Set the starting left position\r\n\t\t\t\t\tmoduleData[i].elem.css(\"left\", startingLeftPosition);\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t}", "function loadModule(moduleName){var module=modules[moduleName];if(module!==undefined){return module;}// This uses a switch for static require analysis\nswitch(moduleName){case'charset':module=__webpack_require__(229);break;case'encoding':module=__webpack_require__(230);break;case'language':module=__webpack_require__(231);break;case'mediaType':module=__webpack_require__(232);break;default:throw new Error('Cannot find module \\''+moduleName+'\\'');}// Store to prevent invoking require()\nmodules[moduleName]=module;return module;}", "load () {\n\t\tthis.instanciable = false;\n\t\tconsole.log(this.name + \" loaded\");\n\t}", "_fetchModules(){\n var directories = fs.readdirSync('./features/');\n for (let directory of directories){\n if (!directory.includes('.')) { //means is a directory\n this._requireModules('./features/' + directory, directory);\n }\n }\n }", "function Module_alloc(){}", "function modules() {\n // Bootstrap JS \n var bootstrapJS = gulp.src('./node_modules/startbootstrap-sb-admin-2/vendor/bootstrap/js/*')\n .pipe(gulp.dest(paths.vendor + '/bootstrap/js'));\n\n // Bootstrap Select\n var bootstrapSelectJS = gulp.src('./node_modules/bootstrap-select/dist/js/*')\n .pipe(gulp.dest(paths.vendor + '/bootstrap-select/js'));\n var bootstrapSelectCSS = gulp.src('./node_modules/bootstrap-select/dist/css/*')\n .pipe(gulp.dest(paths.vendor + '/bootstrap-select/css'));\n\n // Bokeh\n var bokehJS = gulp.src('./node_modules/@bokeh/bokehjs/build/js/bokeh.min.js')\n .pipe(gulp.dest(paths.vendor + '/bokehjs'));\n\n // SB Admin 2 Bootstrap template\n var bootstrapSbAdmin2 = gulp.src([\n './node_modules/startbootstrap-sb-admin-2/js/*.js',\n './node_modules/startbootstrap-sb-admin-2/css/*.css'\n ]).pipe(gulp.dest(paths.vendor + '/startbootstrap-sb-admin-2'));\n\n // Bootstrap4 toggle\n var bootstrap4toggle = gulp.src([\n './node_modules/bootstrap4-toggle/js/*.js',\n './node_modules/bootstrap4-toggle/css/*.css'\n ]).pipe(gulp.dest(paths.vendor + '/bootstrap4-toggle'));\n\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(paths.vendor + '/datatables'));\n\n // dataTables-buttons\n var dataTablesButtons = gulp.src([\n './node_modules/datatables.net-buttons/js/*.js',\n './node_modules/datatables.net-buttons-bs4/js/*.js',\n './node_modules/datatables.net-buttons-bs4/css/*.css'\n ])\n .pipe(gulp.dest(paths.vendor + '/datatables-buttons'));\n\n // Font Awesome\n var fontAwesome = gulp.src('./node_modules/@fortawesome/**/*')\n .pipe(gulp.dest(paths.vendor + ''));\n\n // jQuery Easing\n var jqueryEasing = gulp.src('./node_modules/jquery.easing/*.js')\n .pipe(gulp.dest(paths.vendor + '/jquery-easing'));\n\n // jQuery\n var jquery = gulp.src([\n './node_modules/jquery/dist/*',\n '!./node_modules/jquery/dist/core.js'\n ])\n .pipe(gulp.dest(paths.vendor + '/jquery'));\n\n // jszip\n var jszip = gulp.src([\n './node_modules/jszip/dist/*.js',\n ])\n .pipe(gulp.dest(paths.vendor + '/jszip'));\n\n // d3 celestial\n var d3Celestial = gulp.src([\n './node_modules/d3-celestial/celestial*.js',\n './node_modules/d3-celestial/lib/d3*.js'\n ])\n .pipe(gulp.dest(paths.vendor + '/d3-celestial'));\n var d3CelestialData = gulp.src('./node_modules/d3-celestial/data/*.json')\n .pipe(gulp.dest(paths.vendor + '/d3-celestial/data'));\n var d3CelestialImage = gulp.src('./node_modules/d3-celestial/images/*')\n .pipe(gulp.dest(paths.cssDir + '/images'));\n\n // particles.js\n var particlesJs = gulp.src('./node_modules/particles.js/particles.js')\n .pipe(gulp.dest(paths.vendor + '/particles.js'));\n\n // PrismJs\n var prismJs = gulp.src('./node_modules/prismjs/prism.js')\n .pipe(gulp.dest(paths.vendor + '/prismjs'));\n var prismJsYaml = gulp.src('./node_modules/prismjs/components/prism-yaml.min.js')\n .pipe(gulp.dest(paths.vendor + '/prismjs'));\n var prismJsLineNum = gulp.src('./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.min.js')\n .pipe(gulp.dest(paths.vendor + '/prismjs/line-numbers'));\n var prismJsCss = gulp.src('./node_modules/prismjs/themes/prism.css')\n .pipe(gulp.dest(paths.vendor + '/prismjs'));\n var prismJsLineNumCss = gulp.src('./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css')\n .pipe(gulp.dest(paths.vendor + '/prismjs/line-numbers'));\n\n return merge(bootstrapJS, bootstrapSbAdmin2, bootstrap4toggle, bokehJS, dataTables, dataTablesButtons, fontAwesome, jquery, jqueryEasing, jszip, d3Celestial, d3CelestialData, d3CelestialImage, particlesJs, prismJs, prismJsYaml, prismJsLineNum, prismJsCss, prismJsLineNumCss);\n}", "function load() {\n\t\t// Load external resources then proceed with init.\n\t\t//require([\"cog1/ext/glMatrix.js\",\"cog1/exercise.js\"], init(createSceneFkt););\n\t\t//require([\"cog1/ext/glMatrix.js\"], function() { init(createSceneFkt); });\n\t\tinit();\n\t}", "function moduleDidLoad() {\n common.hideModule();\n}", "function loadDemos () {\n var files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))\n files.forEach(function (file) {\n require(file)\n })\n autoUpdater.updateMenu()\n}", "cacheLoader (mainNameSpace) {\n \n let NoEmptyNamespace = false \n if (mainNameSpace) {\n \n let keys_exists = Object.keys(mainNameSpace) ; \n\n (keys_exists || keys_exists.length > 0)?NoEmptyNamespace = true : NoEmptyNamespace \n \n if(NoEmptyNamespace){\n \n for(let method in mainNameSpace){\n \n (typeof mainNameSpace[method] == \"function\") ? mainNameSpace[method]() : console.warn(`no module found on ${mainNameSpace}`)\n }\n }\n }\n \n }", "_prepare_module_init(){\n this.module_faces=[this.module_base_face_dimensions_axes,\n this.module_top_face_dimensions_axes,\n this.module_left_face_dimensions_axes,\n this.module_right_face_dimensions_axes];\n this.initial_module_faces=[this.module_base_face_dimensions_axes.slice(),\n this.module_top_face_dimensions_axes.slice(),\n this.module_left_face_dimensions_axes.slice(),\n this.module_right_face_dimensions_axes.slice()];\n }", "initModule() {\n // get promises from children\n const promises = this.nextModules.map((module) => {\n return module.initModule();\n });\n // add own async initialization\n const asyncInit = new Promise((resolve, reject) => {\n setTimeout(resolve, 1000);\n });\n\n promises.push(asyncInit);\n // resolve when everything is done\n return Promise.all(promises);\n }", "async init () {\n this.bridge = await this._getBridge()\n this.lamps = await this._getLamps()\n this.modules = await this._loadModules()\n }", "function initializeModules () {\r\n $(\".module\").each (function (n) {\r\n $(this).css (\"display\",\"none\");\r\n if (n == 0) {\r\n $(this).css (\"display\", \"block\");\r\n }\r\n });\r\n}", "load() {}", "load() {}", "function ModuleWithProviders() { }" ]
[ "0.74074703", "0.73393846", "0.7286648", "0.71619457", "0.70987093", "0.7093772", "0.695527", "0.6927254", "0.6906776", "0.6877943", "0.68752927", "0.6868552", "0.6862309", "0.68588", "0.6841948", "0.6815628", "0.6722725", "0.6722725", "0.6721548", "0.6693581", "0.66857797", "0.668145", "0.666524", "0.6625396", "0.6608731", "0.660024", "0.65946877", "0.65933055", "0.65842843", "0.6572277", "0.6564269", "0.6555751", "0.65310556", "0.65179986", "0.651399", "0.6484958", "0.6469832", "0.6453661", "0.6452573", "0.64486504", "0.6439273", "0.6408229", "0.6407515", "0.6392701", "0.63711935", "0.63623327", "0.63608307", "0.63145006", "0.6301342", "0.6301342", "0.6301342", "0.62994164", "0.6288945", "0.6279414", "0.627452", "0.6273552", "0.6253961", "0.6251037", "0.6244754", "0.6244754", "0.6244754", "0.6244754", "0.6244754", "0.6244754", "0.62357813", "0.6226131", "0.62248874", "0.62187815", "0.6209293", "0.620916", "0.61860603", "0.61685544", "0.6165026", "0.614549", "0.61443704", "0.61430115", "0.6127145", "0.61119574", "0.61119413", "0.61111224", "0.61111224", "0.6110974", "0.6106248", "0.6095801", "0.608857", "0.608347", "0.6082441", "0.6075652", "0.6073431", "0.60672843", "0.6065551", "0.606197", "0.6047165", "0.60375804", "0.60361457", "0.60245645", "0.60242665", "0.60217047", "0.6007738", "0.6007738", "0.6002853" ]
0.0
-1
Function & Prompt for User to select password length from 8128
function lengthPrompt() { while (length === "" || length === null || length < 8 || length > 128) { length = prompt( "How many characters would you like to include in your password? Please select a number between 8-128." ); if (length >= 8 && length <= 128) { return length; } else { alert("Please enter valid option."); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseLength() {\n do {\n passwordLength = parseInt(window.prompt('How Long Do You Want Your Password to Be? Choose a number between 8 and 128 characters', \"\"));\n } while(isNaN(passwordLength) || passwordLength < 8 || passwordLength > 128)\n}", "function passCharLength () {\n charLimit =parseInt(prompt('Please select the number of characters you would like for your password. Please choose between 8-128.'));\n if (charLimit <8 || charLimit > 128) {\n alert('Please try again with 8 through 128 characters for your password');\n passCharLength();\n }\n}", "function lengthSelect() {\n var entry = prompt(\"Choose password between 8-128 charcters\");\n // CHECK IF ENTRY IS A WHOLE NUMBER\n if (isNaN(entry) || entry % 1 != 0) {\n alert(\"Must be a whole number\");\n lengthSelect();\n // CHECK IF ENTRY IS BETWEEN 8-128\n } else if (entry > 128 || entry < 8) {\n alert(\"Must be between 8-128\");\n lengthSelect();\n } else {\n return passwordLength = (entry);\n \n }\n}", "function passwordSize(){\n var charaLength = window.prompt(\"Length of password must be between 8 to 128.\");\n // if statments not 8 - 128 alert invaild length and return\n while (charaLength < 8 || charaLength > 128){\n charaLength = window.prompt(\"Please enter a number betwenn 8 to 128.\")\n \n }\n \n return(charaLength)\n}", "function getPassLength() {\n var passLength = parseInt(prompt(\"Please enter password length 8 and 128 characters long\"));\n while (passLength < 8 || passLength > 128 || !Number.isInteger(passLength)) {\n passLength = parseInt(prompt(\"Please enter a number between 8 and 128\"))\n }\n return passLength;\n}", "function passLength() {\n var characters = prompt(\n \"Password length: Please choose a number between 8 and 128\"\n );\n if (isNaN(characters)) {\n alert(\"Please choose a number between 8 and 128\");\n return passLength();\n }\n if (characters < 8 || characters > 128) {\n alert(\"Please choose a number between 8 and 128\");\n return passLength();\n }\n return characters;\n}", "function passAskLength() {\n\tpassLength = prompt(\"Enter your desired password length between 8-128\");\n\tconsole.log(passLength);\n\tvar passLengthInt = parseInt(passLength);\n\n\tif (\n\t\tpassLength !== \"\" &&\n\t\tpassLengthInt >= 8 &&\n\t\tpassLengthInt <= 128 &&\n\t\tNumber.isInteger(passLengthInt)\n\t) {\n\t\talert(\"your pass is \" + passLengthInt + \" characters long\");\n\t\taskPassCrit();\n\t} else {\n\t\talert(\"please enter a proper whole number\");\n\t}\n}", "function pwLength () {\n passwordLgth = prompt(\"Select password length (must be between 8-128 characters)\");\n\n if (passwordLgth < 8) {\n alert(\"Password minimum is 8 characters long\");\n pwLength();\n }\n else if (passwordLgth > 128) {\n alert(\"password cannot be more than 128 characters\")\n pwLength();\n }\n else { \nalert(\"Select character types\")\n return passwordLgth;\n\n }\n}", "function getPassswordLength() {\n let passwordLength = 0;\n let isInputNumber = true;\n\n while (passwordLength < 8 || passwordLength > 128 || isInputNumber == false) {\n passwordLength = parseInt(\n window.prompt(\"Please enter a password length between 8 - 128 character.\")\n );\n\n if (isNaN(passwordLength)) {\n isInputNumber = false;\n } else {\n isInputNumber = true;\n }\n }\n\n return passwordLength;\n}", "function getPasswordLength() {\n var isValidLength = false; // Used to determine if user selected valid length\n var pwdLength = 0; // Initialize return value\n\n // This loop gets user input on password length and validates it\n while (!isValidLength) {\n pwdLength = prompt(\"How many characters would you like in your password (8-128)?\");\n\n // If user presses cancel, end function and return 0\n if (!pwdLength) {\n return 0;\n }\n // otherwise, convert input to a number\n else {\n pwdLength = parseInt(pwdLength);\n }\n\n // Have to verify that it is a number and is between 8 and 128, inclusive\n isValidLength = (((typeof pwdLength) == \"number\") && (pwdLength >= 8) && (pwdLength <= 128));\n\n // If user entered something other than a number, or a number < 8 or > 128, ask if they want to continue\n if (!isValidLength) {\n // If user presses cancel, end function and return 0\n if (!confirm(\"That is not a valid password length. Continue?\")) {\n return 0;\n }\n }\n } // while !isValidLength\n\n return pwdLength;\n} // function getPasswordLength", "function passwordLength(){\n //reset passLength \n passlength = \"\"\n //prompt asking for length of password\n passLength = passlength += prompt(\"Please specify a length for the password between 8-128 characters long.\")\n //check making sure a value was entered\n if (passLength === \"\" || passLength === null){\n alert(\"Please enter a valid answer.\")\n passwordLength()\n }\n // changing legnth to a number and not a string\n passLength = parseInt(passLength)\n //checking to make sure the number is between 8-128\n if(passLength < 8 || passLength > 128){\n alert(\"Please Enter a password length between 8-128\")\n passwordLength()\n }\n console.log(passlength)\n}", "function passlength () { \n\n \n window.alert(\"How long do you want your password to be from 8-128 characters.\\n E.x 20\");\n var pLength = parseInt(window.prompt(\"Please enter length\")); \n if (pLength < 8 || pLength > 128) {\n \n window.alert(\"Please enter a valid number between 8-128\");\n passlength();\n\n } else if (!pLength) { \n window.alert(\"Please enter a valid number between 8-128\")\n passlength(); \n } else {\n window.alert(\"You have entered a valid length of: \" + pLength + \"\\n Password will now be generated\");\n return pLength; \n }\n}", "function decideLength() {\n passwordLength = prompt(\"How many characters would you like your password to be (between 8-128 characters:\");\n \n if (passwordLength < 8) {\n alert(\"Password length must be a number between 8-128 characters\" );\n decideLength();\n } else if (passwordLength > 128) {\n alert(\"Password length must be a number between 8-128 characters\" );\n decideLength();\n } else if (isNaN(passwordLength)) {\n alert(\"Password length must be a number between 8-128 characters\" );\n decideLength();\n } else { \n alert(\"In the following screens, check for what type of characters you would like in your password. If 'no' for all our password will only contain lowercase letters.\");\n }\n return passwordLength;\n}", "function verifyLength() {\n var passLength = prompt(\"Enter desired number of password characters: \\n(min: 8, max: 128)\");\n\n // variable that stores 0 if number is integer, NaN if other string, or value >0 if number not an integer\n var intCheck = passLength % 1;\n\n // exits function on cancel button\n if (!passLength) { \n return;\n // verifies that password is an integer between 8 and 128 inclusive\n } else if (passLength < 8 || passLength > 128 || intCheck != 0) {\n // shows alert and runs character length prompt function again\n alert(\"Must be an integer between 8 and 128\");\n return verifyLength();\n } else {\n return passLength;\n }\n }", "function getLength() {\n var passwordLength = window.prompt(\"How long do you want your password to be? (Choose a number between 8-128)\");\n \n if (passwordLength >= 8 && passwordLength <= 128) {\n return passwordLength;\n }\n else {\n window.confirm(\"That is an invalid option\");\n return getLength();\n }\n}", "function totallen(){\n var totalCharacters = Number(prompt(\"Choose the password length to be at least 8 characters and no more than 128 characters\"));\n while ((totalCharacters < 8 || totalCharacters > 128) || isNaN(totalCharacters)){\n totalCharacters = window.prompt(\"Choose a length between 8 to 128 chars \");\n }\n return totalCharacters;\n}", "function getPasswordLength()\n{\n var passwordLength = Number(document.getElementById(\"passwordLength\").value);\n\n if(passwordLength < 8 || passwordLength > 128)\n {\n alert(\"Error: Invalid password length. Reseting to 8 characters\");\n \n passwordLength = 8;\n\n document.getElementById(\"passwordLength\").value = passwordLength;\n }\n\n return passwordLength;\n}", "function generateLength() {\n var myLength = prompt(\"How long do you want your password to be, between 8 and 128 characters?\")\n if (myLength < 8 || myLength > 128 || isNaN(myLength)) {\n alert(\"Sorry, your password is invalid\");\n return generateLength()\n } else {\n return generateChar(myLength)\n }\n \n}", "function determineLength(){\n passwordLength = prompt(\"Pick how many characters you want in your password 8-20 characters only:\");\n\n if (passwordLength<8){\n alert(\"Password should be a number between 8-20\");\n determineLength();\n }else if (passwordLength>20){\n alert(\"Password should be a number between 8-20\");\n determineLength();\n }else if (isNaN(passwordLength)){\n alert(\"Password should be a number between 8-20\");\n determineLength();\n }else{\n alert(\"Next screens will asked you if you want uppercase letters, numbers and special characters\");\n }\n return passwordLength;\n}", "function checklength() {\n //var pwlength = pwlengthEl;\n var minlength = 8;\n var maxlength = 128;\n var minlen = minlength;\n var maxlen = maxlength;\n if (pwlengthEl < minlen || pwlengthEl > maxlen) {\n alert('Please select a number between ' + minlength + ' and ' + maxlength + ' characters');\n pwlengthEl = parseInt(prompt('Please enter a value from 8 to 128 characters'));\n checklength();\n return '';\n } else {\n alert('You have entered a valid number of ' + pwlengthEl);\n return '';\n }\n }", "function getPasswordLength() {\n var passwordLength = window.prompt(\n \"How many characters will your password contain? Please enter a number between 8 and 128.\"\n );\n //HELP something, maybe While? for if length=0 || length=null then call function getPasswordLength\n if (passwordLength < 8) {\n window.alert(\"Please enter a numeric value greater than 7\");\n getPasswordLength ();\n }\n else if (passwordLength > 128) {\n window.alert(\"Please enter a numeric value lesser than 128\");\n getPasswordLength ();\n } else {\n return passwordLength = passwordLength;\n }\n}", "function setPasswordLength() {\n\n passwordLength = parseInt(prompt(\"Pick a password length between 8 and 128 characters.\"));\n\n while (passwordLength < 8 || passwordLength > 128) {\n alert(\"please pick a valid password length between 8 and 128 characters\");\n passwordLength = parseInt(prompt(\"Pick a password length between 8 and 128 characters.\"));\n }\n console.log(passwordLength);\n}", "function getPasswordLength() {\n var userLength = parseInt(window.prompt(\"How many characters should the password be? (Note: Passwords must be at least 8 and no more than 128 characters).\"), 10);\n console.log(userLength);\n if (isNaN(userLength)) {\n window.alert(\"Please enter a number!\");\n getPasswordLength();\n } else if (userLength < 8 || userLength > 128) {\n window.alert(\"Please enter a number between 8 and 128!\")\n getPasswordLength();\n } else {\n console.log(userLength);\n passwordLength = userLength;\n }\n}", "function determineLength() {\n var passwordLength = prompt(\"Enter password length. Min 8 characters and max 128 characters\");\n\n if (passwordLength < 8) {\n alert(\"Password length must be a number between 8-128 characters\");\n determineLength();\n } else if (passwordLength > 128) {\n alert(\"Password length must be a number between 8-128 characters\");\n determineLength();\n } else if (isNaN(passwordLength)) {\n alert(\"Password length must be a number between 8-128 characters\");\n determineLength();\n }\n return passwordLength;\n\n\n}", "function writePassword() {\n inputCharLength();\n}", "function getPasswordlength() {\n var input;\n var length;\n\n for (;;) {\n input = prompt (\"Choose password length between 8 and 128\");\n alert(\"You chose \" + input + \" characters.\");\n if (input == \"\") {\n alert(\"You must choose a number between 8 and 128.\");\n }else {\n length = parseInt(input);\n if (Number.isNaN(length)) {\n alert (\"Please select a number only.\");\n } else {\n if (length < 8 || length > 128) {\n alert(\"You must choose a number between 8 and 128.\");\n } else {\n break;\n }\n }\n }\n }\n return length;\n}", "function setPasswordOptions() {\n setCharacterOptions();\n\n //Check that at least one character type is selected\n while (passwordOptions.useLowercase == false && passwordOptions.useUppercase == false && passwordOptions.useNumbers == false && passwordOptions.useSpecialCharacters == false) {\n alert(\"You need at least one type of character to generate a password.\");\n setCharacterOptions();\n }\n\n passwordOptions.passwordLength = Number(prompt(\"How long should the password be?\"));\n\n //Check that passwordOptions.passwordLength is a number between 8 and 128\n while (passwordOptions.passwordLength < 8 || passwordOptions.passwordLength > 128 || passwordOptions.passwordLength == NaN) {\n passwordOptions.passwordLength = prompt(\"The password length must be a number between 8 and 128. How long should the password be?\");\n }\n}", "function char() {\n passwordLength = prompt(\"How many characters would you like for your password (between 8 and 128)\");\n if (passwordLength > 128 || passwordLength < 8){\n char()\n }else{\n userChoice()\n };\n}", "function generatePassword() {\n passwordAttributes.reset();\n var passwordLength = window.prompt(\"How many characters do you want your password to be?\");\n passwordLength = parseInt(passwordLength);\n if (Number.isNaN(passwordLength)) {\n window.alert(\"Please enter a numeric value.\");\n generatePassword();\n } else {\n if (passwordLength < 8 || passwordLength > 128) {\n window.alert(\"Password must be greater than 8 characters, but less than 129.\");\n generatePassword();\n } else {\n passwordAttributes.length = passwordLength;\n determineCharacters();\n }\n }\n\n return passwordAttributes.passwordChar;\n}", "function generatePassword() {\n alert (\"Select which criteria to include in the password\");\n\n\n var passLength = parseInt(prompt(\"Choose a length of at least 8 characters and no more than 128 characters\"));\n\n //evaluate user input for password length\n while (isNaN(passLength) || passLength < 8 || passLength > 128)\n {\n \n if (passLength === null) {\n return;\n }\n\n passLength = prompt(\"choose a length of at least 8 characters and no more than 128 characters\");\n }\n\n\n var lowerCase = confirm(\"Do you want lowercase characters in your password\");\n var upperCase = confirm(\"Do you want uppercase characters in your password\");\n var numChar = confirm(\"Do you want numbers in your password?\");\n var specChar = confirm(\"Do you want special characters in your password?\");\n\n\n //evalute criteria for password generation\n if (lowerCase || upperCase || numChar || specChar)\n {\n var otherToGen = '';\n var intList = '0123456789';\n var uCharList ='ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var lCharList ='abcdefghijklmnopqrstuvwxyz'; \n var sCharList =\"!#$%&()*+,-./:;<=>?@[]^_`{|}~\";\n var remainlenght = 0;\n var criteriaMatch = 0;\n var value = '';\n\n if (numChar){\n value += genchar(1, intList);\n criteriaMatch++;\n otherToGen += intList;\n\n }\n\n if (lowerCase){\n value += genchar(1, lCharList);\n criteriaMatch++;\n otherToGen += lCharList;\n }\n\n if (upperCase) {\n value += genchar(1, uCharList);\n criteriaMatch++;\n otherToGen += uCharList;\n }\n\n\n if(specChar) {\n value += genchar(1, sCharList);\n criteriaMatch++;\n otherToGen += sCharList;\n\n }\n\n remainlenght = passLength-criteriaMatch;\n value += genchar(remainlenght, otherToGen);\n\n return value;\n}\n}", "function setLength() {\n passwordLength = prompt(\n \"How long should your password be? Please enter a number between 8-128.\"\n );\n var requestedPasswordLength = isNaN(passwordLength);\n\n if (requestedPasswordLength === true) {\n prompt(\"Please enter a number between 8-128\");\n setLength();\n }\n if (passwordLength < 8 || passwordLength > 128) {\n prompt(\"Please enter a number between 8-128\");\n setLength();\n }\n console.log(requestedPasswordLength);\n return requestedPasswordLength;\n}", "function lengthPrompt () { \n passwordLength = prompt(\"How long does your password need to be? (8-128 characters)\");\n if (passwordLength < 8 || passwordLength > 128 || (isNaN(passwordLength))) {\n alert(\"Error: please enter a number between 8 and 128.\");\n lengthPrompt();\n return;\n }\n else {\n lowercasePrompt();\n return passwordLength;\n }\n}", "function generatePassword() {\n var isValidPasswordLength = false;\n var userInput = \"\";\n var passwordLength = 0;\n\n // Keeps asking for a length until the input given is valid. If the user clicks\n // cancel, stops asking and closes the prompt\n while (userInput !== null && !isValidPasswordLength) {\n userInput = prompt(\"Choose a length between 8 and 128 characters for your password\");\n passwordLength = parseInt(userInput);\n if (passwordLength >= 8 && passwordLength <= 128 ) {\n console.log(\"inside\");\n isValidPasswordLength = true;\n }\n else {\n // if the user didn't click cancel alerts input is invalid\n if (userInput !== null) {\n alert(\"Not a valid length!\");\n }\n }\n }\n \n var password = \"\";\n // if user clicks cancel on the prompt, it doesn't display anything in the textbox\n if (userInput !== null) {\n var charSet = getPasswordCriteria();\n\n for (var i = 0; i < passwordLength; i++) {\n // gets a random integer from 0 to charSet.length - 1\n var random = Math.floor(Math.random() * charSet.length);\n // gets char at position given by random from charSet and concatenates to the end of password\n password += charSet.charAt(random);\n }\n }\n \n\n return password;\n}", "function writePassword() {\n var length = parseInt(prompt(\"Length: Please choose a number starting from or equal to 8 and 128.\"));\n// While loop keeps users from advancing until they select a number between 8 and 128\nwhile (length < 8 || length > 128 || isNaN(length) ) {\n alert(\"Please choose a number starting from or equal to 8 and 128.\")\n length = prompt(\"Length: Please choose a number between 8 and 128.\");\n };\n\n hasLower = confirm(\"Include lower case?\");\n hasUpper = confirm(\"Include upper case?\");\n hasNum = confirm(\"Include numbers?\");\n hasSym = confirm(\"Include Symbols?\");\n password = generatePassword(hasLower, hasUpper, hasNum, hasSym, length);\n passwordText.value = password;\n}", "function writePassword() {\n \n plength = parseInt(prompt(\" How many characters would you like your password to be ? minimum of 8 or maximum of 128 characters\", \"\"));\n \n while (isNaN(passwordlength)) {\n plength = parseInt(prompt(\"Invalid option, Please enter a number between 8 & 128\", \"\"));\n }\n\n while ( passwordlength < 8 || passwordlength > 128) {\n passwordlength = parseInt(prompt(\"Enter a number between 8 & 128 characters\", \"\"));\n }\n\n pLowerCase = confirm(\" Would you like to include lower case letters?\");\n ptUpperCase = confirm(\"Would you like unclude upper case letters?\");\n pNumber = confirm(\"Would you like to use numbers?\"); \n pSpecial = confirm(\"Would you like to use special characters?\");\n \n var password = generatePassword();\n\n document.querySelector(\"#password\").value = password; \n}", "function pass_lenth(passlenth,boxid){\n\t\n\t\nif (passlenth.length < 8) {\n\t document.getElementById(boxid).innerHTML=\"password lenth between 8 and 20 character\";\n return false; // keep form from submitting\n }\n\t\n\t\t\nif (passlenth.length > 20 ) {\n\t document.getElementById(boxid).innerHTML=\"password lenth between 8 and 20 character\";\n return false; // keep form from submitting\n }\n\telse{\n\tdocument.getElementById(boxid).innerHTML=\"\";\n\t}\n}", "function writePassword() {\n var passwordLength=window.prompt(\"select a number between 8 and 128\");\n var useLowerCase=window.confirm(\"use lowercase letters\");\n var useUpperCase=window.confirm(\"use uppercase letters\");\n var useDigits=window.confirm(\"use digits\");\n var useSpecialCharacters=window.confirm(\"use special characters\");\n var password = generatePassword(passwordLength=passwordLength,useLowerCase=useLowerCase,useUpperCase=useUpperCase,useDigits=useDigits,useSpecialCharacters=useSpecialCharacters);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function genPassLength() {\n passwordLength = document.getElementById(\"passLength\").value;\n document.getElementById(\"lengthDisplay\").innerHTML = \" \" + passwordLength;\n}", "function getPasswordLength() {\n //initialize length boolean to false\n let isLengthValid = false;\n let passwordLength = prompt(\"Please enter number of characters for the password. Enter a length of at least 8 characters and no more than 128 characters.\");\n\n // Loop until isLengthValid=true\n while (isLengthValid === false) {\n // If \"cancel\" button is clicked, break out of loop\n if (passwordLength === null) {\n break;\n }\n // Check if passwordLength is a valid integer between 8 and 128 (inclusive). If yes set isLengthValid to true else prompt for a valid entry\n if (Number.isInteger(Number(passwordLength)) && passwordLength >= 8 && passwordLength <= 128) {\n isLengthValid = true;\n } else {\n //Prompt again for valid response\n passwordLength = prompt(\"Please enter a whole number greater or equal to 8 and less than or equal to 128. Try Again.\");\n }\n }\n return passwordLength;\n}", "function generatePassword(){\n var passwordLength = 0;\n while(passwordLength < 8 || passwordLength > 128){\n passwordLength = window.prompt(\"How many characters? 8-128\");\n }\n var includeNumeric = window.confirm(\"Include numbers?\");\n var includeLowerCase = window.confirm(\"Include lowercase?\");\n var includeUpperCase = window.confirm(\"Include uppercase?\");\n var includeSpecial = window.confirm(\"Include special characters?\");\n //verify that it is a valid password\n if(verifyPassword(includeNumeric, includeLowerCase, includeUpperCase, includeSpecial)){\n var password = createPassword(passwordLength, includeNumeric, includeLowerCase, includeUpperCase, includeSpecial);\n }else{\n //If none of the criterion were selected then rerun the \n window.alert(\"Please select at least one criterion.\");\n generatePassword();\n }\n return password;\n}", "function appropriateLength(){\n //get user input for length of password\n var userLength = prompt(\"How many characters do you want your new password to be? The best passwords are between 8 and 128 Characters\");\n //turn input into a number\n userLength = parseInt(userLength);\n //IF: number value of input is \"NaN\" or outside desired bounds, it enters loop...\n while(isNaN(userLength) || userLength < 8 || userLength > 128){\n //THEN:\n //Prompt user to give valid input\n userLength = prompt(\"Make sure you enter a number between 8 and 128\");\n //turn input into a number\n userLength = parseInt(userLength);\n //IF: input is still \"NaN\" or out of bounds, re-enter loop...\n }\n //once we are sure we have a valid length input, we return it to be used\n return userLength\n}", "function lengthChecker() {\n //Password Length Ask\n passwordLength = prompt(\"In order to generate your password, please enter a number between 8 and 128.\");\n console.log(passwordLength);\n // If user enters in a number between 8 and 128, they meet the required character allotment \n if (passwordLength >= 8 && passwordLength<= 128) {\n alert(\"Your entry meets the required character allotment. Let's move on.\");\n } \n // If user does not enter in a number between 8 and 128, they will be prompted to try again. \n else {\n alert(\"Your entry did not meet the required character allotment. Please try again.\");\n lengthChecker();\n }\n}", "function generatePassword() {\n //between 8 and 128 characters\n var pw = [];\n\n passwordLength = prompt(\n \"select length of password in numbers between 8 to 128.\"\n );\n document.getElementsByClassName(\"pw-length\").value = passwordLength;\n\n console.log(\"password length is \" + passwordLength);\n //retrieves the user input for password lnegth\n var length = document.getElementsByClassName(\"pw-length\").value;\n\n console.log(length);\n //generate the correct amount of characters for the password depending on requestLength()\n for (var i = 0; i < length / 4; i++) {\n var letter = getRandom(lowerCasedCharacters);\n\n var letterCaps = getRandom(upperCasedCharacters);\n\n var number = getRandom(numbers);\n\n var specialCharacter = getRandom(specialCharacters);\n pw.push(letter);\n pw.push(letterCaps);\n pw.push(number);\n pw.push(specialCharacter);\n }\n document.getElementById(\"password\").value = pw.join(\"\");\n console.log(pw.join(\"\"));\n}", "function getPasswordOptions() {\n // Variable to store length of password from user input\n var passLength = (prompt('How many characters long would you like your password to be?'));\n\n // Conditional statement to check if password length is a number. Prompts restart if this evaluates false\n while (isNaN(passLength)) {\n alert('Password length must be provided as a number');\n var passLength = (prompt('How many characters long would you like your password to be?'));\n }\n\n // Conditional statement to check if password length is at least 8 characters long. Prompts restart if this evaluates false\n while (passLength <8 || passLength >128) {\n alert('Your password must be at least 8 characters but no longer than 128.');\n var passLength = (prompt('How many characters long would you like your password to be?'));\n }\n\n alert('Your password will be ' + passLength + ' characters long.');\n\n // Variable to store boolean regarding the inclusion of special characters\n var specialCharactersConfirm = (confirm('Would you like to include special characters in your password? OK for yes; Cancel for no.'));\n\n // Variable to store boolean regarding the inclusion of numeric characters\n var numericCharactersConfirm = (confirm('Would you like to include numeric characters in your password? OK for yes; Cancel for no.'));\n\n // Variable to store boolean regarding the inclusion of lowercase characters\n var lowerCaseCharactersConfirm = (confirm('Would you like to include lowercase letters in your password? OK for yes; Cancel for no.'));\n\n // Variable to store boolean regarding the inclusion of uppercase characters\n var upperCaseCharactersConfirm = (confirm('Would you like to include uppercase letters in your password? OK for yes; Cancel for no.'));\n\n // Conditional statement to check if user does not include any types of characters. Password generator restarts if all four variables evaluate to false\n while (specialCharactersConfirm === false && numericCharactersConfirm === false && lowerCaseCharactersConfirm === false && upperCaseCharactersConfirm === false) {\n alert('You must select at least one of the following: Special Character, Numeric Character, Lowercase Letter, or Uppercase Letter.');\n var specialCharactersConfirm = (confirm('Would you like to include special characters in your password? OK for yes; Cancel for no.'));\n var numericCharactersConfirm = (confirm('Would you like to include numeric characters in your password? OK for yes; Cancel for no.'));\n var lowerCaseCharactersConfirm = (confirm('Would you like to include lowercase letters in your password? OK for yes; Cancel for no.'));\n var upperCaseCharactersConfirm = (confirm('Would you like to include uppercase letters in your password? OK for yes; Cancel for no.'));\n }\n \n // Object to store user input variables\n var passwordOptions = {\n passLength,\n specialCharactersConfirm,\n numericCharactersConfirm,\n lowerCaseCharactersConfirm,\n upperCaseCharactersConfirm\n };\n return passwordOptions;\n}", "function passwordSizeEntry() {\n var passSize = parseInt(window.prompt(\"What is the length of your password? (8-128 Characters)\"));\n\n if (passSize < 8) {\n window.alert(\"Password too short please choose another length.\");\n passwordSizeEntry();\n }\n else if (passSize > 128) {\n window.alert(\"Password too long please choose another length.\");\n passwordSizeEntry();\n }\n else if(typeof passSize !== \"number\") {\n window.alert(\"Password incorrect please enter another value.\");\n passwordSizeEntry();\n }\n else {\n return(passSize);\n }\n \n}", "function getpasswordLength() {\n let passwordLength;\n while (true) {\n passwordLength = parseInt(prompt(\"please enter the number of characters that you want for your password. It must be more than 12 characters but less than 128.\"))\n if (isNaN(passwordLength)) {\n alert (\"The password length must be a number\")\n \n }\n else {\n if (passwordLength < 12 ||passwordLength > 128) {\n alert(\"Password must be between 12 and 128, characters inclusive\")\n \n }\n\n else {\n \n break;\n \n }\n \n }\n}\nreturn passwordLength\n}", "function writePassword() {\n\t// prompt for parameters to determine password construct\n\t// 1. Parameter 1 - Password length '\n\n\tpwdLength = prompt(\n\t\t\"Password must be between 8 and 128 characters. How many characters in your password?\"\n\t);\n\n\tconsole.log(pwdLength);\n\n\t// Cancel selected on Prompt - no password\n\tif (!pwdLength) {\n\t\tpassword = \"Cancel selected - number of characters - No password generated\";\n\t\tvar passwordText = document.querySelector(\"#password\");\n\n\t\tpasswordText.value = password;\n\t\treturn password;\n\t}\n\n\t// Password length must be between 8 and 128 characters\n\n\tif (pwdLength < 8 || pwdLength > 128) {\n\t\talert(\"Number of characters must be 8 or more and 128 or less\");\n\t\treturn;\n\t}\n\n\t// 2. Parameter 2 - Include upper case letters\n\n\tinclUpper = prompt(\"Include UPPER CASE letters in your password? (y or n)\");\n\n\t// Cancel selected on Prompt - no password\n\tif (!inclUpper) {\n\t\tpassword = \"Cancel selected - include Upper Case - No password generated\";\n\t\tvar passwordText = document.querySelector(\"#password\");\n\n\t\tpasswordText.value = password;\n\t\treturn password;\n\t}\n\n\tinclUpper.toLowerCase;\n\n\t// Include upper case must be y or n\n\n\tif (inclUpper !== \"n\" && inclUpper !== \"y\") {\n\t\talert(\"Must answer y or n to including Upper Case characters\");\n\t\treturn;\n\t}\n\n\t// 3. Parameter 3 - Include lower case letters\n\n\tinclLower = prompt(\"Include lower case letters in your password? (y or n)\");\n\n\t// Cancel selected on Prompt - no password\n\tif (!inclLower) {\n\t\tpassword = \"Cancel selected - include Lower Case - No password generated\";\n\t\tvar passwordText = document.querySelector(\"#password\");\n\n\t\tpasswordText.value = password;\n\t\treturn password;\n\t}\n\n\tinclLower.toLowerCase;\n\n\t// Include lower case must be y or n\n\n\tif (inclLower !== \"n\" && inclLower !== \"y\") {\n\t\talert(\"Must answer y or n to including Lower Case characters\");\n\t\treturn;\n\t}\n\n\t// 4. Parameter 4 - Include numeric characters\n\n\tinclNumber = prompt(\"Include Numeric characters in your password? (y or n)\");\n\n\t// Cancel selected on Prompt - no password\n\tif (!inclNumber) {\n\t\tpassword = \"Cancel selected - include Numeric - No password generated\";\n\t\tvar passwordText = document.querySelector(\"#password\");\n\n\t\tpasswordText.value = password;\n\t\treturn password;\n\t}\n\n\tinclNumber.toLowerCase;\n\n\t// Include Numeric must be y or n\n\n\tif (inclNumber !== \"n\" && inclNumber !== \"y\") {\n\t\talert(\"Must answer y or n to including Numeric characters\");\n\t\treturn;\n\t}\n\n\t// 5. Parameter 5 - Include special characters\n\n\tinclSpecial = prompt(\"Include Special characters in your password? (y or n)\");\n\n\t// Cancel selected on Prompt - no password\n\tif (!inclSpecial) {\n\t\tpassword = \"Cancel selected - include Special - No password generated\";\n\t\tvar passwordText = document.querySelector(\"#password\");\n\n\t\tpasswordText.value = password;\n\t\treturn password;\n\t}\n\n\tinclSpecial.toLowerCase;\n\n\t// Include Numeric must be y or n\n\n\tif (inclSpecial !== \"n\" && inclSpecial !== \"y\") {\n\t\talert(\"Must answer y or n to including Special characters\");\n\t\treturn;\n\t}\n\n\t// All prompts answered - now generate password using selected parameters\n\tvar password = generatePassword();\n\tvar passwordText = document.querySelector(\"#password\");\n\n\tpasswordText.value = password;\n}", "function generatePassword() {\n\n // Prompt user for length of the password\n var passwordLength = parseInt(prompt(\"Enter the length of your password between 8 and 128 characters\"));\n\n // Sets input variable to be at least 8 characters and no more than 128 characters\n var minChar = 8;\n var maxChar = 128;\n\n // If the password is not a number, an alert pops up to warn the user, who must click the button again\n\n if (isNaN(passwordLength)) {\n alert(\"You must choose a number between 8 and 128\");\n }\n // Prompts an alert to user if user inputs less than 8 characters\n if (passwordLength < minChar) {\n alert(\"Password must be at least 8 characters\");\n passwordLength = 0;\n }\n\n // Prompts an alert to user if user inputs more than 128 characters\n else if (passwordLength > maxChar) {\n alert(\"Password must be less than 128 characters\");\n passwordLength = 0;\n }\n // Prompts user to confirm at least one required character type\n else {\n var useLowerCase = confirm(\"Click OK to use lowercase characters\");\n var useUpperCase = confirm(\"Click OK to use uppercase characters\");\n var useNumeric = confirm(\"Click OK to use numberic characters\");\n var useSpecialChar = confirm(\"Click OK to use special characters\");\n }\n\n // Prompts alert if user does not confirm at least one character type requirement\n if (useLowerCase === false && useUpperCase === false && useNumeric === false && useSpecialChar === false) {\n alert(\"At least ONE type of character is required to generate your password\");\n }\n else {\n\n // Array of special characters to be included in password\n var specialCharacters = [\"@\", \"%\", \"+\", \"\\\\\", \"/\",\"'\", \"!\", \"#\", \"$\", \"^\", \"?\", \":\", \",\", \")\", \"(\", \"}\", \"{\", \"]\", \"[\", \"~\", \"-\", \"_\", \".\"]; \n\n // Array of numeric characters to be included in password\n var numericCharacters = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n\n // Array of lowercase characters to be included in password\n var lowerCasedCharacters = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n\n // Array of uppercase characters to be included in password\n var upperCasedCharacters = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"];\n\n // Sets up variables that will store the string of characters to be used for password generation\n var characterString = \"\"\n var guaranteedCharacters = []\n \n // Sets up function that will create the random string\n function randomNum(a) {\n var number = Math.floor(Math.random() * a.length);\n return number;\n }\n\n // Declares function that will take the string created from the true user input and turns it into it into characterString as one string\n function pushChar(x, y) {\n if (y) {\n characterString += (x);\n guaranteedCharacters.push(x[randomNum(x)]);\n }\n }\n \n // Function then runs through each of the variables created from line 41 to 67\n pushChar(lowerCasedCharacters, useLowerCase);\n pushChar(upperCasedCharacters, useUpperCase);\n pushChar(numericCharacters, useNumeric);\n pushChar(specialCharacters, useSpecialChar);\n }\n \n // Prompts loop will randomly choose characters from characterString and placing it into passwordString until finished the number of characters collected matches the value assigned to passwordLength\n for (var i = 0, passwordString = \"\"; i < passwordLength; i++) {\n passwordString += characterString[randomNum(characterString)];\n }\n\n // Prompts passwordString to convert from a string into an array called passwordArray\n var passwordArray = passwordString.split(\"\");\n\n //Runs loop that will swap the index of passwordArray with the index of guaranteedCharacter so that any 'True Confirms' for a character will be included in the final password\n for (var i = 0; i < guaranteedCharacters.length; i++) {\n passwordArray[i] = guaranteedCharacters[i];\n }\n\n //Converts the array created on line 100 back into a single string called finalPassword\n var finalPassword = passwordArray.join('');\n\n //Generates the final password\n return finalPassword; \n }", "function getPasswordOptions() {\n var validLength = false;\n var validType = false;\n while (!validLength) {\n getLength = prompt(\"Length of password (10-64): \");\n if (parseInt(getLength) >=10 && parseInt(getLength) <= 64) {\n validLength = true;\n }\n else { \n alert (\"You must enter a number between 10 and 64\"); \n }\n }\n while (!validType) {\n getLowerCase = confirm(\"Include lower case?\");\n getUpperCase = confirm(\"Include upper case?\");\n getNumeric = confirm(\"Include numeric?\");\n getSpecChar = confirm(\"Include special characters?\");\n if (getLowerCase || getUpperCase || getNumeric || getSpecChar) {\n validType = true;\n }\n else {\n alert (\"You must select at least one type of character for your password.\");\n }\n }\n}", "function getPasswordOptions() {\r\n // Variable to store length of password from user input\r\n var length = parseInt(\r\n prompt('How many characters would you like your password to contain?')\r\n );\r\n\r\n\r\n \r\n//Complete your function here...\r\n // Conditional statement to check if password length is a number. Prompts end if this evaluates false\r\nif(typeof length == 'number'){\r\n console.log('it is!')\r\n}\r\nelse{\r\n console.log('no')\r\n}\r\n\r\n // Conditional statement to check if password length is at least 8 characters long. Prompts end if this evaluates false\r\nif (length>=8){\r\n console.log('yes');\r\n}\r\nelse {\r\n console.log ('no')\r\n}\r\n\r\n // Conditional statement to check if password length is less than 128 characters long. Prompts end if this evaluates false\r\n if (length<=128){\r\n console.log('yes');\r\n }\r\n else {\r\n console.log ('no')\r\n\r\n // Variable to store boolean regarding the inclusion of special characters\r\n var specialChar = confirm('Have you included a special character (yes/no)')\r\n\r\n // Variable to store boolean regarding the inclusion of numeric characters\r\n var specialNumber= confirm('Have you included a Number (yes/no)')\r\n // Variable to store boolean regarding the inclusion of lowercase characters\r\n var lowerCase = confirm('Have you included a lowercase (yes/no)')\r\n\r\n // Variable to store boolean regarding the inclusion of uppercase characters\r\n var upperCase = confirm('Have you included an uppercase (yes/no)')\r\n\r\n // Conditional statement to check if user does not include any types of characters. Password generator ends if all four variables evaluate to false\r\n if(specialChar == false && specialNumber == false && lowerCase == false && upperCase == false){\r\n return 0\r\n }\r\n}\r\n}", "function generatePassword() {\n //debugger;\n // Prompt for password legnth\n //debugger;\n passLength = window.prompt(\n \"How long would you like your password? (Please Pick a number between 8 and 128)\"\n );\n\n var lengthOf = parseInt(passLength);\n\n if (Number.isNaN(passLength)) {\n alert(\"Password length must be a number\");\n return null;\n }\n\n if (lengthOf < 8 || lengthOf > 128) {\n alert(\"Password must be greater than 8 but less than 128\");\n return null;\n }\n\n var numbers = window.confirm(\n \"Click OK if you want to include numberical values?\"\n );\n\n var upCase = window.confirm(\n \"Click OK if you want to include uppercase letters?\"\n );\n\n var lowCase = window.confirm(\n \"Click OK if you want to include lowercase letters?\"\n );\n\n var special = window.confirm(\n \"Click OK if you want to include special characters?\"\n );\n\n if (\n numbers == false &&\n upCase == false &&\n lowCase == false &&\n special == false\n ) {\n alert(\"You must select at least one criteria.\");\n return null;\n }\n\n var userSelections = {\n numbers: numbers,\n lowCase: lowCase,\n upCase: upCase,\n special: special,\n lengthOf: lengthOf,\n };\n return combinesSelection(userSelections);\n}", "function password(){\n\t\t\n\t\t\tvar a = document.getElementById(\"pwd1\").value;\n\t\t\tif(a.length <= 8 ){\n\t\t\t\tdocument.getElementById(\"pwd1Hint\").style.display ='block';\n\t\t\t\n\t\t\t}\n\t\t\tif(a.length >= 8){\n\t\t\t\tdocument.getElementById(\"pwd1Hint\").style.display ='none';\n\t\t\t}\n\t\t\n\t\t\t\n\t\t\t\n\t}", "function validatePassword()\n{\n\tvar y = document.forms[\"myForm\"][\"password\"].value;\n\tif ( y.length<6)\n\tdocument.getElementById(\"pass\").innerHTML=\"*Password must be atleast 6 char long\";\n}", "function generatePassword() {\n var passwordLength = parseInt(window.prompt ('How many characters? Enter between 8-128'));\n\n if (passwordLength < 8 || passwordLength > 128) {\n alert('Please select a number between 8-128');\n return \"\"\n }\n\n else if (passwordLength >= 8 && passwordLength <= 128) {\n var numeric = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n var lowercase = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];\n var uppercase = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];\n var specialCharacters = ['@', '&', '+', '/', '!', '#', '$', '^', '?', ';', ':', ',', '(', ')', '{', '}', '[', ']', '~', '-', '_'];\n var possibleChars = [];\n\n var numericIncluded = window.confirm (\"Do you want to include numbers?\");\n switch (numericIncluded) {\n case true:\n possibleChars = numeric;\n break;\n }\n var lowercaseIncluded = window.confirm(\"Do you want to include lowercase?\");\n switch (lowercaseIncluded) {\n case true:\n possibleChars = [].concat(possibleChars, lowercase);\n break;\n }\n var uppercaseIncluded = window.confirm(\"Do you want to include uppercase?\");\n switch (uppercaseIncluded) {\n case true:\n possibleChars = [].concat (possibleChars, uppercase);\n break;\n }\n var specialcharIncluded = window.confirm(\"Do you want to include special characters?\");\n switch (specialcharIncluded) {\n case true:\n possibleChars = [].concat (possibleChars, specialCharacters);\n break;\n }\n\n var newPassword = ''\n for (var i = 0; i < passwordLength; i++) {\n var randomPassword = possibleChars[Math.floor(Math.random() * possibleChars.length)];\n newPassword += randomPassword\n }\n\n return newPassword\n }\n\n else if (isNaN) {\n return \"\"\n }\n}", "function generatePassword(){\n var result=\"\";\n\n // when user click generate button prompt user what length you want to be your password. \n\n var passwordLength = prompt(\"What length you would like in your password. It should be 8 character and maximum 128\")\n\n // use while loop if user enter wrong length\n while(passwordLength <8 || passwordLength >=128)\n {\n alert(\"Incorect input. Please enter the length between 8 and 128\")\n var passwordLength =prompt(\"What length you would like in your password. It should be 8 character and maximum 128\")\n // Prompt user what character you want in lowercase a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z and store the result in variable.\n var lowercaseChar = prompt(\"What lowercase character you want to be in your password, Select options: a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\")\n\n // Prompt user what character you want in uppercase A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z and store the result in variable.\n var uppercaseChar = prompt(\"What lowercase character you want to be in your password, Select options: A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z\")\n\n // // Prompt user what numeric value you want in your password. choose 0,1,2,3,4,5,6,7,8,9 and store the result in variable\n var number = prompt(\"What numeric value you want to be in your password, Select options 0,1,2,3,4,5,6,7,8,9\")\n\n// // Prompt user what character value you want in your password. choose !,@,#,$,%,&,\n\n var specialCharacter=prompt(\"what special character you want in your password selec option !,@,#,$,%,&\")\n\n // store user input in variable called final\n\n var final=lowercaseChar+uppercaseChar+number+specialCharacter;\n var charLength=final.length;\n\n // use for loop to select rendom charater and number and retutn the result.\n\n for ( var i = 0; i < passwordLength; i++ ) {\n result += final.charAt(Math.floor(Math.random() * charLength));\n }\n return result;\n }\n\n\n\n}", "function getPrompt1() {\n let charLen = parseInt(prompt(\"Please choose password length between 8 and 128\" + \"\\n\" + \"Enter as digit\")) ;\n\n console.log(typeof(charLen)) ;\n\n //Validating character length and that entry isn't a word\n if (charLen >= 8 && charLen <= 128) {\n console.log(charLen + \" is acceptable length\") ;\n } else {\n alert(\"Please choose an appropriate length\") ;\n return getPrompt1()\n }\n\n console.log(\"prompt1 has returned \" + charLen)\n return charLen\n}", "function clickGen(){\n\n var passLength = prompt(\"How long would you like the password? (between 8 and 128 characters)\");\n\n if(passLength > 7 && passLength < 129){\n var choiceLower = confirm(\"Would you like to include lowercase letters?\");\n\n var choiceUpper = confirm(\"Would you like to include capital letters?\");\n\n var choiceNum = confirm(\"Would you like to include numbers?\");\n\n var choiceSpecial = confirm(\"Would you like to include special characters?\");\n\n if(choiceLower || choiceUpper || choiceNum || choiceSpecial){\n var password = \"\";\n do{\n var typesMatch = false;\n password = buildPass(passLength, choiceLower, choiceUpper, choiceNum, choiceSpecial);\n typesMatch = passCheck(password, choiceLower, choiceUpper, choiceNum, choiceSpecial);\n }while(typesMatch === false);\n\n writePassword(password);\n }\n // If they didn't select at least 1 type of character to add\n else{\n alert(\"I'm sorry, but you need to select at least one option\");\n writePassword(\"Your Secure Password would be here if you actually wanted one\");\n }\n }\n // If they didn't select a proper password size\n else{\n alert(\"I'm sorry, we need a number input from 8-128 only\");\n writePassword(\"Your Secure Password would be here if you followed directions\");\n }\n}", "function passwordCrit() \n{\n // prompt to determine the length of the password\n pwdLength = prompt(\"How many characters does the password need?\");\n // checks if the length is within the criteria then it asks for the rest of the criteria\n if (pwdLength >= 8 && pwdLength <= 128) \n {\n specChar = confirm(\"Would you like special characters?\");\n numChar = confirm(\"Would you like numbers?\");\n capChar = confirm(\"Would you like to use capital letters\");\n \n }\n // security for when someone tries to input a number too little or too high or any other character.\n else \n {\n alert(\"Pick a number of 8 characters and a max of 128 characters for your password length.\")\n passwordCrit();\n }\n}", "function generatePassword() {\n let passLength = prompt(\"Please enter a number between 8-128 for the number of characters in you password\");\n if (passLength > 128){\n alert(\"Error: password must not exceed 128 characters\");\n generatePassword();\n return;\n }\n if (passLength < 8){\n alert(\"Error: password must be at least 8 characters long\");\n generatePassword();\n return;\n }\n\n // Confirm lowercase letters\n let passLower = confirm(\"Would you like lower case characters?\");\n if (passLower == true){\n optionChoices.push(lowerOptions);\n }\n\n // Confirm uppercase letters\n let passUpper = confirm(\"Would you like upper case characters?\");\n if (passUpper == true) {\n optionChoices.push(upperOptions);\n }\n\n // Confirm numerals\n let passNumeric = confirm(\"Do you want numbers to be included?\");\n if (passNumeric == true) {\n optionChoices.push(numericOptions);\n }\n\n // Confirm special characters\n let passSpecial = confirm(\"Do you want special characters included?\");\n if (passSpecial == true){\n optionChoices.push(specialOptions);\n }\n // For Loop that generates the characters of the requested password\n for (let i = 0; i < passLength; i++){\n let optionsArray = optionChoices[Math.floor(Math.random() * optionChoices.length)];\n let passSelection = optionsArray.charAt(Math.floor(Math.random() * optionsArray.length));\n generatedPass += passSelection;\n }\n}", "function writePassword() {\n \n console.log(passwordLength);\n var passwordText = document.querySelector(\"#password\");\n var generatedPassword = generatePassword();\n passwordText.value = generatedPassword;\n\n}", "function generatePW(){\n\t\tvar pwLength = parseInt(prompt(\"Enter the length of your password between 8 and 128 characters:\"));\n\t\tif (!pwLength) { //validation for length of password fits criteria with these two checks\n\t\t alert(\"this needs a value\");\n\t\t return;\n\t\t} if ( pwLength < 8 || pwLength > 128 ) {\n\t\t pwLength = parseInt(prompt(\"Choose a number between 8 and 128\"));\n\t\t\treturn;\n\t\t} \n\n\t\tlet confirmNumber = confirm(\"Would you like to include numbers?\");\n\t\tlet confirmCharacter = confirm(\"Would you like to include special characters?\");\n\t\tlet confirmUpper = confirm(\"Would you like to include uppercase letters?\");\n\t\tlet confirmLower = confirm(\"Would you like to include lowercase letters?\");\n\t\t\n\t// validation that at least one type of character must be selected\n\tif (!confirmNumber && !confirmCharacter && !confirmUpper && !confirmLower) {\n\t\talert('Must select at least one type of password character!');\n\t\treturn;\n\t}\t\n\t// set password to empty string to build array for password based on length and char type\n\tvar password = '';\n\n\tfor ( var i = 0; i < pwLength; i++) {\n\t\tif(confirmNumber && password.length < pwLength) {\n\t\t\tpassword += getRandom(numberCase);\n\t\t}\n\t\tif(confirmCharacter && password.length < pwLength) {\n\t\t\tpassword += getRandom(specialCase);\n\t\t}\n\t\tif(confirmUpper && password.length < pwLength) {\n\t\t\tpassword += getRandom(upperCase);\n\t\t}\n\t\tif(confirmLower && password.length < pwLength) {\n\t\t\tpassword += getRandom(lowerCase);\n\t\t}\n\t}\n\treturn password;\n}", "function generatePassword(){\n passLength = parseInt(prompt(\"How long do you want the password to be? (8-128)\"))\n while(isNaN(passLength) || passLength == null){\n passLength =parseInt(prompt(\"No letters allowed or blank allowed, please enter a number between 8-128\"))\n }\n if(passLength < 8){\n alert(\"The password needs to have at least 8 characters. Hit generate to start again\")\n }\n else if(passLength > 128){\n alert(\"The password can't exceed 128 character. (Why would you need such a long password?) Hit generate to start again\")\n }\n else if(passLength >= 8 && passLength <=128){\n var lowPass = confirm(\"Would you like lowercase letters in the password?\")\n var upperPass = confirm(\"Would you like uppercase letters in your password?\")\n var numPass = confirm(\"Would you like numbers in your password?\")\n var symPass = confirm(\"Would you like symbols in the password?\")\n if(lowPass == false && upperPass == false && numPass == false && symPass == false){\n alert(\"You have to select at least one variable to generate a code, please hit generate password to start again.\")\n }\n logic(passLength, lowPass, upperPass, numPass, symPass)\n }\n return storePass\n}", "function writePassword() {\n var charCount = userOption()\n var password = generatePassword(charCount);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n console.log(charCount);\n}", "function generatePassword(){\n //ask for password length and assign length to lengthCriteria \n var lengthCriteria = prompt(\"Select Password length. Please enter a NUMBER between 8 and 128 characters.\");\n\n // print lengthCriteria to console \n console.log(lengthCriteria);\n\n //Verify length selection is allowable and if so procede to uppercase inclusion/exclusion\n if (isNaN(lengthCriteria) !== isNaN(\"1\") ){\n alert(\"You have entered an invalid value!\");\n return;\n }\n if (lengthCriteria < 8 || lengthCriteria > 128 ){\n alert(\"You have entered an invalid value!\");\n return;\n }\n if (lengthCriteria >= 8 && lengthCriteria <= 128 ){\n var upperCase = prompt(\"Would you like to use upperCase letters? Please enter y for yes or n for no.\");\n \n //insure input is as requested and uppercase. if so print to console and procede to lowercase inclusion/exclusion\n upperCase = upperCase.toUpperCase(); \n if(upperCase != \"N\" && upperCase != \"Y\"){\n alert(\"Sorry you did not submit a valid entry!\");\n return;\n }\n\n // Print uppercase to console\n console.log(upperCase);\n\n //insure input is as requested and uppercase. if so print to console and procede to numberical inclusion/exclusion\n var lowerCase = prompt(\"Would you like to use lowerCase letters? Please enter y for yes or n for no.\");\n lowerCase = lowerCase.toUpperCase(); \n if(lowerCase != \"N\" && lowerCase != \"Y\"){\n alert(\"Sorry you did not submit a valid entry!\");\n return;\n }\n\n // Print lowercase to console \n console.log(lowerCase);\n\n //Numerical inclusion?\n var numbers = prompt(\"Would you like to include numbers? Please enter y for yes or n for no.\");\n numbers = numbers.toUpperCase(); \n if(numbers != \"N\" && numbers != \"Y\"){\n alert(\"Sorry you did not submit a valid entry!\");\n return;\n }\n\n //print number to console\n console.log(numbers);\n\n var specialChars = prompt(\"Would you like to include special characters? Please enter y for yes or n for no\")\n specialChars = specialChars.toUpperCase(); \n if(specialChars != \"N\" && specialChars != \"Y\"){\n alert(\"Sorry you did not submit a valid entry!\");\n return;\n }\n\n //print specialchar to console\n console.log(specialChars);\n\n }\n //make all local values global\n genCriteria[0] = upperCase;\n genCriteria[1] = lowerCase;\n genCriteria[2] = numbers;\n genCriteria[3] = specialChars;\n console.log(genCriteria);\n LengthCriteria = lengthCriteria;\n uppercase = upperCase;\n lowercase = lowerCase;\n numerical = numbers;\n special = specialChars;\n //create an array to detect if no character type was selected\n var notAllowed = [\"N\", \"N\", \"N\", \"N\"];\n if (genCriteria.toString() === notAllowed.toString()){\n alert(\"Sorry you must select at least one character type to constitute your password.\");\n return;\n }\n //if at least one char type is selected the generate selected characterset\n else if (genCriteria !== notAllowed){\n if (genCriteria[0] == \"Y\"){\n selectChars = \"QWERTYUIOPLKJHGFDSAZXCVBNM\";\n }\n if (genCriteria[1] == \"Y\"){\n selectChars = selectChars.concat('qwertyuioplkjhgfdsazxcvbnm');\n }\n if (genCriteria[2] == \"Y\"){\n selectChars = selectChars.concat(\"0123456789\");\n }\n if (genCriteria[3] == \"Y\"){\n selectChars = selectChars.concat(\"!@#$%^&*()-_+=~/|[]{},.`<>?\");\n }\n }\n\n // print charset to the console for verification \n console.log(selectChars);\n\n //Generate Password from selected characterset and length and store it in pw\n var pw = \"\";\n for (var i = 0; i < LengthCriteria; i++){\n pw = pw.concat(selectChars.charAt(Math.floor(Math.random() * selectChars.length)));\n }\n\n //pass pw to \n return pw;\n\n }", "function generatePassword() {\n // initialize variables for the password criteria\n var passwordLength = 0;\n var wantsLowercase = false, wantsUppercase = false, wantsNumeric = false, wantsSpecial = false;\n\n // ask for the password length, and keep asking until they enter a valid response\n while (isNaN(passwordLength) || passwordLength < 8 || passwordLength > 128) {\n passwordLength = parseInt(prompt(\"Enter the desired password length as a number between 8 and 128, inclusive\"));\n }\n\n // ask which character sets the user wants included in the password, and keep asking if they don't choose any\n while (!(wantsLowercase || wantsUppercase || wantsNumeric || wantsSpecial)) {\n alert(\"Your password may contain lowercase letters, uppercase letters, numbers, and/or special characters.\\nChoose at least one type\");\n wantsLowercase = confirm(\"Do you want your password to include lowercase letters?\");\n wantsUppercase = confirm(\"Do you want your password to include uppercase letters?\");\n wantsNumeric = confirm(\"Do you want your password to include numbers?\");\n wantsSpecial = confirm(\"Do you want your password to include special characters?\");\n }\n\n // create a variable for the characters the user wants and add each character set that they selected\n var userCharset = \"\";\n if (wantsLowercase) { userCharset += lowercase; }\n if (wantsUppercase) { userCharset += uppercase; }\n if (wantsNumeric) { userCharset += numbers; }\n if (wantsSpecial) { userCharset += specials; }\n\n // initialize a variable to generate the password into\n var password = \"\";\n\n // loop a number of times equal to the desired length\n for (let i = 0; i < passwordLength; i++) {\n password += userCharset[Math.floor(Math.random() * userCharset.length)];\n }\n\n return password;\n}", "function passUnifyPrompted() {\n\n// This do/while brings in the password length\ndo {\n alert(\"Please select your password length. Length must be between 8 to 128 characters.\")\n passLength = prompt(\"Select password Length (8 - 128):\");\n passLength = +passLength;\n if (passLength === 0) {\n break;\n }\n}\nwhile (passLength < 8 || passLength > 128);\n\n// This do/while initiates the criteria questionnaire\ndo {\n if (passLength === 0) {\n break;\n }\n alert(\"Please select the criteria for your password. You must choose at least one option.\")\n runQuestionnaire();\n }\n // This validates whether or not an option was picked\nwhile (lower === false && upper === false && number === false && special === false);\n\nvar passComplete = '';\n\nfor (var i = 0; i < passLength; i++) {\n passComplete = passComplete + passGenerate(lower, upper, number, special);\n }\npasswordText.value = passComplete;\n}", "function passwordPrompt() {\n\n\n var password=\"\";\n\n// asking user desired password length\nvar passwordLength = prompt(\"How many characters would you like in your password? (Must be between 8 and 128 characters)\");\n\n\n// make sure the value entered is a number\nif (isNaN(passwordLength)===true){\n alert(\"Password length must be a number.\");\n return;\n};\n\n// make sure password length is correct\nif (passwordLength < 8 || passwordLength > 128) {\n alert(\"Your password must be between 8 and 128 characters.\");\n return;\n}; \n\n\n// if the data is good proceed with character selection\n var includeLowerCase = confirm(\"Would you like to include lowercase characters?\"); \n var includeUpperCase = confirm(\"Would you like to include UPPERCASE characters?\");\n var includeNumbers = confirm(\"Would you like to include numbers?\");\n var includeSpecial = confirm(\"Final question! Would you like to include special characters?\");\n\n//make sure at least one character type was selected\nif (includeLowerCase === false && includeUpperCase === false && includeNumbers === false && includeSpecial === false) {\n alert (\"Password creation failed. Please select at least one character type to include.\");\n return;\n };\n\n\n//Random math to select characters\nfor (var i = 0; i < passwordLength; i++){\n\n var r= Math.floor(Math.random()*3);\n\n if (includeUpperCase === true && r=== 0){\n password += getRandomUpper();\n } else if (includeLowerCase === true && r=== 1){\n password += getRandomLower();\n } else if (includeSpecial === true && r=== 2){\n password += getRandomSpecial();\n } else if (includeNumbers === true && r=== 3){\n password += getRandomNumber();\n } else {\n i--;\n }\n \n };\n\n //Write the password to the screen\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function generatePassword() {\n const passLength = parseInt(prompt('How long should your password be?'))\n\n if (passLength < 8 || passLength > 128) {\n alert('please pick a length between 8 and 128 characters.')\n generatePassword()\n }\n \n const lowC = confirm('do you want lowercase characters?')\n const upC = confirm('do you want uppercase characters?')\n const numC = +confirm('do you want numbers?')\n const specC = confirm('do you want special characters?')\n let passHolder = ''\n newPass = ''\n if (lowC){\n passHolder += lowerChar;\n }\n if (upC) {\n passHolder += upperChar;\n }\n if (numC) {\n passHolder += numberChar;\n }\n if (specC) {\n passHolder += specialChar;\n }\n if (!lowC && !upC && !numC && !specC) {\n alert('you need to choose at least one character set.')\n generatePassword()\n }\n\n for (let i=0; i < passLength; i++) {\n let randomIndex = Math.floor(Math.random() * passHolder.length)\n newPass += passHolder[randomIndex]\n }\n return newPass\n}", "function generatePassword() {\n length = parseInt(prompt(\"Choose a number from 8 to 28 for your password?\"));\n uppCase = confirm(\"Would you like uppercase?\");\n lowCase = confirm(\"Would you like lowercase?\");\n specChar = confirm(\"Would you like special characters?\");\n if (uppCase && lowCase && specChar ) {\n firstCase();\n } else if (uppCase === false && lowCase === true && specChar === true) {\n secondCase();\n } else if (lowCase === false && uppCase === true && specChar === true ) {\n thirdCase();\n } else if (specChar === false && lowCase === true && uppChar === true ) {\n fourthCase(); \n } else {\n alert(\"invalid entry\");\n generatePassword();\n }\n }", "function generatePassword () {\n var pass = prompt(\"Enter the number of characters for desired password length between 8 and 128.\")\n\n if (pass < 8 || pass > 128) {\n alert(\"That is an invalid number. Try again!\")\n return generatePassword ();\n }\n if (isNaN(pass)) {\n alert(\"You can only choose a number. Try again!\")\n return generatePassword();\n }\n\n if (pass => 8 && pass <= 128) {\n low = confirm(\"Do you want lower case letters within your password?\")\n cap = confirm(\"Do you want capitalized letters in your password?\")\n num = confirm(\"Do you want numbers in your password?\")\n char = confirm(\"Do you want special characters in your password?\")\n \n if (low === false && cap === false && num === false && char === false) {\n alert(\"You need to make a selection. Try again!\");\n return generatePassword();\n }\n\n if (low == true) {\n charactersL = \"abcdefghijklmnopqrstuvwxyz\" \n }\n else {\n charactersL = \"\"\n }\n \n if (cap == true) {\n charactersUp = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" \n }\n else {\n charactersUp = \"\"\n }\n\n if (num == true) {\n numbers = \"0123456789\"\n }\n else {\n numbers = \"\"\n }\n\n if (char == true) {\n specChar = \"!\\\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\" \n } \n else {\n specChar = \"\"\n }\n \n\n random = (charactersL + charactersUp + numbers + specChar)\n\n for (let i = 0; i < pass; ++i) {\n newPass += random.charAt(Math.floor(Math.random() * random.length));\n }\n\n }\n return newPass;\n}", "function generatePassword() {\n\n window.alert(\"Let's make you a secure password!\");\n\n var passwordLength = window.prompt(\"How long would you like your password? Choose between 8 - 128.\");\n\n //makes sure the input is between 8 and 128, not below or above\n while (passwordLength <= 7 || passwordLength >= 129) {\n\n window.alert(\"Your password must be 8 - 128 characters long!\");\n\n var passwordLength = window.prompt(\"How long would you like your password? Choose between 8 - 128.\");\n\n } \n\n window.alert(\"Your password will be \" + passwordLength + \" characters long!\");\n \n console.log(passwordLength);\n\n //confirms which characters the user wants to include in password\n var passwordUpperChar = window.confirm(\"Would you like uppercase letters in your password? Click OK\");\n\n var passwordLowerChar = window.confirm(\"Would you like lowercase letters in your password? Click OK\");\n\n var passwordSpecialChar = window.confirm(\"Would you like special characters in your password? Click OK\");\n\n var passwordNumber = window.confirm(\"Would you like numbers in your password? Click OK\");\n \n // Makes sure that at least one option is true\n while (passwordUpperChar === false && passwordLowerChar === false && passwordSpecialChar === false && passwordNumber === false) {\n\n //Alerts the user that they must choose at least one option\n window.alert(\"You have to choose at least one of the options for a safe password!\");\n \n //Brings up confirmations again to choose at least one option\n var passwordUpperChar = window.confirm(\"Would you like uppercase letters in your password? Click OK\");\n\n var passwordLowerChar = window.confirm(\"Would you like lowercase letters in your password? Click OK\");\n\n var passwordSpecialChar = window.confirm(\"Would you like special characters in your password? Click OK\");\n\n var passwordNumber = window.confirm(\"Would you like numbers in your password? Click OK\");\n }\n\n //storage for the generated password\n var finalPassword = [];\n\n //adds each option to the final password string\n if (passwordUpperChar) {\n\n finalPassword = finalPassword.concat(upperChar);\n\n console.log(\"uppercase characters added to password!\");\n\n console.log(passwordUpperChar);\n\n } else {\n\n console.log(\"uppercase characters not added to password!\");\n }\n\n if (passwordLowerChar) {\n\n finalPassword = finalPassword.concat(lowerChar);\n\n console.log(\"lowercase characters added to password!\");\n\n } else {\n\n console.log(\"lowercase characters not added to password!\");\n }\n\n if (passwordSpecialChar) {\n\n finalPassword = finalPassword.concat(specialChar);\n\n console.log(\"special characters added to password!\");\n\n } else {\n\n console.log(\"special characters not added to password!\");\n\n }\n\n if (passwordNumber) {\n\n finalPassword = finalPassword.concat(number);\n\n console.log(\"numbers added to password!\");\n\n } else {\n\n console.log(\"numbers not added to password!\");\n\n }\n\n console.log(finalPassword);\n\n //puts all specifications into a string\n var randomPasswordString = \"\";\n\n for (var i = 0; i < passwordLength; i++) {\n randomPasswordString = randomPasswordString + finalPassword[Math.floor(Math.random() * finalPassword.length)];\n }\n\n return randomPasswordString;\n \n}", "function askHowManyCharacters() {\n var\n text = window.prompt(\"How many characters do you want in your password? (8-128)\"), // ask user for input\n number = parseInt(text, 10); // attempt to convert input into a number, radix 10 select (0-9)\n\n if (isNaN(number) || number < 8 || number > 128) { // if not valid input\n alert(\"Input must be at valid number between 8 and 128\"); // tell user what is a valid input\n return askHowManyCharacters(); // ask user for input again\n }\n console.log(number);\n return number; // return valid input\n}", "function generatePassword() {\n var userPasswordLength = parseInt(window.prompt(\"Please select a number between 8 - 128 characters\"))\n\n // Checks for valid input, if a number and between 8 -128\n // if not, stops to script - user to click generate button\n if (isNaN(userPasswordLength) || userPasswordLength < 8 || userPasswordLength > 128) {\n alert(\"That was not a valid input. Please select a number between 8 - 128\")\n return\n } else {\n\n // prompt for criteria for user PW requirements (lowercase, uppercase, numeric, and/or special characters)\n var lowerCase = confirm(\"Do you want your password to have lowercase characters include?\");\n var upperCase = confirm(\"Do you want your password to have uppercase characters include?\");\n var numeric = confirm(\"Do you want your password to have numeric characters include?\");\n var specialCharacters = confirm(\"Do you want your password to have special characters include?\");\n\n\n // checks to see if user selected at least one pw requirement\n // if not, stops to script - user to click generate button\n if (lowerCase === false && upperCase === false && numeric === false && specialCharacters === false) {\n alert(\"You must select at least one option from the password criteria options\")\n return\n }\n\n // sets variables for loop count and password capture\n var countLength = userPasswordLength\n var password = \"\"\n\n // Based on user requirements, runs through loop and builds password\n // While Loop - checks to confirm that count length has not reached 0\n // if block reduce count number to prevent a PW being generated outside of user requirements\n while (countLength != 0) {\n\n // if checks to confirm the user would like lowercase in PW\n // if also checks to see if count != 0, (not require for fist if i know)\n if (lowerCase === true && countLength != 0) {\n let arrayNumber = getNumber(26);\n password += alphabet[arrayNumber];\n countLength--;\n arrayNumber = \"\";\n }\n // if checks to confirm the user would like lowercase in PW\n // if also checks to see if count != 0, as loop can be entered and count can be 0 after another if is completed\n if (upperCase === true && countLength != 0) {\n // uses getNumber function to select a random number\n let arrayNumber = getNumber(26);\n // selects letter in the alphabet array and adds it to PW, also converts to uppercase\n password += alphabet[arrayNumber].toUpperCase();\n // reduces count by 1 to prevent PW exceeding required length\n countLength--;\n // cleans out var for next loop\n arrayNumber = \"\";\n }\n if (numeric === true && countLength != 0) {\n let arrayNumber = getNumber(9);\n password += arrayNumber;\n countLength--;\n arrayNumber = \"\";\n }\n if (specialCharacters === true && countLength != 0) {\n let arrayNumber = getNumber(7)\n // selects special char and add it to pw var\n password += specialChars[arrayNumber]\n countLength--;\n arrayNumber = \"\";\n }\n }\n }\n // calls shuffleWord function on PW to ensure its more secure\n // This is because the PW generation in the while loop follows the same pattern\n mixedPW = shuffleWord(password)\n // return the PW to the wite PW function so that the pw is provided to the user\n return mixedPW\n}", "function generatePassword() {\n // Ask the user how many characters they want the password to be\n var length = prompt(\"How many characters would you like your password to contain? (8-128 characters)\");\n // If they input a number less than 8 and greater than 128 then alert then and ask them again \n while (length < 8 || length > 128) {\n alert(\"Please choose a length greater than 8 characters and less that 128 characters.\");\n length = prompt(\"How many characters would you like your password to contain? (8-128 characters)\");\n };\n while (isNaN(length) === true) {\n alert(\"Please type in a NUMBER between 8 and 128.\");\n length = prompt(\"How many characters would you like your password to contain? (8-128 characters)\");\n };\n\n // Ask they about the characters they'd like to include\n var doLowercase = confirm(\"If you would like lowercase letters in your password, click OK.\");\n var doUppercase = confirm(\"If you would like uppercase letters in your password, click OK.\");\n var doNumbers = confirm(\"If you would like numbers in your password, click OK.\");\n var doSpecial = confirm(\"If you would like special characters in your password, click OK.\");\n\n // Make variables for all the characters we will choose from\n var lowLetters = \"abcdefghijklmnopqrstuvwxyz\";\n var upLetters = \"ABCDEFGHIJKLMNOP\";\n var numbers = \"123456789\";\n var specials = \"!\\\"\\#\\$\\%\\&\\'()*+,-./:;<=>?@][\\\\^_`{|}~\";\n\n // Create an empty string to store the types of characters the user wants\n var chosenCharacters = \"\";\n\n // Make newPassword an empty string so we can fill it with characters\n newPassword = \"\";\n\n // Concat the character types that the user wants into chosenCharacters\n if (doLowercase === true) {\n chosenCharacters = chosenCharacters.concat(lowLetters);\n };\n if (doUppercase === true) {\n chosenCharacters = chosenCharacters.concat(upLetters);\n };\n if (doNumbers === true) {\n chosenCharacters = chosenCharacters.concat(numbers);\n };\n if (doSpecial === true) {\n chosenCharacters = chosenCharacters.concat(specials);\n };\n\n // Randomly select characters from chosenCharacters and add each new character to newPassword until it reaches the length that the user chose\n for (i = 0; i < length; i++) {\n var charType = chosenCharacters.charAt(Math.floor(Math.random() * chosenCharacters.length));\n newPassword = newPassword + charType;\n };\n }", "function generatePassword() {\n var passwordLength = prompt(\n \"Please choose how many characters you would like for your password between 8 and 128\"\n );\n\n if (passwordLength >= 8 && passwordLength <= 128) {\n alert(\n \"Thanks. The amount of characters in your password will be\" +\n passwordLength\n );\n } else {\n alert(\"Your number must be between 8 and 128\");\n generatePassword();\n }\n\n // Create prompts for your other password parameters\n // Reminder that for confirm prompts. Ok = True, Cancel = False\n var numbers = confirm(\"Do you want numbers in your password?\");\n\n console.log(numbers);\n\n var lowerCases = confirm(\"Do you want lowercases in your password?\");\n\n console.log(lowerCases);\n\n var upperCases = confirm(\"Do you want uppercases in your password?\");\n console.log(upperCases);\n\n var special = confirm(\"Do you want special characters in your password?\");\n console.log(special);\n}", "function writePassword(passwordLength, includedLowercase, includedUppercase, includedNumbers, includedSpecialCharacters ) {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function generatePassword (){\n var passLength = (window.prompt (\"How many characters would you like to include (be sure to select between 8 and 128)\"))\n while (passLength <= 7 || passLength >= 129){\n alert(\"Please select a number between 8 and 128\")\n var passLength = (window.prompt (\"How many characters would you like to include (be sure to select between 8 and 128)\"))\n }\n var incUppercase = confirm (\"Include Uppercase Letters?\")\n var incLowercase = confirm (\"Include Lowercase Letters?\")\n var incSymbols = confirm (\"Include Symbols?\")\n var incNumbers = confirm (\"Include Numbers?\")\n \n\n \n\n\n// Determine what will be included based on the user's choice from the questions above\n var included = \"\";\n if (incUppercase) {\n included = included + uppercase;\n } if (incLowercase) { \n included = included + lowercase; \n } if (incSymbols) { \n included = included + symbols;\n } if (incNumbers) { \n included = included + numbers;\n }\n\n\n // Loop to create the password itself using the information gathered above\n var result = \"\"\n for (var i = 0; i < passLength; i++) {\n result = result + included[Math.floor(Math.random() * included.length)];\n }\n \n return(result);\n\n}", "function userSelectType() {\n howMany = prompt(\"How many characters would you like your password to contain.\")\n if (howMany < 8 || howMany > 128) {\n alert(\"Please select a value between 8 and 128.\")\n } else {\n firstType = confirm(\"Click OK to add lowercase characters.\")\n secondType = confirm(\"Click OK to add uppercase characters.\")\n thirdType = confirm(\"Click OK to add numeric characters.\")\n fourthType = confirm(\"Click OK to add special characters.\")\n }\n}", "function generatePassword() {\n // User Input\n var askPwdLength = prompt(\"How long do you want your password to be? Your password MUST be 8 to 128 characters.\");\n\n // User can't input anything less than 8 or greater than 128 characters long\n if (askPwdLength >= 8 && askPwdLength <= 128) {\n alert(\"Your password will have \" + askPwdLength + \" characters\");\n console.log(askPwdLength);\n\n var upperCase = confirm(\"Do you want uppercase characters in your password?\")\n var lowerCase = confirm(\"Do you want lowercase characters in your password?\")\n var special = confirm(\"Do you want special characters in your password?\")\n var number = confirm(\"Do you want numbers in your password?\")\n\n var bankChar = \"\"\n var password = \"\"\n\n if (upperCase) {\n bankChar += \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n }\n\n if (lowerCase) {\n bankChar += \"abcdefghijklmnopqrstuvwxyz\"\n }\n\n if (special) {\n bankChar += \"!#$%&'()*+,-./:;<=>?@_`{|}[]~\"\n }\n\n if (number) {\n bankChar += \"0123456789\"\n }\n\n for (i = 0; i < askPwdLength; i++) {\n console.log(\"i\" + i);\n password += bankChar.charAt(Math.floor(Math.random() * bankChar.length));\n console.log(\"password\" + password)\n console.log(\"bankChar\" + bankChar)\n }\n\n return (password);\n } else {\n alert(\"Your password needs to be 8-128 characters long. Try again.\");\n // var askPwdLength = prompt(\"How long do you want your password to be? Your password must be atleast 8 to 128 characters.\");\n }\n}", "function generatePassword() {\n\n//Query user on how many characters they would like in their password\n var charCount = prompt(\"How many characters would you like your password to be? Please enter a value between 8 and 128.\");\n var charCountInput = parseInt(charCount)\n\n if (charCountInput < 8 || charCountInput > 128 || isNaN(charCountInput)) {\n alert(\"Please enter a valid number of characters\")\n } \n\n else {\n console.log(charCountInput);\n\n//Query user if lowercase should be included\n let lowerCaseInput = confirm(\"Would you like to include lowercase characters? Press OK to Confirm.\");\n\n console.log(lowerCaseInput);\n\n if (lowerCaseInput) {\n alert(\"Okay we will include lowercase characters\")\n }\n else {\n alert(\"Okay we won't include lowercase characters\")\n };\n//Query user if uppercase should be included\n let upperCaseInput = confirm(\"Would you like to include uppercase characters? Press OK to Confirm\");\n\n console.log(upperCaseInput);\n\n if (upperCaseInput) {\n alert(\"Okay we will include uppercase characters\")\n }\n else {\n alert(\"Okay we won't include uppercase characters\")\n };\n\n//Query user if numbers should be included\n let numCharInput = confirm(\"Would you like to include numbers? Press OK to Confirm\");\n\n console.log(numCharInput);\n\n if (numCharInput) {\n alert(\"Okay we will include numbers\")\n }\n else {\n alert(\"Okay we won't include numbers\")\n };\n\n//Query user if special character should be included\n let specialCharInput = confirm(\"Would you like to include special characters? Press OK to Confirm\");\n\n console.log(specialCharInput);\n\n if (specialCharInput) {\n alert(\"Okay we will include special characters\")\n }\n else {\n alert(\"Okay we won't include special characters\")\n };\n\n//Begin 13 combinations of possibilites for user options \n if (lowerCaseInput && upperCaseInput && numCharInput && specialCharInput) {\n function genPass(){\n var length = charCountInput;\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass();\n }\n else if (upperCaseInput && numCharInput && specialCharInput) {\n function genPass2(){\n var length = charCountInput;\n charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass2();\n }\n else if (lowerCaseInput && numCharInput && specialCharInput) {\n function genPass3(){\n var length = charCountInput;\n charset = \"abcdefghijklmnopqrstuvwxyz1234567890!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass3();\n }\n else if (lowerCaseInput && upperCaseInput && specialCharInput) {\n function genPass4(){\n var length = charCountInput;\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass4();\n }\n else if (lowerCaseInput && upperCaseInput && numCharInput) {\n function genPass5(){\n var length = charCountInput;\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass5();\n }\n else if (numCharInput && specialCharInput) {\n function genPass6(){\n var length = charCountInput;\n charset = \"1234567890!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass6();\n }\n else if (upperCaseInput && specialCharInput) {\n function genPass7(){\n var length = charCountInput;\n charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass7();\n }\n else if (upperCaseInput && numCharInput) {\n function genPass8(){\n var length = charCountInput;\n charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass8();\n }\n else if (lowerCaseInput && specialCharInput) {\n function genPass8(){\n var length = charCountInput;\n charset = \"abcdefghijklmnopqrstuvwxyz!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass8();\n }\n else if (lowerCaseInput && numCharInput) {\n function genPass9(){\n var length = charCountInput;\n charset = \"abcdefghijklmnopqrstuvwxyz1234567890\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass9();\n }\n else if (lowerCaseInput && upperCaseInput) {\n function genPass10(){\n var length = charCountInput;\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass10();\n }\n else if (lowerCaseInput) {\n function genPass11(){\n var length = charCountInput;\n charset = \"abcdefghijklmnopqrstuvwxyz\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass11();\n }\n else if (upperCaseInput) {\n function genPass12(){\n var length = charCountInput;\n charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass12();\n }\n else if (numCharInput) {\n function genPass13(){\n var length = charCountInput;\n charset = \"1234567890\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass13();\n }\n else if (specialCharInput) {\n function genPass13(){\n var length = charCountInput;\n charset = \"!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\"\n retVal = \"\";\n for (var i = 0; i < length; i++) {\n retVal += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return retVal;\n }\n return genPass13();\n }\n //Validation alert for not choosing at least one character type\n else {\n alert (\"Please choose at least one character type to include\")\n };\n }\n}", "function writePassword() {\n var password = \"\";\n var passwordText = document.querySelector(\"#password\");\n // Prompt shows up allowing for one to insert a value\n var length = prompt(\"Please enter password length between 8 to 128 characters\");\n // while loop to check for numerical value and also length\n while (isNaN(length)||length < 8 || length >128){\n alert(\"Please enter a numerical value or a value between 8 to 128 characters\")\n length = prompt(\"Please enter password length between 8 to 128 characters\")\n }\n// Opens comfirm prompts that allow for user to choose characters\n var uppercase = confirm(\"Would you like uppercase letters?\");\n var lowercase = confirm(\"Would you like lowercase letters?\");\n var symbols = confirm (\"Would you like symbols?\");\n var numbers = confirm (\"World you like numbers?\"); \n// If user doesn't choose any of the options it repeats and alerts them to select atleast one\n while (!uppercase && !lowercase && !symbols && !numbers){\n alert(\"Please choose one of the following characters.\");\n uppercase = confirm(\"Would you like uppercase letters?\");\n lowercase = confirm(\"Would you like lowercase letters?\");\n symbols = confirm (\"Would you like symbols?\");\n numbers = confirm (\"World you like numbers?\"); \n }\n// constants for the uppercase,lowercase,numbers,and symbols\n var master = \"\";\n const up = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n const low = \"abcdefghijklmnopqrstuvwxyz\";\n const num = \"1234567890\";\n const sym = \"!\\\"#$%&\\'()*+,-./:;<=>?@[\\\\]^_`{|}~\";\n// If statments checking if statments are true added to varible master\n if (uppercase == true) {\n master += up\n }\n if (lowercase == true) {\n master += low\n }\n if (symbols == true) {\n master += sym\n }\n if (numbers == true) {\n master += num\n }\n\n for (let i = 0; i < length; i++) {\n password += master[Math.floor(Math.random() * master.length)];\n }\n\n\n passwordText.value = password;\n\n}", "function writePassword(passwordLength) {\n var password = generatePassword(passwordLength);\n\n passwordText.value = password;\n}", "function generatePassword(){\n // Checking the password length who must be betwen and also including 8 and 128\n var passwordLength = 0 \n while (passwordLength<8 || passwordLength>128){\n passwordLength= prompt(\"Choose a length of at least 8 character and no more thant 128\");\n \n }\n //Confirming what type of characters users want to include in his password \nvar confirmLowerCase = confirm(\"Do you want lowercase in your password\");\nvar confirmUpperCase = confirm(\"Do you want uppperCase in your password\");\nvar confirmNumber = confirm(\"Do you want any number in your character\");\nvar confirmSpecialCharacter = confirm(\"Do you want any specialcharacter in your password?\");\n// Controling they choice by making sure that they choose at least one character\n while(!confirmLowerCase && !confirmUpperCase && !confirmNumber && !confirmSpecialCharacter){\n alert(\n \"You must choose one of those character\"\n )\n generatePassword();\n }\n//Building the array of each type of characters\nvar lowerCase = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"];\nvar upperCase = [\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];\nvar number = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\",\"9\"];\nvar specialCharacter = ['@', '%', '+', '\\\\', '/', \"'\", '!', '#', '$', '^', '?', ':', ', ', ')', '(', '}', '{', ']', '[', '~', '-', '_', '.'];\nvar passwordChoices=[];\n\n//concatenating together whatever characters they confirm to chose from\nif (confirmLowerCase){\n passwordChoices=passwordChoices.concat(lowerCase);\n}\n\nif (confirmUpperCase){\n passwordChoices=passwordChoices.concat(upperCase);\n}\nif (confirmNumber){\n passwordChoices=passwordChoices.concat(number);\n}\nif (confirmSpecialCharacter){ \n passwordChoices=passwordChoices.concat(specialCharacter)\n}\nconsole.log(passwordChoices);\n\nvar randomPassword= \"\";\n//loop through the number of character they picked which constitute the password length;\nfor ( var i= 0; i<passwordLength; i++){\n // randomly picking a number of index out of passwordChoices\n var numberPicked = Math.floor(Math.random()*passwordChoices.length);\n //adding each character to randomPassword to build up the full password\n randomPassword += passwordChoices[numberPicked];\n \n console.log(randomPassword);\n}\nreturn randomPassword;\n}", "function checkLength(l) {\n var regExp = /[a-zA-Z]/g;\n if (regExp.test(l)) {\n window.alert(\"Password must be a length from 8-128\");\n return null;\n } else if (l < 8 || l > 128) {\n window.alert(\"Password must be a length from 8-128\");\n return null;\n } else {\n return l;\n }\n}", "function generatePassword() {\n //prompt user to enter length between 8 and 128\n var passwordLength = prompt(\"How long would you like your password to be? Please choose a number between 8 and 128.\");\n passwordLength = parseInt(passwordLength)\n while (passwordLength === \"\" || passwordLength === null || passwordLength < 8 || passwordLength > 128 || isNaN(passwordLength)) {\n passwordLength = prompt(\"That's not a valid option. Please choose a number between 8 and 128.\")\n }\n\n //ask if user wants lowercase letters \n var lowerCaseConfirm = confirm(\"Would you like lowercase letters included in your password?\");\n var upperCaseConfirm = confirm(\"Would you like uppercase letters included in your password?\");\n var numberConfirm = confirm(\"Would you like numbers included in your password?\");\n var specialConfirm = confirm(\"Would you like special characters included in your password?\");\n\n //make sure user selects at least one type of char\n while ((!lowerCaseConfirm) && (!upperCaseConfirm) && (!numberConfirm) && (!specialConfirm)) {\n alert(\"You need to choose at least one option. Thank you!\")\n var lowerCaseConfirm = confirm(\"Would you like lowercase letters included in your password?\");\n var upperCaseConfirm = confirm(\"Would you like uppercase letters included in your password?\");\n var numberConfirm = confirm(\"Would you like numbers included in your password?\");\n var specialConfirm = confirm(\"Would you like special characters included in your password?\");\n }\n\n //array of GUARANTEED characters (must include these based on user's answers to confirm questions)\n var guaranteedChars = [];\n\n //array of possible characters to include after guaranteed\n var possibleChars = [];\n //if statements to build possible char array based on users answers to character type confirms\n if (lowerCaseConfirm) {\n possibleChars = possibleChars.concat(lowerCase);\n guaranteedChars.push(getLower);\n }\n if (upperCaseConfirm) {\n possibleChars = possibleChars.concat(upperCase);\n guaranteedChars.push(getUpper);\n }\n if (numberConfirm) {\n possibleChars = possibleChars.concat(number);\n guaranteedChars.push(getNumber);\n }\n if (specialConfirm) {\n possibleChars = possibleChars.concat(specialChar);\n guaranteedChars.push(getSpecial);\n }\n\n //password currently set to the guaranteed characters array\n var password = guaranteedChars;\n\n var totalLength = passwordLength - guaranteedChars.length\n\n // for loop to grab the rest of the characters from possibleChars array, randomly\n for (var j = 0; j < totalLength; j++) {\n password.push(getRandom(possibleChars))\n }\n\n //function to shuffle arrays\n function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n\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\n return array;\n }\n\n //shuffle password array so guaranteed chars aren't right at the front\n shuffle(password);\n\n //change password array into a string\n var finalPassword = \"\"\n for (var i = 0; i < password.length; i++) {\n finalPassword = finalPassword + password[i]\n }\n\n //show user the password\n return finalPassword;\n}", "function generatePassword() {\n \n var charList = \"\";\n \n if (upCharacters) {\n charList = charList + \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n }\n if (lowCharacters) {\n charList = charList + \"abcdefghijklmnopqrstuvwxyz\";\n }\n if (numbers) {\n charList = charList + \"0123456789\";\n }\n if (specCh) {\n charList = charList + \"~!@#$%^&*()\";\n }\n \n /* this is in place so that if user doesnt select from the options this will alert */\n \n if (charList == \"\") {\n alert(\"You didn't pick from any of the criteria.\");\n return;\n }\n var password = \"\";\n for (var i = 0; i < passCharLength; i++) {\n password += charList[Math.floor(Math.random() * charList.length)];\n }\n document.getElementById('passwordBox').value = password;\n }", "function idPassLength(user, pw) {\n\treturn user.length >= 6 && pw.length >= 6;\n}", "function generatePassword() {\n //prompt for password length\n var passLength = prompt(\"Please enter password length between 8 and 128\", \"8\");\n if (passLength < 8 || passLength > 128) {\n alert(\"Please enter a number between 8 and 128\");\n return;\n }\n //prompt for password complexity options\n var passUpOpt = confirm(\"would you like to include uppercase characters?\");\n var passLowOpt = confirm(\"would you like to include lowercase characters?\");\n var passNumOpt = confirm(\"would you like to include numeric characters?\");\n var passSpecOpt = confirm(\"would you like to include special characters?\");\n //array for password characters\n //let passChar = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')' '_' '+'];\n var passUpChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var passLowChar = \"abcdefghijklmopqrstuvwxyz\";\n var passNumChar = \"1234567890\";\n var passSpecChar = \"!@#$%^&*()_+\";\n var passChar = \"\";\n \n /* if (passUpOpt = true) {\n if (passLowOpt = true) {\n if (passNumOpt = true) {\n if (passSpecOpt = true) {\n passChar = passUpChar + passLowChar + passNumChar + passSpecChar;\n }\n }\n }\n } else if (passUpOpt = false) {\n if (passLowOpt = true) {\n if (passNumOpt = true) {\n if (passSpecChar = true) {\n passChar = passLowChar + passNumChar + passSpecChar;\n }\n }\n }\n } */\n //combinations of strings\n if (passUpOpt && passLowOpt && passNumOpt && passSpecOpt) {\n passChar = passUpChar + passLowChar + passNumChar + passSpecChar;\n } else if (!passUpOpt && !passLowOpt && !passNumOpt && !passSpecOpt) {\n alert(\"Please choose at least one type of character\")\n } else if (passLowOpt && passNumOpt && passSpecOpt) {\n passChar = passLowChar + passNumChar + passSpecChar;\n } else if (passNumOpt && passSpecOpt) {\n passChar = passNumChar + passSpecChar;\n } else if (passSpecOpt) {\n passChar = passSpecChar;\n } else if (passUpOpt && passNumOpt && passSpecOpt) {\n passChar = passUpChar + passNumChar + passSpecChar;\n } else if (passUpOpt && passSpecOpt) {\n passChar = passUpChar + passSpecChar;\n } else if (passUpOpt && passLowOpt && passNumOpt) {\n passChar = passUpChar + passLowChar + passNumChar;\n } else if (passUpOpt && passLowOpt && passSpecChar) {\n passChar = passUpChar + passLowChar + passSpecChar;\n } else if (passUpOpt && passNumOpt) {\n passChar = passUpChar + passNumChar;\n } else if (passUpOpt) {\n passChar = passUpChar;\n } else if (passLowOpt && passNumOpt) {\n passChar = passLowChar + passNumChar;\n } else if (passLowChar) {\n passChar = passLowChar;\n } else if (passNumOpt && passSpecOpt) {\n passChar = passNumChar + passSpecChar;\n } else if (passSpecOpt) {\n passChar = passSpecChar;\n } else if (passNumOpt) {\n passChar = passNumChar;\n } else if (passUpOpt && passLowOpt) {\n passChar = passUpChar + passLowChar;\n } else if (passLowOpt && passSpecOpt) {\n passChar = passLowChar && passSpecChar;\n }\n\n console.log(passChar);\n\n\n var pass = \"\";\n //for loop to pick the characters the password will contain\n for(var i = 0; i <= passLength; i++) {\n pass = pass + passChar.charAt(Math.floor(Math.random() * Math.floor(passChar.length - 1)));\n }\n alert(pass);\n //return pass;\n document.querySelector(\"#password\").value = pass;\n\n}", "function writePassword() {\n\tvar params = {\n\t\tlowercase: confirm('Would you like to use lowercase characters?'),\n\t\tuppercase: confirm('Would you like to use uppercase characters?'),\n\t\tspecialChars: confirm('Would you like to use special characters?'),\n\t\tnumericChars: confirm('Would you like to use numeric characters?'),\n\t};\n\twhile (params.length < 8 || params.length > 128 || params.length === undefined) {\n\t\tparams.length = parseInt(prompt('How long would you like your password to be? Greater than 8 Less than 128'));\n\t}\n\tvar password = generatePassword(params);\n\tvar passwordText = document.querySelector('#password');\n\n\tpasswordText.value = password;\n}", "function writePassword() {\n var password = \"\";\n for (var i = 0; i <= userLength; i++) {\n password = password + finalOptions.charAt(Math.floor(Math.random() * Math.floor(finalOptions.length - 1)));\n }\n document.getElementById(\"password\").value = password;\n }", "function writePassword()\n {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value =\"Your Secure Password\";\n // Alerting the User that they will be prompted to provide criteria and to confirm their choices\n alert(\"You will be prompted with several password criteria selections:\");\n var passwordLength = prompt(\"Please provide password length between 8 and 128 characters:\");\n\n var passwordLengthChar = \"\";\n for(var i=0; i<passwordLength.length; i++){\n passwordLengthChar = passwordLength.charAt(i);\n //alert(i+\" passwordLengthChar \"+passwordLengthChar);\n if (passwordLengthChar != \"0\" && passwordLengthChar != \"1\" && passwordLengthChar != \"2\" &&\n passwordLengthChar != \"3\" && passwordLengthChar != \"4\" && passwordLengthChar != \"5\" && passwordLengthChar != \"6\" &&\n passwordLengthChar != \"7\" && passwordLengthChar != \"8\" && passwordLengthChar != \"9\"){\n alert(\"You must enter a numeric value between 8 and 128. Please click on generate password and try again\");\n return;\n }\n }\n \n if (passwordLength < 8 || passwordLength > 128){\n alert(\"The password length must be between 8 and 128. Please click on generate password and try again\");\n return;\n }\n\n var includeLowercase = confirm(\"Do you want to include Lowercase?\");\n var includeUppercase = confirm(\"Do you want to include Uppercase?\");\n var includeNumbers = confirm(\"Do you want to include Numbers?\");\n var includeSpecialChars = confirm(\"Do you want to include Special characters?\");\n \n\n // Check condition - If user doesn't provide any criteria they will be alerted again to select criteria\n if (!includeLowercase && !includeUppercase && !includeNumbers && !includeSpecialChars)\n {\n alert(\"You must select atleast one character type. Please click on generate password and try again.\");\n passwordText.value = \"Your Secure Password\";\n }else\n {\n // Calling Function with above user selected values\n generatePassword(passwordLength,includeLowercase,includeUppercase,includeNumbers,includeSpecialChars);\n passwordText.value = finalresult; \n }\n}", "function generatePassword() {\n var passwordLength = prompt(\n \"Please enter number of characters you want your new password to be. It must be between 8 and 128 characters\"\n );\n console.log(passwordLength);\n if (passwordLength < 8 || passwordLength > 128) {\n alert(\"Please choose a password between 8 and 128\");\n generatePassword();\n return;\n }\n\n var choiceUpper = confirm(\n \"Would you like to use uppercases in your password?\"\n );\n\n var choiceLower = confirm(\n \"Would you like to use lowercases in your password?\"\n );\n\n var choiceNumber = confirm(\"Would you like to use numbers in your password?\");\n\n var choiceSpecial = confirm(\n \"Would you like to use special characters in your password?\"\n );\n\n //create array of all possible characters, users choices\n //create empty array to store all possible character choices\n //concat all users choices\n var choices = [];\n\n //concat upper cases to empty choices\n if (choiceUpper) {\n choices = choices.concat(upperCase);\n }\n if (choiceLower) {\n choices = choices.concat(lowerCase);\n }\n if (choiceNumber) {\n choices = choices.concat(numbers);\n }\n if (choiceSpecial) {\n choices = choices.concat(characters);\n }\n\n if (choiceLower) var NewrandomPassword = [];\n if (choiceUpper) var NewrandomPassword = [];\n if (choiceNumber) var NewrandomPassword = [];\n if (choiceSpecial) var NewrandomPassword = [];\n\n for (var i = 0; i < passwordLength; i++) {\n var allSelections = choices[Math.floor(Math.random() * choices.length)];\n NewrandomPassword.push(allSelections);\n }\n return NewrandomPassword.join(\"\");\n}", "function generatePassword() {\n var actualPassword = \"\";\n \n alert(\"You will be presented with the following prompts to select criteria for generating a password.\");\n\n // choice of password length between 8-128\n var pwdLength = prompt(\"Choose a number between 8 and 128. This choice will be the length of the password.\", );\n if (pwdLength != null) {\n if (pwdLength >= 8 && pwdLength <= 128) {\n\n // choice of Lowercase, Uppercase, Numerals, Special Character\n alert(\"In the following prompts, at least one choice of lowercase, uppercase, numeric, and/or special characters must be confirmed.\");\n\n var chooser = false;\n var charChoices = \"\";\n\n var uCase = confirm(\"Would you like your password to contain uppercase characters?\");\n if (uCase === true) {\n chooser = true;\n charChoices += uChars; \n }\n\n var lCase = confirm(\"Would you like your password to contain lowercase characters?\");\n if (lCase === true) {\n chooser = true;\n charChoices += lChars;\n }\n\n var numChoice = confirm(\"Would you like your password to contain numeric characters?\");\n if (numChoice === true) {\n chooser = true;\n charChoices += nChars;\n }\n\n var specChar = confirm(\"Would you like your password to contain special characters?\");\n if (specChar === true) {\n chooser = true;\n charChoices += sChars;\n }\n\n if (chooser === false) {\n alert(\"At least one choice of lowercase, uppercase, numeric, and/or special characters must be confirmed.\");\n } else {\n\n // actually password generation code\n for (i = 1; i < pwdLength ; i++ ) {\n actualPassword += charChoices[Math.floor(Math.random()*charChoices.length)];\n };\n };\n\n } else {\n alert(\"Please enter a number between 8 and 128\")\n };\n\n };\n\n return actualPassword;\n}", "function generatePassword(\n selectLowerCase,\n selectUpperCase,\n selectNumber,\n selectSpecial\n) {\n plength = parseInt(\n prompt(\"Enter the length of your password it must be 8 to 128 characters\")\n );\n password = \"\";\n\n if (!plength) {\n alert(\"This needs a value\");\n } else if (plength < 8 || plength > 128) {\n plength = parseInt(\n prompt(\n \"Enter length of password.* Length must be between 8 - 128 characters\",\n \"\"\n )\n );\n } else {\n // Confirm whether user wants to use lower case letters\n\n selectLowerCase = confirm(\"Would you like to use lower case letters?\");\n\n // Confirm whether user wants to use upper case letters\n\n selectUpperCase = confirm(\"Would you like to use upper case letters?\");\n\n //Confirm whether user wants to use numeric characters\n\n selectNumber = confirm(\"Would you like to use numbers?\");\n\n //Confirm whether user wants to use special symbols\n\n selectSpecial = confirm(\"Would you like to user special characters?\");\n }\n\n for (let i = 0; i < plength; i++) {\n password += passwordText.charAt(\n Math.floor(Math.random() * passwordText.length)\n );\n\n if (selectLowerCase && password.length < plength) {\n password = passwordText += lowerCase.charAt(\n Math.floor(Math.random() * lowerCase.length)\n );\n }\n if (selectUpperCase && password.length < plength) {\n password = passwordText += upperCase.charAt(\n Math.floor(Math.random() * upperCase.length)\n );\n }\n\n if (selectNumber && password.length < plength) {\n password = passwordText += numbers.charAt(\n Math.floor(Math.random() * numbers.length)\n );\n }\n\n if (selectSpecial && password.length < plength) {\n password = passwordText += specialCharacters.charAt(\n Math.floor(Math.random() * specialCharacters.length)\n );\n }\n\n // returns input to text area\n passwordText.value = password;\n }\n}", "function getPassInput() {\n //storing the users length preference\n var length = parseInt(\n prompt(\"How long would you like your password. Please pick between 8 and 129\")\n );\n //checking if user entered a valid number and length, if not valid, send an alert \n if (isNaN(length) === true) {\n alert(\"Please provide a number\");\n return;\n }\n\n if (length > 128) {\n alert(\"Please provide a number less than 129\");\n return;\n }\n\n if (length < 8) {\n alert(\"Please provide a number larger than 7\");\n }\n //user chooses if they want to include lowercase letters, uppercase letters, numbers & special characters in the password using confirm\n var hasLowerCasedLetters = confirm(\n \"Click OK to include lowercase letters in password.\"\n );\n\n var hasUpperCasedLetters = confirm(\n \"Click OK to include uppercase letters in password.\"\n );\n\n var hasNumericalCharacters = confirm(\n \"Click OK to include numbers in password.\"\n );\n\n var hasSpecialCharacters = confirm(\n \"Click OK to include special characters in password.\"\n );\n // Send alert to user if they didnt add any of the previous prompted character\n if (!hasLowerCasedLetters && !hasUpperCasedLetters && !hasNumericalCharacters && !hasSpecialCharacters) {\n alert(\"Please select at least one option.\");\n return;\n }\n //Store the users answers\n var passwordInput = {\n length: length,\n hasLowerCasedLetters: hasLowerCasedLetters,\n hasUpperCasedLetters: hasUpperCasedLetters,\n hasNumericalCharacters: hasNumericalCharacters,\n hasSpecialCharacters: hasSpecialCharacters\n };\n\n return passwordInput;\n}//end of first function", "function getPasswordOption() {\n var length = parseInt(prompt(\"How many characters?\"));\n\n if (length < 8 || length > 128) {\n alert(\"Must be at least 8 characters and less than or equal to 128 characters.\")\n return null\n }\n\n var hasSpecialCharacters = confirm(\"Click ok if you want special characters.\");\n\n var hasNumericCharacters = confirm(\"Click ok if you want numeric characters.\");\n\n var hasUppercaseCharacters = confirm(\"Click ok if you want uppercase characters.\");\n\n var hasLowercaseCharacters = confirm(\"Click ok if you want lowercase characters.\");\n\n if (\n hasSpecialCharacters === false &&\n hasNumericCharacters === false &&\n hasLowercaseCharacters === false &&\n hasUppercaseCharacters === false\n ) {\n alert(\"Must select at least one character type.\")\n return null\n };\n\n var passwordOptionsObject = {\n pwdLength: length,\n pwdSpecial: hasSpecialCharacters,\n pwdUpper: hasUppercaseCharacters,\n pwdLower: hasLowercaseCharacters,\n pwdNumeric: hasNumericCharacters,\n\n }\n \n return passwordOptionsObject\n\n}", "function generatePassword() {\n\n // prompt user for password length\n let userLength = prompt(\"Enter a password length between 8 and 128.\");\n \n // If not a number between 8 and 128, alert user\n // This works to return the user to the main page, so they have to click Generate Password again.\n if (userLength < 8 || userLength > 128 || isNaN(userLength)) {\n alert(\"Please enter a valid selection for password length. Click Generate Password to try again.\");\n pwString = \"\";\n return;\n };\n\n //prompt user for password characters\n let userLowerCase = confirm(\"Would you like LOWER CASE letters in your password? Click OK for YES and Cancel for NO.\");\n let userUpperCase = confirm(\"Would you like UPPER CASE letters in your password? Click OK for YES and Cancel for NO.\");\n let userNumbers = confirm(\"Would you like NUMBERS in your password? Click OK for YES and Cancel for NO.\");\n let userSymbols = confirm(\"Would you like SYMBOLS in your password? Click OK for YES and Cancel for NO.\");\n\n // Strings for password\n let lowerCase = \"abcdefghijklmnopqrstuvwxyz\";\n let upperCase = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n let numbers = \"0123456789\";\n let symbols = \"!*$%&#@+?:;()^\";\n let pwString = \"\";\n\n // Create pwString based on user inputs\n if (userLowerCase) {\n pwString = pwString + lowerCase;\n }\n\n if (userUpperCase) {\n pwString = pwString + upperCase;\n } \n\n if (userNumbers) {\n pwString = pwString + numbers;\n }\n\n if (userSymbols) {\n pwString = pwString + symbols;\n }\n\n // if pwString has no characters, alert the user\n if (pwString === \"\") {\n alert(\"A password requires some characters. Click Generate Password to try again.\");\n pwString = \"\";\n return;\n }\n\n // generate random string from StackOverflow: \n // https://stackoverflow.com/questions/1349404/generate-random-string-characters-in-javascript\n let userPassword = \"\";\n for (let i = 0; i < userLength; i++) {\n userPassword += pwString.charAt(Math.floor(Math.random() * pwString.length));\n }\n\n // console.log(userPassword);\n // userPWPrompt = alert(\"Your password is \" + userPassword);\n return userPassword;\n}", "function generatePassword() {\n var passLength = prompt(\"Enter Desired Password Length. Min 8 Characters and 128 Max.\");\n\n // Verify that password length meets requirements and creates an array that is the same length as the user input.\n if (passLength >= 8 && passLength <= 128) {\n var newPasswordLength = parseInt(passLength);\n console.log(newPasswordLength)\n //var newPasswordLength = passLength;\n //console.log(newPasswordLength);\n var confirmUppercase = confirm(\"Have Password Contain Uppercase Letters?\");\n var confirmLowercase = confirm(\"Have Password Contain Lowercase Letters?\");\n var confirmNumbers = confirm(\"Have Password Contain Numbers?\");\n var confirmSpecial = confirm(\"Have Password Contain Special Characters?\");\n\n var newPasswordLength;\n if (confirmUppercase && confirmLowercase && confirmNumbers && confirmSpecial) {\n // var all = uppercase + lowercase + number + special;\n var all = uppercase.concat(lowercase, number, special);\n console.log(all)\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n }\n\n // 2.) only uppercase, lowercase, & numbers are selected\n else if (confirmUppercase && confirmLowercase && confirmNumbers) {\n var all = uppercase.concat(lowercase, number);\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n }\n\n // 3.) only uppercase & lowercase are selected\n else if (confirmUppercase && confirmLowercase) {\n var all = uppercase.concat(lowercase);\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n }\n\n\n\n // 4.) only uppercase is selected\n else if (confirmUppercase) {\n var all = uppercase;\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n }\n\n\n // 5.) only lowercase is selected\n else if (confirmLowercase) {\n var all = lowercase;\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n }\n\n\n // 6.) only numbers are selected\n else if (confirmNumbers) {\n var all = number;\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n }\n\n\n // 7.) only symbols are selected\n else if (confirmSpecial) {\n var all = special;\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n }\n\n // 8.) only numbers & symbols are selected\n else if (confirmNumbers && confirmSpecial) {\n var all = number.concat(special);\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n }\n\n\n // 9.) only lowercase & numbers are selected\n else if (confirmLowercase && confirmNumbers) {\n var all = lowercase.concat(number);\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n }\n\n\n // 10.) only lowercase & numbers are selected\n else if (confirmLowercase && confirmSpecial) {\n var all = lowercase.concat(special);\n var password = '';\n for (var index = 0; index < newPasswordLength; index++) {\n var character = Math.floor(Math.random() * all.length);\n password += all[(character, character + 1)];\n }\n document.getElementById(\"password\").innerHTML = password;\n } else {\n alert(\"Please select at least one conditional choice from lower or uppercase letters, numbers, or special characters\");\n alert(\"Please enter a number between 8 and 128\");\n }\n function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }\n console.log(password);\n\n function copyClipboard() {\n var copyText = document.getElementById(\"password\");\n var text = copyText.textContent;\n if (text.length > 0) {\n copyText.select();\n copyText.setSelectionRange(0, 99999)\n document.execCommand(\"copy\");\n alert(\"Your password has been copied to clipboard.\");\n }\n }\n }\n}", "function generatePassword() {\n var passwordLength = Number(window.prompt('Please select the length of your password (8 to 128 characters).'));\n\n // Executes when the user inputs anything other than a number 8 to 128.\n if (passwordLength < 8 || passwordLength > 128) {\n alert('Password must be between 8 and 128 characters. Please try again');\n return null\n }\n if (isNaN(passwordLength)) {\n alert('Please input a number between 8 and 128 for the length of your password.');\n return null\n }\n\n // This creates the variables for the password characters.\n var uppercase, lowercase, numbercount, specialOption = false;\n var letters = 'abcdefghijklmnopqrstuvwxyz'\n var numeric = '0123456789'\n var specialCharacter = '\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\_\\`\\{\\|\\}\\~'\n\n // These confirmation functions prompts the user what variables they would like in their password.\n uppercase = confirm('Would you like to include uppercase letters?');\n lowercase = confirm('Would you like to include lowercase letters?');\n numbercount = confirm('Would you like to include numbers?');\n specialOption = confirm('Would you like to include special characters (\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\_\\`\\{\\|\\}\\~) ?');\n\n // Concatenates strings of the variables selected by the user into one string. \n var userPassword = '';\n\n if (uppercase === true) {\n userPassword += letters.toUpperCase()\n }\n if (lowercase === true) {\n userPassword += letters\n }\n if (numbercount === true) {\n userPassword += numeric\n }\n if (specialOption === true) {\n userPassword += specialCharacter\n }\n\n // This makes sure the user selects at least one option for their password or else it prompts the user to try again.\n if (uppercase === false && lowercase === false && numbercount === false && specialOption === false) {\n alert('You must select at least one option. Please try again')\n return null\n }\n\n // This loop randomizes the variables the user selected by the password length and returns a new string. \n var genPassword = ''\n\n for (var i = 0; i < passwordLength; i++) {\n var ranChar = Math.floor(Math.random() * userPassword.length)\n genPassword += userPassword[ranChar]\n }\n return genPassword\n}", "function verifPassword(champ)\n{\n if(champ.value.length < 8 )\n {\n surlignePassword(champ, true);\n return false;\n }\n else\n {\n surlignePassword(champ, false);\n return true;\n }\n}" ]
[ "0.8530329", "0.83937323", "0.8208733", "0.8032275", "0.8026836", "0.7867448", "0.7849628", "0.7807894", "0.77992564", "0.77986324", "0.7731731", "0.772057", "0.7719936", "0.7680814", "0.7673526", "0.76701087", "0.7605969", "0.7601792", "0.7593146", "0.75797164", "0.7569442", "0.7560862", "0.75335324", "0.7522044", "0.75056344", "0.74790865", "0.7452553", "0.7437945", "0.74260974", "0.74170506", "0.74062145", "0.7404566", "0.74009544", "0.7395716", "0.7377216", "0.7371597", "0.7352712", "0.7343926", "0.7342788", "0.7302133", "0.7299618", "0.7293817", "0.7257845", "0.7236586", "0.7226271", "0.7219856", "0.7209244", "0.71874654", "0.7180596", "0.7169874", "0.7159004", "0.71533376", "0.71386766", "0.71363056", "0.7131276", "0.7126002", "0.7121721", "0.7119105", "0.7108941", "0.70979744", "0.7094218", "0.7084755", "0.70805943", "0.70650643", "0.7061964", "0.705983", "0.70581096", "0.7053235", "0.7050383", "0.7043393", "0.70371056", "0.70339835", "0.7016037", "0.70108837", "0.7006733", "0.69931054", "0.6976148", "0.6960446", "0.6953788", "0.6938312", "0.6934672", "0.6933779", "0.6929759", "0.69232047", "0.6923153", "0.6914137", "0.69130015", "0.6903969", "0.68943095", "0.6892554", "0.6888906", "0.6888689", "0.68870145", "0.6884406", "0.6883151", "0.6877248", "0.6871264", "0.6870506", "0.6869313", "0.6866304" ]
0.777062
10
Functions to generate random characters
function getRandomUppercase() { var randomUpper = uppercaseChar[Math.floor(Math.random() * uppercaseChar.length)]; return randomUpper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateRandomChar() {\n var randNum = Math.floor(Math.random() * 25);\n var randCharCode = \"A\".charCodeAt(0) + randNum;\n return String.fromCharCode(randCharCode);\n}", "function randomNumericCharacters(){\n return String.fromCharCode((Math.random()*10)+48)\n }", "generateRandomAphabet() {\n return String.fromCharCode(this.generateRandom(97, 123));\n }", "function getRandomChar() {\n return specialChar[Math.floor(Math.random() * specialChar.length)];\n}", "function randomSpecialCharacters(){\n var specialCharacter = \"!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\";\n return specialCharacter[Math.floor(Math.random()*specialCharacter.length)];\n }", "function MakeCharacter() {\n const START = 18000; // start of unicode in decimal\n let text = (START + Math.floor(Math.random()*NCHARS)).toString(16); \n return String.fromCharCode(parseInt(text,16));\n}", "function createRandom() {\n let length = 10;\n let charSet =\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789*$!?\";\n let output = \"\";\n\n for (let i = 0; i < length; i++) {\n output =\n output + charSet.charAt(Math.floor(Math.random() * charSet.length));\n }\n return output;\n}", "function random(chars) {\n var res = \"\";\n var choice = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n res += choice.charAt(Math.floor(Math.random() * choice.length));\n }\n return res;\n}", "function getRandomChar() {\r\n var alfabeto = 'abcdefghijklmnopqrstuvwxyz';\r\n // Numero casuale tra 0 e 25 (lettere sono 26)\r\n var posizione = getRndInteger(0, 25);\r\n // Genero la lettera casuale\r\n var lettera_casuale = alfabeto.charAt(posizione);\r\n return lettera_casuale;\r\n}", "function generateRandomString() {\r\n let characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\"\r\n let charactersLength = characters.length;\r\n let result = '';\r\n for (let i = 0; i < 6; i++){\r\n result += characters.charAt(Math.floor(Math.random() * charactersLength))\r\n }\r\n return result;\r\n}", "function generateRandomString() {\n var generate = \"\";\n var randomChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i <= 6; i++) {\n generate += randomChar.charAt((Math.floor(Math.random() * randomChar.length)));\n\n }\n return generate;\n}", "generateChar()\n {\n let randVal = floor(random(0,this.geneLength));\n return randVal;\n }", "function generateSpecialChar() {\n var specialchars = [];\n // special characters are non contiguous so I created a list of special chars to randomly select from\n for (let i = 33; i <= 47; i++) {\n specialchars.push(i);\n };\n\n for (let i = 58; i <= 64; i++) {\n specialchars.push(i);\n };\n // random number picker that uses ascii knowledge\n var value = specialchars[Math.floor(Math.random() * (specialchars.length))];\n return String.fromCharCode(value);\n}", "function randomstring() \n{\n var text = '';\n var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for (var i=0; i < 8; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function genRandomChar(charactersSelected) {\n var randomIndex = Math.floor(Math.random() * charactersSelected.length);\n return charactersSelected[randomIndex];\n}", "function getRandomString(chars) {\n var text = new Array(chars);\n for (var i = 0; i < chars; i++) {\n text[i] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\".charAt(Math.floor(Math.random() * 62));\n }\n return text.join(\"\");\n}", "function generateRandomString() {\n console.log('generating');\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function randomCharOrInt()\n{\n var text = \"\";\n var possibleChars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n text += possibleChars.charAt(Math.floor(Math.random() * possibleChars.length));\n return text;\n}", "function generateRandomString() {\n let text = \"\"\n let characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\n for (var i = 0; i < 6; i++) {\n text += characters.charAt(Math.floor(Math.random() * characters.length));\n }\n return text;\n}", "function randomGen(n, chars) {\n return range(n || DEFAULT).reduce(function (result) {\n return result + sample(chars)[0];\n }, '');\n }", "function randomKey() {\n var randKey = '';\n for (var i = 0; i < 100; i++) {\n randKey += String.fromCharCode(Math.floor(Math.random() * (122 - 97 + 1)) + 97);\n };\n return randKey;\n}", "function randomStr()\n{\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 25; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "function createCode(){\n\tlet code = '';\n\tlet numOfChars = 5;\n\tfor(let i = 0; i < numOfChars; i++){\n\t\tlet charIndex = Math.floor(Math.random() * chars.length);\n\t\tcode += chars[charIndex];\n\t}\n\treturn code;\n}", "function generaterandomString() {\n var randomString = \"\";\n var possibleChars = \"1234567890abcdefghijklmnopqrstuvqwxyzABCDEFGHIJKLMNOPQRSTUVWYZ\";\n for (i = 0; i < 6; i++) {\n randomString += possibleChars.charAt(Math.floor(Math.random() * possibleChars.length));\n };\n return randomString;\n}", "function newChar() {\n var c = floor(random(63, 122))\n if (c == 63) c = 32;\n if (c == 64) c = 46;\n return String.fromCharCode(c);\n}", "function generateRandomString() {\n const charset = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n let rand = '';\n\n for (let i = 0; i < 6; i ++) {\n rand += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return rand;\n}", "generateRandomAlphanumeric() {\n if (this.generateRandom(0, 2)) {\n return this.generateRandomAphabet();\n } else {\n return this.generateRandomNumber();\n }\n }", "getRandomChars(length){\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()?><|\\?/~`';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function generateRandomString() {\n const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let result = '';\n for (let i = 6; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];\n return result;\n}", "function random_str() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 5; i++){\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n }", "function getRandomString(chars) {\r\n var text = new Array(chars);\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n for (var i = 0; i < chars; i++) {\r\n text[i] = possible.charAt(Math.floor(Math.random() * possible.length));\r\n }\r\n return text.join(\"\");\r\n}", "function randomLetter() {\r\n //generam un cod ascii aleatoriu intre 65 ('A') si 90 ('Z')\r\n let codeOfA = \"A\".charCodeAt(0)\r\n let codeOfZ = \"Z\".charCodeAt(0)\r\n let randomCode = randomNumber(codeOfA, codeOfZ)\r\n //convertim codul ascii in caracterul asociat lui\r\n return String.fromCharCode(randomCode)\r\n}", "function gen_special_char() {\r\n ref_list = '`~!#$%^*()_-+=[{]{|:;\"<,>./?';\r\n idx = Math.floor(Math.random() * ref_list.length);\r\n return ref_list[idx];\r\n}", "function generateRandomString() {\n let result = '';\n let characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n let charactersLength = characters.length;\n for ( let i = 0; i < 6; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n };\n return result;\n}", "function newChar() {\n let c = floor(random(63, 122));\n if (c === 63) c = 32;\n if (c === 64) c = 46;\n\n return String.fromCharCode(c);\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generateRandomString(){\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 5; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generateRandomString() {\n let result = \"\";\n const characters = \"0123456789\";\n const charactersLength = characters.length;\n\n for (let i = 0; i < 6; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function generateRandomString() {\n let text = \"\";\n const alphabet = 'abcdefghijklmnopqrstuvwxyz';\n const possible = alphabet + alphabet.toUpperCase() + '1234567890';\n\n for (var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n}", "function generate(CharAmount, IncludeUpperCase, IncludeNumbers, IncludeSymbols) {\n let charcodes = LOWERCASE\n if (IncludeUpperCase) charcodes = charcodes.concat(UPPERCASE)\n if (IncludeNumbers) charcodes = charcodes.concat(NUMBERS)\n if (IncludeSymbols) charcodes = charcodes.concat(SYMBOLs)\n\n const passwordZ = []\n for (let i = 0; i < CharAmount; i++) {\n const charactercode = charcodes[Math.floor(Math.random() * charcodes.length)]\n passwordZ.push(String.fromCharCode(charactercode))\n }\n return passwordZ.join(\"\")\n}", "function generateRandomString() {\n var length = 6,\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\",\n retVal = \"\";\n for (var i = 0, n = charset.length; i < length; ++i) {\n retVal += charset.charAt(Math.floor(Math.random() * n));\n }\n return retVal;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for(var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function randomString() {\n var generate = \"\";\n var randomChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i <= 6; i++) {\n generate += randomChar.charAt((Math.floor(Math.random() * randomChar.length)));\n }\n return generate;\n }", "function generateRandomString() {\n var output = '';\n chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for (var i = 0; i < 6; i++) {\n output += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return output;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 6; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * 6));\n }\n return text;\n}", "function getRandomAlphabets() {\n return hexAlphabets[Math.floor(Math.random() * hexAlphabets.length)]\n}", "function random_char() {\n var string = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&**';\n var rndnum = Math.floor(Math.random() * 68);\n return string.charAt(rndnum);\n}", "function randomChar(){\n \tlet randomLetter = \"\";\n \tconst possible = \"abcdefghijklmnopqrstuvwxyz\";\n\trandomLetter += possible.charAt(Math.floor(Math.random() * possible.length));\n \treturn randomLetter;\n}", "function genRegular(x) {\n var regularchar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n var text = \"\";\n\n for (var i = 0; i < x; i++)\n text += regularchar.charAt(Math.floor(Math.random() * regularchar.length));\n return text;\n}", "function genchar(length, charlist) {\n var result = '';\n var charactersLength = charlist.length;\n for ( var i = 0; i < length; i++ ) {\n result += charlist.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}", "static getRandomToken(){\n let result = '';\n let characters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n let charactersLength = characters.length;\n for (let i = 0; i < 50; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function generateRandomString () {\n const charOptions = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let randomString = '';\n for (let i = 0; i < 6; i += 1) {\n randomString += charOptions[Math.floor(Math.random() * charOptions.length)];\n }\n return randomString;\n}", "function generateRandomString() {\n let randomString = \"\";\n let possCharacters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 6; i++) {\n randomString += possCharacters.charAt(Math.floor(Math.random() * possCharacters.length));\n }\n return randomString;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for(let i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generatePassword() { \n var generatedPassword= [];\n for (var i=0; i < passwordLength; i++) {\n generatedPassword[i]= generateCharacter();\n function generateLength() {\n var charLength\n charLength = length[Math.floor(Math.random())]\n \n }\n\n } return generatedPassword.join(\"\");\n\n}", "function generateRandomString() {\n let text = \"\";\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (let i = 0; i < 6; i++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); }\n return text;\n}", "function generateID()\n{\n\tvar text = \"\";\n\tvar characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\t\n\tfor (var i = 0; i < 8; i++)\n\ttext += characters.charAt(Math.floor(Math.random() * characters.length));\n\tconsole.log(text);\n\treturn text;\n}", "function random_token() {\n var s = '';\n var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');\n for (var i = 0; i < 16; i++) {\n s += alphabet[Math.round(Math.random() * alphabet.length)];\n }\n return s;\n }", "function _getRandomLetter() {\n return String.fromCharCode(\n aCharCode + Math.floor(Math.random() * (zCharCode - aCharCode + 1))\n )\n}", "function generateRandomString() {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n for (let i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function getRandomSymbol() {\n var symbol = \"!@#$%^&*.\";\n return symbol[Math.floor(Math.random() * symbol.length)];\n}", "function codeGen() {\r\n var code = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890987654321\"\r\n for (i = 0; i < 7; i++) {\r\n code += possible.charAt(Math.round(Math.random() * possible.length));\r\n }\r\n return code;\r\n }", "function generatePassword () {\n let chosenLength = getPasswordLength();\n let characterTypes = specialRequests();\n\n let generatedPassword = '';\n for (i=0; i < chosenLength; i++){\n generatedPassword += characterTypes.charAt(Math.floor(Math.random() * characterTypes.length));\n }\n return generatedPassword;\n\n\n}", "function codeGenerator(){\n var possibleAlphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';\n var code = \"\";\n for(let i = 0; i<6; i++)\n code += possibleAlphabets[parseInt(Math.random()*possibleAlphabets.length)];\n return code;\n}", "function randomChars(len) {\n return (new Array(len)\n .fill(0)\n .map(e => String.fromCharCode(33 + 94 * Math.random() | 0))\n .join(''));\n }", "function generateRandomString() {\n const length = 6;\n const chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n var result = '';\n for (let i = length; i > 0; --i) {\n result += chars[Math.floor(Math.random() * chars.length)];\n } \n return result;\n}", "function randomLetters() {\r\n var letterepossibili = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n var lettera = letterepossibili[randomNumbers(0, letterepossibili.length - 1)];\r\n return lettera;\r\n}", "function generatePassword() {\n var length = 8,\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\",\n retVal = \"\";\n for (var i = 0, n = charset.length; i < length; ++i) { \n retVal += charset.charAt(Math.floor(Math.random() * n));\n }\n return retVal;\n}", "function randomSecret() {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVXZabcdefghijklmnopqrstuvxz0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < 32; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n //console.log( result );\n return result;\n}", "function getRandomString() {\n var s = '';\n for (var i = 0; i < RANDOM_STRING_LENGTH; i++)\n s += String.fromCharCode(Math.floor(Math.random() * 26) + 64);\n return s;\n}", "function random_string() {\n\tvar set_length = Math.floor( Math.random() * 9 +1 );\n var random_text = \"\";\n var alph = \"abcdefghijklmnopqrstuvwxyz\";\n\tfor( var i=0; i < set_length; i++ )\n random_text += alph.charAt(Math.floor(Math.random() * alph.length));\n\treturn random_text;\n}", "function generateRandomString() {\n let rString = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let result = '';\n for (let i = 0; i < 6; i++) {\n result += rString[Math.floor(Math.random() * rString.length)];\n }\n return result;\n}", "function generateRandomString() {\n let key = \"\";\n const characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\n for (let i = 0; i < 6; i++) {\n key += characters.substr(Math.floor((Math.random() * characters.length)), 1);\n }\n return key;\n}", "function generateRandomString() {\n const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';\n const stringLength = 6;\n let stringResult = '';\n for (let i = 0; i < stringLength; i++) {\n let num = Math.floor(Math.random() * chars.length);\n stringResult += chars[num];\n }\n return stringResult;\n}", "function generatePassword(){\n for(i=0, n = result.length; i < charLength; i++){\n retVal += result.charAt(Math.floor(Math.random() * n))\n }\n return retVal;\n }", "function randomString() {\n\tlength = 25;\n var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n}", "function randomString() {\n var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n var str = '';\n for (var i = 0; i < 10; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n }", "generateID(){\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 5; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "function newPss() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 8; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "function random (howMany, chars) {\n chars = chars || \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n var rnd = crypto.randomBytes(howMany),\n value = new Array(howMany),\n len = chars.length;\n\n for (var i = 0; i < howMany; i++) {\n value[i] = chars[rnd[i] % len];\n }\n return value.join('');\n}", "function randomString() {\n\t var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n\t var str = '';\n\t for (var i = 0; i < 10; i++) {\n\t str += chars[Math.floor(Math.random() * chars.length)];\n\t }\n\t return str;\n\t}", "function randomLetter() {\n let c = floor(random(65, 122));\n return String.fromCharCode(c);\n}", "static generateKey(length = keyGen.length) {\n let tmpString = \"\"; // Start empty\n\n // Append 1 char at a time\n for(let i = 0; i < length; i++) {\n // Generate a random character code (use config to define keycode ranges)\n let tmpRange = Util.randomBetween(0, keyGen.charRanges.length - 1);\n let low = keyGen.charRanges[tmpRange].low;\n let high = keyGen.charRanges[tmpRange].high;\n tmpString += String.fromCharCode(Util.randomBetween(low, high)); // Convert keycode to char and append\n }\n return tmpString; // Return completed key\n }", "function generateRandomMnemonic() {\n return bip39.generateMnemonic(256);\n}", "function generatePassword(choices, numberOfChar) {\n password = \"\";\n for (let i = 0; i < numberOfChar; i++) {\n password += getRandomValue(choices);\n }\n document.querySelector(\"#password\").textContent = password;\n return password;\n}", "function alphabet(){ \n randomletter = letters[getRandomInteger(0,27)];\n let string_length = getRandomInteger(5,26);\n for ( let i = 0; i < string_length; i++) {\n output = randomletter.repeat(string_length);\n };\n console.log(output);\n}", "function randomPass() {\n var pass = \"\";\n\n for (i = 0; i < 20; i++)\n pass += String.fromCharCode(Math.floor(33 + 94 * Math.random()));\n\n return pass;\n }", "function getRandomChar() {\n \n return pool[Math.floor(Math.random() * Object.keys(pool).length)] \n \n}", "function getRandomSymbol(){\n var symbol = \"!@#$%^&*(){}[]=<>/,.|~?\";\n return symbol[Math.floor(Math.random()*symbol.length)];\n}", "function generateKey() { return 10*Math.random();}", "function randomString() {\n var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n var str = '';\n for (let i = 0; i < 10; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n }", "function genToken() {\n\tvar letters = \"abcdefghiklmnopqrstuvwwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\";\n\tvar token = \"\";\n\tfor (var i = 0 ; i < 36 ; ++i) {\n\t\ttoken += letters[Math.floor(Math.random() * letters.length)];\n\t}\n\treturn token;\n}", "function getRandomSpecialCharacter() {\n var index = Math.floor(Math.random() * specialCharacters.length - 1) + 1;\n return specialCharacters[index];\n}", "function generate() {\n\treturn (Math.random() * 1e18).toString(32).slice(0, 11);\n}", "function generatePasswordMixed(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n console.log(result)\n return result;\n}", "function generatesInitials() {\r\n let uniqueCode = [];\r\n for (var i = 0; i < 2; i++) {\r\n uniqueCode.push(String.fromCharCode((Math.random() * (91 - 65) + 65).toFixed(0)));\r\n }\r\n return uniqueCode.join(\"\");\r\n}", "function generateRandomLetter() {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n\n return alphabet[Math.floor(Math.random() * alphabet.length)];\n}" ]
[ "0.81255794", "0.80817217", "0.7900217", "0.78989863", "0.7877435", "0.78714836", "0.78649974", "0.78327173", "0.78208065", "0.7795399", "0.7766177", "0.77611524", "0.77419806", "0.77365613", "0.77284926", "0.77230525", "0.7714792", "0.77047676", "0.770172", "0.76877356", "0.7658266", "0.76523423", "0.76424724", "0.76257545", "0.7623271", "0.761835", "0.76171106", "0.76154214", "0.761258", "0.7606533", "0.7596375", "0.75912774", "0.7588454", "0.7580196", "0.7577645", "0.75721544", "0.7567242", "0.7565683", "0.75562155", "0.75450754", "0.7543481", "0.7541798", "0.7540456", "0.7539822", "0.7530675", "0.7529368", "0.75227845", "0.7522753", "0.75223833", "0.7510902", "0.7500721", "0.7500599", "0.7493556", "0.74880725", "0.7485311", "0.74851906", "0.7484185", "0.74765605", "0.7476247", "0.7461455", "0.7449195", "0.74485695", "0.7446966", "0.744675", "0.74411106", "0.7429482", "0.7421428", "0.74175656", "0.7415711", "0.7404258", "0.7403908", "0.74033374", "0.73996466", "0.73977774", "0.7395148", "0.73940814", "0.738927", "0.73891705", "0.7384042", "0.7383222", "0.7369763", "0.73694056", "0.7365261", "0.7362436", "0.7358324", "0.73570627", "0.73488456", "0.7347365", "0.7343055", "0.7340155", "0.7339765", "0.7331517", "0.7331473", "0.7331271", "0.73276794", "0.7325345", "0.7322203", "0.73217297", "0.7321066", "0.73086274", "0.7303527" ]
0.0
-1
Write password to the password input
function writePassword() { var password = generatePassword(); var passwordText = document.querySelector("#password"); //console.log(passwordText); passwordText.value = password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writePassword() {}", "function writePassword() {\n var password = getPasswordOptions();\n var passwordText = document.querySelector('#password');\n \n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n generatePassword()\n }", "function writePassword() {\n var password = buildPassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var passwordLen = getpasswordLength();\n var options = getPasswordOptionSet();\n\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = makePassword(passwordLen, options);\n\n\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n }", "function writePassword() {\n let password = generatePassword(passwordlength).join(\"\");\n let passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n getUserInputs();\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n // Reset variables\n passwordLength = 0;\n selectedCharacters = \"\";\n includeLowercase = false;\n includeUppercase = false;\n includeNumbers = false;\n includeSpecialChar = false;\n}", "function writePassword() {\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var length = getPasswordLength();\n length = parseInt(length);\n ensureCharacterType();\n var password = generatePassword(length);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword()\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n }", "function writePassword() {\n var passwordReqs = {};\n passwordReqs = passReqs(passwordReqs);\n var password = generatePassword(passwordReqs);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n // Only set the new password if one was actually generated. Otherwise, keep the previous password on the screen.\n if (passwordText !== \"\") {\n passwordText.value = password;\n }\n}", "function writePassword() {\n let newOptions = { ...options };\n setOptions(newOptions);\n var password = generatePassword(newOptions);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n\tvar passwordText = document.querySelector('#password');\n\n\tpasswordText.value = finalPassword;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n //prompt(password)\n }", "function _3writePassword(password) {\n console.log(\"writing password\")\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n \n}", "function writePassword() {\n const password = generatePassword();\n const passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n const password = generatePassword();\n const passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var criteria = passwordCriteria();\n var password = generatePassword(criteria);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n // If password is empty string, return without printing\n if (!password) {\n return;\n }\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n if (password !== undefined) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n }\n}", "function writePassword() {\n var password = generatePassword();\n if (password) {\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n }\n}", "function writePassword () {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\")\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword().join(\"\");\n // console.log(password);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = pwCriteria();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword(password) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var userPassword = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = userPassword;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n return;\n}", "function writePassword() {\n var password = createPassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\r\n\r\n var password = generatePassword(),\r\n passwordText = document.querySelector(\"#password\");\r\n\r\n passwordText.value = password;\r\n \r\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n if(password) {\n passwordText.value = password;\n }\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n passwordText.value = password;\n passwordEngine.reset();\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n // clears password variables in case user doesn't click clear button before generating a new password\n passCreate = \"\";\n password = \"\";\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}" ]
[ "0.88605946", "0.85434437", "0.8511256", "0.8500835", "0.84896296", "0.84846", "0.84719414", "0.84686357", "0.8454292", "0.8443738", "0.8431387", "0.8419759", "0.8418786", "0.8406216", "0.8403772", "0.8400314", "0.8392802", "0.83758265", "0.8370068", "0.83642554", "0.836013", "0.8358564", "0.8357296", "0.8355442", "0.8354251", "0.83408403", "0.83408403", "0.8301905", "0.8292826", "0.8292826", "0.8292826", "0.8292826", "0.828747", "0.8274406", "0.8269479", "0.82615584", "0.8256443", "0.82556236", "0.82519406", "0.8250689", "0.82503533", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.82437736", "0.82437736", "0.82437736", "0.8240616", "0.8238806", "0.8238588", "0.8236282", "0.82324123", "0.82302624", "0.82299846", "0.8229535", "0.8229535", "0.82283163", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293" ]
0.0
-1
global translation function in every component
_(...args) { return frappe._(...args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onTranslation() {\n }", "function TI18n() {}", "function TI18n() {}", "function TI18n() {}", "function TI18n() { }", "function TI18n() { }", "function TI18n(){}", "function translate(key) { return ___WEBPACK_IMPORTED_MODULE_0__[\"Translator\"].translate(key); }", "translate(...args) {\n\t\tif (this._localizationEnabled) {\n\t\t\treturn this.__(...args)\n\t\t}\n\n\t\treturn args[0]\n\t}", "translateWhenEnabledAndServiceExist(translationKey, localeKey) {\n let text = '';\n const gridOptions = this.sharedService && this.sharedService.gridOptions;\n // get locales provided by user in main file or else use default English locales via the Constants\n const locales = gridOptions && gridOptions.locales || Constants.locales;\n if (gridOptions.enableTranslate && this.translate && this.translate.currentLang && this.translate.instant) {\n text = this.translate.instant(translationKey || ' ');\n }\n else if (locales && locales.hasOwnProperty(localeKey)) {\n text = locales[localeKey];\n }\n else {\n text = localeKey;\n }\n return text;\n }", "function $gettext (msg) {\n return msg\n}", "function trans( string ){\n\tif( window.furasta.lang[ string ] ){\n\t\treturn window.furasta.lang[ string ];\n\t}\n\treturn string;\n}", "function translate(language) {\n if (language === \"es\") {\n return \"Hola, mundo!\";\n } else if (language === \"fr\") {\n return \"Bonjour le monde\";\n } else {\n return \"Hello, World\";\n }\n\n}", "function initTranslations() {\n\ti18n.init( {\n\t\tresGetPath: '/TrixLoc/resources/locales/__lng__/__ns__.json',\n\t\tresPostPath: '/TrixLoc/resources/locales/add/__lng__/__ns__'\n\t}, function(t) {\n\t\t_t = t;\n\t\ttranslateAll(t);\n\t});\n}", "setupTranslations () {\n const localeSetup = formatMessage.setup();\n if (localeSetup && localeSetup.translations[localeSetup.locale]) {\n Object.assign(\n localeSetup.translations[localeSetup.locale],\n // eslint-disable-next-line no-use-before-define\n extensionTranslations[localeSetup.locale]\n );\n }\n }", "function translations (lang = 'en') {\n let text = {\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n limit: 'Limit reached ({{limit}} items max).',\n loading: 'Loading...',\n minLength: 'Min. Length',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n notSelected: 'Nothing Selected',\n required: 'Required',\n search: 'Search'\n }\n return window.VueStrapLang ? window.VueStrapLang(lang) : text\n}", "function translations (lang = 'en') {\n let text = {\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n limit: 'Limit reached ({{limit}} items max).',\n loading: 'Loading...',\n minLength: 'Min. Length',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n notSelected: 'Nothing Selected',\n required: 'Required',\n search: 'Search'\n }\n return window.VueStrapLang ? window.VueStrapLang(lang) : text\n}", "function Lang() { \n}", "function translations(lang) {\n\t\t lang = lang || 'en';\n\t\t var text = {\n\t\t daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n\t\t limit: 'Limit reached ({{limit}} items max).',\n\t\t loading: 'Loading...',\n\t\t minLength: 'Min. Length',\n\t\t months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n\t\t notSelected: 'Nothing Selected',\n\t\t required: 'Required',\n\t\t search: 'Search'\n\t\t };\n\t\t return window.VueStrapLang ? window.VueStrapLang(lang) : text;\n\t\t}", "function LangMap() {}", "function LangMap() {}", "_loadWithCurrentLang() {\n i18n.changeLang(this.DOM.body, this.lang, this.DOM.domForTranslate, true);\n }", "function trs(what, atts) {\n var struct = that.messages[what];\n\n if (struct && struct[language])\n return translate(what, atts);\n return what;\n }", "translate(translation_key){\n\t\tlet languages = this.getLanguages(),\n\t\t\ttranslation_key_lcase = translation_key.toLowerCase(),\n\t\t\tresult = (translation_key in languages) ? languages[translation_key] : (translation_key_lcase in languages) ? languages[translation_key_lcase] : null,\n\t\t\tdefault_language = utils_daterange_i18n['default'];\n\n\t\tif (result == null)\n\t\t\tresult = (translation_key in default_language) ? default_language[translation_key] : (translation_key_lcase in default_language) ? default_language[translation_key_lcase] : '';\n\n\t\treturn result;\n\t}", "ADD_LOCALE(state, { locale, translations }) {\n // reduce the given translations to a single-depth tree\n state.translations[locale] = flattenTranslations(translations)\n\n // make sure to notify vue of changes (this might break with new vue versions)\n try {\n if (state.translations.__ob__) state.translations.__ob__.dep.notify()\n } catch (ex) {}\n }", "function translate(word)\n{\n return Language[word]\n\n}", "changeLanguageStrings () {\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_modal_header_text\", this.labels.modal_header_text);\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_btn_ok_text\", this.labels.btn_ok_text);\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_btn_all_text\", this.labels.btn_all_text);\n\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesicon-label\", this.labels.modal_titlesicon_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesname_text\", this.labels.modal_titlesname_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlestotal_text\", this.labels.modal_titlestotal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesglobal_text\", this.labels.modal_titlesglobal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titleslocal_text\", this.labels.modal_titleslocal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlescopies_text\", this.labels.modal_titlescopies_text);\n\t}", "function translate($translateProvider) {\n \t\t// Define json translation file location\n $translateProvider.useLoader('$translatePartialLoader', {\n urlTemplate: '/i18n/{lang}/{part}.json'\n });\n\n // Default language is 'fr'\n $translateProvider.preferredLanguage('fr');\n }", "function en(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "translateAllUiTexts(locales) {\n if (this._enableTranslate && this.translate && this.translate.instant && this.translate.currentLang) {\n this.textItemsPerPage = this.translate.instant('ITEMS_PER_PAGE');\n this.textItems = this.translate.instant('ITEMS');\n this.textOf = this.translate.instant('OF');\n this.textPage = this.translate.instant('PAGE');\n }\n else if (locales) {\n this.textItemsPerPage = locales.TEXT_ITEMS_PER_PAGE || 'TEXT_ITEMS_PER_PAGE';\n this.textItems = locales.TEXT_ITEMS || 'TEXT_ITEMS';\n this.textOf = locales.TEXT_OF || 'TEXT_OF';\n this.textPage = locales.TEXT_PAGE || 'TEXT_PAGE';\n }\n }", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n\t\t\t\thelpArray=[_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\"),_(\"help6\"),_(\"help7\"),_(\"Next\"),_(\"Close\"),_(\"help8\"),_(\"help9\")];\n scope.heading=_(\"Emission spectra\");\n\t\t\t\tscope.variables=_(\"Variables\"); \n\t\t\t\tscope.result=_(\"Result\"); \n\t\t\t\tscope.copyright=_(\"copyright\"); \n\t\t\t\tscope.calibrate_txt = _(\"Reset\");\n scope.calibrate_slider_txt = _(\"Calibrate Telescope :\");\n scope.select_lamp_txt = _(\"Select Lamp :\");\n light_on_txt = _(\"Switch On Light\");\n light_off_txt = _(\"Switch Off Light\");\n place_grating_txt = _(\"Place grating\");\n remove_grating_txt = _(\"Remove grating\");\n scope.telescope_angle_txt = _(\"Angle of Telescope :\");\n scope.vernier_table_angle_txt = _(\"Angle of Vernier Table :\");\n scope.fine_angle_txt = _(\"Fine Angle of Telescope :\");\n scope.start_txt = _(\"Start\");\n\t\t\t\tscope.reset_txt = _(\"Reset\");\n scope.lamp_array = [{\n lamp:_(\"Mercury\"),\n index:0\n },{\n lamp:_(\"Hydrogen\"),\n index:1\n },{\n lamp:_(\"Neon\"),\n index:2\n }];\n scope.$apply();\t\t\t\t\n\t\t\t}", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n helpArray=[_(\"Next\"),_(\"Close\"),_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\")];\n scope.heading=_(\"Moment of Inertia of Flywheel\");\n scope.variables=_(\"Variables\"); \n scope.result=_(\"Result\"); \n scope.copyright=_(\"copyright\"); \n scope.choose_enviornment = _(\"Choose Environment:\");\n cm = _(\" cm\");\n scope.kg = _(\"kg\");\n scope.cm = cm;\n scope.gm = _(\"gm\");\n scope.earth = _(\"Earth, g=9.8m/s\");\n scope.mass_of_fly_wheel_lbl = _(\"Mass of fly wheel:\");\n scope.dia_of_fly_wheel_lbl = _(\"Diameter of fly wheel:\");\n scope.mass_of_rings_lbl = _(\"Mass of rings:\");\n scope.axle_diameter_lbl = _(\"Diameter of axle:\");\n scope.no_of_wound_lbl = _(\"No. of wound of chord:\");\n scope.mInertia_lbl = _(\"First start experiment..!\");\n scope.mInertia_val = \"\";\n btn_lbls = [_(\"Release fly wheel\"),_(\"Hold fly wheel\")];\n scope.release_hold_txt = btn_lbls[0];\n scope.reset = _(\"Reset\");\n scope.enviornment_array = [{\n enviornment: _('Earth, g=9.8m/s'),\n type: 9.8\n }, {\n enviornment: _('Moon, g=1.63m/s'),\n type: 1.63\n }, {\n enviornment: _('Uranus, g=10.5m/s'),\n type: 10.5\n }, {\n enviornment: _('Saturn, g=11.08m/s'),\n type: 11.08\n }, {\n enviornment: _('Jupiter, g=25.95m/s'),\n type: 25.95\n }];\n scope.$apply(); \n }", "viewTranslation() {\n switch(this.state.CurrentViewIndex) {\n case 0 :\n return \"By Student\";\n case 1 :\n return \"By Poem\";\n default:\n return \"\";\n }\n }", "function translate(message) {\n $.ajax({\n url: '/translate',\n type: \"POST\",\n data: { message: message },\n success: function(data) {\n toastr.error(data);\n },\n });\n } // TO MAKE TRANSLATE THE SINGLE MESSAGE", "function init() {\n Translation.getTranslation($scope);\n }", "updateLocalizedContent() {\n this.i18nUpdateLocale();\n }", "updateLocalizedContent() {\n this.i18nUpdateLocale();\n }", "function sb_(text) {\n if (SB_TRANSLATIONS != false && text in SB_TRANSLATIONS) {\n return SB_TRANSLATIONS[text];\n } else {\n return text;\n }\n }", "function translate(req, res, next) {\n set(res.locals, 'translate', (key) => get(labels, key))\n next()\n}", "function getStrings(){\n\t\t//console.log('getString', lang, str, translations[lang][str])\n\t\tlet lang=document.documentElement.lang.split('-')[0]||'en' \n\t\tif(!translations[lang]) lang='en'\n\t\treturn translations[lang]\n\t}", "function _t(str) {\n return translate[str]\n}", "function Fn(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "getTranslatedMessages() {\n\t\tif (!_.isObject(this.props.messages)) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (this.props.messages[this.props.lang]) {\n\t\t\treturn this.props.messages[this.props.lang];\n\t\t}\n\n\t\treturn this.props.messages['ENG'];\n\t}", "function translate(str){\n\treturn str;\n}", "function translateAll(t) {\n\tvar $elementsToTranslate = $('[data-i18n]');\n\t\n\tif (exists($elementsToTranslate)) {\n\t\tfor(var indexTranslate = 0; indexTranslate < $elementsToTranslate.length; indexTranslate++) {\n\t\t\tvar $elementToTranslate = $($elementsToTranslate[indexTranslate]);\n\t\t\t\n\t\t\tif (exists($elementToTranslate)) {\n\t\t\t\t$elementToTranslate.i18n();\n\t\t\t}\n\t\t}\n\t}\n}", "function I18nMutateOpCodes(){}", "changeLanguage (language) {\n COMPONENT.innerHTML = DATA.lang[language];\n }", "@action(Action.INIT_LANGUAGE)\n @dispatches(Action.UI_LANGUAGE_READY)\n async initUiLanguage (store) {\n await $.getScript(`${basepath}/i18n/${this.getLanguage(store).code}.js`)\n\n t10.scan() // translate\n }", "function translate(translationKey) {\n var translationKeyLowerCase = translationKey.toLowerCase();\n var result = translationKey in languages ? languages[translationKey] : translationKeyLowerCase in languages ? languages[translationKeyLowerCase] : null;\n var defaultLanguage = $.dateRangePickerLanguages['default'];\n if (result == null) result = translationKey in defaultLanguage ? defaultLanguage[translationKey] : translationKeyLowerCase in defaultLanguage ? defaultLanguage[translationKeyLowerCase] : '';\n\n return result;\n }", "function add_i18n()\n {\n var i18n = {};\n\n i18n[I18N.LANG.EN] = {};\n i18n[I18N.LANG.EN][MODULE_NAME + '_short_desc'] = 'Fold Twinoid bar';\n i18n[I18N.LANG.EN][MODULE_NAME + '_full_desc'] = 'Fold the Twinoid black bar at the top of the screen. Put your mouse near the top of the screen to show it again.';\n\n i18n[I18N.LANG.FR] = {};\n i18n[I18N.LANG.FR][MODULE_NAME + '_short_desc'] = 'Replier la barre Twinoid';\n i18n[I18N.LANG.FR][MODULE_NAME + '_full_desc'] = 'Permet de gagner de la place en repliant la barre Twinoid. Rapprochez votre souris du bord supérieur de l\\'écran pour l\\'afficher de nouveau.';\n\n I18N.set(i18n);\n }", "function override() {\n\n\t//store translation data in object array\n\ttranslate = {\n\t\t'姓に全額文字以外が含まれています': \"Last name is not full-width characters\",\n\t\t'名に全額文字以外が含まれています': \"First name is not full-width characters\",\n\t\t'姓(カナ)が全角カタカナではありません': \"Last name(kana) is not full-width katakana\",\n\t\t'名(カナ)が全角カタカナではありません': \"First name(kana) is not full-width katakana\",\n\t\t'住所に都道府県が入力されていません': \"Entered address does not include a valid prefecture\",\n\t\t'住所に許容されていない半角記号が入力されてます': \"Half-width numbers cannot be used in address field\",\n\t\t'電話番号が半角数字ではありません': \"Phone number must be half-width numbers\",\n\t\t'連絡先メールアドレスが入力されていません': \"Mail Address has not been entered\",\n\t\t'連絡先メールアドレスの書式が不正です': \"Email address has not been entered correctly\"\n\t}\n\n\t//backup the alert box function to reuse it (if you want to program your own fancy alery box then go for it, you could probably even use jQuery UI or the chrome built in desktop notifications API, because alert boxes are lame)\n\twindow.alertback = window.alert\n\t\n\t//redefine the alert function to pass text into the backup of the original alert function after it's translated\n\twindow.alert = function alert(x) {\n\n\t\tmsg = translate[x]; //call array only once\n\t\tif(msg == \"undefined\"){\n\t\t\talertback('Could not translate: /n' + x + '/n/nPlease report this on PSO-World. See web console (CTRL + SHIFT + J) to copy the Japanese text'); //Translation not found, give the original message with instructions\n\t\t\tconsole.log('Could not translate: /n' + x);\n\t\t}else{\n\t\t\talertback(msg); //Translation found, use translate message\n\t\t}\n\t};\n\n}", "translateGridMenu() {\n if (this.gridMenuExtension && this.gridMenuExtension.translateGridMenu) {\n this.gridMenuExtension.translateGridMenu();\n }\n }", "function translate(key) {\n \"use strict\";\n if (langData.hasOwnProperty(lang)) {\n if (langData[lang].hasOwnProperty(key)) {\n return langData[lang][key];\n } else {\n return \"Undefined\";\n }\n } else {\n return \"Undefined\";\n }\n}", "function translateView() {\n \"use strict\";\n $(\".totranslate\").each(function () {\n var key = $(this).attr(\"data-totranslate\");\n\n $(this).text(translate(key));\n });\n}", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n\t\t\t\thelpArray = [_(\"Next\"),_(\"Close\"),_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\"),_(\"help6\"),_(\"help7\"),_(\"help8\"),_(\"help9\"),_(\"help10\")];\n scope.heading = _(\"Young's Modulus-Uniform Bending\");\n\t\t\t\tscope.variables = _(\"Variables\"); \n\t\t\t\tscope.result = _(\"Result\"); \n\t\t\t\tscope.copyright = _(\"copyright\"); \n\t\t\t\tscope.environment_lbl = _(\"Select Environment\");\n\t\t\t\tscope.material_lbl = _(\"Select Material\");\n\t\t\t\tscope.mass_lbl = _(\"Mass of weight hanger : \");\n\t\t\t\tscope.material_lbl = _(\"Select Material\");\n\t\t\t\tscope.unit_gram = _(\"g\");\n\t\t\t\tscope.unit_cm = _(\"cm\");\n\t\t\t\tscope.breadth_lbl = _(\"Breadth of bar(b) : \");\n scope.thickness_lbl = _(\"Thickness of bar(d) : \");\n scope.blade_distance_lbl = _(\"Knife edge distance : \");\n scope.weight_hangers_distance_lbl = _(\"Weight hangers distance : \");\n scope.reset = _(\"Reset\");\n\t\t\t\tscope.result_txt = _(\"Young's Modulus of \");\n\t\t\t\tscope.environment_array = [{\n environment: _('Earth, g=9.8m/s'),\n value: 9.8\n }, {\n environment: _('Moon, g=1.63m/s'),\n value: 1.63\n }, {\n environment: _('Uranus, g=10.67m/s'),\n value: 10.67\n }, {\n environment: _('Saturn, g=11.08m/s'),\n value: 11.08\n }];\n scope.material_array = [{\n material: _('Wood'),\n value: 1.1\n }, {\n material: _('Aluminium'),\n value: 6.9\n }, {\n material: _('Copper'),\n value: 11.7\n }, {\n material: _('Steel'),\n value: 20\n }];\n\n scope.$apply();\t\t\t\t\n\t\t\t}", "setTranslatedValue(props) {\n let { label, params } = props || this.props;\n\n return translate(label, params || null)\n .then(text => {\n this.setState({ text });\n });\n }", "function MyComponent() {\n return (\n <Trans i18nKey=\"description.part1\">\n To get started, edit <code>src/App.js</code> and save to reload.\n </Trans>\n );\n}", "function MyComponent() {\n return (\n <Trans i18nKey=\"description.part1\">\n To get started, edit <code>src/App.js</code> and save to reload.\n </Trans>\n );\n}", "function BrowserLanguage() {\n}", "async function getTranslations () {\n\treturn {\n\t\t'en-US': {\n\t\t\t'HOME.HELLO': 'Welcome home!',\n\t\t\t'PAGE1.HELLO': 'Hello from Page1',\n\t\t\t'PAGE2.HELLO': 'Hello from Page2',\n\t\t\t'NOT-FOUND': 'couldnt find it!',\n\t\t\t'BANNER': 'Hello world',\n\t\t\t'LINK.HOME': 'Home',\n\t\t\t'LINK.PAGE-1': 'Page 1',\n\t\t\t'LINK.PAGE-2': 'Page 2'\n\t\t}\n\t}\n}", "function uiHelper(phraseToTranslate) {\n\tGetLanguages()\n\t\t.then(async res => {\n\t\t\tconst response = res;\n\t\t\tconst results = await Promise.all(\n\t\t\t\tresponse.map(async res => {\n\t\t\t\t\treturn await Translate(\"en\", res.code, phraseToTranslate);\n\t\t\t\t})\n\t\t\t);\n\t\t\treturn results;\n\t\t})\n\t\t.then(res => console.log(res));\n}", "function localizeElement(el, key, args) {\n el.innerHTML = '';\n var text = navigator.mozL10n.get(key, args);\n el.appendChild(document.createTextNode(text));\n}", "componentWillMount () {\n this.updateLang()\n }", "function add_i18n()\n {\n var i18n = {};\n\n i18n[I18N.LANG.EN] = {};\n i18n[I18N.LANG.EN][MODULE_NAME + '_short_desc'] = 'Enable shortcuts';\n i18n[I18N.LANG.EN][MODULE_NAME + '_full_desc'] = 'Let you use keyboard shortcuts in town to quickly access important places. The shortcuts are listed below : <br /><dl><dt>G + O</dt><dd>Overview</dd><dt>G + H</dt><dd>Home</dd><dt>G + W</dt><dd>Well</dd><dt>G + B</dt><dd>Bank</dd><dt>G + C</dt><dd>Citizens</dd><dt>G + D</dt><dd>Buildings</dd><dt>G + G</dt><dd>Gates</dd><dt>G + P</dt><dd>Town upgrades</dd><dt>G + T</dt><dd>Watchtower</dd><dt>G + M</dt><dd>Workshop</dd><dt>G + L</dt><dd>Night watch</dd></dl>';\n\n i18n[I18N.LANG.FR] = {};\n i18n[I18N.LANG.FR][MODULE_NAME + '_short_desc'] = 'Activer les raccourcis clavier';\n i18n[I18N.LANG.FR][MODULE_NAME + '_full_desc'] = 'Active des raccourcis claviers pour accéder rapidement aux places importantes en ville. Les raccourcis sont listés ci-dessous : <br /><dl><dt>G + O</dt><dd>Vue d\\'ensemble</dd><dt>G + H</dt><dd>Maison</dd><dt>G + W</dt><dd>Puits</dd><dt>G + B</dt><dd>Banque</dd><dt>G + C</dt><dd>Citoyens</dd><dt>G + D</dt><dd>Constructions</dd><dt>G + G</dt><dd>Portes</dd><dt>G + P</dt><dd>Évolutions</dd><dt>G + T</dt><dd>Tour de guet</dd><dt>G + M</dt><dd>Atelier</dd><dt>G + L</dt><dd>Veille</dd></dl>';\n\n I18N.set(i18n);\n }", "renderAboutUsMessage(language) {\n switch(language) {\n case 'en':\n this.setState({aboutUsMessage: 'Message about STORMRIDER'});\n break;\n case 'is':\n this.setState({aboutUsMessage: 'Bulbulbul asfgwthyt STORMRIDER'});\n break;\n default:\n break;\n }\n }", "function setPreferredLang() {\n angularTranslateSvc.use(service.getPreferredLang());\n }", "_setLocalizationSettings(locale, messages) {\n const that = this;\n\n that.locale = locale;\n that.messages = messages;\n\n // Sets default locale && messages\n that.defaultLocale = 'en';\n that.defaultMessages = {\n 'en': {\n // Texts\n criteriaText: 'Criteria:',\n onInavlidData: 'On invalid data:',\n appearance: 'Appearance:',\n showWarning: 'Show warning',\n rejectInput: 'Reject input',\n showValidationHelpText: 'Show validation help text:',\n cancelButtonText: 'cancel',\n removeValidationButtonText: 'remove validation',\n saveButtonText: 'save',\n andTextBetweenInput: 'and',\n expectTrue: 'Expect true',\n expectFalse: 'Expect false',\n resetButtonText: 'Reset',\n\n //DataType Number\n NumberDataTypeText: 'Number',\n //DataType Number Conditions\n Number_between: 'between',\n Number_not_between: 'not between',\n Number_less_than: 'less than',\n Number_less_than_or_equal_to: 'less than or equal to',\n Number_greater_than: 'greater than',\n Number_greater_than_or_equal_to: 'greater than or equal to',\n Number_equal_to: 'equal to',\n Number_not_equal_to: 'not equal to',\n\n //DataType Text\n TextDataTypeText: 'Text',\n //DataType Text Conditions\n Text_contains: 'contains',\n Text_does_not_contain: 'does not contain',\n Text_equals: 'equals',\n Text_is_valid_email: 'is valid email',\n Text_is_valid_url: 'is valid url',\n\n //DataType Date\n DateDataTypeText: 'Date',\n //DataType Date Conditions\n Date_is_valid_date: 'is valid date',\n Date_equal_to: 'equal to',\n Date_before: 'before',\n Date_on_or_before: 'on or before',\n Date_after: 'after',\n Date_on_or_after: 'on or after',\n Date_between: 'between',\n Date_not_between: 'not between',\n\n //DataType Boolean\n BooleanDataTypeText: 'Boolean',\n\n //Number\n numberBetweenValidationText: 'Enter a number between',\n numberNotBetweenValidationText: 'Enter a number not between',\n numberLessThanValidationText: 'Enter a number less than',\n numberLessThanOrEqualToValidationText: 'Enter a number less than or equal to',\n numberGreaterThanValidationText: 'Enter a number greater than',\n numberGreaterThanOrEqualToValidationText: 'Enter a number greater than or equal to',\n numberEqualToValidationText: 'Enter a number equal to',\n numberNotEqualToValidationText: 'Enter a number not equal to',\n\n //Text\n textContainsValidationText: 'Enter text that contains',\n textNotContainsValidationText: 'Enter text that does not contain',\n textEqualsValidationText: 'Enter text that equals',\n textValidEmailValidationText: 'Enter a valid email',\n textValidUrlValidationText: 'Enter a valid url',\n\n //Date\n dateValidDateValidationText: 'Enter a valid date',\n dateEqualToValidationText: 'Enter a date equal to',\n dateBeforeValidationText: 'Enter a date before',\n dateOnOrBeforeValidationText: 'Enter a date on or before',\n dateAfterValidationText: 'Enter a date after',\n dateOnOrAfterValidationText: 'Enter a date on or after',\n dateBetweenValidationText: 'Enter a date between',\n dateNotBetweenValidationText: 'Enter a date not between',\n\n //Boolean\n booleanValidationText: 'Enter \\'true\\' or \\'false\\'',\n\n },\n };\n\n // If messages not passed - get default\n if (!that.messages) {\n that.messages = that.defaultMessages;\n }\n\n // If passed invalid language\n if (!that.messages[that.locale]) {\n if (that.messages[that.defaultLocale]) {\n that.locale = that.defaultLocale;\n }\n else {\n that.messages = that.defaultMessages;\n that.locale = that.defaultLocale;\n }\n }\n }", "set translations(translations) {\n const defaultTranslation = defaultTranslations();\n if (translations) {\n this.chatService.translations = {\n ...defaultTranslation,\n ...translations,\n presence: {\n ...defaultTranslation.presence,\n ...translations.presence,\n },\n };\n }\n }", "function translate(...parts) {\n return I18nLib.translator.translate(parts.join('.'));\n}", "init_() {\n this.localizationService_ = getLocalizationService(this.storyAutoAdsEl_);\n\n const enXaPseudoLocaleBundle = createPseudoLocale(\n LocalizedStringsEn,\n (s) => `[${s} one two]`\n );\n\n this.localizationService_.registerLocalizedStringBundles({\n 'default': LocalizedStringsEn,\n 'ar': LocalizedStringsAr,\n 'de': LocalizedStringsDe,\n 'en': LocalizedStringsEn,\n 'en-GB': LocalizedStringsEnGb,\n 'es': LocalizedStringsEs,\n 'es-419': LocalizedStringsEs419,\n 'fr': LocalizedStringsFr,\n 'hi': LocalizedStringsHi,\n 'id': LocalizedStringsId,\n 'it': LocalizedStringsIt,\n 'ja': LocalizedStringsJa,\n 'ko': LocalizedStringsKo,\n 'nl': LocalizedStringsNl,\n 'no': LocalizedStringsNo,\n 'pt-PT': LocalizedStringsPtPt,\n 'pt-BR': LocalizedStringsPtBr,\n 'ru': LocalizedStringsRu,\n 'tr': LocalizedStringsTr,\n 'vi': LocalizedStringsVi,\n 'zh-cn': LocalizedStringsZhCn,\n 'zh-TW': LocalizedStringsZhTw,\n 'en-xa': enXaPseudoLocaleBundle,\n });\n }", "getTranslation() {\nreturn this.translation;\n}", "function add_i18n()\n {\n var i18n = {};\n\n i18n[I18N.LANG.EN] = {};\n i18n[I18N.LANG.EN][MODULE_NAME + '_short_desc'] = 'Directly enable the good escort options';\n i18n[I18N.LANG.EN][MODULE_NAME + '_full_desc'] = 'When the escort mode is enabled, you can directly be taken further away and your rucksack objects can be manipulated.';\n\n i18n[I18N.LANG.FR] = {};\n i18n[I18N.LANG.FR][MODULE_NAME + '_short_desc'] = 'Activer les bonnes options d\\'escorte automatiquement';\n i18n[I18N.LANG.FR][MODULE_NAME + '_full_desc'] = 'Quand le mode escorte est activé, vous pouvez automatiquement être éloigné de la ville et les objets de votre sac peuvent être manipulés.';\n\n I18N.set(i18n);\n }", "recompileTranslations() {\n // Remove installed translations\n let cmd = `cinnamon-xlet-makepot -r ${this.metadata.path}`;\n let resp = QUtils.spawn_command_line_sync_string_response(cmd);\n let success = true;\n if (resp.success && resp.stdout) {\n if (resp.stdout.match(/polib/)) {\n success = false;\n QUtils.show_error_notification(resp.stdout);\n }\n }\n \n if (success) {\n // Reinistall translations\n cmd = `cinnamon-xlet-makepot -i ${this.metadata.path}`;\n resp = QUtils.spawn_command_line_sync_string_response(cmd);\n if (resp.success && resp.stdout) {\n QUtils.show_info_notification(resp.stdout);\n }\n }\n }", "_setTranslation () {\n\n\t\t// Find the parts of the translation\n\t\tconst atoms = this.value.split(/:(.*)/);\n\t\tconst key = atoms.length > 0 ? atoms[0] : null;\n\t\tconst obj = atoms.length > 1 ? JSON.parse(atoms[1]) : null;\n\n\t\tconst translation = this.translate.get(key, obj);\n\t\tthis.ownerElement.innerHTML = translation || `${this.value}`;\n\n\t\t// Keep a reference to the old value for optimizations\n\t\tthis.oldValue = this.value;\n\t}", "function setLocalizedLabel() {\n var getI18nMsg = chrome.i18n.getMessage;\n\n $('save_button').innerText = 'save'; //getI18nMsg('save');\n// $('delete_button').value = 'delete'; //getI18nMsg('deleteTitle');\n deleteLabel = 'delete';\n $('submit_button').value = 'add'; //getI18nMsg('submitButton');\n}", "function translate() {\n return function (WrappedComponent) {\n var _translate = function _translate(props, context) {\n return _react2.default.createElement(WrappedComponent, _extends({}, props, { t: context.t }));\n };\n\n _translate.contextTypes = {\n t: _propTypes2.default.func.isRequired\n };\n\n return _translate;\n };\n}", "function _localize(s) {\n\tvar strings = {\n\t\t\"&Arguments\": {\n\t\t\tru: \"&Аргументы\"\n\t\t},\n\t\t\"OK\": {\n\t\t\tru: \"ОК\"\n\t\t},\n\t\t\"Exec\": {\n\t\t\tru: \"Запустить\"\n\t\t},\n\t\t\"Edit\": {\n\t\t\tru: \"Изменить\"\n\t\t},\n\t\t\"Cancel\": {\n\t\t\tru: \"Отмена\"\n\t\t}\n\t};\n\tvar lng;\n\tswitch(AkelPad.GetLangId(1 /*LANGID_PRIMARY*/)) {\n\t\tcase 0x19: lng = \"ru\"; break;\n\t\tdefault: lng = \"en\";\n\t}\n\t_localize = function(s) {\n\t\treturn strings[s] && strings[s][lng] || s;\n\t};\n\treturn _localize(s);\n}", "function requestTranslation() {\n var messageTexts = document.getElementsByClassName(\"message-text\");\n var messageContainers = document.getElementsByClassName(\"message-translated\");\n const languageCode = document.getElementById('language').value;\n if(languageCode == \"orig\"){\n for (var i = 0; i < messageTexts.length; i++) {\n messageTexts[i].classList.remove('hidden');\n messageContainers[i].classList.add('hidden');\n }\n } else {\n for (var i = 0; i < messageTexts.length; i++) {\n translateElement(messageTexts[i], messageContainers[i], languageCode);\n }\n }\n }", "function e(a){var c=b.localeData||b.langData;return c.call(b,a)||c.call(b,\"en\")}", "function translationLabels() {\n\t\t\t\t/** This help array shows the hints for this experiment */\n\t\t\t\thelpArray = [_(\"help1\"), _(\"help2\"), _(\"help3\"), _(\"help4\"),_(\"help5\"),_(\"help6\"),_(\"help7\"), _(\"Next\"), _(\"Close\")];\n\t\t\t\t/** Experiment name */\n\t\t\t\tscope.heading = _(\" Electrogravimetric Estimation of Metals\");\n\t\t\t\t/** Label for voltage slider */\n\t\t\t\tscope.voltage_label = _(\"Voltage\")\n\t\t\t\t/** Unit for voltage */\n scope.voltage_unit = _(\"V\");\n\t\t\t\t/** Label for resistance slider */\n\t\t\t\tscope.resistance_label = _(\"Resistance\")\n\t\t\t\t/** Unit for resistance */\n\t\t\t\tscope.resistance_unit = _(\"Ω\");\n\t\t\t\t/** Label for time slider */\n\t\t\t\tscope.time_label = _(\"Time\")\n\t\t\t\t/** Unit for time */\n\t\t\t\tscope.time_unit = _(\"min\");\n\t\t\t\t/** Labels for buttons */\n\t\t\t\tstart_btn_var =_(\"start\");\n\t\t\t\tstop_btn_var =_(\"stop\");\n\t\t\t\tpause_btn_var =_(\"pause\");\n\t\t\t\tplay_btn_var =_(\"play\");\n\t\t\t\tplatinum_text = _('Platinum');\n\t\t\t\tscope.reset = _(\"Reset\");\n\t\t\t\tscope.variables = _(\"variables\");\n\t\t\t\tscope.result = _(\"result\");\n\t\t\t\tscope.copyright = _(\"copyright\");\n\t\t\t\t/** Labels for select solution */\n\t\t\t\tscope.selectSolution_label = _(\"Select Solution :\");\n\t\t\t\t/** Labels for cathode */\n\t\t\t\tscope.cathode_label = _(\"Cathode\");\n\t\t\t\t/** Labels for anode */\n\t\t\t\tscope.anode_label = _(\"Anode\");\n\t\t\t\t/** Labels for initial weight of cathode */\n\t\t\t\tscope.initial_weight_label = _(\"Initial weight of cathode : 10.00 g\");\n\t\t\t\t/** Labels for total weight of cathode */\n\t\t\t\tscope.total_weight_label = _(\"Total weight of cathode\");\n\t\t\t\t/** Unit for total weight */\n\t\t\t\tscope.total_weight_unit = _(\"g\");\n\t\t\t\t/** Initializing solution array*/\n\t\t\t\tscope.selectSolutionArray = [{optionsSolution: _('CuSO₄'),type: 0}, {optionsSolution: _('PbSO₄'),type: 1}, {optionsSolution: _('MnSO₄'),type: 2},{optionsSolution: _('NiSO₄'),type: 3}, {optionsSolution: _('CdSO₄'),type: 4}];\n\t\t\t\t/** Setting initial value of cathode and anode*/\n\t\t\t\tscope.cathode_value = platinum_text;\n\t\t\t\tscope.anode_value = platinum_text;\n }", "async translate(text, lan, messageId) {\n try {\n this.props.translateOne(text, lan, messageId)\n let {showTrans} = this.state\n await this.setState({\n showTrans: !showTrans,\n translate: this.props.translate\n })\n } catch (err) {\n console.error(err)\n }\n }", "i18nLoad(languageInfo) {\n if (!languageInfo) return;\n this.setState({\n locale: languageInfo.locale,\n messages: localeData[languageInfo.locale],\n });\n }", "__(key, replace)\n {\n var translation = window.config.translations[key]\n ? window.config.translations[key]\n : key;\n\n _.forEach(replace, (value, key) => {\n key = String(key);\n\n if (value === null) {\n console.error(\n `Translation '${translation}' for key '${key}' contains a null replacement.`,\n );\n\n return;\n }\n\n value = String(value);\n\n const searches = [\n ':' + key,\n ':' + key.toUpperCase(),\n ':' + key.charAt(0).toUpperCase() + key.slice(1),\n ];\n\n const replacements = [\n value,\n value.toUpperCase(),\n value.charAt(0).toUpperCase() + value.slice(1),\n ];\n\n for (var i = searches.length - 1; i >= 0; i--) {\n translation = translation.replace(searches[i], replacements[i]);\n }\n });\n\n return translation;\n }", "changeTextOnDOM(){\n var keys = Object.keys(this.idsToLangKey)\n keys.forEach((value)=>{\n document.getElementById(value).innerHTML = this.localeModel.getCurrentLanguage(this.idsToLangKey[value])\n })\n }", "get_string(stringFor){\n let language=''\n if(this.state.language===''){\n if(this.props.location.state)\n language = this.props.location.state.language\n else\n language='en'\n }\n else\n language=this.state.language\n return (Translate.find({stringFor}).fetch()[0]?Translate.find({stringFor}).fetch()[0].langArray[language]:undefined)\n }", "get_string(stringFor){\n let language=''\n if(this.state.language===''){\n if(this.props.location.state)\n language = this.props.location.state.language\n else\n language='en'\n }\n else\n language=this.state.language\n return (Translate.find({stringFor}).fetch()[0]?Translate.find({stringFor}).fetch()[0].langArray[language]:undefined)\n }", "function $l(key, text) {\r\n var string, l;\r\n if (lang[language][key]) { string = lang[language][key]; l = language; }\r\n else { string = lang['en'][key]; l = 'en' }\r\n if (text) { string = string.replace('%s', text); }\r\n return string;\r\n }", "function PlcGeral(){\r\n}", "function $l(key,text) {\r\n\tvar string, l;\r\n\tif (lang[language][key]) { string = lang[language][key]; l = language; }\r\n\telse { string = lang['en'][key]; l = 'en'}\r\n\tif (text) { string = string.replace('%s', text); }\r\n\treturn string;\r\n}", "function $l(key,text) {\r\n\tvar string, l;\r\n\tif (lang[language][key]) { string = lang[language][key]; l = language; }\r\n\telse { string = lang['en'][key]; l = 'en'}\r\n\tif (text) { string = string.replace('%s', text); }\r\n\treturn string;\r\n}", "function $l(key,text) {\r\n\tvar string, l;\r\n\tif (lang[language][key]) { string = lang[language][key]; l = language; }\r\n\telse { string = lang['en'][key]; l = 'en'}\r\n\tif (text) { string = string.replace('%s', text); }\r\n\treturn string;\r\n}", "function n__1(context,strings,stringp,n,arg1) {\n\t//return sprintf(portal_translateOptionalContext_plural(\n\t//\t$strings,$stringp,$n,$context), $arg1);\n\t//return _i18n.strfmt(strings,arg1);\n \treturn _i18n.dcnpgettext(null, context, strings, stringp, n, arg1);\n}", "function translateCtrl($translate, $scope, $localStorage) {\n init();\n\n function init() {\n if (!$localStorage.langKey){\n $localStorage.langKey = 'en';\n }\n\n changeLanguage($localStorage.langKey);\n }\n\n $scope.changeLanguage = changeLanguage;\n function changeLanguage(langKey) {\n $translate.use(langKey);\n $scope.language = langKey;\n $localStorage.langKey = langKey;\n }\n}", "function translations() {\n $(\".countryLbl\").html(country),\n $(\".cityLbl\").html(city),\n $(\".locationLbl\").html(loc),\n $(\".pickUpTitle\").html(pickup),\n $(\".pickDateLbl\").html(pickupDate),\n $(\".pickTimLbl\").html(pickUpTime),\n $(\".dropDateLbl\").html(dropoffDate),\n $(\".droptimeLbl\").html(dropOffTime),\n $(\".driversAge\").html(driverAge),\n $(\".searchBtn\").text(search),\n $(\"#locationSpan\").html(loc);\n}", "function initializeLangVars() {\nswitch (Xlang) {\n// --------------------------------------------------------------------------------------------------------------------------------------------------------------------\n// - The 03/02/2010 ------------- by Ptitfred06\n// Modification : small word to have good view in tasklist\n// - Small modification on word (translation).\n// - comment what can be personnalise / and what can't \n// -----------------------------------------------------------------------\n\tcase \"fr\": // thanks Tuga\n// Texte détécté dans les page Travian (NE PAS CHANGER / No CHANGE !!!)\n\t\taLangAllBuildWithId = [\"Bûcheron\", \"Carrière de terre\", \"Mine de fer\", \"Ferme\", \"\", \"Scierie\", \"Usine de poteries\", \"Fonderie\", \"Moulin\", \"Boulangerie\", \"Dépôt de ressources\", \"Silo de céréales\", \"Armurerie\", \"Usine d'armures\", \"Place du tournoi\", \"Bâtiment principal\", \"Place de rassemblement\", \"Place du Marché\", \"Ambassade\", \"Caserne\", \"Écurie\", \"Atelier\", \"Académie\", \"Cachette\", \"Hôtel de ville\", \"Résidence\", \"Palais\", \"Chambre aux trésors\", \"Comptoir de commerce\", \"Grande Caserne\", \"Grande Écurie\", \"Mur d'enceinte\", \"Mur de terre\", \"Palissade\", \"Tailleur de Pierres\", \"Brasserie\", \"Fabricant de pièges\",\"Manoir du héros\", \"Grand dépôt de ressources\", \"Grand silo de céréales\", \"Merveille du monde\", \"Abreuvoir\"];\n\t\taLangAllBuildAltWithId = [/*\"Bûcheron\"*/, \"Carrière de Terre\", /*\"Mine de fer\"*/, \"Ferme de céréales\", \"\", /*\"Scierie\"*/, \"Usine de Poteries\", /*\"Fonderie\", \"Moulin\"*/,/* \"Boulangerie\"*/, /*\"Dépôt de ressources\"*/, /*\"Silo de céréales\"*/, /*\"Armurerie\"*/, /*\"Usine d'armures\"*/, /*\"Place du tournoi\"*/, \"Bâtiment Principal\", /*\"Place de rassemblement\"*/, \"Place du marché\", /*\"Ambassade\"*/, /*\"Caserne\"*/, /*\"Écurie\"*/, /*\"Atelier\"*/, /*\"Académie\"*/, /*\"Cachette\"*/, \"Hôtel de Ville\", /*\"Résidence\"*/, /*\"Palais\"*/, /*\"Chambre aux trésors\"*/, \"Comptoir de commerce\", \"Grande Caserne\", \"Grande Écurie\", \"Mur d'enceinte\", \"Mur de terre\", \"Palissade\", \"Tailleur de Pierres\", \"Brasserie\", \"Fabricant de pièges\",\"Manoir du Héros\", \"Grand dépôt de ressources\", \"Grand silo de céréales\", \"Merveille du monde\", \"Abreuvoir\"];\n\n// <-- Peu être modifié / can be personnalize\n\t\taLangAddTaskText = [\"Ajouter tache\", \"Type\", \"Village actif\", \"Cible\", \"Vers\", \"Mode\", \"Aide Const.\", \"Quantité de ress.\", \"Bouger vers le haut\", \"Bouger vers le bas\", \"Effacer\", \"&#160;&#160;&#160;Taches\", \"Bouger \", \"Eliminer toutes les tâches\"];\n\t\taLangTaskKind = [\"Évol \", \"N Cons \", \"Att \", \"Rech \", \"Entrai \", \"Trans \", \"NPC\", \"Dém \", \"Fête\"];\n// -->\n\n// <-- Peu être modifié / can be personnalize\n\t\taLangGameText = [\"Niv\", \"Marchands\", \"Id\", \"Capitale\", \"Temps début\", \"this timeseting is unuseful now.\", \"Vers\", \"Village\", \"Transport\", \"de\", \"Transport vers\", \"Transport de\", \"Retour de\", \"Ressources\", \"Bâtiment\", \"Construire un nouveau bâtiment\", \"Vide\", \"Niveau\"];\n// original \taLangGameText = [\"Niveau\", \"Marchands\", \"Identification\", \"Capitale\", \"Inicio\", \"this timeseting is unuseful now.\", \"Vers\", \"Village\", \"Transport\", \"de\", \"Transport vers\", \"Transport de\", \"Retour de\", \"Ressources\", \"Bâtiment\", \"Construire un nouveau bâtiment\", \"Vazio\", \"Niveau\"];\n// -->\tfin\t\n\n\t\taLangRaceName = [\"Romains\", \"Germains\",\"Gaulois\"];\n// <-- Peu être modifié\n\t\taLangTaskOfText = [\"Planifier evolution\", \"Planifier nouvelle construction\", \"RessUpD\", \"OFF\", \"Comencer\", \"ON\", \"Arreter\", \"La distribution des champs de ce village est \", \"AutoT\", \"Auto transport n est pas ouvert\", \"Ouvert\", \"Transport avec succès\", \"Taches\", \"Limit\", \"Defaut\", \"Modifier\", \"Bois/Terre/Fer\", \"Céréales\", \"Planification de demolition\", \"Planif.Attaque\", \"Type d´attaque\", \"Temps de voyage\", \"Repeter numero de fois\", \"Temps de intervales\",\"00:30:00\",\"Cible catapulte\",\"Aléatoire\", \"Inconnu\", \" Fois\", \"/\", \" \", \"Troupes envoyées\", \"Planification d´entrainement\",\"Train ubication\",\"Planification d´entrainement fini\",\"TransP\",\"Setup Interval Time of Reload\",\"This is the interval of page reload ,\\n default sont 20 minutes, Insérer nouveau temps:\\n\\n\",\"Remain\",\"Planifier fête\",\"petite fête\",\"grande fête\",\"Set Interval of Ressources concentration\",\"minutes\",\".\",\".\",\"START\",\"STOP\",\"Planifier entrainement\",\"Augmenter Attaque\",\"Augmenter Defense\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n// -->> fin\n// < ne pas change / no change !!! Detected for the feedback error.\n\t\taLangErrorText = [\"Pas assez de ressources\", \"Les ouvriers sont déjà au travail\", \"Construction complète\", \"Début de la construction\", \"Dans développement\", \"Son Dépôt de ressources est petit. Évolue son Dépôt de ressources pour continuer sa construction\", \"Son silo de céréales est petit. Évolue son Silo de céréales pour continuer sa construction\", \"Ressources suffisantes\",\"Une fête est déjà organisée\"];\n// -->> fin\n\t\taLangOtherText = [\"Il remarque important\", \"Seulement les champs de ressources du capitale <br/>peuvent être élevés à niveau 20. Son capital <br/> n'est pas décelable. S'il vous plaît il visite son profil.\", \"Raccourci ici ^_^\", \"Installation conclue\", \"Annulé\", \"Initier les tâches\", \"Upgrade avec succès\", \"Exécuter avec succès\", \"Sa race est inconnue, et son type de troupe aussi. <br/>Il visite son profil pour déterminer la race.<br/>\", \"S'il vous plaît il visite sa Manoir du héros pour déterminer<br/>la vitesse et le type de héros.\"];\n\t\taLangResources=[\"Bois\",\"Terre\",\"Fer\",\"Céréales\"];\n\t\taLangTroops[0] = [\"Légionnaire\", \"Prétorien\", \"Impérian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Bélier\", \"Catapulte de feu\", \"Sénateur\", \"Colon\", \"Héros\"];\n\t\taLangTroops[1] = [\"Combattant au gourdin\", \"Combattant à la lance\", \"Combattant à la hache\", \"Eclaireur\", \"Paladin\", \"Cavalier Teuton\", \"Bélier\", \"Catapulte\", \"Chef de tribu\", \"Colon\", \"Héros\"];\n\n// <-- NE PAS modifier // Utilisé dans plannification d'attaque, dans recherche de niveau suppèrieur / NO CHANGE !!\n\t\taLangTroops[2] = [\"Phalange\", \"Combattant à l'épée\", \"Eclaireur\", \"Eclair de Toutatis\", \"Cavalier druide\", \"Hédouin\", \"Bélier\", \"Catapulte de Guerre\", \"Chef\", \"Colon\", \"Héros\"];\n// original\taLangTroops[2] = [\"Phalange\", \"Combattant à l'épée\", \"Eclaireur\", \"Eclair de Toutatis\", \"Cavalier druide\", \"Hédouin\", \"Bélier\", \"Catapulte de Guerre\", \"Chef\", \"Colon\", \"Héros\"];\n\n// <-- Peu être modifié // Label des taches / CAN BE CHANGE\n// original\taLangAttackType = [\"Assistance\", \"Attaque\", \"Pillage\"];\n\t\taLangAttackType = [\"Ass.\", \"Att.\", \"Pill.\"];\n// -->\t\t\n\t\tbreak;\n// -------------------------------------------------------------------------------------------------------------------------------\n\n\tcase \"cc\": // 2011.02.13 -- yesren\n\tcase \"cn\": // 感谢K.C.Alvis\n\t\taLangAllBuildWithId = [\"伐木场\", \"黏土矿\", \"铁矿场\", \"农场\", \"\", \"木材厂\", \"砖块厂\", \"铸造厂\", \"磨坊\", \"面包房\", \"仓库\", \"粮仓\", \"铁匠铺\", \"军械库\", \"竞技场\", \"中心大楼\", \"集结点\", \"市场\", \"大使馆\", \"兵营\", \"马厩\", \"工场\", \"研发所\", \"山洞\", \"市政厅\", \"行宫\", \"皇宫\", \n\t\t\t\"宝库\", \"交易所\", \"大兵营\", \"大马厩\", \"罗马城墙\", \"日尔曼城墙\", \"高卢城墙\", \"石匠铺\", \"酿酒厂\", \"陷阱机\", \"英雄园\", \"大仓库\", \"大粮仓\", \"世界奇观\", \"饮马槽\"];\n\t\taLangAllBuildAltWithId = [\"伐木场\", \"黏土矿\", \"铁矿场\", \"农场\", \"\", \"木材厂\", \"砖块厂\", \"铸造厂\", \"磨坊\", \"面包房\", \"仓库\", \"粮仓\", \"铁匠铺\", \"军械库\", \"竞技场\", \"中心大楼\", \"集结点\", \"市场\", \"大使馆\", \"兵营\", \"马厩\", \"工场\", \"研发所\", \"山洞\", \"市政厅\", \"行宫\", \"皇宫\", \n\t\t\t\"宝库\", \"交易所\", \"大兵营\", \"大马厩\", \"罗马城墙\", \"日尔曼城墙\", \"高卢城墙\", \"石匠铺\", \"酿酒厂\", \"陷阱机\", \"英雄园\", \"大仓库\", \"大粮仓\", \"世界奇观\", \"饮马槽\"];\n\t\taLangAddTaskText = [\"添加任务\", \"任务类型\", \"所在村\", \"任务对象\", \"目标\", \"模式\", \"支援建设\", \"资源集中\", \"上移\", \"下移\", \"删除\", \"任务内容\", \"移动\", \"清除所有任务\"];\n\t\taLangTaskKind = [\"升级\", \"新建\", \"攻击\", \"研发\", \"训练\", \"运输\", \"活动\", \"拆除\", \"定制运输\"];\n\t\taLangGameText = [\"等级\", \"商人\", \"坑号\", \"主村\", \"执行时间\", \"此时间设置目前无效\", \"到\", \"村庄\", \"运送\", \"回来\", \"向\", \"来自于\", \"从\", \"资源\", \"建筑\", \"建造新的建筑\", \"空\", \"等级\"];\n\t\taLangRaceName = [\"罗马人\", \"日尔曼人\", \"高卢人\"];\n\t\taLangTaskOfText = [\"预定升级\", \"预定新建\", \"资源自动升级\", \"尚未开启\", \"马上开启\", \"已经开启\", \"点击关闭\", \"该村资源田分布\", \"自动运输\", \"自动运输尚未设定\", \"已设定\", \"运送成功\", \"任务列表\", \"资源输入限额\", \"默认\", \"更改\", \"木/泥/铁\", \"粮食\", \"预定拆除\",\n\t\t\t\"预定发兵\", \"攻击类型\", \"到达所需时间\", \"重复次数\", \"间隔时间\", \"00:30:00\", \"投石目标\", \"随机\", \"未知\", \"次\", \"月\", \"日\", \"部队已发出\",\"预定训练\",\"训练设施\",\"训练任务已执行\",\"定制运输\",\"设定页面刷新间隔\",\n\t\t\t\"页面刷新的间隔时间,是指隔多久执行一次页面的自动载入。\\n此时间过短,会增加被系统侦测到的危险,过长则影响任务执行的效率。\\n默认为20分钟,请输入新的时间间隔:\\n\\n\",\"资源输出保留\",\"预定活动\",\"小型活动\",\"大型活动\",\"资源集中模式的运输间隔\",\n\t\t\t\"分钟\",\"暂停中\",\"开启中\",\"开启\",\"暂停\",\"预定改良\",\"改良攻击\",\"改良防御\", \"资源过剩检查\", \"已经开启\", \"已经关闭\", \"粮田自动升级\", \"切换\"];\n\t\taLangErrorText = [\"资源不足\", \"已经有建筑在建造中\", \"建造完成\", \"将马上开始全部建造\", \"在开发中\", \"建造所需资源超过仓库容量上限,请先升级你的仓库\", \"建造所需资源超过粮仓容量上限,请先升级你的粮仓\", \"资源何时充足时间提示\",\"粮食产量不足: 需要先建造一个农场\",\"一个活动正在举行中\"];\n\t\taLangOtherText = [\"重要提示\", \"只有主村的资源田可以升级到20,<br />目前主村尚未识别,点击个人资料<br />页面可以解决这一问题\", \"五星级传送门^_^\", \"已经设置完成\", \"已经取消\", \"开始执行任务\", \"升级成功\", \"已顺利执行\", \"种族尚未确认,兵种也就无法确定,<br />请点击个人资料页面,以便侦测种族\", \"然后,请顺便访问英雄园,以便确认<br />英雄的种类和速度。<br />\"];\n\t\taLangResources=[\"木材\",\"泥土\",\"铁块\",\"粮食\"];\n\t\taLangTroops[0] = [\"古罗马步兵\", \"禁卫兵\", \"帝国兵\", \"使节骑士\", \"帝国骑士\", \"将军骑士\", \"冲撞车\", \"火焰投石器\", \"参议员\", \"拓荒者\", \"英雄\"];\n\t\taLangTroops[1] = [\"棍棒兵\", \"矛兵\", \"斧头兵\", \"侦察兵\", \"圣骑士\", \"日耳曼骑兵\", \"冲撞车\", \"投石器\", \"执政官\", \"拓荒者\", \"英雄\"];\n\t\taLangTroops[2] = [\"方阵兵\", \"剑士\", \"探路者\", \"雷法师\", \"德鲁伊骑兵\", \"海顿圣骑士\", \"冲撞车\", \"投石器\", \"首领\", \"拓荒者\", \"英雄\"];\n\t\taLangAttackType = [\"支援\", \"攻击\", \"抢夺\"];\n\t\tbreak;\n\t\t\n\tcase \"hk\": // 感谢sean3808、K.C.Alvis\n\t\taLangAllBuildWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\",\"\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬棚\", \"工場\", \"研究院\", \"山洞\", \"村會堂\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬棚\", \"城牆\", \"土牆\", \"木牆\", \"石匠鋪\", \"釀酒廠\", \"陷阱\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAllBuildAltWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\",\"\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬棚\", \"工場\", \"研究院\", \"山洞\", \"城鎮廳\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬棚\", \"城牆\", \"土牆\", \"木牆\", \"石匠鋪\", \"釀酒廠\", \"陷阱機\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAddTaskText = [\"添加任務\", \"任務類型\", \"所在村\", \"任務對象\", \"目標\", \"模式\", \"支援建設\", \"資源集中\", \"上移\", \"下移\", \"刪除\", \"任務內容\", \"移動\", \"清除所有任務\"];\n\t\taLangTaskKind = [\"升級\", \"新建\", \"攻擊\", \"研發\", \"訓練\", \"運輸\", \"平倉\", \"拆除\", \"活動\"];\n\t\taLangGameText = [\"等級\", \"商人\", \"坑號\", \"主村\", \"執行時間\", \"該時間設置尚未啟用\", \"到\", \"村莊\", \"運送\", \"回來\", \"運輸到\", \"從\", \"由\", \"資源\", \"建築\", \"建造新的建築物\", \"empty\", \"等級\"];\n\t\taLangRaceName = [\"羅馬人\", \"條頓人\", \"高盧人\"];\n\t\taLangTaskOfText = [\"預定升級\", \"預定建築\", \"資源自動升級\", \"尚未開啟\", \"馬上開啟\", \"已經開啟\", \"點擊關閉\", \"該村資源分布\", \"自動運輸\", \"自動運輸尚未設定\", \"已設定\", \"運送成功\", \"任務列表\", \"資源輸入限額\", \"默認\", \"更改\", \"木/磚/鐵\", \"穀物\", \"預定拆除\",\n\t\t\t\"預定發兵\", \"攻擊類型\", \"到達所需時間\", \"重複次數\", \"間隔時間\", \"00:30:00\", \"投石目標\", \"隨機\", \"未知\", \"次\", \"月\", \"日\", \"部隊已發出\",\"預定訓練\",\"訓練設施\",\"訓練任務已執行\",\"定制運輸\",\"設定頁面刷新間隔\",\"頁面刷新的間隔時間,是指隔多久執行一次頁面的自動載入。\\n此時間過短,會增加被系統偵測到的危險,過長則影響任務執行的效率。\\n默認為20分鐘,請輸入新的時間間隔:\\n\\n\",\"資源輸出保留\",\"預定活動\",\"小型活動\",\"大型活動\",\"資源集中模式的間隔時間\",\n\t\t\t\"分鐘\",\"暫停中\",\"開啟中\",\"開啟\",\"暫停\",\"預定改良\",\"改良攻擊\",\"改良防御\", \"資源過剩檢查\", \"已經開啟\", \"已經關閉\", \"糧田自動升級\", \"切換\"];\n\t\taLangErrorText = [\"資源不足\", \"工作正在進行中\", \"完全地開發\", \"將馬上開始全部建造\", \"在開發中\", \"倉庫需要升級\", \"糧倉需要升級\", \"資源何時充足時間提示\",\"糧食產量不足: 需要先建造一個農場\",\"派對進行中\"];\n\t\taLangOtherText = [\"重要提示\", \"只有主村的資源田可以升級到20,<br/>目前主村尚未識別,點擊個人資料<br/>頁面可以解決這一問題\", \"五星級傳送門^_ ^\", \"已經設置完成\", \"已經取消\", \"開始執行任務\", \"升級成功\", \"已順利執行\", \"種族尚未確認,兵種也就無法確定,<br/>請點擊個人資料頁面,以便偵測種族\", \"然後,請順便訪問英雄園,以便確認<br/>英雄的種類和速度。<br/>\"];\n\t\taLangResources=[\"木材\",\"磚塊\",\"鋼鐵\",\"穀物\"];\n\t\taLangTroops[0] = [\"古羅馬步兵\", \"禁衛兵\", \"帝國兵\", \"使者騎士\", \"帝國騎士\", \"將軍騎士\", \"衝撞車\", \"火焰投石機\", \"參議員\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[1] = [\"棍棒兵\", \"矛兵\", \"斧頭兵\", \"偵察兵\", \"遊俠\", \"條頓騎士\", \"衝撞車\", \"投石機\", \"司令官\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[2] = [\"方陣兵\", \"劍士\", \"探路者\", \"雷法師\", \"德魯伊騎兵\", \"海頓聖騎\", \"衝撞車\", \"投石機\", \"族長\", \"開拓者\", \"英雄\"];\n\t\taLangAttackType = [\"支援\", \"攻擊\", \"搶奪\"];\n\t\tbreak;\n\n\tcase \"tw\": // 感谢adobe、魎皇鬼、ieyp、K.C.Alvis\n\t\taLangAllBuildWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\", \"農田\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬廄\", \"工場\", \"研究院\", \"山洞\", \"村會堂\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬廄\", \"城牆\", \"土牆\", \"木牆\", \"石匠舖\", \"釀酒廠\", \"陷阱機\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAllBuildAltWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\", \"農田\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬廄\", \"工場\", \"研究院\", \"山洞\", \"村會堂\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬廄\", \"城牆\", \"土牆\", \"木牆\", \"石匠舖\", \"釀酒廠\", \"陷阱機\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAddTaskText = [\"添加任務\", \"任務類型\", \"所在村\", \"任務對象\", \"目標\", \"模式\", \"支援建設\", \"資源集中\", \"上移\", \"下移\", \"刪除\", \"任務內容\", \"移動\", \"清除所有任務\"];\n\t\taLangTaskKind = [\"升級\", \"新建\", \"攻擊\", \"研發\", \"訓練\", \"運輸\", \"平倉\", \"拆除\", \"活動\"];\n\t\taLangGameText = [\"等級\", \"商人\", \"坑號\", \"主村\", \"執行時間\", \"該時間設置尚未啟用\", \"到\", \"村莊\", \"運送\", \"回來\", \"運送到\", \"從\", \"由\", \"資源\", \"建築\", \"建造新的建築物\", \"empty\", \"等級\"];\n\t\taLangRaceName = [\"羅馬人\", \"條頓人\", \"高盧人\"];\n\t\taLangTaskOfText = [\"預定升級\", \"預定建築\", \"資源自動升級\", \"尚未開啟\", \"馬上開啟\", \"已經開啟\", \"點擊關閉\", \"該村資源分布\", \"自動運輸\", \"自動運輸尚未設定\", \"已設定\", \"運送成功\", \"任務列表\", \"資源輸入限額\", \"默認\", \"更改\", \"木/磚/鐵\", \"穀物\", \"預定拆除\",\n\t\t\t\"預定發兵\", \"攻擊類型\", \"到達所需時間\", \"重複次數\", \"間隔時間\", \"00:30:00\", \"投石目標\", \"隨機\", \"未知\", \"次\", \"月\", \"日\", \"部隊已發出\",\"預定訓練\",\"訓練設施\",\"訓練任務已執行\",\"定制運輸\",\"設定頁面刷新間隔\",\"頁面刷新的間隔時間,是指隔多久執行一次頁面的自動載入。\\n此時間過短,會增加被系統偵測到的危險,過長則影響任務執行的效率。\\n默認為20分鐘,請輸入新的時間間隔:\\n\\n\",\"資源輸出保留\",\"預定活動\",\"小型活動\",\"大型活動\",\"資源集中模式的間隔時間\",\n\t\t\t\"分鐘\",\"暫停中\",\"開啟中\",\"開啟\",\"暫停\",\"預定改良\",\"改良攻擊\",\"改良防御\", \"資源過剩檢查\", \"已經開啟\", \"已經關閉\", \"糧田自動升級\", \"切換\"];\n\t\taLangErrorText = [\"資源不足\", \"已經有建築在建造中\", \"建造完成\", \"將馬上開始全部建造\", \"在開發中\", \"建造所需資源超過倉庫容量上限,請先升級你的倉庫\", \"建造所需資源超過糧倉容量上限,請先升級你的糧倉\", \"資源何時充足時間提示\",\"糧食產量不足: 需要先建造一個農場\",\"派對進行中\"];\n\t\taLangOtherText = [\"重要提示\", \"只有主村的資源田可以升級到20,<br/>目前主村尚未識別,點擊個人資料<br/>頁面可以解決這一問題\", \"五星級傳送門^_ ^\", \"已經設置完成\", \"已經取消\", \"開始執行任務\", \"升級成功\", \"已順利執行\", \"種族尚未確認,兵種也就無法確定,<br/>請點擊個人資料頁面,以便偵測種族\", \"然後,請順便訪問英雄園,以便確認<br/>英雄的種類和速度。<br/>\"];\n\t\taLangResources=[\"木材\",\"磚塊\",\"鋼鐵\",\"穀物\"];\n\t\taLangTroops[0] = [\"古羅馬步兵\", \"禁衛兵\", \"帝國兵\", \"使者騎士\", \"帝國騎士\", \"將軍騎士\", \"衝撞車\", \"火焰投石機\", \"參議員\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[1] = [\"棍棒兵\", \"矛兵\", \"斧頭兵\", \"偵察兵\", \"遊俠\", \"條頓騎士\", \"衝撞車\", \"投石機\", \"司令官\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[2] = [\"方陣兵\", \"劍士\", \"探路者\", \"雷法師\", \"德魯伊騎兵\", \"海頓聖騎\", \"衝撞車\", \"投石機\", \"族長\", \"開拓者\", \"英雄\"];\n\t\taLangAttackType = [\"支援\", \"攻擊\", \"搶奪\"];\n\t\tbreak;\n\n\tcase \"fi\": // thanks Christer82\n\t\taLangAllBuildWithId = [\"Puunhakkaaja\", \"Savimonttu\", \"Rautakaivos\", \"Viljapelto\", \"\", \"Saha\", \"Tiilitehdas\", \"Rautavalimo\", \"Mylly\", \"Leipomo\", \"Varasto\", \"Viljasiilo\", \"Aseseppä\", \"Haarniskapaja\", \"Turnausareena\", \"Päärakennus\", \"Kokoontumispiste\", \"Tori\", \"Lähetystö\", \"Kasarmi\", \"Talli\", \"Työpaja\", \"Akatemia\", \"Kätkö\", \"Kaupungintalo\", \"Virka-asunto\", \"Palatsi\", \"Aarrekammio\", \"Kauppavirasto\", \"Suuri kasarmi\", \"Suuri talli\", \"Kaupungin muuri\", \"Maamuuri\", \"Paaluaita\", \"Kivenhakkaaja\", \"Panimo\", \"Ansoittaja\",\"Sankarin kartano\", \"Suuri varasto\", \"Suuri viljasiilo\", \"Maailmanihme\", \"Hevostenjuottoallas\"];\n\t\taLangAllBuildAltWithId = [\"Puunhakkaaja\", \"Savimonttu\", \"Rautakaivos\", \"Viljapelto\", \"\", \"Saha\", \"Tiilitehdas\", \"Rautavalimo\", \"Mylly\", \"Leipomo\", \"Varasto\", \"Viljasiilo\", \"Aseseppä\", \"Haarniskapaja\", \"Turnausareena\", \"Päärakennus\", \"Kokoontumispiste\", \"Tori\", \"Lähetystö\", \"Kasarmi\", \"Talli\", \"Työpaja\", \"Akatemia\", \"Kätkö\", \"Kaupungintalo\", \"Virka-asunto\", \"Palatsi\", \"Aarrekammio\", \"Kauppavirasto\", \"Suuri kasarmi\", \"Suuri talli\", \"Kaupungin muuri\", \"Maamuuri\", \"Paaluaita\", \"Kivenhakkaaja\", \"Panimo\", \"Ansoittaja\",\"Sankarin kartano\", \"Suuri varasto\", \"Suuri viljasiilo\", \"Maailmanihme\", \"Hevostenjuottoallas\"];\n\t\taLangAddTaskText = [\"Lisää tehtävä\", \"Tyyli\", \"Kohdistettu kylä\", \"Tehtävän kohde\", \"Minne:\", \"Tyyppi\", \"Rakennustuki\", \"Resurssien keskittäminen\", \"Siirry ylös\", \"Siirry alas\", \"Poista\", \"&#160;&#160;&#160;Tehtävän sisältö\", \"Siirry \", \"Poista kaikki tehtävät\"];\n\t\taLangTaskKind = [\"Päivitä\", \"Uusi rakennus\", \"Hyökkäys\", \"Tutkimus\", \"Koulutus\", \"Kuljetus\", \"NPC\", \"Hajotus\", \"Juhla\"];\n\t\taLangGameText = [\"Taso\", \"Kauppiaat\", \"ID\", \"Pääkaupunki\", \"Aloitusaika\", \"Tätä aika-asetusta ei voi nyt käyttää.\", \"minne:\", \"Kylä\", \"kuljetus\", \"mistä\", \"Kuljeta kylään\", \"Kuljeta kylästä\", \"Palaa kylästä\", \"Resurssit\", \"rakennus\", \"Rakenna uusi rakennus\", \"tyhjä\", \"taso\"];\n\t\taLangRaceName = [\"Roomalaiset\", \"Teutonit\", \"Gallialaiset\"];\n\t\taLangTaskOfText = [\"Aseta kentän päivitys\", \"Aseta uusi rakennuskohde\", \"Automaattinen resurssipäivitys\", \"Ei toimintaa\", \"Aloita\", \"Aloitettu\", \"Keskeytä\", \"Tämän kylän resurssikenttien jakauma on \", \"Automaattikuljetus\", \"automaattikuljetusta ei ole avattu\", \"Avattu\", \"Kuljetus onnistui\", \"Tehtäväluettelo\", \"Trans_In_limit\", \"Perusasetus\", \"Muokkaa\", \"Puu/Savi/Rauta\", \"vilja\", \"Tehtävälistan poisto\",\n\t\t\t\"Schedule attack\", \"Hyökkäystyyppi\", \"Kuljetusaika\", \"toistokerrat\", \"Hyökkäysaikaväli\",\"00:30:00\",\"Katapultin kohde\",\"Satunnainen\", \"Tuntematon\", \"kertaa\", \"Kuukausi\", \"Päivä\", \"Joukot on lähetetty\",\"Aseta koulutustehtävä\",\"Koulutuskohde\",\"Koulutustehtävä suoritettu\",\"waitForTranslate\",\"setup Hyökkäysaikaväli of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans_Out_Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\n\t\t\t\"minutes\",\"pausing\",\"running\",\"run\",\"pause\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Liian vähän resursseja\", \"Työntekijät ovat jo töissä.\", \"Rakennuskohde valmis\", \"Aloitetaan rakentaminen\", \"Työ kesken\", \"Varastosi on liian pieni. Suurenna varastoa aloittaaksesi rakentamisen\", \"Viljasiilosi on liian pieni. Suurenna viljasiiloa aloittaaksesi rakentamisen\", \"Riittävästi resursseja\"];\n\t\taLangOtherText = [\"Tärkeä huomautus\", \"Vain pääkaupungin resurssikenttiä voidaan <br/>päivittää tasolle 20. Nyt pääkaupunkia<br/> ei voida todentaa. Päivitä profiiliasi, kiitos.\", \"Pikalinkki tähän ^_^\", \"Asennus valmis\", \"Peruttu\", \"Aloita tehtävät\", \"Päivitys valmis\", \"Tehty onnistuneesti\", \"Heimosi on määrittämätön, siksi joukkojesi tyyppiä <br/>Päivitä profiiliasi heimon määrittämiseksi.<br/>\", \"Käy Sankarin kartanossa määrittääksesi<br/> sankarisi tyypin ja nopeuden.\"];\n\t\taLangResources=[\"waitTranslate\",\"waitTranslate\",\"waitTranslate\",\"waitTranslate\"];\n\t\taLangTroops[0] = [\"Legioonalainen\", \"Pretoriaani\", \"Imperiaani\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Muurinmurtaja\", \"Tulikatapultti\", \"Senaattori\", \"Uudisasukas\", \"Sankari\"];\n\t\taLangTroops[1] = [\"Nuijamies\", \"Keihäsmies\", \"Kirvessoturi\", \"Tiedustelija\", \"Paladiini\", \"Teutoniritari\", \"Muurinmurtaja\", \"Katapultti\", \"Päällikkö\", \"Uudisasukas\", \"Sankari\"];\n\t\taLangTroops[2] = [\"Falangi\", \"Miekkasoturi\", \"Tunnustelija\", \"Teutateksen salama\", \"Druidiratsastaja\", \"Haeduaani\", \"Muurinmurtaja\", \"Heittokone\", \"Päällikkö\", \"Uudisasukas\", \"Sankari\"];\n\t\taLangAttackType = [\"Vahvistus\", \"Hyökkäys\", \"Ryöstö\"];\n\t\tbreak;\n\n\tcase \"us\": // by shadowx360\n\t\taLangAllBuildWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armory\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"Town Hall\", \"Residence\", \"Palace\", \"Treasury\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason's Lodge\", \"Brewery\", \"Trapper\",\"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\taLangAllBuildAltWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armory\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"Town Hall\", \"Residence\", \"Palace\", \"Treasury\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason's Lodge\", \"Brewery\", \"Trapper\",\"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is notuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct a new building\", \"empty\", \"level\"];\n\t\taLangRaceName = [\"Romans\", \"Teutons\", \"Gauls\"];\n\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Wheat\", \"Schedule demolition\",\n\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\",\"00:30:00\",\"Catapult target\",\"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\n\t\t\t\"minutes\", \".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Too few resources.\", \"Your builders are already working\", \"completely upgraded\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\",\"Lack of food: extend cropland first\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\taLangResources=[\"lumber\",\"clay\",\"iron\",\"wheat\"];\n\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Hero\"];\n\t\taLangAttackType = [\"Reinforce\", \"Attack\", \"Raid\"];\n\t\tbreak;\n\n\tcase \"in\":\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armoury\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armoury\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\t\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is unuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct a new building\", \"empty\", \"level\"];\n\t\t\t\taLangRaceName = [\"Romans\", \"Teutons\", \"Gauls\"];\n\t\t\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\",\n\t\t\t\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\", \"00:30:00\", \"Catapult target\", \"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"ScheduleParty\", \"small party\", \"big party\", \"setInterval of Resources concentration\",\n\t\t\t\t\t\t\"minutes\", \".\", \".\", \"START\", \"STOP\", \"Schedule Improve\", \"Improve Attack\", \"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Too few resources.\", \"Your workers are already building something.\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\", \"Food shortage: Upgrade a wheat field first\", \"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources = [\"lumber\", \"clay\", \"iron\", \"crop\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Reinforce\", \"Attack\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"Place for new building\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Smithy\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Smithy\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\t\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is unuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct a new building\", \"empty\", \"level\"];\n\t\t\t\taLangRaceName = [\"Romans\", \"Teutons\", \"Gauls\"];\n\t\t\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\",\n\t\t\t\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\", \"00:30:00\", \"Catapult target\", \"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"ScheduleParty\", \"small party\", \"big party\", \"setInterval of Resources concentration\",\n\t\t\t\t\t\t\"minutes\", \".\", \".\", \"START\", \"STOP\", \"Schedule Improve\", \"Improve Attack\", \"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Too few resources.\", \"Your workers are already building something.\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\", \"Food shortage: Upgrade a wheat field first\", \"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources = [\"lumber\", \"clay\", \"iron\", \"crop\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Reinforce\", \"Attack\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'in\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\tcase \"sk\": // by Zapo [ 2011.04.07 ]\n\t\taLangAllBuildWithId = [\"Drevorubač\", \"Hlinená baňa\", \"Železná baňa\", \"Obilné pole\", \"\", \"Píla\", \"Tehelňa\", \"Zlievareň\", \"Mlyn\", \"Pekáreň\", \"Sklad surovín\", \"Sýpka\", \"Kováč\", \"Zbrojnica\", \"Turnajové ihrisko\", \"Hlavná budova\", \"Zhromaždisko\", \"Trhovisko\", \"Ambasáda\", \"Kasárne\", \"Stajne\", \"Dielňa\", \"Akadémia\", \"Úkryt\", \"Radnica\", \"Rezidencia\", \"Palác\", \"Pokladnica\", \"Obchodná kancelária\", \"Veľké kasárne\", \"Veľká stajňa\", \"Mestské hradby\", \"Zemná hrádza\", \"Palisáda\", \"Kamenár\", \"Pivovar\", \"Pasti\",\"Dvor hrdinov\", \"Veľké dielne\", \"Veľká sýpka\", \"Div sveta\", \"Žriedlo\"];\n\t\taLangAllBuildAltWithId = [\"Drevorubač\", \"Hlinená baňa\", \"Železná baňa\", \"Obilné pole\", \"\", \"Píla\", \"Tehelňa\", \"Zlievareň\", \"Mlyn\", \"Pekáreň\", \"Sklad surovín\", \"Sýpka\", \"Kováč\", \"Zbrojnica\", \"Turnajové ihrisko\", \"Hlavná budova\", \"Zhromaždisko\", \"Trhovisko\", \"Ambasáda\", \"Kasárne\", \"Stajne\", \"Dielňa\", \"Akadémia\", \"Úkryt\", \"Radnica\", \"Rezidencia\", \"Palác\", \"Pokladnica\", \"Obchodná kancelária\", \"Veľké kasárne\", \"Veľká stajňa\", \"Mestské hradby\", \"Zemná hrádza\", \"Palisáda\", \"Kamenár\", \"Pivovar\", \"Pasti\",\"Dvor hrdinov\", \"Veľké dielne\", \"Veľká sýpka\", \"Div sveta\", \"Žriedlo\"];\n\t\taLangAddTaskText = [\"Pridaj úlohu\", \"Štýl\", \"Aktívna dedina\", \"Plánovaný cieľ\", \"To\", \"Mód\", \"Construction support\", \"Resources concentration\", \"Presuň hore\", \"Presuň dole\", \"Zmaž\", \" Obsah úloh\", \"Posun \", \"Zmaž všetky úlohy\"];\n\t\taLangTaskKind = [\"Upgrade\", \"Nová stavba\", \"Útok\", \"Výskum\", \"Trénovať\", \"Transport\", \"NPC\", \"Búrať\", \"Oslavy\"];\n\t\taLangGameText = [\"Lvl\", \"Obchodníci\", \"ID\", \"Hlavná dedina\", \"Start time\", \"nastavenie času je nepoužiteľný teraz.\", \"do\", \"Dedina\", \"transport\", \"od\", \"Transport do\", \"Transport od\", \"Návrat z\", \"suroviny\", \"budova\", \"Postaviť novú budovu\", \"prázdne\", \"úroveň\"];\n\t\taLangRaceName = [\"Rimania\", \"Germáni\", \"Galovia\"];\n\t\taLangTaskOfText = [\"Naplánovať Upgrade\", \"Naplánovať novú budovu\", \"Auto ResUpD\", \"Nebeží\", \"Štart\", \"Beží\", \"Suspend\", \"Surovinová distribúcia tejto dediny je \", \"Autotransport\", \"Autotransport nie je otvorený\", \"Otvorený\", \"Transport úspešný\", \"Zoznam úloh\", \"Trans In limit\", \"Default\", \"Zmeň\", \"Drevo/Hlina/Železo\", \"Obilie\", \"Naplánuj demolíciu\",\n\t\t\t\"Naplánuj útok\", \"Typ útoku\", \"Čas cesty\", \"opakovať\", \"časový interval\",\"00:30:00\",\"Cieľ Katapultu\",\"Náhodne\", \"Neznámy\", \"krát\", \"Mesiac\", \"Deň\", \"Poslať jednotky\",\n\t\t\t\"Naplánovať výcvik\",\"Výcvikové miesto\",\"Výcviková úloha hotová\",\"customTransport\",\"nastav časový interval obnovenia\",\"toto je interval obnovenia stránky ,\\n default je 20 minút, prosím vlož nový čas:\\n\\n\",\"Trans Out Rmn\",\"NaplánujOslavu\",\"malá slava\",\"veľká oslava\",\"nastavInterval surovinovej koncentrácie\",\n\t\t\t\"minút\",\"pozastavené\",\"spustené\",\"spusť\",\"pauza\",\"Naplánuj vylepšenie\",\"Vylepšiť Útok\",\"Vylepšiť Obranu\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Príliš málo surovín.\", \"Stavitelia majú momentálne veľa práce\", \"Stavanie kompletné\", \"Začína stavanie\", \"Vo vývoji\", \"Tvoj sklad je príliš malý. Prosím zvýš tvoj Sklad na pokračovanie stavania\", \"Tvoja Sýpka je príliš malá. Prosím zvýš tvoju Sýpku na pokračovanie stavania\", \"Dostatok surovín\",\"Nedostatok potravín: rozšír obilné polia najskôr!\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Dôležité poznámky\", \"Surovinové polia môžu byť len v hlavnej zvyšované na úroveň 20. Teraz nieje určená tvoja hlavná. Navštív tvoj Profil prosím.\", \"Skratka tu ^_^\", \"Nastavenie kompletné\", \"Zrušené\", \"Spusť úlohy\", \"Upgrade úspešný\", \"Spustenie úspešné\", \"Tvoj národ je neznámy, therefore your troop type. Navštív tvoj Profil na určenie tvojho národa.\", \"Prosím navštív tiež tvoj Dvor hrdinov na určenie rýchlosti a typu tvojho hrdinu.\"];\n\t\taLangResources = [\"drevo\",\"hlina\",\"železo\",\"obilie\"];\n\t\taLangTroops[0] = [\"Legionár\", \"Pretorián\", \"Imperián\", \"Equites Legáti\", \"Equites Imperátoris\", \"Equites Caesaris\", \"Rímske Baranidlo\", \"Ohnivý Katapult\", \"Senátor\", \"Osadník\", \"Hrdina\"];\n\t\taLangTroops[1] = [\"Pálkar\", \"Oštepár\", \"Bojovník so sekerou\", \"Špeh\", \"Rytier\", \"Teuton jazdec\", \"Germánske baranidlo\", \"Katapult\", \"Kmeňový vodca\", \"Osadník\", \"Hrdina\"];\n\t\taLangTroops[2] = [\"Falanx\", \"Šermiar\", \"Sliedič\", \"Theutates Blesk\", \"Druid jazdec\", \"Haeduan\", \"Drevené Baranidlo\", \"Vojnový Katapult\", \"Náčelník\", \"Osadník\", \"Hrdina\"];\n\t\taLangAttackType = [\"Podpora\", \"Útok\", \"Lúpež\"];\n\t\tbreak;\n\n\tcase \"id\":\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Penebangan Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Penggergajian\", \"Pabrik Bata\", \"Peleburan Besi\", \"Penggilingan Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Penebang Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Penggergajian\", \"Pabrik Bata\", \"Peleburan Besi\", \"Penggilingan Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAddTaskText = [\"Tambah Pengerjaan\", \"Jenis\", \"Desa Aktif\", \"Target Pengerjaan\", \"ke\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Menaikkan\", \"Dirikan\", \"Serang\", \"riset\", \"latih\", \"Kirim\", \"NPC\", \"Bongkar\", \"Perayaan\"];\n\t\t\t\taLangGameText = [\"Tk\", \"Pedagang\", \"ID\", \"Ibukota\", \"Waktu mulai\", \"jangan gunakan waktu di atas\", \"ke\", \"Desa\", \"kirim\", \"dari\", \"Kirim ke\", \"Kiriman dari\", \"Kembali dari\", \"sumberdaya\", \"bangunan\", \"Mendirikan Bangunan\", \"kosong\", \"tingkat\"];\n\t\t\t\taLangRaceName = [\"Romawi\", \"Teuton\", \"Galia\"];\n\t\t\t\taLangTaskOfText = [\"Jadwal Menaikkan\", \"Jadwal Dirikan\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Otomatis kirim\", \"Autotransport is not opened\", \"Opened\", \"Pengiriman Berhasil\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Kayu/Liat/Besi\", \"Gandum\", \"Jadwal Pembongkaran\",\n\t\t\t\t\t\"Jadwal Serangan\", \"Tipe serangan\", \"Waktu tiba\", \"diulang\", \"rentang waktu\", \"00:30:00\", \"Target catapult\", \"Acak\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Pasukan terkirim\",\n\t\t\t\t\t\"Jadwal Pelatihan\", \"Tempat latih\", \"Pelatihan selesai\", \"Atur kirim\", \"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"Jadwal Perayaan\",\"Perayaan kecil\",\"Perayaan besar\",\"setInterval of Resources concentration\",\n\t\t\t\t\t\"minutes\", \".\",\".\",\"START\",\"STOP\",\"Jadwal Pengembangan\",\"Pengembangan serangan\",\"Pengembangan pertahanan\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"sumberdaya cukup pada\", \"Pekerja sedang bekerja\", \"sepenuhnya telah dikembangkan\", \"Dirikan bangunan\", \"Sedang Membangun\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"sumberdaya cukup pada\",\"Kurang makanan: kembangkan ladang terlebih dahulu\",\"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources=[\"Kayu\",\"Liat\",\"Besi\",\"Gandum\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangAttackType = [\"Bantuan\", \"Serang\", \"Rampok\"];\n\t\t\t\tbreak; \n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Penebang Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Pemotong Kayu\", \"Pabrik Bata\", \"Pelebur Besi\", \"Penggiling Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Penebang Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Pemotong Kayu\", \"Pabrik Bata\", \"Pelebur Besi\", \"Penggiling Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAddTaskText = [\"Tambah Pengerjaan\", \"Jenis\", \"Desa Aktif\", \"Target Pengerjaan\", \"ke\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Menaikkan\", \"Dirikan\", \"Serang\", \"riset\", \"latih\", \"Kirim\", \"NPC\", \"Bongkar\", \"Perayaan\"];\n\t\t\t\taLangGameText = [\"Tk\", \"Pedagang\", \"ID\", \"Ibukota\", \"Waktu mulai\", \"jangan gunakan waktu di atas\", \"ke\", \"Desa\", \"kirim\", \"dari\", \"Kirim ke\", \"Kiriman dari\", \"Kembali dari\", \"sumberdaya\", \"bangunan\", \"Mendirikan Bangunan\", \"kosong\", \"tingkat\"];\n\t\t\t\taLangRaceName = [\"Romawi\", \"Teuton\", \"Galia\"];\n\t\t\t\taLangTaskOfText = [\"Jadwal Menaikkan\", \"Jadwal Dirikan\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Otomatis kirim\", \"Autotransport is not opened\", \"Opened\", \"Pengiriman Berhasil\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Kayu/Liat/Besi\", \"Gandum\", \"Jadwal Pembongkaran\",\n\t\t\t\t\t\"Jadwal Serangan\", \"Tipe serangan\", \"Waktu tiba\", \"diulang\", \"rentang waktu\", \"00:30:00\", \"Target catapult\", \"Acak\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Pasukan terkirim\",\n\t\t\t\t\t\"Jadwal Pelatihan\", \"Tempat latih\", \"Pelatihan selesai\", \"Atur kirim\", \"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"Jadwal Perayaan\",\"Perayaan kecil\",\"Perayaan besar\",\"setInterval of Resources concentration\",\n\t\t\t\t\t\"minutes\", \".\",\".\",\"START\",\"STOP\",\"Jadwal Pengembangan\",\"Pengembangan serangan\",\"Pengembangan pertahanan\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"sumberdaya cukup pada\", \"Pekerja sedang bekerja\", \"sepenuhnya telah dikembangkan\", \"Dirikan bangunan\", \"Sedang Membangun\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"sumberdaya akan cukup pada\",\"Gandum anda dalam kondisi minus maka tidak akan pernah sampai pada jumlah sumber daya yang dibutuhkan.\",\"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources=[\"Kayu\",\"Liat\",\"Besi\",\"Gandum\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangAttackType = [\"Bantuan\", \"Serang\", \"Rampok\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'id\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\n\tcase \"au\":\t\n\tcase \"uk\":\t\n\tcase \"com\": // thanks ieyp\n\tdefault:\n\t\t// used for logic, translation required\n\t\taLangAllBuildWithId = aLangAllBuildWithIdComDef.slice(0);\n\t\t// used for logic, translation required\n\t\taLangAllBuildAltWithId = aLangAllBuildAltWithIdComDef.slice(0);\n\t\t// used for display only\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t// used for display only\n\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\t// used for logic and display, translation required\n\t\taLangGameText = aLangGameTextComDef.slice(0);\n\t\t// used for getMainVillageid(), translation required\n\t\taLangRaceName = aLangRaceNameComDef.slice(0);\n\t\t// used for display only\n\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\",\n\t\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\", \"00:30:00\", \"Catapult target\", \"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"ScheduleParty\", \"small party\", \"big party\", \"setInterval of Resources concentration\",\n\t\t\t\t\"minutes\", \".\", \".\", \"START\", \"STOP\", \"Schedule Improve\", \"Improve Attack\", \"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t// used for logic & display, translation required\n\t\taLangErrorText = aLangErrorTextComDef.slice(0);\n\t\t// used for display\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t// used for display only, however translation can be done\n\t\taLangResources = aLangResourcesComDef.slice(0);\n\t\t// used for logic & display, translation required\n\t\taLangTroops[0] = aLangTroopsComDef[0].slice(0);\n\t\taLangTroops[1] = aLangTroopsComDef[1].slice(0);\n\t\taLangTroops[2] = aLangTroopsComDef[2].slice(0);\n\t\t// used for display only, however translation can be done\n\t\taLangAttackType = aLangAttackTypeComDef.slice(0);\n\t\tbreak;\n\n\tcase \"pl\": // partial translation by deFox\n\t\t// 2011.02.13 -- partial translation by Blaker\n\t\taLangAllBuildWithId = [\"Las\", \"Kopalnia gliny\", \"Kopalnia żelaza\", \"Pole zboża\", \"\", \"Tartak\", \"Cegielnia\", \"Huta stali\", \"Młyn\", \"Piekarnia\", \"Magazyn surowców\", \"Spichlerz\", \"Zbrojownia\", \"Kuźnia\", \"Plac turniejowy\", \"Główny budynek\", \"Miejsce zbiórki\", \"Rynek\", \"Ambasada\", \"Koszary\", \"Stajnia\", \"Warsztat\", \"Akademia\", \"Kryjówka\", \"Ratusz\", \"Rezydencja\", \"Pałac\", \"Skarbiec\", \"Targ\", \"Duże koszary\", \"Duża stajnia\", \"Mur obronny\", \"Wał ziemny\", \"Palisada\", \"Kamieniarz\", \"Browar\", \"Traper\",\"Dwór bohatera\", \"Duży magazyn surowców\", \"Duży spichlerz\", \"Cud świata\", \"Wodopój\"];\n\t\taLangAllBuildAltWithId = [\"Las\", \"Kopalnia gliny\", \"Kopalnia żelaza\", \"Pole zboża\", \"\", \"Tartak\", \"Cegielnia\", \"Huta stali\", \"Młyn\", \"Piekarnia\", \"Magazyn surowców\", \"Spichlerz\", \"Zbrojownia\", \"Kuźnia\", \"Plac turniejowy\", \"Główny budynek\", \"Miejsce zbiórki\", \"Rynek\", \"Ambasada\", \"Koszary\", \"Stajnia\", \"Warsztat\", \"Akademia\", \"Kryjówka\", \"Ratusz\", \"Rezydencja\", \"Pałac\", \"Skarbiec\", \"Targ\", \"Duże koszary\", \"Duża stajnia\", \"Mur obronny\", \"Wał ziemny\", \"Palisada\", \"Kamieniarz\", \"Browar\", \"Traper\",\"Dwór bohatera\", \"Duży magazyn surowców\", \"Duży spichlerz\", \"Cud świata\", \"Wodopój\"];\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is unuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct new building\", \"empty\", \"level\"];\n\t\taLangRaceName = [\"Rzymianie\", \"Germanie\", \"Galowie\"];\n\t\taLangTaskOfText = [\"Zaplanuj Upgrade\", \"Zaplanuj Budowę\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Lista zadań\", \"Trans In limit\", \"Domyśl.\", \"Zmień\", \"Drewno/Glina/Żelazo\", \"Zboże\", \"Schedule demolition\",\n\t\t\t\"Zaplanuj atak\", \"Typ Ataku\", \"Czas podróży\", \"repeat times\", \"odstęp czasu\", \"00:30:00\",\"Cel dla katapult\", \"Losowy\", \"Nieznany\", \"times\", \"Mies.\", \"Dzień\", \"Troops sent\",\n\t\t\t\"Zaplanuj szkolenie\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\",\"this is the interval of page reload,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\n\t\t\t\"minut\", \".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Zbyt mało surowców.\", \"The workers are already at work.\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\",\"Lack of food: extend cropland first\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Ważna wiadomość\", \"Tylko w stolicy można rozbudować teren do poz. 20.<br/>Aktywna wioska nie została rozpoznana jako stolica.<br/>Wejdź w Ustawienia by wywołać aktualizację.\", \"Szybki link ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"Upgrade successfully\", \"Run successfully\", \"Nie udało się określić twojej rasy, stąd typy jednostek<br/>nie są znane. Wejdź w Ustawienia by skrypt wykrył twoją rasę.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\"];\n\t\taLangResources = [\"drewno\", \"glina\", \"żelazo\", \"zboże\"];\n\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\taLangTroops[2] = [\"Falanga\", \"Miecznik\", \"Tropiciel\", \"Grom Teutatesa\", \"Jeździec druidzki\", \"Haeduan\", \"Taran\", \"Trebusz\", \"Herszt\", \"Osadnicy\", \"Bohater\"];\n\t\taLangAttackType = [\"Posiłki\", \"Atak normalny\", \"Grabież\"];\n\t\tbreak;\n\n\tcase \"ua\":\n\t\taLangAllBuildWithId = [\"Лісоповал\", \"Глиняний кар'єр\", \"Залізна копальня\", \"Ферма\", \"\", \"Деревообробний завод\", \"Цегляний завод\", \"Чавуноливарний завод\", \"Млин\", \"Пекарня\", \"Склад\", \"Зернова комора\", \"Кузня зброї\", \"Кузня обладунків\", \"Арена\", \"Головна будівля\", \"Пункт збору\", \"Ринок\", \"Посольство\", \"Казарма\", \"Стайня\", \"Майстерня\", \"Академія\", \"Схованка\", \"Ратуша\", \"Резиденція\", \"Палац\", \"Скарбниця\", \"Торгова палата\", \"Велика казарма\", \"Велика стайня\", \"Міська стіна\", \"Земляний вал\", \" Огорожа\", \"Каменяр\", \"Пивна\", \"Капканщик\",\"Таверна\", \"Великий склад\", \"Велика Зернова комора\", \"Чудо світу\", \"Водопій\"];\n\t\taLangAllBuildAltWithId = [\"Лісоповал\", \"Глиняний кар'єр\", \"Залізна копальня\", \"Ферма\", \"\", \"Деревообробний завод\", \"Цегляний завод\", \"Чавуноливарний завод\", \"Млин\", \"Пекарня\", \"Склад\", \"Зернова комора\", \"Кузня зброї\", \"Кузня обладунків\", \"Арена\", \"Головна будівля\", \"Пункт збору\", \"Ринок\", \"Посольство\", \"Казарма\", \"Стайня\", \"Майстерня\", \"Академія\", \"Схованка\", \"Ратуша\", \"Резиденція\", \"Палац\", \"Скарбниця\", \"Торгова палата\", \"Велика казарма\", \"Велика стайня\", \"Міська стіна\", \"Земляний вал\", \" Огорожа\", \"Каменяр\", \"Пивна\", \"Капканщик\",\"Таверна\", \"Великий склад\", \"Велика Зернова комора\", \"Чудо світу\", \"Водопій\"];\n\t\taLangAddTaskText = [\"Додати завдання\", \"Спосіб\", \"Активне поселення\", \"Ціль завдання\", \"| Ціль\", \"Тип\", \"Підтримка будівництва\", \"Концентрація ресурсів\", \"Вверх\", \"Вниз\", \"\", \"\", \"\", \"Видалити усі завдання\"];\n\t\taLangTaskKind = [\"Покращити:\", \"Нове завдання:\", \"Атакувати:\", \"Розвідати:\", \" наняти:\", \"Відправити ресурси:\", \"NPC:\", \"Зруйнувати:\", \"Урочистість:\"];\n\t\taLangGameText = [\" Рівень \", \"Торговці\", \"ID\", \"Столиця\", \"Час початку\", \"(тимчасово не працює)\", \"в\", \"Поселення\", \"Транспортування\", \"з\", \"Транспортування в\", \"Транспортування из\", \"Повернення з\", \"ресурси\", \"будівля\", \"Побудувати нову будівлю\", \"пусто\", \"рівень\"];\n\t\taLangRaceName = [\"Римляни\", \"Тевтонці\", \"Галли\"];\n\t\taLangTaskOfText = [\"Запланувати удосконалення\", \"Запланувати нове завдання\", \"Качати реурси\", \"Викл\", \"Старт\", \"Вкл\", \"стоп\", \"Розполілення полів в поселенні: \", \"Автовідправлення\", \"Автовідправлення викл.\", \"Вкл.\", \"Успішно відправленно\", \"* Задачі *\", \"Обмеження ввозу\", \"Ні\", \"Змінити \", \"Дерево/Глина/Залізо\", \"Зерно\", \"Запланувати зруйнування\",\n\t\t\t\"Запланувати атаку\", \"Тип атаки\", \"Час в дорозі\", \"повтори\", \"проміжок\",\"00:30:00\",\"Ціль катов\",\"Випадково\", \"Невідомо\", \" раз\", \"/\", \" :дата/час: \", \"Війска\",\n\t\t\t\"Запланувати найм\",\"Train site\",\"Навчання військ завершено\",\"цілеве відправлення\",\"Інтервал оновлення\",\"Це інтервал оновлення сторінки ,\\n по замовчуванню - 20 хвилин, Введіть новоий час:\\n\\n\",\"Обмеження вивозу\",\"Запланувати святкування\",\"Малий праздник\",\"Великий праздник\",\"Встановлення інтервала концентрації ресурсів\",\n\t\t\t\"хвилини\",\"зупинено\",\"працює\",\"старт\",\"пауза\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Недостатньо сировини\", \"Всі будівельники зараз зайняті\", \"Це завдання зупинено повністю\", \"Починаю будівництво\", \"Процес розвитку\", \"Недостатня місткість складу\", \"Недостатня місткість Зернової комори\", \"Достатньо ресурсів\",\"\",\"Проводится урочистість\"];\n\t\taLangOtherText = [\"Важливі замітки\", \"Тільки в столиці поля можуть бути до рівня 20. Столиця не визначена.Зайдіть в профіль будьласка\", \"Ссилка тут ^_^\", \"Настройка завершена\", \"Відмінено\", \"Почати завдання\", \"Удосконалення пройшло успішно\", \"Успішно\", \"Ваш народ невизначений.Будьласка зайдіть в профіль.\", \"Також будьласка зайдіть в таверну для визначення типу та скорості героя\"];\n\t\taLangResources=[\"Деревина\",\"Глина\",\"Залізо\",\"Зерно\"];\n\t\taLangTroops[0] = [\"Легіонер\", \"Преторіанець\", \"Імперіанець\", \"Кінний розвідник\", \"Кіннота імператора\", \"Кіннота Цезаря\", \"Таран\", \"Вогняна катапульта\", \"Сенатор\", \"Поселенець\", \"Герой\"];\n\t\taLangTroops[1] = [\"Дубинник\", \"Списник\", \"Сокирник\", \"Скаут\", \"Паладин\", \"Тевтонський вершник\", \"Стінобитне знаряддя\", \"Катапульта\", \"Ватажок\", \"Поселенець\", \"Герой\"];\n\t\taLangTroops[2] = [\"Фаланга\", \"Мечник\", \"Слідопит\", \"Тевтацький грім\", \"Друїд-вершник\", \"Едуйська кіннота\", \"Таран\", \"Катапульта\", \"Лідер\", \"Поселенець\", \"Герой\"];\n\t\taLangAttackType = [\"Підкріплення\", \"Напад\", \"Набіг\"];\n\t\tbreak;\n\n\tcase \"tr\": // by karambol update the 27 Mar 2010 by SARLAK\n aLangAllBuildWithId = [\"Oduncu\", \"Tuğla Ocağı\", \"Demir Madeni\", \"Tarla\", \"\", \"Kereste Fabrikası\", \"Tuğla Fırını\", \"Demir Dökümhanesi\", \"Değirmen\", \"Ekmek Fırını\", \"Hammadde deposu\", \"Tahıl Ambarı\", \"Silah Dökümhanesi\", \"Zırh Dökümhanesi\", \"Turnuva Yeri\", \"Merkez Binası\", \"Askeri Üs\", \"Pazar Yeri\", \"Elçilik\", \"Kışla\", \"Ahır\", \"Tamirhane\", \"Akademi\", \"Sığınak\", \"Belediye\", \"Köşk\", \"Saray\", \"Hazine\", \"Ticari Merkez\", \"Büyük Kışla\", \"Büyük Ahır\", \"Sur\", \"Toprak Siper\", \"Çit\", \"Taşçı\", \"İçecek Fabrikası\", \"Tuzakçı\",\"Kahraman Kışlası\", \"Büyük Hammadde deposu\", \"Büyük Tahıl Ambarı\", \"Dünya Harikası\", \"Yalak\"];\n aLangAllBuildAltWithId = [\"Oduncu\", \"Tuğla Ocağı\", \"Demir Madeni\", \"Tarla\", \"\", \"Kereste Fabrikası\", \"Tuğla Fırını\", \"Demir Dökümhanesi\", \"Değirmen\", \"Ekmek Fırını\", \"Hammadde deposu\", \"Tahıl Ambarı\", \"Silah Dökümhanesi\", \"Zırh Dökümhanesi\", \"Turnuva Yeri\", \"Merkez Binası\", \"Askeri Üs\", \"Pazar Yeri\", \"Elçilik\", \"Kışla\", \"Ahır\", \"Tamirhane\", \"Akademi\", \"Sığınak\", \"Belediye\", \"Köşk\", \"Saray\", \"Hazine\", \"Ticari Merkez\", \"Büyük Kışla\", \"Büyük Ahır\", \"Sur\", \"Toprak Siper\", \"Çit\", \"Taşçı\", \"İçecek Fabrikası\", \"Tuzakçı\",\"Kahraman Kışlası\", \"Büyük Hammadde deposu\", \"Büyük Tahıl Ambarı\", \"Dünya Harikası\", \"Yalak\"];\n aLangAddTaskText = [\"Görev Ekle\", \"Stil\", \"Aktif Köy\", \"Görev Hedefi\", \"Hedef\", \"Türü\", \"İnşaat Desteği\", \"Hammadde karışımı\", \"Yukarı Taşı\", \"Aşağı Taşı\", \"Sil\", \"Görev İçeriği\", \"Sırala\", \"Tüm görevleri sil\"]; \n aLangTaskKind = [\"Geliştirilen Bina :\", \"Yeni Bina :\", \"Hücum\", \"Araştır\", \"Yetiştir\", \"Gönder\", \"NPC\", \"Yıkılan Bina :\", \"Festival\"]; \n aLangGameText = [\"Seviye \", \"Tüccar\", \"ID\", \"Başkent\", \"Başlangıç zamanı\", \"Değiştirilemez.\", \"buraya\", \"Aktif Köy\", \"gönder\", \"buradan\", \"Gönderiliyor\", \"Gönderildi\", \"Dönüş\", \"hammadde\", \"bina\", \"Yeni bina kur\", \"boş\", \"Seviye \"]; \n aLangRaceName = [\"Romalılar\", \"Cermenler\", \"Galyalılar\"]; \n aLangTaskOfText = [\"Geliştirme Zamanla\", \"Yeni Bina Kurulumu\", \"Otomatik hammadde güncelle\", \"Çalışmıyor\", \"Başlat\", \"Çalışıyor\", \"Durdur\", \"Bu köyün kaynak alanları dağılımıdır \", \"Otomatik Gönderme\", \"Otomatik gönderme açılmadı\", \"Açıldı\", \"Gönderme Tamamladı\", \"\", \"Gönderme limiti\", \"Varsayılan\", \"Değiştir\", \"Odun/Tuğla/Demir\", \"Tahıl\", \"Yıkımı zamanla\", \n \"Hücum zamanla\", \"Hücum Şekli\", \"Varış zamanı\", \"Tekrar Sayısı\", \"Tekrar Aralığı\",\"00:30:00\",\"Mancınık hedef\",\"Rastgele\", \"Bilinmeyen\", \"kere\", \"Ay\", \"Gün\", \"Asker gönder\", \"Asker Yetiştir\",\"Yetiştirilme Noktası\",\"Eğitim görevi tamamlandı\",\"Hammadde Gönderimi Zamanla\",\"Gerçekleşmeyen Kurulumu Tekrarlama Süresi\",\"Tekrar deneme süresini giriniz.\\n(Varsayılan Değer: 20 Dakika)\",\"Trans Out Rmn\",\"Festivalzamanla\",\"Küçük festival\",\"Büyük festival\",\"Hammadde Toplama Aralığı\", \n \"dakikalar\",\"Pasif\",\"Aktif\",\"Aktif Et\",\"Pasif Et\",\"Asker Gelişimi Zamanla\",\"Silah Gelişimi\",\"Zırh Gelişimi\",\"saati\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n aLangErrorText = [\"Çok az kaynak.\", \"Işçi zaten iş başında.\", \"İnşaat tamamlandı\", \"İnşaat başlatılıyor\", \"Araştırma yapılıyor\", \"İnşaata Hammadde deposunu geliştirip devam ediniz.\", \"İnşaata Tahıl ambarını geliştirip devam ediniz.\", \"Yeterli hammadde\",\"Kaynak eksikliği: önce Tarlanı geliştir\",\"Şu anda bir festival yapılıyor zaten\"]; \n aLangOtherText = [\"Önemli not\", \"Sadece başkent için hammadde üretebilirsiniz <br/>be Güncellendi seviye 20. Şimdi Başkentin<br/> tesbit edilemedi. Profilinizi ziyaret ediniz.\", \"Buraya kısa yol ^_^\", \"Kurulum tamamlandı\", \"Vazgeçildi\", \"Görevleri başlat\", \"Güncelleme tamamlandı\", \"Çalışma tamam\", \"Irkınız bilinmediğinden asker türünüz belilenemedi <br/>Profilinizi ziyaret edip ırkınızı belirleyin<br/>\", \"Ayrıca kahraman kışlasınıda ziyaret edin<br/> Kahramanınızın hızı ve tipi.\"]; \n aLangResources=[\"Odun\",\"Tuğla\",\"Demir\",\"Tahıl\"]; \n aLangTroops[0] = [\"Lejyoner\", \"Pretoryan\", \"Emperyan\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Koçbaşı\", \"Ateş Mancınığı\", \"Senatör\", \"Göçmen\", \"Kahraman\"]; \n aLangTroops[1] = [\"Tokmak Sallayan\", \"Mızrakçı\", \"Balta Sallayan\", \"Casus\", \"Paladin\", \"Toyton\", \"Koçbaşı\", \"Mancınık\", \"Reis\", \"Göçmen\", \"Kahraman\"]; \n aLangTroops[2] = [\"Phalanx\", \"Kılıçlı\", \"Casus\", \"Toytatın Şimşeği\", \"Druyid\", \"Heduan\", \"Koçbaşı\", \"Mancınık\", \"Kabile Reisi\", \"Göçmen\", \"Kahraman\"]; \n aLangAttackType = [\"Destek\", \"Saldırı: Normal\", \"Saldırı: Yağma\"]; \n break;\n\n\tcase \"br\":\n\t\taLangAllBuildWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serraria\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalaria\", \"Oficina\", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalaria\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAllBuildAltWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serraria\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalaria\", \"Oficina\", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalaria\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAddTaskText = [\"Adicionar tarefa\", \"Estilo\", \"Aldeia Activa\", \"Alvo\", \"Para\", \"Modo\", \"Ajuda na Construção\", \"Quantidade de recursos\", \"Mover para cima\", \"Mover para baixo\", \"Apagar\", \"&#160;&#160;&#160;Tarefas\", \"Mover \", \"Eliminar todas as tarefas\"];\n\t\taLangTaskKind = [\"Evolução\", \"Novo construção\", \"Ataque\", \"Pesquisa\", \"Treino\", \"Transporte\", \"NPC\", \"Demolição\", \"Celebração\"];\n\t\taLangGameText = [\"Lvl\", \"Mercadores\", \"Identificação\", \"Capital\", \"Inicio\", \"this timeseting is unuseful now.\", \"Para\", \"Aldeia\", \"Transporte\", \"de\", \"Transporte para\", \"Transporte de\", \"A regressar de\", \"Recursos\", \"Edificio\", \"Construir novo edifício\", \"Vazio\", \"Nivel\"];\n\t\taLangRaceName = [\"Romanos\", \"Teutões\", \"Gauleses\"];\n\t\taLangTaskOfText = [\"Agendar Evolução\", \"Agendar nova construção\", \"ResourcesUpD\", \"OFF\", \"Iniciar\", \"ON\", \"Parar\", \"A distribuição dos campos desta aldeia é \", \"Autotransporte\", \"Autotransporte não está aberto\", \"Aberto\", \"Transporte com sucesso\", \"Lista de agendamento\", \"Limit\", \"Default\", \"Alterar\", \"madeira/barro/ferro\", \"cereal\", \"Agendamento de demolição\",\n\t\t\t\"Agendamento de ataque\", \"Tipo de ataque\", \"Tempo de viagem\", \"Repetir número de vezes\", \"Tempo de intervalo\",\"00:30:00\",\"Alvo catapulta\",\"Aleatório\", \"Desconhecido\", \"Vezes\", \" Mês\", \" Dia\", \"Tropas enviadas\",\n\t\t\t\"Agendamento de treino\",\"localização de tropas\",\"Agendamento de treino feito\",\"Transporte personalizado\",\"Setup Interval Time of Reload\",\"This is the interval of page reload ,\\n default são 20 minutos, Insira novo tempo:\\n\\n\",\"Remain\",\"Agendar Celebração\",\"pequena celebração\",\"grande celebração\",\"Set Interval of Resources concentration\",\n\t\t\t\"minutos\",\"parado\",\"ligado\",\"ligar\",\"parar\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Poucos recursos.\", \"Os trabalhadores já estão a trabalhar.\", \"Construção completa\", \"Inicio da construção\", \"Em desenvolvimento\", \"Seu Armazém é pequeno. Evolua o seu armazém para continuar a sua construção\", \"Seu Celeiro é pequeno. Evolua o seu Celeiro para continuar a sua construção\", \"Recursos suficientes\",\"Já se encontra uma celebração em curso\"];\n\t\taLangOtherText = [\"Nota importante\", \"Apenas os campos de recursos da capital <br/>podem ser elevados a nivel 20 . A sua capital <br/> nao está detectavel. Por favor visite o seu perfil.\", \"Atalho aqui ^_^\", \"Instalação concluída\", \"Cancelado\", \"Iniciar as tarefas\", \"Upgrade com sucesso\", \"Executar com sucesso\", \"Sua raça é desconhecida, e o seu tipo de tropa também. <br/>Visite o seu perfil para determinar as raça.<br/>\", \"Por favor visite a sua mansão do heroi para determinar<br/> a velocidade e o tipo de heroi.\"];\n\t\taLangResources=[\"Madeira\",\"Barro\",\"Ferro\",\"Cereais\"];\n\t\taLangTroops[0] = [\"Legionário\", \"Pretoriano\", \"Imperiano\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Aríete\", \"Catapulta de Fogo\", \"Senador\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[1] = [\"Salteador\", \"Lanceiro\", \"Bárbaro\", \"Espião\", \"Paladino\", \"Cavaleiro Teutão\", \"Aríete\", \"Catapulta\", \"Chefe\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[2] = [\"Falange\", \"Espadachim\", \"Batedor\", \"Trovão Theutate\", \"Cavaleiro Druida\", \"Haeduano\", \"Aríete\", \"Trabuquete\", \"Chefe de Clã\", \"Colonizador\", \"Heroi\"];\n\t\taLangAttackType = [\"Reforço\", \"Ataque\", \"Assalto\"];\n\t\tbreak;\n\n\n case \"pt\": // thanks RASCO and Tuga\n\t\taLangAllBuildWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serração\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalariça\", \"Oficina \", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalariça\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAllBuildAltWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serração\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalariça\", \"Oficina \", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalariça\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAddTaskText = [\"Adicionar tarefa\", \"Estilo\", \"Aldeia Activa\", \"Alvo\", \"Para\", \"Modo\", \"Ajuda na Construção\", \"Quantidade de recursos\", \"Mover para cima\", \"Mover para baixo\", \"Apagar\", \"&#160;&#160;&#160;Tarefas\", \"Mover \", \"Eliminar todas as tarefas\"];\n\t\taLangTaskKind = [\"Evolução\", \"Novo construção\", \"Ataque\", \"Pesquisa\", \"Treino\", \"Transporte\", \"NPC\", \"Demolição\", \"Celebração\"];\n\t\taLangGameText = [\"Lvl\", \"Mercadores\", \"Identificação\", \"Capital\", \"Inicio\", \"this timeseting is unuseful now.\", \"Para\", \"Aldeia\", \"Transporte\", \"de\", \"Transporte para\", \"Transporte de\", \"A regressar de\", \"Recursos\", \"Edificio\", \"Construir novo edifício\", \"Vazio\", \"Nivel\"];\n\t\taLangRaceName = [\"Romanos\", \"Teutões\", \"Gauleses\"];\n\t\taLangTaskOfText = [\"Agendar Evolução\", \"Agendar nova construção\", \"ResourcesUpD\", \"OFF\", \"Iniciar\", \"ON\", \"Parar\", \"A distribuição dos campos desta aldeia é \", \"Autotransporte\", \"Autotransporte não está aberto\", \"Aberto\", \"Transporte com sucesso\", \"Lista de agendamento\", \"Limit\", \"Default\", \"Alterar\", \"madeira/barro/ferro\", \"cereal\", \"Agendamento de demolição\",\n\t\t\t\"Agendamento de ataque\", \"Tipo de ataque\", \"Tempo de viagem\", \"Repetir número de vezes\", \"Tempo de intervalo\",\"00:30:00\",\"Alvo catapulta\",\"Aleatório\", \"Desconhecido\", \"Vezes\", \" Mês\", \" Dia\", \"Tropas enviadas\", \"Agendamento de treino\",\"localização de tropas\",\"Agendamento de treino feito\",\"Transporte personalizado\",\"Setup Interval Time of Reload\",\"This is the interval of page reload ,\\n default são 20 minutos, Insira novo tempo:\\n\\n\",\"Remain\",\"Agendar Celebração\",\"pequena celebração\",\"grande celebração\",\"Set Interval of Resources concentration\",\"minutos\",\".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Poucos recursos.\", \"Os trabalhadores já estão a trabalhar.\", \"Construção completa\", \"Inicio da construção\", \"Em desenvolvimento\", \"Seu Armazém é pequeno. Evolua o seu armazém para continuar a sua construção\", \"Seu Celeiro é pequeno. Evolua o seu Celeiro para continuar a sua construção\", \"Recursos suficientes\",\"Já se encontra uma celebração em curso\"];\n\t\taLangOtherText = [\"Nota importante\", \"Apenas os campos de recursos da capital <br/>podem ser elevados a nivel 20 . A sua capital <br/> nao está detectavel. Por favor visite o seu perfil.\", \"Atalho aqui ^_^\", \"Instalação concluída\", \"Cancelado\", \"Iniciar as tarefas\", \"Upgrade com sucesso\", \"Executar com sucesso\", \"Sua raça é desconhecida, e o seu tipo de tropa também. <br/>Visite o seu perfil para determinar as raça.<br/>\", \"Por favor visite a sua mansão do heroi para determinar<br/> a velocidade e o tipo de heroi.\"];\n\t\taLangResources = [\"Madeira\",\"Barro\",\"Ferro\",\"Cereais\"];\n\t\taLangTroops[0] = [\"Legionário\", \"Pretoriano\", \"Imperiano\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Aríete\", \"Catapulta de Fogo\", \"Senador\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[1] = [\"Salteador\", \"Lanceiro\", \"Bárbaro\", \"Espião\", \"Paladino\", \"Cavaleiro Teutão\", \"Aríete\", \"Catapulta\", \"Chefe\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[2] = [\"Falange\", \"Espadachim\", \"Batedor\", \"Trovão Theutate\", \"Cavaleiro Druida\", \"Haeduano\", \"Aríete\", \"Trabuquete\", \"Chefe de Clã\", \"Colonizador\", \"Heroi\"];\n\t\taLangAttackType = [\"Reforço\", \"Ataque\", \"Assalto\"];\n\t\tbreak;\n\n case \"my\":\n\t\taLangAllBuildWithId = [\"Kawasan Pembalakan\", \"Kuari Tanat Liat\", \"Lombong Bijih Besi\", \"Ladang\", \"\", \"Kilang Papan\", \"Kilang Bata\", \"Faundri Besi\", \"Pengisar Bijian\", \"Kilang Roti\", \"Gudang\", \"Jelapang\", \"Kedai Senjata\", \"Kedai Perisai\", \"Gelanggang Latihan\", \"Bangunan Utama\", \"Titik Perhimpunan\", \"Pasar\", \"Kedutaan\", \"Berek\", \"Kandang Kuda\", \"Bengkel\", \"Akademi\", \"Gua\", \"Dewan Perbandaran\", \"Residen\", \"Istana\", \"Perbendaharaan\", \"Pejabat Dagangan\", \"Berek Besar\", \"Kandang Kuda Besar\", \"Tembok Bandar\", \"Tembok Tanah\", \"Pagar Kubu\", \"Kedai Tukang Batu\", \"Kilang Bir\", \"Pemerangkap\",\"Rumah Agam Wira\", \"Gudang Besar\", \"Jelapang Besar\", \"Dunia Keajaiban\", \"Palung Kuda\"];\n\t\taLangAllBuildAltWithId = [\"Kawasan Pembalakan\", \"Kuari Tanat Liat\", \"Lombong Bijih Besi\", \"Ladang\", \"\", \"Kilang Papan\", \"Kilang Bata\", \"Faundri Besi\", \"Pengisar Bijian\", \"Kilang Roti\", \"Gudang\", \"Jelapang\", \"Kedai Senjata\", \"Kedai Perisai\", \"Gelanggang Latihan\", \"Bangunan Utama\", \"Titik Perhimpunan\", \"Pasar\", \"Kedutaan\", \"Berek\", \"Kandang Kuda\", \"Bengkel\", \"Akademi\", \"Gua\", \"Dewan Perbandaran\", \"Residen\", \"Istana\", \"Perbendaharaan\", \"Pejabat Dagangan\", \"Berek Besar\", \"Kandang Kuda Besar\", \"Tembok Bandar\", \"Tembok Tanah\", \"Pagar Kubu\", \"Kedai Tukang Batu\", \"Kilang Bir\", \"Pemerangkap\",\"Rumah Agam Wira\", \"Gudang Besar\", \"Jelapang Besar\", \"Dunia Keajaiban\", \"Palung Kuda\"];\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\taLangTaskKind = [\"Tingkatkan\", \"Bina bangunan\", \"Serang\", \"Selidik\", \"latih\", \"Angkut\", \"NPC\", \"musnah\", \"Perayaan\"];\n\t\taLangGameText = [\"Tahap\", \"Pedagang\", \"ID\", \"Ibu Kota\", \"Waktu mula\", \"this timeseting is unuseful now.\", \"ke\", \"Kampung\", \"angkut\", \"dari\", \"Angkut ke\", \"Angkut dari\", \"Balik dari\", \"sumber\", \"bangunan\", \"Bina bangunan\", \"Kosong\", \"tahap\"];\n\t\taLangRaceName = [\"Rom\", \"Teuton\", \"Gaul\"];\n\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"AutoResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans_In_limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\", \"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\",\"00:30:00\",\"Catapult target\",\"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\", \"Schedule Train\",\"Train site\",\"TrainTask done\",\"customTransport\",\"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans_Out_Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\"minutes\",\".\",\".\",\"START\",\"STOP\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Terlalu sedikit sumber\", \"Para pekerja sedang bekerja\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\",\"Lack of food: extend cropland first\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"Upgrade successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\"];\n\t\taLangResources=[\"kayu\",\"tanah liat\",\"besi\",\"tanaman\"];\n\t\taLangTroops[0] = [\"Askar Legion\", \"Pengawal Pertahanan\", \"Askar Empayar\", \"Kesatria Diplomatik\", \"Kesatria Empayar\", \"Kesatria Jeneral\", \"Kereta Pelantak\", \"Tarbil Api\", \"Senator\", \"Peneroka\", \"Wira\"];\n\t\taLangTroops[1] = [\"Askar Belantan\", \"Askar Lembing\", \"Askar Kapak\", \"Peninjau\", \"Kesatria Santo\",\"Kesatria Teutonik\", \"Kereta Pelantak\", \"Tarbil\", \"Penghulu\", \"Peneroka\", \"Wira\"];\n\t\taLangTroops[2] = [\"Falanks\", \"Askar Pedang\", \"Penjelajah\", \"Guruh Theutates\", \"Penunggang Druid\", \"Haeduan\", \"Kereta Pelantak\", \"Tarbil\", \"Pemimpin\", \"Peneroka\", \"Wira\"];\n\t\taLangAttackType = [\"Bantuan\", \"Serangan: Normal\", \"Serangan: Serbuan\"];\n\t\tbreak;\n\n\n case \"nl\":\n\t\taLangAllBuildWithId = [\"Houthakker\", \"Klei-afgraving\", \"IJzermijn\", \"Graanakker\", \"\", \"Zaagmolen\", \"Steenbakkerij\", \"Ijzersmederij\", \"Korenmolen\", \"Bakkerij\", \"Pakhuis\", \"Graansilo\", \"Wapensmid\", \"Uitrustingssmederij\", \"Toernooiveld\", \"Hoofdgebouw\", \"Verzamelenplaats\", \"Marktplaats\", \"Ambassade\", \"Barakken\", \"Stal\", \"Werkplaats\", \"Acedemie\", \"Schuilplaats\", \"Raadhuis\", \"Residentie\", \"Paleis\", \"Schatkamer\", \"Handelskantoor\", \"Grote Barakken\", \"Grote Stal\", \"Stadsmuur\", \"Muur van aarde\", \"Palissade\", \"Steenhouwerij\", \"Brouwerij\", \"Vallenzetter\",\"Heldenhof\", \"Groot Pakhuis\", \"Grote Graansilo\", \"Wereldwonder\", \"Drinkplaats\"];\n\t\taLangAllBuildAltWithId = [\"Houthakker\", \"Klei-afgraving\", \"IJzermijn\", \"Graanakker\", \"\", \"Zaagmolen\", \"Steenbakkerij\", \"Ijzersmederij\", \"Korenmolen\", \"Bakkerij\", \"Pakhuis\", \"Graansilo\", \"Wapensmid\", \"Uitrustingssmederij\", \"Toernooiveld\", \"Hoofdgebouw\", \"Verzamelenplaats\", \"Marktplaats\", \"Ambassade\", \"Barakken\", \"Stal\", \"Werkplaats\", \"Acedemie\", \"Schuilplaats\", \"Raadhuis\", \"Residentie\", \"Paleis\", \"Schatkamer\", \"Handelskantoor\", \"Grote Barakken\", \"Grote Stal\", \"Stadsmuur\", \"Muur van aarde\", \"Palissade\", \"Steenhouwerij\", \"Brouwerij\", \"Vallenzetter\",\"Heldenhof\", \"Groot Pakhuis\", \"Grote Graansilo\", \"Wereldwonder\", \"Drinkplaats\"];\n\t\taLangAddTaskText = [\"Taak toevoegen\", \"Type\", \"Gekozen dorp\", \"Taakdoel\", \"Naar\", \"Modus\", \"Bouwhulp\", \"Grondstofconcentratie\", \"Naar boven\", \"Naar benenden\", \"Del\", \"&#160;&#160;&#160;Doelen\", \"Bewegen \", \"Verwijder alle taken\"]; \n\t\taLangTaskKind = [\"Verbeteren\", \"Gebouw bouwen\", \"Aanvallen\", \"Onderzoeken\", \"Trainen\", \"Handel\", \"NPC\", \"Slopen\", \"Vieren\"]; \n\t\taLangGameText = [\"Niveau\", \"Handelaren\", \"ID\", \"Hoofddorp\", \"Start tijd\", \"Deze tijdsinstelling is onbruikbaar op dit moment.\", \"Naar\", \"Dorp\", \"transport\", \"Van\", \"Transporteren naar\", \"Transporteren van\", \"Terugkeren van\", \"Grondstoffen\", \"Gebouw\", \"Nieuw gebouw bouwen\", \"Leeg\", \"Niveau\"]; \n aLangRaceName = [\"Romeinen\", \"Germanen\", \"Galliërs\"]; \n\t\taLangTaskOfText = [\"Upgrade plannen\", \"Nieuwbouw plannen\", \"Auto ResUpD\", \"Inactief\", \"Start\", \"Bezig\", \"Stop\", \"De grondverdeling van dit dorp is \", \"Autotransport\", \"Autotransport is niet gestart\", \"Gestart\", \"Transport succesvol\", \"Takenlijst\", \"Trans In limit\", \"Standaard\", \"Aanpassen\", \"Hout/Klei/Ijzer\", \"Graan\", \"Slopen plannen\", \n \"Aanval plannen\", \"Aanvalssoort\", \"Tijdsduur\", \"Herhalen\", \"tussentijd\",\"00:30:00\",\"Katapult doel\",\"Random\", \"Onbekend\", \"keren\", \"Maand\", \"Dag\", \"Troepen verstuurd\", \n \"Training plannen\", \"Trainingkant\", \"Trainingstaak voltooid\", \"Handmatig Transport\", \"Stel de tussentijd in\",\"Dit is de tussentijd van de pagina herladen ,\\n standaard is 20 minuten, stel a.u.b. een nieuwe tijd in:\\n\\n\",\"Trans Out Rmn\",\"Feest plannen\",\"Klein Feest\",\"Groot Feest\",\"Stel tussentijd in voor grondstofconcentratie\", \n \"minuten\", \".\",\".\",\"START\",\"STOP\",\"Verbetering plannen\",\"Verbeter aanval\",\"Verbeter uitrusting\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n aLangErrorText = [\"Te weinig grondstoffen.\", \"Je bouwvakkers zijn al aan het werk.\", \"Bouwopdracht voltooid\", \"Bouwopdracht begint\", \"Bezig\", \"Je pakhuis is te klein. Verbeter je pakhuis om de bouwopdracht voort te zetten.\", \"Je graansilo is te klein. Verbeter je graansilo om de bouwopdracht voort te zetten\", \"Genoeg grondstoffen\",\"Te weinig graanproductie: Verbeter eerst een graanveld\",\"Er is al een feest gaande\"]; \n\t\taLangOtherText = [\"Belangrijk bericht\", \"Alleen de grondstofvelden van het hoofddorp kunnen <br/>verbeterd worden tot niveau 20. Nu is je hoofddorp<br/> niet vastgesteld. Bezoek je profiel a.u.b.\", \"Afkorting hier ^_^\", \"Instellingen succesvol\", \"Geannuleerd\", \"Start de taken\", \"Verbetering succesvol\", \"Start succesvol\", \"Je ras is onbekend, daardoor ook je troeptype. <br/>Bezoek je profiel om je ras vast te stellen<br/>\", \"Bezoek a.u.b. ook je heldenhof om <br/> de snelheid en type van je held vast te stellen.\"]; \n\t\taLangResources=[\"Hout\",\"Klein\",\"Ijzer\",\"Graan\"]; \n\t\taLangTroops[0] = [\"Legionair\", \"Praetoriaan\", \"Imperiaan\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Ram\", \"Vuurkatapult\", \"Senator\", \"Kolonist\", \"Held\"]; \n\t\taLangTroops[1] = [\"Knuppelvechter\", \"Speervechter\", \"Bijlvechter\", \"Verkenner\", \"Paladijn\", \"Germaanse Ridder\", \"Ram\", \"Katapult\", \"Leider\", \"Kolonist\", \"Held\"]; \n\t\taLangTroops[2] = [\"Phalanx\", \"Zwaardvechter\", \"Padvinder\", \"Toetatis donder\", \"Druideruiter\", \"Haeduaan\", \"Ram\", \"Trebuchet\", \"Onderleider\", \"Kolonist\", \"Held\"]; \n\t\taLangAttackType = [\"Versterking\", \"Aanval\", \"Overval\"]; \n\t\tbreak;\n\n\ncase \"hu\": //Harrerp\n\n\t\taLangAllBuildWithId = [\"Favágó\", \"Agyagbánya\", \"Vasércbánya\", \"Búzafarm\", \"\", \"Fűrészüzem\", \"Agyagégető\", \"Vasöntöde\", \"Malom\", \"Pékség\", \"Raktár\", \"Magtár\", \"Fegyverkovács\", \"Páncélkovács\", \"Gyakorlótér\", \"Főépület\", \"Gyülekezőtér\", \"Piac\", \"Követség\", \"Kaszárnya\", \"Istálló\", \"Műhely\", \"Akadémia\", \"Rejtekhely\", \"Tanácsháza\", \"Rezidencia\", \"Palota\", \"Kincstár\", \"Kereskedelmi központ\", \"Nagy Kaszárnya\", \"Nagy Istálló\", \"Kőfal\", \"Földfal\", \"Cölöpfal\", \"Kőfaragó\", \"Sörfőzde\", \"Csapdakészítő\", \"Hősök háza\", \"Nagy Raktár\", \"Nagy Magtár\", \"Világcsoda\",\"Lóitató\"];\n\t\taLangAllBuildAltWithId = [\"Favágó\", \"Agyagbánya\", \"Vasércbánya\", \"Búzafarm\", \"\", \"Fűrészüzem\", \"Agyagégető\", \"Vasöntöde\", \"Malom\", \"Pékség\", \"Raktár\", \"Magtár\", \"Fegyverkovács\", \"Páncélkovács\", \"Gyakorlótér\", \"Főépület\", \"Gyülekezőtér\", \"Piac\", \"Követség\", \"Kaszárnya\", \"Istálló\", \"Műhely\", \"Akadémia\", \"Rejtekhely\", \"Tanácsháza\", \"Rezidencia\", \"Palota\", \"Kincstár\", \"Kereskedelmi központ\", \"Nagy Kaszárnya\", \"Nagy Istálló\", \"Kőfal\", \"Földfal\", \"Cölöpfal\", \"Kőfaragó\", \"Sörfőzde\", \"Csapdakészítő\", \"Hősök háza\", \"Nagy Raktár\", \"Nagy Magtár\", \"Világcsoda\",\"Lóitató\"];\n\t\taLangAddTaskText = [\"Feladat hozzáadása\", \"Feladat\", \"Aktív falu\", \"Feladat célja\", \"Ide\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Fel\", \"Le\", \"Törlés\", \" Feladatok\", \"Sorrend\", \"Összes feladat törlése\"];\n\t\taLangTaskKind = [\"Kiépítés\", \"Új épület\", \"Támadás\", \"Fejlesztés\", \"Kiképzés\", \"Szállítás\", \"NPC\", \"Bontás\", \"Ünnep\"];\n\t\taLangGameText = [\"Szint\", \"Kereskedők\", \"ID\", \"Capital\", \"Indítási idő\", \"az időbeállítás nem szükséges.\", \"ide\", \"Falu\", \"szállítás\", \"innen\", \"Szállítás ide\", \"Szállítás innen\", \"Visszaérkezés\", \"nyersanyag\", \"épület\", \"Új épület építése\", \"empty\", \"szint\"];\n\t\taLangRaceName = [\"Római\", \"Germán\", \"Gall\"];\n\t\taLangTaskOfText = [\"Időzített kiépítés\", \"Időzített építés\", \"AutoResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Auto szállítás\", \"Autotransport is not opened\", \"Opened\", \"Szállítás kész\", \"Feladat lista\", \"Trans_In_limit\", \"Default\", \"Módosítás\", \"Fa/Agyag/Vasérc\", \"Búza\", \"Időzített bontás\",\n\t\t\t\"Időzítet támadás\", \"Támadás típus\", \"Utazási idő\", \"Ismétlés\", \"Idő intervallum\",\"00:30:00\",\"Katapult célpont\",\"Véletlen\", \"Ismeretlen\", \"ismétlés\", \"Hónap\", \"Nap\", \"Egységek küldése\",\n\t\t\t\"Időzített kiképzés\",\"Kiképzőhely\",\"Kiképzés befejezve\",\"Egyedi szállítás\",\"Frissítési időintervallum beállítás\",\"Ez az oldalfrissítési időintervallum,\\n az alap 20 perc, írd be az új időt:\\n\\n\",\"Trans_Out_Rmn\",\"Időzített ünnepség\",\"Kis ünnepség\",\"Nagy ünnepség\",\"setInterval of Resources concentration\",\n\t\t\t\"perc\",\"áll\",\"fut\",\"indulj\",\"állj\",\"Időzített fejlesztés\",\"Fegyver fejlesztés\",\"Páncél fejlesztés\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Too few resources.\", \"The workers are already at work.\", \"Építés kész\", \"Építés indul\", \"Fejlesztés folyamatban\", \"A raktárad túl kicsi. Építsd tovább a raktárt, hogy folytathasd az építést\", \"A magtárad túl kicsi. Építsd tovább a magtárt, hogy folytathasd az építést\", \"Elég nyersanyag\",\"Élelemhiány: Előtte egy búzafarmot kell építened \",\"Jelenleg is ünnepelnek\",\"There is already research going on\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Beállítás kész\", \"Cancelled\", \"Start the tasks\", \"Kiépítés kész\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\"];\n\t\taLangResources= [\"fa\",\"agyag\",\"vasérc\",\"búza\"];\n\t\taLangTroops[0] = [\"Légiós\", \"Testőr\", \"Birodalmi\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Faltörő kos\", \"Tűzkatapult\", \"Szenátor\", \"Telepes\", \"Hős\"]; //Római\n\t\taLangTroops[1] = [\"Buzogányos\", \"Lándzsás\", \"Csatabárdos\", \"Felderítő\", \"Paladin\", \"Teuton lovag\", \"Faltörő kos\", \"Katapult\", \"Törzsi vezető\", \"Telepes\", \"Hős\"]; //Germán\n\t\taLangTroops[2] = [\"Phalanx\", \"Kardos\", \"Felderítő\", \"Theutat villám\", \"Druida lovas\", \"Haeduan\", \"Falromboló\", \"Harci-katapult\", \"Főnök\", \"Telepes\", \"Hős\"]; //Gall\n\t\taLangAttackType = [\"Támogatás\", \"Támadás\", \"Rablás\"];\n\t\tbreak;\t\t\n\n\ncase \"lv\": //by sultāns updated the 16/04/2010\n\t\taLangAllBuildWithId = [\"Cirsma\", \"Māla Karjers\", \"Dzelzs Raktuves\", \"Labības Lauks\", \"\", \"Kokzāģētava\", \"Ķieģelu Fabrika\", \"Dzelzs Lietuve\", \"Dzirnavas\", \"Maiznīca\", \"Noliktava\", \"Klēts\", \"Ieroču kaltuve\", \"Bruņu kaltuve\", \"Turnīru laukums\", \"Galvenā ēka\", \"Pulcēšanās Vieta\", \"Tirgus laukums\", \"Vēstniecība\", \"Kazarmas\", \"Stallis\", \"Darbnīca\", \"Akadēmija\", \"Paslēptuve\", \"Rātsnams\", \"Rezidence\", \"Pils\", \"Dārgumu glabātuve\", \"Tirdzniecības Birojs\", \"Lielās Kazarmas\", \"Lielais Stallis\", \"Pilsētas Mūris\", \"Zemes Mūris\", \" Palisāde\", \"Akmeņlauztuve\", \"Alus Darītava\", \"Mednieku māja\",\"Varoņu Savrupmāja\", \"Lielā Noliktava\", \"Liela Klēts\", \"Pasaules Brīnums\"];\n\t\taLangAllBuildAltWithId = [\"Cirsma\", \"Māla Karjers\", \"Dzelzs Raktuves\", \"Labības Lauks\", \"\", \"Kokzāģētava\", \"Ķieģelu Fabrika\", \"Dzelzs Lietuve\", \"Dzirnavas\", \"Maiznīca\", \"Noliktava\", \"Klēts\", \"Ieroču kaltuve\", \"Bruņu kaltuve\", \"Turnīru laukums\", \"Galvenā ēka\", \"Pulcēšanās Vieta\", \"Tirgus laukums\", \"Vēstniecība\", \"Kazarmas\", \"Stallis\", \"Darbnīca\", \"Akadēmija\", \"Paslēptuve\", \"Rātsnams\", \"Rezidence\", \"Pils\", \"Dārgumu glabātuve\", \"Tirdzniecības Birojs\", \"Lielās Kazarmas\", \"Lielais Stallis\", \"Pilsētas Mūris\", \"Zemes Mūris\", \" Palisāde\", \"Akmeņlauztuve\", \"Alus Darītava\", \"Mednieku māja\",\"Varoņu Savrupmāja\", \"Lielā Noliktava\", \"Liela Klēts\", \"Pasaules Brīnums\"];\n\t\taLangAddTaskText = [\"Izveidot uzdevumu\", \"Veids\", \"Aktīvais ciems\", \"Uzdevuma mērķis\", \"| Mērķis\", \"Tips\", \"Celtniecības atbalsts\", \"Resursu koncentrācija\", \"Uz augšu\", \"Uz leju\", \"Izdzēst\", \" Uzdevuma stāvoklis\", \"Pārvietot\", \"Dzēst visus uzdevumus\"];\n\t\taLangTaskKind = [\"Uzlabot\", \"Jauna ēka\", \"Uzbrukt\", \"Izpētīt\", \"Apmācīt\", \"Nosūtīt resursus\", \"NPC\", \"Nojaukt\", \"Svinības\"];\n\t\taLangGameText = [\"Līmenis\", \"Tirgotāji\", \"ID\", \"Galvaspilsēta\", \"Sākuma laiks\", \"Īslaicīgi nestrādā\", \"uz\", \"Ciems\", \"Transportēt\", \"no\", \"Transportēt uz\", \"Transportēt no\", \"Atgriezties no\", \"resursi\", \"ēka\", \"Būvēt jaunu ēku\", \"tukšs\", \"līmenis\"];\n\t\taLangRaceName = [\"Romieši\", \"Ģermāņi\", \"Galli\"];\n\t\taLangTaskOfText = [\"Ieplānot uzlabojumus\", \"Ieplānot jaunas ēkas celtniecību\", \"Uzlabot resursu laukus\", \"Izslēgt\", \"Uzsākt\", \"Ieslēgts\", \"Stop\", \"Resursu lauku izvietojums šajā ciemā\", \"Automātiska nosūtīšana\", \"Automātiska nosutīšana atslēgta\", \"Ieslēgts\", \"Veiksmīgi nosūtīts\", \"* Uzdevumi *\", \"Ienākošais limits\", \"Default\", \"Izmainīt\", \"Koks/Māls/Dzelzis\", \"Labība\", \"Ieplānot nojaukšanu\",\n\t\t\t\"Ieplānot uzbrukumu\", \"Uzbrukuma veids\", \"Laiks ceļā\", \"Atkartošanas laiks\", \"laika intervāls\",\"00:30:00\",\"Ar katapultām massēt\",\"Pofig pa ko\", \"Nezināms\", \"laiki\", \"Mēnesis\", \"Diena\", \"Kareivji nosūtīti\",\n\t\t\t\"Ieplānot apmācību\",\"Train site\",\"Kareivju apmācība pabeigta\",\"optimizēt transportēšanu\",\"Ievadīt laiku pēc kura atkārtot iekraušanu\",\"Šis ir intervāls lapas parlādēšanai ,\\n pēc noklusējuma - 20 min., Lūdzu ievadiet jaunu laiku:\\n\\n\",\"Izejošais limits\",\"Ieplānot svinības\",\"mazās svinības\",\"lielās svinības\",\"Uzstādīt laika intervālu resursu sūtīšanai\",\n\t\t\t\"minūtes\", \".\",\".\",\"Start\", \"Stop\", \"Ieplānot uzdevumus\",\"Ieplānot uzbrukumus\",\"Ieplanot aizsardzību\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Nepietiek resursu\", \"Strādnieki jau strādā\", \"Būvniecība pabeigta\", \"Ir uzsākta būvniecība\", \"Attīstības stadija\", \"Nepietiek vietas noliktavā, lūdzu paplašiniet to\", \"Nepietiek vietas klētī, ludzu paplašinoiet to\", \"Pietiekoši resursu\",\"\",\"Svinības jau notiek\"];\n\t\taLangOtherText = [\"Svarīgi\", \"Tikai galvaspilsētā resursu laukus var uzlabot uz 20Lvl. Galvaspilsāta nav noteikta. Ieejiet lūdzu savā profilā\", \"Shortcut here ^_^\", \"Iestatījumi pabeigti\", \"Atcelts\", \"Sākt uzdevumus\", \"Uzlabots veiksmīgi\", \"Viss notiek\", \"Jūsu rase ir unknown. Lūdzu ieejiet profilā.\", \"Kā arī, lūdzu ieejiet varoņu majā, lai noteiktu varoņa veidu un ātrumu\"];\n\t\taLangResources=[\"Koks\",\"Māls\",\"Dzelzs\",\"Labība\"];\n\t\taLangTroops[0] = [\"Leģionārs\", \"Pretorietis\", \"Iekarotājs\", \"Ziņnesis\", \"Romas Jātnieks\", \"Romas Bruņinieks\", \"Mūra Brucinātājs\", \"Uguns Katapulta\", \"Senators\", \"Kolonists\", \"Varonis\"];\n\t\taLangTroops[1] = [\"Rungas Vēzētājs\", \"Šķēpnesis\", \"Karacirvja Vēzētājs\", \"Izlūks\", \"Bruņinieks\", \"Ģermāņu Bruņinieks\", \"Postītājs\", \"Katapultas\", \"Virsaitis\", \"Kolonists\", \"Varonis\"];\n\t\taLangTroops[2] = [\"Falanga\", \"Zobenbrālis\", \"Pēddzinis\", \"Zibens Jātnieks\", \"Priesteris - Jātnieks\", \"Edujs\", \"Tarāns\", \"Trebušets\", \"Barvedis\", \"Kolonists\", \"Varonis\"];\n\t\taLangAttackType = [\"Papildspēki\", \"Uzbrukums\", \"Iebrukums\"];\n\t\tbreak;\n\tcase \"cl\":\n\tcase \"mx\":\n\tcase \"net\": // thanks Renzo\n\t\taLangAllBuildWithId = [\"Leñador\", \"Barrera\", \"Mina\", \"Granja\", \"\", \"Serrería\", \"Ladrillar\", \"Fundición de Hierro\", \"Molino\", \"Panadería\", \"Almacén\", \"Granero\", \"Herrería\", \"Armería\", \"Plaza de torneos\", \"Edif. principal\", \"Plaza reuniones\", \"Mercado\", \"Embajada\", \"Cuartel\", \"Establo\", \"Taller\", \"Academia\", \"Escondite\", \"Ayuntamiento\", \"Residencia\", \"Palacio\", \"Tesoro\", \"Oficina de Comercio\", \"Cuartel Grande\", \"Establo Grande\", \"Muralla\", \"Terraplén\", \"Empalizada\", \"Cantero\", \"Cervecería\", \"Trampero\",\"Hogar del héroe\", \"Almacén Grande\", \"Granero Grande\", \"Maravilla\", \"Abrevadero\"];\n\t\taLangAllBuildAltWithId = [\"Leñador\", \"Barrera\", \"Mina\", \"Granja\", \"\", \"Serrería\", \"Ladrillar\", \"Fundición de Hierro\", \"Molino\", \"Panadería\", \"Almacén\", \"Granero\", \"Herrería\", \"Armería\", \"Plaza de torneos\", \"Edif. principal\", \"Plaza reuniones\", \"Mercado\", \"Embajada\", \"Cuartel\", \"Establo\", \"Taller\", \"Academia\", \"Escondite\", \"Ayuntamiento\", \"Residencia\", \"Palacio\", \"Tesoro\", \"Oficina de Comercio\", \"Cuartel Grande\", \"Establo Grande\", \"Muralla\", \"Terraplén\", \"Empalizada\", \"Cantero\", \"Cervecería\", \"Trampero\",\"Hogar del héroe\", \"Almacén Grande\", \"Granero Grande\", \"Maravilla\", \"Abrevadero\"];\n\t\taLangAddTaskText = [\"Añadir tarea\", \"Estilo\", \"Aldea activa\", \"Objetivo de Tarea\", \"Para\", \"Modo\", \"Soporte de Construcción\", \"Concentración de Recursos\", \"Ir arriba\", \"Ir abajo\", \"Borrar\", \" Contenido de tarea\", \"Mover \", \"Borrar todas las tareas\"];\n\t\taLangTaskKind = [\"Subir\", \"Construir edificio nuevo\", \"Atacar\", \"Mejorar\", \"Entrenar\", \"Transportar\", \"NPC\", \"Demoler\", \"Fiesta\"];\n\t\taLangGameText = [\"Nivel\", \"Comerciantes\", \"ID\", \"Capital\", \"Tiempo de Inicio\", \"esta prueba de tiempo no es útil.\", \"para\", \"Aldea\", \"transportar\", \"de\", \"Transportar a\", \"Transporte de\", \"Regreso de\", \"recursos\", \"edificio\", \"Construir nuevo edificio\", \"vacío\", \"nivel\"];\n\t\taLangRaceName = [\"Romanos\", \"Germanos\", \"Galos\"];\n\t\taLangTaskOfText = [\"Programar subida\", \"Programar nueva Construcción\", \"AutoResUpD\", \"OFF\", \"Empezar\", \"ON\", \"Suspender\", \"La distribución de campos de recursos de esta aldea es \", \"Autotransporte\", \"Autotransporte no está abierto\", \"Abierto\", \"Transporte exitoso\", \"Lista de Tareas\", \"Trans_In_limit\", \"Por Defecto\", \"Modificar\", \"Madera/Barro/Hierro\", \"Cereal\", \"Programar demolición\",\"Programar ataque\", \"Tipo de Ataque\", \"Tiempo de Viaje\", \"Número de Repeticiones\", \"Tiempo de intervalo\",\"00:30:00\",\"Objetivo de Catapulta\",\"Al Azar\", \"Desconocido\", \"Veces\", \"Mes\", \"Día\", \"Tropas enviadas\", \"Programar Cadena\",\"Sitio de Cadena\",\"Tarea de Cadena completada\",\"Transporte Custom\",\"Establecer tiempo de intervalo de la recarga\",\"este es el tiempo de intervalo entre cada recarga de la página,\\n Por defecto es 20 minutos, por favor introduza el nuevo tiempo:\\n\\n\",\"Trans_Out_Rmn\",\"Programar Fiesta\",\"fiesta pequeña\",\"fiesta grande\",\"Establecer intervalo de concentración de recursos\",\"minutos\",\".\",\".\",\"START\",\"STOP\", \"Programar Mejora\", \"Mejorar Ataque\", \"Mejorar Defensa\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Muy pocos recursos.\", \"Los aldeanos ya están trabajando.\", \"Construcción completa\", \"Empezando construcción\", \"En desarrollo\", \"Su almacén es muy pequeño. Por favor amplíe su almacén para continuar su construcción\", \"Su almacén es muy pequeño. Por favor amplíe su almacén para continuar su construcción\", \"Suficientes Recursos\",\"Falta de Alimento: Amplíe una granja primero\",\"Ya hay una fiesta en progreso\",\"Ya hay una exploración en progreso\"];\n\t\taLangOtherText = [\"Nota importante\", \"Solo los campos de recurso de la capital pueden ser ampliados a nivel 20. Su capital no ha sido detectada. Por favor visite su perfil.\", \"Atajo aquí ^_^\", \"Configuración completada\", \"Cancelado\", \"Empezar tareas\", \"Mejora Exitosa\", \"Ejecución exitosa\", \"Su raza es desconocida, asimismo su tipo de tropas. Visite su Perfil para determinar su raza.\", \"Por favor visite su Hogar del Heroe para determinar la velocidad y tipo de su heroe.\"];\n\t\taLangResources = [\"madera\", \"barro\", \"hierro\", \"cereal\"];\n\t\taLangTroops[0] = [\"Legionario\", \"Pretoriano\", \"Imperano\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Carnero\", \"Catapulta de Fuego\", \"Senador\", \"Colono\", \"Héroe\"];\n\t\taLangTroops[1] = [\"Luchador de Porra\", \"Lancero\", \"Luchador de Hacha\", \"Emisario\", \"Paladín\", \"Jinete Teutón\", \"Ariete\", \"Catapulta\", \"Cabecilla\", \"Colono\", \"Héroe\"];\n\t\taLangTroops[2] = [\"Falange\", \"Luchador de Espada\", \"Batidor\", \"Rayo de Teutates\", \"Jinete Druida\", \"Jinete Eduo\", \"Ariete\", \"Catapulta de Guerra\", \"Cacique\", \"Colono\", \"Héroe\"];\n\t\taLangAttackType = [\"Refuerzo\", \"Ataque\", \"Atraco\"];\n\t\tbreak;\n\n\tcase \"se\": // thanks to Arias\n\t\taLangAllBuildWithId = [\"Skogshuggare\", \"Lergrop\", \"Järngruva\", \"Vetefält\", \"\", \"Sågverk\", \"Murbruk\", \"Järngjuteri\", \"Vetekvarn\", \"Bageri\", \"Magasin\", \"Silo\", \"Smedja\", \"Vapenkammare\", \"Tornerplats\", \"Huvudbyggnad\", \"Samlingsplats\", \"Marknadsplats\", \"Ambassad\", \"Baracker\", \"Stall\", \"Verkstad\", \"Akademi\", \"Grotta\", \"Stadshus\", \"Residens\", \"Palats\", \"Skattkammare\", \"Handelskontor\", \"Stor barack\", \"Stort stall\", \"Stadsmur\", \"Jordvall\", \"Palisad\", \"Stenmurare\", \"Bryggeri\", \"Fälla\", \"Hjältens egendom\", \"Stort magasin\", \"Stor silo\", \"Världsunder\", \"Vattenbrunn\"];\n\t\taLangAllBuildAltWithId = [\"Skogshuggare\", \"Lergrop\", \"Järngruva\", \"Vetefält\", \"\", \"Sågverk\", \"Murbruk\", \"Järngjuteri\", \"Vetekvarn\", \"Bageri\", \"Magasin\", \"Silo\", \"Smedja\", \"Vapenkammare\", \"Tornerplats\", \"Huvudbyggnad\", \"Samlingsplats\", \"Marknadsplats\", \"Ambassad\", \"Baracker\", \"Stall\", \"Verkstad\", \"Akademi\", \"Grotta\", \"Stadshus\", \"Residens\", \"Palats\", \"Skattkammare\", \"Handelskontor\", \"Stor barack\", \"Stort stall\", \"Stadsmur\", \"Jordvall\", \"Palisad\", \"Stenmurare\", \"Bryggeri\", \"Fälla\", \"Hjältens egendom\", \"Stort magasin\", \"Stor silo\", \"Världsunder\", \"Vattenbrunn\"];\n\t\taLangAddTaskText = [\"Lägg till uppgift\", \"Stil\", \"Aktiv by\", \"Task target\", \"Till\", \"Läge\", \"Kontruktions stöd\", \"Råvaro koncentration\", \"Flytta upp\", \"Flytta ner\", \"Radera\", \"Uppgifter\", \"Flytta \", \"Radera alla uppgifterna\"];\n\t\taLangTaskKind = [\"Uppgradering:\", \"Ny byggnad:\", \"Attack:\", \"Forskning:\", \"Träning:\", \"Transport:\", \"NPC:\", \"Demolish:\", \"Celebration:\"];\n\t\taLangGameText = [\"Nivå \", \"Handel\", \"ID\", \"Capital\", \"Start time\", \"this timesetting is unuseful now.\", \"till\", \"By\", \"Transport\", \"från\", \"Transport till\", \"Transport från\", \"Återvänder från\", \"Råvaror\", \"Byggnad\", \"Konstruera en ny byggnad\", \"Tom\", \"Nivå\"];\n\t\taLangRaceName = [\"Romare\", \"Germaner\", \"Galler\"];\n\t\taLangTaskOfText = [\"Schemalägg uppgradering\", \"Schemalägg ny byggnad\", \"Uppgradera fält\", \"Ej Aktiv\", \"Starta\", \"Startad\", \"Avbryt\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport lyckades\", \"Uppgifter\", \"Trans_In_limit\", \"Standard\", \"Ändra \", \"Trä/Lera/Järn\", \"Vete\", \"Schemalägg demolition\",\n\t\t\t\"Schemalägg attack\", \"Attack type\", \"Res tid\", \"antal upprepningar\", \"interval time\",\"00:30:00\",\"Catapult target\",\"Random\", \"Okänd\", \"times\", \"Månad\", \"Dag\", \"Trupper skickade\", \"Schemalägg Träning\",\"Tränings plats\",\"Träningen klar\",\"Anpassad transport\",\"Sätt intervallen för omladdning av sidan\",\"Detta är intevallen för omladdning av sida,\\n standard är 20 minuter, vänligen ange ny intervall:\\n\\n\",\"Trans_Out_Rmn\",\"Schemalägg fest\",\"Liten fest\",\"Stor fest\",\"Sätt intervall av råvarukoncentration\",\n\t\t\t\"minuter\",\".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"För få råvaror\", \"Dina arbetare är redan ute på jobb\", \"Byggnad klar\", \"Påbörjar byggnad\", \"Under utveckling\", \"Ditt magasin är för litet. Vänligen uppgradera ditt magasin för att fortsätta ditt byggnadsarbete.\", \"Din silo är för liten. Vänligen uppgradera din silo för att fortsätta ditt byggnadsarbete.\", \"Tillräckligt med resurser\", \"Brist på mat: utöka vetefälten först\", \"En fest pågår redan.\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup klar\", \"Avbruten\", \"Starta uppgifterna\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\taLangResources=[\"Trä\",\"Lera\",\"Järn\",\"Vete\"];\n\t\taLangTroops[0] = [\"Legionär\", \"Praetorian\", \"Imperiesoldat\", \"Spårare\", \"Imperieriddare\", \"Ceasarriddare\", \"Murbräcka\", \"Eld Katapult\", \"Senator\", \"Nybyggare\", \"Hjälte\"];\n\t\taLangTroops[1] = [\"Klubbman\", \"Spjutman\", \"Yxman\", \"Scout\", \"Paladin\", \"Germansk Knekt\", \"Murbräcka\", \"Katapult\", \"Stamledare\", \"Nybyggare\", \"Hjälte\"];\n\t\taLangTroops[2] = [\"Falanx\", \"Svärdskämpe\", \"Spårare\", \"Theutates Blixt\", \"Druidryttare\", \"Haeduan\", \"Murbräcka\", \"Krigskatapult\", \"Hövding\", \"Nybyggare\", \"Hjälte\"];\n\t\taLangAttackType = [\"Förstärkning\", \"Normal\", \"Plundring\"];\n\t\tbreak;\n\n\tcase \"it\": // thanks Hamkrik, corrections by baldo 2011.04.08\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\t// 2011.02.16 -- provided by Psea\n\t\t\t\taLangAllBuildWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di Mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fabbro\", \"Armeria\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande Caserma\", \"Grande Scuderia\", \"Mura Cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fabbro\", \"Armeria\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande Caserma\", \"Grande Scuderia\", \"Mura cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAddTaskText = [\"Aggiungere Compito\", \"Tipo\", \"Villaggio Attivo\", \"Obiettivo del Compito\", \"Coordinate\", \"Modalita'\", \"Supporto ampliamento risorse\", \"Concentrazione risorse\", \"SU\", \"GIU\", \"Cancella\", \" Contenuto del Compito\", \"Muovere\", \"Cancella tutti i Compiti\"]; \n\t\t\t\taLangTaskKind = [\"Amplia\", \"Nuovo Edificio\", \"Attacco\", \"Ricerca\", \"Addestra\", \"Trasporto\", \"NPC\", \"Demolire\", \"Festa\"]; \n\t\t\t\taLangGameText = [\"Livello\", \"Mercanti\", \"ID\", \"Capitale\", \"Tempo di Inizio\", \"questa impostazione di tempo non si usa.\", \"Coordinate\", \"Villaggio\", \"trasporto\", \"dalla\", \"Trasporto alla\", \"Trasporto dalla\", \"Ritorno dalla\", \"risorse\", \"edifici\", \"Costruisci nuovo edificio\", \"vuoto\", \"livello\"]; \n\t\t\t\taLangRaceName = [\"Romani\", \"Teutoni\", \"Galli\"]; \n\t\t\t\taLangTaskOfText = [\"Programma Ampliamento\", \"Programma Nuovo Edificio\", \"AutoResUpD\", \"Non_attivo\", \"Start\", \"Iniziato\", \"Sospeso\", \"La distribuzione delle risorse di questo villaggio e' \", \"Autotrasporto\", \"Autotrasporto non e aperto\", \"Aperto\", \"Trasportato con successo\", \"Lista Compiti\", \"Trans_In_limit\", \"Default\", \"Modificare\", \"Legno/Argilla/Ferro\", \"Grano\", \"Demolire\",\n\t\t\t\t\t\"Programma Attacco\", \"Tipo Attacco\", \"Tempo Percorso\", \"ripeti\", \"intervallo di tempo\", \"00:30:00\", \"Obiettivo Catapulta\", \"Random\", \"Sconosciuto\", \"volte\", \"Mese\", \"Giorno\", \"Truppe Inviate\", \"Programma Addestramento\", \"Edificio di addestramento\", \"Addestramento Finito\", \"Transporto Diverso\", \"ripeti numero volte\", \"questo é l'intervallo di ricarica pagina,\\n default é 20 minuti, per favore inserire nuovo tempo:\\n\\n\", \"Trans_Out_Rmn\", \"Programma la Festa\", \"festa piccola\", \"Festa grande\", \"Imposta l'Intervallo di Concentrazione delle Risorse\",\n\t\t\t\t\t\"minuti\", \"in attesa\", \"corrente\", \"fare\", \"pausa\", \"Schedula Miglioria\", \"Migliora l'attacco\", \"Migliora la difesa\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n\t\t\t\taLangErrorText = [\"Mancano le risorse.\", \"I Lavoratori Sono Pronti per Lavorare\", \"Edificio Completo\", \"Inizia Edificio\", \"Nella Ricerca\", \"Il tuo Magazzino é piccolo. Per favore amplia il magazzino per continuare la costruzione\", \"Il tuo Granaio e piccolo. Per favore amplia il granaio per continuare la costruzione\", \"Risorse sufficienti\", \"Mancanza di Cibo: Amplia i Campi di grano\", \"Pronta la Festa\"]; \n\t\t\t\taLangOtherText = [\"Nota Importante \", \"Solo i Campi della Capitale possono essere ampliati al livello 20. La tua capitale non é determinata. Visita il tuo Profilo per favore.\", \"Shortcut here ^_^\", \"Setup compiuto\", \"Cancellato\", \"Inizia i Compiti\", \"Ampliato con successo\", \"Iniziato con successo\", \"La tua razza e' sconosciuta, anche il tipo di truppe. Visita il tuo Profilo per determinare la razza.\", \"Per favore visita Circolo degli eroi per determinare la velocita e il tipo di eroe.\"];\n\t\t\t\taLangResources = [\"legno\", \"argilla\", \"ferro\", \"grano\"]; \n\t\t\t\taLangTroops[0] = [\"Legionario\", \"Pretoriano\", \"Imperiano\", \"Emissario a cavallo\", \"Cavaliere del Generale\", \"Cavaliere di Cesare\", \"Ariete\", \"Onagro\", \"Senatore\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[1] = [\"Combattente\", \"Alabardiere\", \"Combattente con ascia\", \"Esploratore\", \"Paladino\", \"Cavaliere Teutonico\", \"Ariete\", \"Catapulta\", \"Comandante\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[2] = [\"Falange\", \"Combattente con spada\", \"Ricognitore\", \"Fulmine di Teutates\", \"Cavaliere druido\", \"Paladino di Haeduan\", \"Ariete\", \"Trabucco\", \"Capo tribù\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangAttackType = [\"Rinforzi\", \"Attacco\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\t// 2011.03.28 -- provided by Psea\n\t\t\t\taLangAllBuildWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di Mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fucina\", \"Fucina\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande caserma\", \"Grande Scuderia\", \"Mura Cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio Civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fucina\", \"Fucina\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande Caserma\", \"Grande Scuderia\", \"Mura cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio Civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAddTaskText = [\"Aggiungere Compito\", \"Tipo\", \"Villaggio Attivo\", \"Obiettivo del Compito\", \"Coordinate\", \"Modo\", \"Supporto di Costruzione\", \"Concentrazione risorse\", \"SU\", \"GIU\", \"Cancella\", \" Contenuto del Compito\", \"Muovere\", \"Cancella tutti i Compiti\"]; \n\t\t\t\taLangTaskKind = [\"Amplia\", \"Nuovo Edificio\", \"Attacco\", \"Ricerca\", \"Addestra\", \"Trasporto\", \"NPC\", \"Demolire\", \"Festa\"]; \n\t\t\t\taLangGameText = [\"Livello\", \"Mercanti\", \"ID\", \"Capitale\", \"Tempo di Inizio\", \"Questa impostazione di tempo non si usa.\", \"Coordinate\", \"Villaggio\", \"Trasporto\", \"dalla\", \"Trasporto a\", \"Trasporto da\", \"In ritorno da\", \"Risorse\", \"Edifici\", \"Costruisci nuovo edificio\", \"vuoto\", \"livello\"]; \n\t\t\t\taLangRaceName = [\"Romani\", \"Teutoni\", \"Galli\"]; \n\t\t\t\taLangTaskOfText = [\"Programma Ampliamento\", \"Programma Nuovo Edificio\", \"AutoResUpD\", \"Non_attivo\", \"Start\", \"Iniziato\", \"Sospeso\", \"La distribuzione delle risorse di questo villaggio e' \", \"Autotrasporto\", \"Autotrasporto non aperto\", \"Aperto\", \"Trasportato con successo\", \"Lista Compiti\", \"Trans_In_limit\", \"Default\", \"Modificare\", \"Legno/Argilla/Ferro\", \"Grano\", \"Demolire\",\n\t\t\t\t\t\"Programma Attacco\", \"Tipo Attacco\", \"Tempo Percorso\", \"ripeti\", \"intervallo di tempo\", \"00:30:00\", \"Obiettivo Catapulta\", \"Random\", \"Sconosciuto\", \"volte\", \"Mese\", \"Giorno\", \"Truppe Inviate\", \"Programma Addestramento\", \"Edificio addestramento\", \"Addestramento Finito\", \"Transporto Diverso\", \"Ripeti numero volte\", \"Questo é l'intervallo di ricarica pagina,\\n default é 20 minuti, per favore inserisci il nuovo tempo:\\n\\n\", \"Trans_Out_Rmn\", \"Programma la Festa\", \"Festa piccola\", \"Festa grande\", \"Imposta l'Intervallo di Concentrazione delle Risorse\",\n\t\t\t\t\t\"minuti\", \"in attesa\", \"corrente\", \"fare\", \"pausa\", \"Schedula miglioria\", \"Migliora attacco\", \"Migliora difesa\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n\t\t\t\taLangErrorText = [\"Mancano le risorse.\", \"I tuoi costruttori sono già occupati nella costruzione di un altro edificio\", \"Livello massimo raggiunto\", \"Inizia Edificio\", \"Nella Ricerca\", \"Il tuo Magazzino \", \"Il tuo Granaio \", \"Risorse disponibili\", \"Mancanza di cibo\", \"Pronta la Festa\"]; \n\t\t\t\taLangOtherText = [\"Nota Importante \", \"Solo i Campi della Capitale possono essere ampliati al livello 20. La tua capitale non é determinata. Visita il tuo Profilo per favore.\", \"Shortcut here ^_^\", \"Setup compiuto\", \"Cancellato\", \"Inizia i Compiti\", \"Ampliato con successo\", \"Iniziato con successo\", \"La tua razza e' sconosciuta, anche il tipo di truppe. Visita il tuo Profilo per determinare la razza.\", \"Per favore visita il Circolo degli eroi per determinare la velocita e tipo di eroe.\"];\n\t\t\t\taLangResources = [\"legno\", \"argilla\", \"ferro\", \"grano\"]; \n\t\t\t\taLangTroops[0] = [\"Legionario\", \"Pretoriano\", \"Imperiano\", \"Emissario a cavallo\", \"Cavaliere del Generale\", \"Cavaliere di Cesare\", \"Ariete\", \"Onagro\", \"Senatore\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[1] = [\"Combattente\", \"Alabardiere\", \"Combattente con ascia\", \"Esploratore\", \"Paladino\", \"Cavaliere Teutonico\", \"Ariete\", \"Catapulta\", \"Comandante\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[2] = [\"Falange\", \"Combattente con spada\", \"Ricognitore\", \"Fulmine di Teutates\", \"Cavaliere druido\", \"Paladino di Haeduan\", \"Ariete\", \"Trabucco\", \"Capo tribù\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangAttackType = [\"Rinforzi\", \"Attacco\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'it\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\n\tcase \"si\": // thanks Bananana and Tuga\n\t\taLangAllBuildWithId = [\"Gozdar\", \"Glinokop\", \"Rudnik železa\", \"Žitno polje\", \"\", \"Žaga\", \"Opekarna\", \"Talilnica železa\", \"Mlin\", \"Pekarna\", \"Skladišče\", \"Žitnica\", \"Izdelovalec orožja\", \"Izdelovalec oklepov\", \"Vadbišče\", \"Gradbeni ceh\", \"Zbirališče\", \"Tržnica\", \"Ambasada\", \"Barake\", \"Konjušnica\", \"Izdelovalec oblegovalnih naprav\", \"Akademija\", \"Špranja\", \"Mestna hiša\", \"Rezidenca\", \"Palača\", \"Zakladnica\", \"Trgovski center\", \"Velike barake\", \"Velika konjušnica\", \"Mestno obzidje\", \"Zemljen zid\", \"Palisada\", \"Kamnosek\", \"Pivnica\", \"Postavljalec pasti\", \"Herojeva rezidenca\", \"Veliko skladišče\", \"Velika žitnica\", \"Čudež sveta\"];\n\t\taLangAllBuildAltWithId = [\"Gozdar\", \"Glinokop\", \"Rudnik železa\", \"Žitno polje\", \"\", \"Žaga\", \"Opekarna\", \"Talilnica železa\", \"Mlin\", \"Pekarna\", \"Skladišče\", \"Žitnica\", \"Izdelovalec orožja\", \"Izdelovalec oklepov\", \"Vadbišče\", \"Gradbeni ceh\", \"Zbirališče\", \"Tržnica\", \"Ambasada\", \"Barake\", \"Konjušnica\", \"Izdelovalec oblegovalnih naprav\", \"Akademija\", \"Špranja\", \"Mestna hiša\", \"Rezidenca\", \"Palača\", \"Zakladnica\", \"Trgovski center\", \"Velike barake\", \"Velika konjušnica\", \"Mestno obzidje\", \"Zemljen zid\", \"Palisada\", \"Kamnosek\", \"Pivnica\", \"Postavljalec pasti\", \"Herojeva rezidenca\", \"Veliko skladišče\", \"Velika žitnica\", \"Čudež sveta\"];\n\t\taLangAddTaskText = [\"Dodaj nalogo\", \"Style\", \"Aktivna vas\", \"Nadgradi\", \"Na\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Prestavi gor\", \"Prestavi dol\", \"Izbriši\", \" Naloge\", \"Premakni \", \"Izbriši vse naloge\"];\n\t\taLangTaskKind = [\"Nadgradi\", \"Zazidljiva parcela\", \"Napad\", \"Razišči\", \"Uri\", \"Transport\", \"NPC\", \"Demolish\", \"Festival\"];\n\t\taLangGameText = [\"Stopnja\", \"Merchants\", \"ID\", \"Prestolnica\", \"Začetek ob\", \"Nastavitev časa ni pomembna.\", \"to\", \"Vas\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Postavi nov objekt\", \"empty\", \"level\"];\n\t\taLangRaceName = [\"Rimljani\", \"Tevtoni\", \"Galci\"];\n\t\taLangTaskOfText = [\"Nadgradi kasneje\", \"Postavi nov objekt\", \"Surovine gor\", \"Pauza\", \"Začetek\", \"Začeto\", \"Prekliči\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Naloge\", \"Trans_In_limit\", \"Osnovno\", \"Spremeni\", \"Les/Glina/Železo\", \"Crop\", \"Podri kasneje\",\n\t\t\t\"Napadi kasneje\", \"Tip napada\", \"Do napada\", \"Ponovi\", \"Vrnitev čez\",\"00:30:00\",\"Tarča katapultov\",\"Naključno\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Enote poslane\", \"Uri kasneje\",\"Mesto urjenja\",\"Urjenje končano\",\"customTransport\",\"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans_Out_Rmn\",\"ScheduleParty\",\"mali festival\",\"veliki festival\",\"setInterval of Resources concentration\",\n\t\t\t\"minute\",\".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Primankljaj surovin.\", \"Delavci so že na delu.\", \"Zgrajeno\", \"Začnem z gradnjo\", \"V razvoju\", \"Seu Armazém é pequeno. Evolua o seu armazém para continuar a sua construção\", \"Seu Celeiro é pequeno. Evolua o seu Celeiro para continuar a sua construção\", \"Recursos suficientes\",\"Já se encontra uma celebração em curso\"];\n\t\taLangOtherText = [\"Pomembno!\", \"Samo polja v prestolnicigredo do stopnje 20 . A sua capitalnao está detectavel. Por favor visite o seu perfil.\", \"Atalho aqui ^_^\", \"Naloga uspešno dodana\", \"Preklicano\", \"Začni z nalogo\", \"Uspešno nadgrajeno\", \"Executar com sucesso\", \"Sua raça é desconhecida, e o seu tipo de tropa também.Visite o seu perfil para determinar as raça.\", \"Por favor visite a sua mansão do heroi para determinara velocidade e o tipo de heroi.\"];\n\t\taLangResources=[\"Les\",\"Glina\",\"Železo\",\"Žito\"]; \n\t\taLangTroops[0] = [\"Legionar\", \"Praetorijan\", \"Imperijan\", \"Izvidnik\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Oblegovalni oven\", \"Ognjeni katapult\", \"Senator\", \"Kolonist\", \"Heroj\"];\n\t\taLangTroops[1] = [\"Gorjačar\", \"Suličar\", \"Metalec sekir\", \"Skavt\", \"Paladin\", \"Tevtonski vitez\", \"Oblegovalni oven\", \"Mangonel\", \"Vodja\", \"Kolonist\", \"Heroj\" ];\n\t\taLangTroops[2] = [\"Falanga\", \"Mečevalec\", \"Stezosledec\", \"Theutatesova Strela\", \"Druid\", \"Haeduan\", \"Oblegovalni oven\", \"Trebušet\", \"Poglavar\", \"Kolonist\", \"Heroj\"];\n\t\taLangAttackType = [\"Okrepitev\", \"Napad\", \"Ropanje\"];\n\t\tbreak;\n\n\tcase \"vn\": // thanks Tuga\n\t\taLangAllBuildWithId = [\"Tiều Phu\", \"Mỏ Đất Sét\", \"Mỏ sắt\", \"Ruộng lúa\", \"\", \"Xưởng Gỗ\", \"Lò Gạch\", \"Lò Rèn\", \"Nhà Xay Lúa\", \"Lò Bánh\", \"Nhà Kho\", \"Kho Lúa\", \"Thợ Rèn\", \"Lò Luyện Giáp\", \"Võ Đài\", \"Nhà Chính\", \"Binh Trường\", \"Chợ\", \"Đại Sứ Quán\", \"Trại Lính\", \"Chuồng Ngựa\", \"Xưởng\", \"Học Viện\", \"Hầm Ngầm\", \"Tòa Thị Chính\", \"Lâu Đài\", \"Cung Điện\", \"Kho Bạc\", \"Phòng Thương Mại\", \"Doanh Trại Lớn\", \"Trại Ngựa\", \"Tường Thành\", \"Tường Đất\", \"Tường Rào\", \"Thợ Xây Đá\", \"Quán bia\", \"Hố Bẫy\",\"Lâu đài tướng\", \"Nhà Kho Lớn\", \"Kho Lúa Lớn\", \"Kỳ Quan\", \"Tàu ngựa\"];\n\t\taLangAllBuildAltWithId = [\"Tiều Phu\", \"Mỏ Đất Sét\", \"Mỏ sắt\", \"Ruộng lúa\", \"\", \"Xưởng Gỗ\", \"Lò Gạch\", \"Lò Rèn\", \"Nhà Xay Lúa\", \"Lò Bánh\", \"Nhà Kho\", \"Kho Lúa\", \"Thợ Rèn\", \"Lò Luyện Giáp\", \"Võ Đài\", \"Nhà Chính\", \"Binh Trường\", \"Chợ\", \"Đại Sứ Quán\", \"Trại Lính\", \"Chuồng Ngựa\", \"Xưởng\", \"Học Viện\", \"Hầm Ngầm\", \"Tòa Thị Chính\", \"Lâu Đài\", \"Cung Điện\", \"Kho Bạc\", \"Phòng Thương Mại\", \"Doanh Trại Lớn\", \"Trại Ngựa\", \"Tường Thành\", \"Tường Đất\", \"Tường Rào\", \"Thợ Xây Đá\", \"Quán bia\", \"Hố Bẫy\",\"Lâu đài tướng\", \"Nhà Kho Lớn\", \"Kho Lúa Lớn\", \"Kỳ Quan\", \"Tàu ngựa\"];\n\t\taLangAddTaskText = [\"Thêm nhiệm vụ\", \"Loại\", \"Tại làng\", \"Mục tiêu\", \"Tới\", \"Phương thức\", \"Tự động\", \"Tùy chỉnh\", \"Di chuyển lên\", \"Di chuyển xuống\", \"Xóa\", \"&#160;&#160;&#160;Nội dung công việc\", \"Di chuyển\", \"Xóa tất cả danh mục\"];\n\t\taLangTaskKind = [\"Nâng cấp\", \"Kiến Trúc Mới\", \"Tấn công\", \"Nghiên cứu\", \"Huấn luyện\", \"Vận chuyển\", \"NPC\", \"Phá hủy\", \"ăn mừng\"];\n\t\taLangGameText = [\"Cấp \", \"Lái Buôn\", \"Tại vị trí\", \"Thủ đô\", \"Bắt đầu tại\", \"Chưa dùng được chức năng này.\", \"đến\", \"Làng\", \"vận chuyển\", \"từ\", \"Vận chuyển đến\", \"Vận chuyển từ\", \"Trở về từ\", \"Tài nguyên\", \"Kiến trúc\", \"Xây Kiến Trúc Mới\", \"không có gì\", \"Cấp\"];\n\t\taLangRaceName = [\"Tộc Romans\", \"Tộc Teutons\", \"Tộc Gauls\"];\n\t\taLangTaskOfText = [\"Lên lịch nâng cấp kiến trúc này\", \"Lên lịch xây kiến trúc này\", \"Tự động nâng cấp các mỏ\", \"Chưa kích hoạt\", \"Kích hoạt\", \"Đã kích hoạt\", \"Hủy\", \"Đây là làng loại \", \"Tự động gửi tài nguyên\", \"Tự động gửi tài nguyên chưa được kích hoạt\", \"Đã được kích hoạt\", \"Gủi thành công\", \"Danh mục\", \"Tài nguyên bạn muốn nhận\", \"Mặc định\", \"Tùy chỉnh \", \"Gỗ/Đất sét/Sắt\", \"Lúa\", \"Lên lịch phá hủy công trình\",\n\t\t\t\"Lên lịch tấn công làng này\", \"Loại tấn công\", \"Thời gian để đến nơi\", \"Số lần lặp lại\", \"Khoảng cách giữa các lần lặp lại\",\"00:30:00\",\"Mục tiêu cata\",\"Ngẫu nhiên\", \"Chưa biết\", \"Giờ\", \"Tháng\", \"Ngày\", \"Đã gửi lính\", \"Lên lịch huấn luyện lính này\",\"Train ubication\",\"Lính đang được huấn luyện\",\"Tùy chỉnh gửi tài nguyên\",\"Thiết lập thời gian tải lại trang web\",\"Đây là khoảng thởi gian tải lại trang web ,\\n Mặc định là 20 phút, hãy điền vào số phút bạn muốn thay đổi:\\n\\n\",\"Tài nguyên bạn muốn chừa lại\",\"Lên lịch ăn mừng\",\"Ăn mừng nhỏ\",\"Ăn mừng lớn\",\"Thiết lập khoảng thời gian bạn muốn gửi tài nguyên\",\n\t\t\t\"Phút\",\"Đang tạm dừng\",\"Đang thi hanh\",\"Thi hành\",\"Tạm dừng\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Quá ít tài nguyên.\", \"Công nhân đang làm nhiệm vụ khác.\", \"Kiến trúc đã hoàn thiên\", \"Bắt đầu xây dựng\", \"Đang xây dựng\", \"Nhà kho quá nhỏ. Hãy nâng cấp nhà kho mới xây dựng được kiến trúc\", \"Kho lúa quá nhỏ. Hãy nâng cấp kho lúa mới xây được kiến trúc\", \"Quá ít tài nguyên\",\"\",\"Hiện đang có buổi lễ ăn mừng\"];\n\t\taLangOtherText = [\"Chú thích quan trọng\", \"Chỉ thủ đô mới có thể<br/>nâng cấp các mỏ lên level 20. THủ đô của bạn<br/> chưa thấy. hãy vào phần hồ sơ của bạn.\", \"Click vào đây\", \"Cài đặt hoàn tất\", \"Đã hủy\", \"Bắt đầu công việc\", \"Nâng cấp thành công\", \"Kích hoạt thành công\", \"CHưa biết bạn thuộc tộc nào. <br/>Vì vậy bạn nên vào hồ sơ để cập nhật thông tin.<br/>\", \"Bạn cũng nên vào Lâu Đài Tướng để cập nhật<br/> tốc đọ và loại tướng.\"];\n\t\taLangResources=[\"Gỗ\",\"Đất sét\",\"Sắt\",\"Lúa\"];\n\t\taLangTroops[0] = [\"Lính Lê Dương\", \"Thị Vệ\", \"Chiến Binh Tinh Nhuệ\", \"Kỵ Binh Do Thám\", \"Kỵ Binh\", \"Kỵ Binh Tinh Nhuệ\", \"Xe Công Thành\", \"Máy Phóng Lửa\", \"Nguyên Lão\", \"Dân Khai Hoang\", \"Tướng\"];\n\t\taLangTroops[1] = [\"Lính Chùy\", \"Lính Giáo\", \"Lính Rìu\", \"Do Thám\", \"Hiệp Sĩ Paladin\", \"Kỵ Sĩ Teutonic\", \"Đội Công Thành\", \"Máy Bắn Đá\", \"Thủ Lĩnh\", \"Dân Khai Hoang\", \"Tướng\"];\n\t\taLangTroops[2] = [\"Lính Pha Lăng\", \"Kiếm Sĩ\", \"Do Thám\", \"Kỵ Binh Sấm Sét\", \"Tu Sĩ\", \"Kỵ Binh\", \"Máy Nện\", \"Máy Bắn Đá\", \"Tù Trưởng\", \"Dân Khai Hoang\", \"Tướng\"];\n\t\taLangAttackType = [\"Tiếp viện\", \"Tấn công\", \"Cướp bóc\"];\n\t\tbreak;\n\n\tcase \"ru\": // by MMX\n\t\taLangAllBuildWithId = [\"Лесопилка\", \"Глиняный карьер\", \"Железный рудник\", \"Ферма\", \"\", \"Лесопильный завод\", \"Кирпичный завод\", \"Чугунолитейный завод\", \"Мукомольная мельница\", \"Пекарня\", \"Склад\", \"Амбар\", \"Кузница оружия\", \"Кузница доспехов\", \"Арена\", \"Главное здание\", \"Пункт сбора\", \"Рынок\", \"Посольство\", \"Казарма\", \"Конюшня\", \"Мастерская\", \"Академия\", \"Тайник\", \"Ратуша\", \"Резиденция\", \"Дворец\", \"Сокровищница\", \"Торговая палата\", \"Большая казарма\", \"Большая конюшня\", \"Стена\", \"Земляной вал\", \"Изгородь\", \"Каменотес\", \"Пивная\", \"Капканщик\",\"Таверна\", \"Большой склад\", \"Большой амбар\", \"Чудо света\", \"Водопой\"];\n\t\taLangAllBuildAltWithId = [\"Лесопилка\", \"Глиняный карьер\", \"Железный рудник\", \"Ферма\", \"\", \"Лесопильный завод\", \"Кирпичный завод\", \"Чугунолитейный завод\", \"Мукомольная мельница\", \"Пекарня\", \"Склад\", \"Амбар\", \"Кузница оружия\", \"Кузница доспехов\", \"Арена\", \"Главное здание\", \"Пункт сбора\", \"Рынок\", \"Посольство\", \"Казарма\", \"Конюшня\", \"Мастерская\", \"Академия\", \"Тайник\", \"Ратуша\", \"Резиденция\", \"Дворец\", \"Сокровищница\", \"Торговая палата\", \"Большая казарма\", \"Большая конюшня\", \"Стена\", \"Земляной вал\", \"Изгородь\", \"Каменотес\", \"Пивная\", \"Капканщик\",\"Таверна\", \"Большой склад\", \"Большой амбар\", \"Чудо света\", \"Водопой\"];\n\t\taLangAddTaskText = [\"Добавить задание\", \"Тип задания\", \"Активная деревня\", \"Цель задания\", \" Цель\", \"Тип\", \"Поддержка строительства\", \"Концентрация ресурсов\", \"Вверх\", \"Вниз\", \"\", \"\", \"\",\"Снять все задания\"];\n\t\taLangTaskKind = [\"Улучшить:\", \"Строим:\", \"Атаковать:\", \"Исследовать:\", \" нанять:\", \"Отправить ресурсы:\", \"NPC:\", \"Разрушить:\", \"Торжество:\"];\n\t\taLangGameText = [\" \", \"Торговцы\", \"ID\", \"Столица\", \"Время запуска\", \"временно не работает\", \"в\", \"Деревня\", \"Транспортировка\", \"из\", \"Транспортировка в\", \"Транспортировка из\", \"Отправка из\", \"ресурсы\", \"здание\", \"Построить новое здание\", \"пусто\", \"уровень\"];\n\t\taLangRaceName = [\"Римляне\", \"Германцы\", \"Галлы\"];\n\t\taLangTaskOfText = [\"Запланировать улучшение\", \"Запланировать новое здание\", \"Качать ресурсы\", \"Выкл\", \"(►)\", \"Вкл\", \"(■)\", \"Распределение полей в деревне: \", \"Автоотправка\", \"Автоотправка выкл.\", \"Вкл.\", \"Успешно отправлено\", \"/Задания/\", \"Лимит ввоза\", \"Нет\", \"Правка \", \"Дерево/Глина/Железо\", \"Зерно\", \"Запланировать разрушение\",\n\t\t\t\"Запланировать атаку\", \"Тип атаки\", \"Време в пути\", \"повторы\", \"через\", \"00:30:00\", \"Цель катов\", \"Случайно\", \"Неизвестно\", \" раз\", \"/\", \" :дата/время: \", \"Войска\",\n\t\t\t\"Запланировать найм\",\"Выбранное здание \", \"Обучение войск завершено\",\"Поставки\", \"Задать интревал обновления\", \"Это интервал обновления страницы ,\\n по умолчанию - 20 минут, Введите новое время:\\n\\n\", \"Лимит вывоза\", \"Запланировать празднование\", \"Малый праздник\", \"Большой праздник\", \"Установка интервала концентрации ресов\",\n\t\t\t\"минуты\", \"Выключен\", \"Включено\", \"(►)\", \"(■)\",\"Запланировать улучшение\",\"Улучшить атаку\",\"Улучшить защиту\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Недостаточно сырья\", \"Все строители сейчас заняты\", \"Это здание отстроено полностью\", \"Начинаю строительство\", \"Процесс развития\", \"Недостаточна вместимость склада\", \"Недостаточна вместимость амбара\", \"Достаточно ресурсов\", \"Недостаток продовольствия: развивайте фермы.\",\"Проводится торжество\"];\n\t\taLangOtherText = [\"Важные заметки\", \"Только в столице поля могут быть до уровня 20.<br/>Столица не определена.Зайдите в профиль\", \"Ссылка тут ^_^\", \"<br/>Настройка завершена\", \"Отменено\", \"Начать задачи\", \" Улучшение прошло успешно\", \"Успешно\", \"Ваш народ неопределен.Пожалуйста зайдите в профиль.\", \"Также пожалуйста зайдите в таверну<br/>для определения типа и скорости героя\"];\n\t\taLangResources = [\"Древесина\",\"Глина\",\"Железо\",\"Зерно\"];\n\t\taLangTroops[0] = [\"Легионер\", \"Преторианец\", \"Империанец\", \"Конный разведчик\", \"Конница императора\", \"Конница Цезаря\", \"Таран\", \"Огненная катапульта\", \"Сенатор\", \"Поселенец\", \"Герой\"];\n\t\taLangTroops[1] = [\"Дубинщик\", \"Копьеносец\", \"Топорщик\", \"Скаут\", \"Паладин\", \"Тевтонская конница\", \"Стенобитное орудие\", \"Катапульта\", \"Вождь\", \"Поселенец\", \"Герой\"];\n\t\taLangTroops[2] = [\"Фаланга\", \"Мечник\", \"Следопыт\", \"Тевтатский гром\", \"Друид-всадник\", \"Эдуйская конница\", \"Таран\", \"Требушет\", \"Предводитель\", \"Поселенец\", \"Герой\"];\n\t\taLangAttackType = [\"Подкрепление\", \"Нападение\", \"Набег\"];\n\t\tbreak; \n\n\tcase \"rs\": // by rsinisa\n\t\taLangAllBuildWithId = [\"Дрвосеча\", \"Рудник глине\", \"Рудник гвожђа\", \"Њива\", \"\", \"Пилана\", \"Циглана\", \"Ливница гвожђа\", \"Млин\", \"Пекара\", \"Складиште\", \"Силос\", \"Ковачница оружја\", \"Ковачница оклопа\", \"Витешка арена\", \"Главна зграда\", \"Место окупљања\", \"Пијаца\", \"Амбасада\", \"Касарна\", \"Штала\", \"Радионица\", \"Академија\", \"Склониште\", \"Општина\", \"Резиденција\", \"Палата\", \"Ризница\", \"Трговачки центар\", \"Велика касарна\", \"Велика штала\", \"Градски зид\", \"Земљани зид\", \"Палисада\", \"Каменорезац\", \"Пивница\", \"Постављач замки\",\"Дворац хероја\", \"Велико складиште\", \"Велики силос\", \"Светско чудо\", \"Појилиште\"];\n\t\taLangAllBuildAltWithId = [\"Дрвосеча\", \"Рудник глине\", \"Рудник гвожђа\", \"Њива\", \"\", \"Пилана\", \"Циглана\", \"Ливница гвожђа\", \"Млин\", \"Пекара\", \"Складиште\", \"Силос\", \"Ковачница оружја\", \"Ковачница оклопа\", \"Витешка арена\", \"Главна зграда\", \"Место окупљања\", \"Пијаца\", \"Амбасада\", \"Касарна\", \"Штала\", \"Радионица\", \"Академија\", \"Склониште\", \"Општина\", \"Резиденција\", \"Палата\", \"Ризница\", \"Трговачки центар\", \"Велика касарна\", \"Велика штала\", \"Градски зид\", \"Земљани зид\", \"Палисада\", \"Каменорезац\", \"Пивница\", \"Постављач замки\",\"Дворац хероја\", \"Велико складиште\", \"Велики силос\", \"Светско чудо\", \"Појилиште\"];\n\t\taLangAddTaskText = [\"Додај задатак\", \"Начин\", \"Активна села\", \"Задата мета\", \"на\", \"Мод\", \"Подршка изградње\", \"Концентрација ресурса\", \"Помери горе\", \"Помери доле\", \"Бриши\", \" Списак задатака\", \"Помери \", \"Обриши све задатке\"];\n\t\taLangTaskKind = [\"Надогради\", \"Нова градња\", \"Напад\", \"Истраживање\", \"Обучи\", \"Транспорт\", \"НПЦ\", \"Рушити\", \"Забава\"];\n\t\taLangGameText = [\"ниво \", \"Трговци\", \"ID\", \"Главни град\", \"Време почетка\", \"ово временско подешавање је бескорисно\", \" према\", \"Село\", \"транспорт\", \"из\", \"Пребацивање према\", \"Пребацивање из\", \"повратак из\", \"ресурси\", \"изградња\", \"Направи нову зграду\", \"празно\", \"ниво\"];\n\t\taLangRaceName = [\"Римљани\", \"Тевтонци\", \"Гали\"];\n\t\taLangTaskOfText = [\"Распоред за надоградњу\", \"Направи нови распоред\", \"Ауто надоградња ресурса\", \"Неактивно\", \"Покрени\", \"Активно\", \"Заустави\", \"Дистрибуција ресурсних поља овог села је \", \"Аутотранспорт\", \"Аутотранспорт није отворен\", \"Отворен\", \"Транспорт успешан\", \"Листа задатака\", \"Транспорт са лимитом\", \"Подразумевано\", \"Измени\", \"Дрво/Гллина/Гвожђе\", \"Њива\", \"Листа рушења\", \"Листа напада\", \"Врста напада\", \"Време превоза\", \"број понављања\", \"Временски интервал\",\"00:30:00\",\"Мета катапулта\",\"Насумично\", \"Непознат\", \" пута\", \". месец, \", \". дан, у \", \"Слање трупа\", \"Листа обуке\",\"Место обуке\",\"Тренинг задатак урадити\",\"прилагођен транспорт\",\"подеси време поновног учитавања \",\" ово је интервал поновног учитавања стране, \\n подразумевана вредност је 20 минута, молимо Вас убаците ново време:\\n \\n\",\"Остатак одлазног транспорта\",\"Листа забава\",\"мала забава\",\"велика забава\",\" Подесите интервал концентрације ресурса \", \"минути\", \"заустављено\", \"активно\", \"покрени\", \"паузирај\",\"Распоред унапређења\",\"Унапреди напад\",\"Унапреди одбрану\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Премало ресурса.\", \"Радници су већ на послу.\", \"Изградња завршена\", \"Покретање изградње\", \"У изградњи\", \"Складиште је премало. Проширите складиште како би наставили са изградњом\", \"Силос је премали. Проширите силос како би наставили са изградњом\", \"Довољно ресурса\",\"Премало жита: прошири прво њиве\",\"Прослава је већ у току\"];\n\t\taLangOtherText = [\"Важна напомена\", \"Само у главном граду ресурсна поља могу бити проширена на ниво 20. Твој главни град није детектован, погледај свој профил.\", \"Пречица овде ^_^\", \"Подешавања готова\", \"Отказано\", \"Покрени задатке\", \"Надоградња успешна\", \"Покретање успешно\", \"Ваше племе је непознато, стога и врста трупа. Погледајте свој профил да видите који сте народ.\",\"Такође посетите дворац хероја да сазнате брзину и тип свог хероја \"];\n\t\taLangResources=[\"дрво\",\"глина\",\"гвожђе\",\"жито\"];\n\t\taLangTroops[0] = [\"Легионар\", \"Преторијанац\", \"Империјанац\", \"Извиђач\", \"Императорова коњица\", \"Цезарева коњица\", \"Ован\", \"Ватрени катапулт\", \"Сенатор\", \"Насељеник\", \"Херој\"];\n\t\taLangTroops[1] = [\"Батинар\", \"Копљаник\", \"Секираш\", \"Извиђач\", \"Паладин\", \"Тевтонски витез\", \"Ован\", \"Катапулт\", \"Поглавица\", \"Насељеник\", \"Херој\"];\n\t\taLangTroops[2] = [\"Фаланга\", \"Мачевалац\", \"Извиђач\", \"Галски витез\", \"Друид\", \"Коњаник\", \"Ован\", \"Катапулт\", \"Старешина\", \"Насељеник\", \"Херој\"];\n\t\taLangAttackType = [\"Појачање\", \"Нормалан\", \"Пљачка\"];\n\t\tbreak;\n\n\tcase \"ba\": // thanks ieyp\n\t\taLangAllBuildWithId = [\"Drvosječa\", \"Rudnik gline\", \"Rudnik željeza\", \"Poljoprivredno imanje\", \"\", \"Pilana\", \"Ciglana\", \"Livnica\", \"Mlin\", \"Pekara\", \"Skladište\", \"Silos\", \"Oruzarnica\", \"Kovacnica oklopa\", \"Mejdan\", \"Glavna zgrada\", \"Mesto okupljanja\", \"Pijaca\", \"Ambasada\", \"Kasarna\", \"Stala\", \"Radionica\", \"Akademija\", \"Skloniste\", \"Opstina\", \"Rezidencija\", \"Palata\", \"Riznica\", \"Trgovacki centar\", \"Velika kasarna\", \"Velika stala\", \"Gradski zid\", \"Zemljani zid\", \"Taraba\", \"Kamenorezac\", \"Pivnica\", \"Zamkar\",\"Dvorac heroja\", \"Veliko skladiste\", \"Veliki silos\", \"WW\", \"Pojiliste\"];\n\t\taLangAllBuildAltWithId = [\"Drvosječa\", \"Rudnik gline\", \"Rudnik željeza\", \"Poljoprivredno imanje\", \"\", \"Pilana\", \"Ciglana\", \"Livnica\", \"Mlin\", \"Pekara\", \"Skladište\", \"Silos\", \"Oruzarnica\", \"Kovacnica oklopa\", \"Mejdan\", \"Glavna zgrada\", \"Mesto okupljanja\", \"Pijaca\", \"Ambasada\", \"Kasarna\", \"Stala\", \"Radionica\", \"Akademija\", \"Skloniste\", \"Opstina\", \"Rezidencija\", \"Palata\", \"Riznica\", \"Trgovacki centar\", \"Velika kasarna\", \"Velika stala\", \"Gradski zid\", \"Zemljani zid\", \"Taraba\", \"Kamenorezac\", \"Pivnica\", \"Zamkar\",\"Dvorac heroja\", \"Veliko skladiste\", \"Veliki silos\", \"WW\", \"Pojiliste\"];\n\t\taLangAddTaskText = [\"Dodaj zadatak\", \"Nacin\", \"Aktivna sela\", \"Zadata meta\", \"Prema\", \"Mod\", \"Podrska izgradnje\", \"Koncentracija resursa\", \"Pomeri gore\", \"Pomeri dole\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Pomeri \", \"Obrisi sve zadatke\"];\n\t\taLangTaskKind = [\"Unapredi\", \"Nova izgradnja\", \"Napad\", \"Istrazivanje\", \"Obuci\", \"Transport\", \"NPC\", \"Rusiti\", \"Zabava\"];\n\t\taLangGameText = [\"Lvl\", \"Trgovci\", \"ID\", \"Glavni grad\", \"Vreme pocetka\", \"ovo vremensko podesavanje je beskorisno\", \"prema\", \"Selo\", \"transport\", \"iz\", \"Prebacivanje prema\", \"Prebacivanje iz\", \"povratak iz\", \"resursi\", \"izgradnja\", \"Napravi novu zgradu\", \"prazno\", \"nivo\"];\n\t\taLangRaceName = [\"Rimljani\", \"Teutonci\", \"Gali\"];\n\t\taLangTaskOfText = [\"Raspored za nadogradnju\", \"Napravi novi raspored\", \"AutoResUpD\", \"Not_run\", \"Pokreni\", \"Pokrenuto\", \"Zaustavi\", \"Distribucija resursnih polja ovog sela je \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Transport sa limitom\", \"Podrazumevano\", \"Izmeni\", \"Drvo/Glina/Gvozdje\", \"Njiva\", \"Lista rusenja\",\n\t\t\t\"Lista napada\", \"Vrsta napada\", \"Vreme prevoza\", \"broj ponavljanja\", \"Vremenski interval\",\"00:30:00\",\"Meta katapulta\",\"Nasumicno\", \"Nepoznat\", \"times\", \"Mesec\", \"Dan\", \"Slanje trupa\", \"Lista obuke\",\"Mesto obuke\",\"TreningZadatak uraditi\",\"prilagodenTransport\",\"podesi vreme ponovnog ucitavanja \",\" ovo je interval ponovnog ucitavanja strane, \\n podrazumevan vrednost je 20 minuta, molimo vas ubacite novo vreme:\\n \\n\",\"Trans_Out_Rmn\",\"Lista zabava\",\"mala zabava\",\"velika zabava\",\" Podesite interval koncentracie resursa \",\n\t\t\t\"minuti\", \"zaustavljanje\", \"pokrece se\", \"pokreni\", \"pauza\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Premalo resursa. Buahaha :D\", \"Radnici su vec na poslu :P\", \"Izgradnja zavrsena\", \"Pokretanje izgradnje\", \"U izgradnji\", \"Skladiste je premalo. Prosirite skladiste kako bi nastavili sa izgradnjom\", \"Silos je malecak. Prosirite silos kako bi nastavili sa izgradnjom\", \"Dovoljno resursa\",\"Premalo zita, prvo prosiri njive\",\"Proslava je u toku\"];\n\t\taLangOtherText = [\"Vazna napomena\", \"Samo u glavnom gradu mozete <br/> prosiriti resursna polja preko nivoa 10. Tvoj glavni grad <br/> nije otkriven, poseti svoj profil.\", \"Precica ovde ^^\", \"Podesavanja gotova\", \"Otkazano\", \"Pokreni zadatke\", \"Nadogradnja uspesna\", \"Pokretanje uspesno\", \"Vase pleme je nepoznato, stoga I tip trupa. Posetite <br/> svoj profil da vidite pleme. <br/>\",\"Posetite dvorac heroja da saznate <br/> brzinu I tip svog heroja \"];\n\t\taLangResources=[\"drvo\",\"glina\",\"gvozdje\",\"zito\"];\n\t\taLangTroops[0] = [\"Legionar\", \"Pretorijanac\", \"Imperijanac\", \"Izvidjac\", \"Imperatorova konjica\", \"Cezareva konjica\", \"Ovan\", \"Vatreni katapult\", \"Senator\", \"Naseljenik\", \"Heroj\"];\n\t\taLangTroops[1] = [\"Batinar\", \"Kopljanik\", \"Sekiras\", \"Izvidjac\", \"Paladin\", \"Tetutonski vitez\", \" Ovan \", \"Katapult\", \"Poglavica\", \"Naseljenik\", \"Heroj\"];\n\t\taLangTroops[2] = [\"Falanga\", \"Macevalac\", \"Izvidjac\", \"Teutateov grom\", \"Druid\", \"Heduan\", \" Ovan \", \"Katapult\", \"Staresina\", \"Naseljenik\", \"Heroj\"];\n\t\taLangAttackType = [\"Pojacanje\", \"Normalan\", \"Pljacka\"];\n\t\tbreak;\n\n\tcase \"org\":\n\tcase \"de\": // by LohoC et al.\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Rüstungsschmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Rüstungsschmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAddTaskText = [\"Aufgabe hinzufügen\",\"Style\",\"Aktives Dorf\",\"Aufgaben Ziel\",\"nach\",\"Modus\",\"Baubetreuung\",\"Ressourcenkonzentration\",\"Rauf\",\"Runter\",\"Entfernen\",\" Aufgaben Inhalte\",\"Bewegen \",\"alle Aufgaben Löschen\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\",\"Neues Gebäude\",\"Angriff\",\"Forschung\",\"ausbilden\",\"Transport\",\"NPC\",\"Zerstören\",\"Fest\"];\n\t\t\t\taLangGameText = [\"Lvl\",\"Händler\",\"ID\",\"Hauptdorf\",\"Startzeit\",\"diese Zeiteinstellung ist nicht sinnvoll.\",\"nach\",\"Dorf\",\"Transport\",\"von\",\"Transport nach\",\"Transport von\",\"Rückkehr aus\",\"Rohstoffe\",\"Gebäude\",\"Neues Gebäude errichten\",\"leer\",\"Stufe\"];\n\t\t\t\taLangRaceName = [\"Römer\",\"Germane\",\"Gallier\"];\n\t\t\t\taLangTaskOfText = [\"Zeitplan Upgrade\",\"Zeitplan Neu Bauen\",\"AutoResRauf\",\"Pausiert\",\"Start\",\"Laufend\",\"Unterbrechen\",\"Es wird Gebaut \",\"Autotransport\",\"Autotransport ist nicht An\",\"AN\",\"Transport Erfolgreich\",\"Aufgabenliste\",\"Transportlimit (-)\",\"Vorgabe\",\"Ändern \",\"Holz/Lehm/Eisen\",\"G3D\",\"Zeitplan Abriss\",\n\t\t\t\t\t\"Zeitplan Angriff\",\"Angriffsart\",\"Laufzeit\",\"Wiederholungen\",\"Intervalzeit\",\"00:30:00\",\"Katapultziel\",\"Zufall\",\"Unbekannt\",\"mal\",\"Monat\",\"Tag\",\"Truppen senden\",\"Zeitplan Ausbildung\",\"Ausbildungsseite\",\"Ausbildungsauftrag abgeschlossen\",\"Manueller Transport\",\"Setzte Intervalzeit für Reload\",\"Dies ist der Interval zum Seitenreload ,\\n Standard sind 20 Minuten, Bitte trage eine neue ein:\\n\\n\",\"Transportlimit (+)\",\"Partyplanung\",\"Kleine Party\",\"Große Party\",\"Setzte den Interval der Ressourcenkonzentration\",\n\t\t\t\t\t\"Minuten\",\".\",\".\",\"START\",\"STOP\",\"Zeitplan Verbessern\",\"Angriff verbessern\",\"Verteidigung verbessern\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Zu wenig Rohstoffe\",\"Es wird bereits gebaut\",\"vollständig ausgebaut\",\"Starte Konstruktion\",\"In Entwicklung\",\"Zuerst Rohstofflager ausbauen\",\"Zuerst Kornspeicher ausbauen\",\"Genug Rohstoffe\",\"Nahrungsmangel: Erst eine Getreidefarm ausbauen\",\"Es wird bereits gefeiert.\"];\n\t\t\t\taLangOtherText = [\"Wichtige Notiz\",\"Nur die Ressourcenfelder der Hauptstadt können<br/>bis Stufe 20 ausgebaut werden. Zur zeit ist deine Hauptstadt<br/>nicht identifiziert. Bitte besuche dein Profil.\",\"Shortcut here ^_^\",\"Setup fertiggestellt\",\"Abgebrochen\",\"Starte die Aufgaben\",\"Upgrade war erfolgreich\",\"Starten war erfolgreich\",\"Deine Rasse ist unbekannt.<br/>Bitte besuche dein Profil.<br/>\",\"Bitte besuche auch deinen Heldenhof um<br/>die Geschwindigkeit und die Art deines Helden zu bestimmen.\"];\n\t\t\t\taLangResources = [\"Holz\",\"Lehm\",\"Eisen\",\"Getreide\"];\n\t\t\t\taLangTroops[0] = [\"Legionär\",\"Prätorianer\",\"Imperianer\",\"Equites Legati\",\"Equites Imperatoris\",\"Equites Caesaris\",\"Rammbock\",\"Feuerkatapult\",\"Senator\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[1] = [\"Keulenschwinger\",\"Speerkämpfer\",\"Axtkämpfer\",\"Kundschafter\",\"Paladin\",\"Teutonen Reiter\",\"Ramme\",\"Katapult\",\"Stammesführer\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\",\"Schwertkämpfer\",\"Späher\",\"Theutates Blitz\",\"Druidenreiter\",\"Haeduaner\",\"Rammholz\",\"Kriegskatapult\",\"Häuptling\",\"Siedler\",\"Held\"];\n\t\t\t\taLangAttackType = [\"Unterstützung\",\"Angriff: Normal\",\"Angriff: Raubzug\"];\n\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Schmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Schmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAddTaskText = [\"Aufgabe hinzufügen\",\"Style\",\"Aktives Dorf\",\"Aufgaben Ziel\",\"nach\",\"Modus\",\"Baubetreuung\",\"Ressourcenkonzentration\",\"Rauf\",\"Runter\",\"Entfernen\",\" Aufgaben Inhalte\",\"Bewegen \",\"alle Aufgaben Löschen\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\",\"Neues Gebäude\",\"Angriff\",\"Forschung\",\"ausbilden\",\"Transport\",\"NPC\",\"Zerstören\",\"Fest\"];\n\t\t\t\taLangGameText = [\"Lvl\",\"Händler\",\"ID\",\"Hauptdorf\",\"Startzeit\",\"diese Zeiteinstellung ist nicht sinnvoll.\",\"nach\",\"Dorf\",\"Transport\",\"von\",\"Transport nach\",\"Transport von\",\"Rückkehr aus\",\"Rohstoffe\",\"Gebäude\",\"Neues Gebäude errichten\",\"leer\",\"Stufe\"];\n\t\t\t\taLangRaceName = [\"Römer\",\"Germane\",\"Gallier\"];\n\t\t\t\taLangTaskOfText = [\"Zeitplan Upgrade\",\"Zeitplan Neu Bauen\",\"AutoResRauf\",\"Pausiert\",\"Start\",\"Laufend\",\"Unterbrechen\",\"Es wird Gebaut \",\"Autotransport\",\"Autotransport ist nicht An\",\"AN\",\"Transport Erfolgreich\",\"Aufgabenliste\",\"Transportlimit (-)\",\"Vorgabe\",\"Ändern \",\"Holz/Lehm/Eisen\",\"G3D\",\"Zeitplan Abriss\",\n\t\t\t\t\t\"Zeitplan Angriff\",\"Angriffsart\",\"Laufzeit\",\"Wiederholungen\",\"Intervalzeit\",\"00:30:00\",\"Katapultziel\",\"Zufall\",\"Unbekannt\",\"mal\",\"Monat\",\"Tag\",\"Truppen senden\",\"Zeitplan Ausbildung\",\"Ausbildungsseite\",\"Ausbildungsauftrag abgeschlossen\",\"Manueller Transport\",\"Setzte Intervalzeit für Reload\",\"Dies ist der Interval zum Seitenreload ,\\n Standard sind 20 Minuten, Bitte trage eine neue ein:\\n\\n\",\"Transportlimit (+)\",\"Partyplanung\",\"Kleine Party\",\"Große Party\",\"Setzte den Interval der Ressourcenkonzentration\",\n\t\t\t\t\t\"Minuten\",\".\",\".\",\"START\",\"STOP\",\"Zeitplan Verbessern\",\"Angriff verbessern\",\"Verteidigung verbessern\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Zu wenig Rohstoffe\",\"Es wird bereits gebaut\",\"vollständig ausgebaut\",\"Starte Konstruktion\",\"In Entwicklung\",\"Zuerst Rohstofflager ausbauen\",\"Zuerst Kornspeicher ausbauen\",\"Genug Rohstoffe\",\"Nahrungsmangel: Erst eine Getreidefarm ausbauen\",\"Es wird bereits gefeiert.\"];\n\t\t\t\taLangOtherText = [\"Wichtige Notiz\",\"Nur die Ressourcenfelder der Hauptstadt können<br/>bis Stufe 20 ausgebaut werden. Zur zeit ist deine Hauptstadt<br/>nicht identifiziert. Bitte besuche dein Profil.\",\"Shortcut here ^_^\",\"Setup fertiggestellt\",\"Abgebrochen\",\"Starte die Aufgaben\",\"Upgrade war erfolgreich\",\"Starten war erfolgreich\",\"Deine Rasse ist unbekannt.<br/>Bitte besuche dein Profil.<br/>\",\"Bitte besuche auch deinen Heldenhof um<br/>die Geschwindigkeit und die Art deines Helden zu bestimmen.\"];\n\t\t\t\taLangResources = [\"Holz\",\"Lehm\",\"Eisen\",\"Getreide\"];\n\t\t\t\taLangTroops[0] = [\"Legionär\",\"Prätorianer\",\"Imperianer\",\"Equites Legati\",\"Equites Imperatoris\",\"Equites Caesaris\",\"Rammbock\",\"Feuerkatapult\",\"Senator\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[1] = [\"Keulenschwinger\",\"Speerkämpfer\",\"Axtkämpfer\",\"Kundschafter\",\"Paladin\",\"Teutonen Reiter\",\"Ramme\",\"Katapult\",\"Stammesführer\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\",\"Schwertkämpfer\",\"Späher\",\"Theutates Blitz\",\"Druidenreiter\",\"Haeduaner\",\"Rammholz\",\"Kriegskatapult\",\"Häuptling\",\"Siedler\",\"Held\"];\n\t\t\t\taLangAttackType = [\"Unterstützung\",\"Angriff: Normal\",\"Angriff: Raubzug\"];\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'de\\' or \\'org\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\tcase \"ir\": // mrreza\n\t\taLangAllBuildWithId = [\"هیزم شکن\", \"آجرسازی\", \"معدن آهن\", \"گندم زار\", \"محل احداث ساختمان\", \"چوب بری\", \"آجرپزی\", \"ذوب آهن\", \"آسیاب\", \"نانوایی\", \"انبار\", \"انبار غذا\", \"آهنگری\", \"زره سازی\", \"میدان تمرین\", \"ساختمان اصلی\", \"اردوگاه\", \"بازار\", \"سفارت\", \"سربازخانه\", \"اصطبل\", \"کارگاه\", \"دارالفنون\", \"مخفیگاه\", \"تالار\", \"اقامتگاه\", \"قصر\", \"خزانه\", \"تجارتخانه\", \"سربازخانه‌ی بزرگ\", \"اصطبل بزرگ\", \"دیوار شهر\", \"دیوار گلی\", \"پرچین\", \"سنگ تراشی\", \"قهوه خانه\", \"تله ساز\",\"عمارت قهرمان\", \"انبار بزرگ\", \"انبارغذای بزگ\", \"شگفتی جهان\", \"آبشخور اسب\"];\n\t\taLangAllBuildAltWithId = [\"هیزم شکن\", \"آجر سازی\", \"معدن آهن\", \"گندم زار\", \"محل\", \"چوب بری\", \"آجرپزی\", \"ذوب آهن\", \"آسیاب\", \"نانوایی\", \"انبار\", \"انبارغذا\", \"آهنگری\", \"زره سازی\", \"میدان تمرین\", \"ساختمان اصلی\", \"اردوگاه\", \"بازار\", \"سفارت\", \"سربازخانه\", \"اصطبل\", \"کارگاه\", \"دارالفنون\", \"مخفیگاه\", \"تالار\", \"اقامتگاه\", \"قصر\", \"خزانه\", \"تجارتخانه\", \"سربازخانه‌ی بزرگ\", \"اصطبل بزرگ\", \"دیوار شهر\", \"دیوار گلی\", \"پرچین\", \"سنگ تراشی\", \"قهوه خانه\", \"تله ساز\",\"عمارت قهرمان\", \"انبار بزرگ\", \"انبار غذای بزرگ\", \" شگفتی جهان\", \"آبشخور اسب\"];\n\t\taLangAddTaskText = [\"اضافه کردن وظیفه\", \"شیوه\", \"دهکده فعال\", \"هدف کاری\", \"به سوی\", \"روش\", \"پشتیبانی از سازه ها\", \"ارسال معمولی (تمرکز منابع)\", \"بالا بردن\", \"پایین آوردن\", \"حذف\", \"&#160;&#160;&#160;محتوای وظیفه\", \"حرکت کردن\", \"پاک کردن تمام وظایف\"];\n\t\taLangTaskKind = [\"ارتقاء دادن\", \"بنای جدید\", \"حمله\", \"تحقیق\", \"تربیت کردن\", \"ارسال منابع\", \"تعدیل منابع\", \"تخریب کردن\", \"برگزاری جشن\"];\n\t\taLangGameText = [\"سطح\", \"بازرگانان\", \"شماره\", \"رئیس\", \"زمان شروع\", \"این تنظیم زمان در حال حاضر بی فایده است.\", \"به سوی\", \"دهکده\", \"انتقال دادن\", \"از\", \"ارسال به\", \"دریافت از\", \"بازگشت از\", \"منابع\", \"ساخنمان\", \"احداث ساختمان جدید\", \"خالی کردن\", \"سطح\" , \"منابع ارسال شدند.\"];\n\t\taLangRaceName = [\"رومی‌ها\" ,\"توتن‌ها\" ,\"گول‌ها\"];\n\t\taLangTaskOfText = [\"برنامه ارتقاء\", \"برنامه ساختمان جدید\", \"ارتقا خودکار منابع\", \"در حال اجرا نمی باشد\", \"شروع\", \"شروع شده\", \"معلق کردن\", \"جدول توزیع منابع در این روستا هست \", \"ارسال خودکار منابع\", \"حمل و نقل خودکار باز نمی باشد\", \"باز شده\", \"حمل و نقل با موفقیت\", \"لیست وظایف\", \"سقف ورود منابع\", \"پیشفرض\", \"اصلاح کردن\", \"چوب/خشت/آهن\", \"گندم\", \"برنامه تخریب\",\n\t\t\t\"برنامه حمله\", \"نوع حمله\", \"زمان سفر\", \"زمان تکرار\", \"فاصله زمانی\",\"00:30:00\",\"هدف منجنیق\",\"تصادفی\", \"نامعلوم\", \"زمان\", \"ماه\", \"روز\", \"سربازان فرستاده شدند\", \"برنامه آموزش\",\"محل آموزش\",\"وظیفه آموزش انجام شد\",\"ارسال سفارشی منابع\",\" فاصله زمانی از زمان راه اندازی مجدد\",\" این فاصله زمانی از صفحه بارگذاری شده است,\\n پیشفرض 20 دقیقه می باشد, لطفا مقدار جدید را وارد کنید زمان:\\n\\n\",\"سقف نگه داشتن منابع\",\"برنامه جشن\",\"جشن کوچک\",\"جشن بزرگ\",\" تنظیم فاصله زمانی حمل معمولی در قسمت ارسال خودکار\",\n\t\t\t\"دقیقه\", \"در حال مکث\", \"در حرکت\", \"ادامه دادن\", \"مکث\",\"ارتقا قدرت نظامی\",\"ارتقا قدرت حمله\",\"ارتقا قدرت دفاع\", \"کنترل سرریز منابع\", \"فعال\", \"غیر فعال\", \"ارتقا خودکار گندمزار\", \"تغییر\"];\n\t\taLangErrorText = [\"کمبود منابع.\", \"کارگران مشغول کار هستند.\", \"به سطح آخر ممکن رسید.\", \"ساخت و ساز شروع شد\", \"در حال توسعه\", \"اول انبار را ارتقا دهید.\", \"اول انبارغذا را ارتقا دهید.\", \"پیش نیازها:\",\"کمبود غذا: اول گندم زار را ارتقا دهید!\",\"در حال حاضر یک جشن در حال برگذاری است\",\"یک جشن هم‌اکنون در حال برگزاری است.\",\"در حال رسیدن به سطح نهایی خود می‌باشد.\"];\n\t\taLangOtherText = [\"توجه داشته باشید\", \"فقط منابع در دهکده پایتخت می توانند <br/>تا سطح 20 ارتقاء یابند. اکنون پایتخت شما<br/> تشخیص داده نشده است. لطفا از پروفایل خود دیدن کنید.\", \"دسترسی آسان در اینجا ^_^\", \"تنظیمات کامل شد\", \"لغو شد\", \"وظیفه آغاز شد\", \"با موفقیت انجام شد\" , \"حرکت با موفقیت انجام شد\", \"نژاد شما معلوم نیست, بنابراین نوع لشکرتون مشخص نیست. <br/>برای مشخص شدن نژادتون از پروفایل خود دیدن کنید.<br/>\", \"همچنین لطفا دیدن کنید از عمارت قهرمان برای مشخص شدن <br/> سطح و نوع آن.\" , \"ارتقاء\"];\n\t\taLangResources=[\"چوب\",\"خشت\",\"آهن\",\"گندم\"];\n\t\taLangTroops[0] = [\"سرباز لژیون\", \"محافظ\", \"شمشیرزن\", \"خبرچین\", \"شوالیه\", \"شوالیه سزار\", \"دژکوب\", \"منجنیق آتشین\", \"سناتور\", \"مهاجر\", \"قهرمان\"];\n\t\taLangTroops[1] = [\"گرزدار\", \"نیزه دار\", \"تبرزن\", \"جاسوس\", \"دلاور\", \"شوالیه‌ی توتن\", \"دژکوب\", \"منجنیق\", \"رئیس\", \"مهاجر\", \"قهرمان\"];\n\t\taLangTroops[2] = [\"سرباز پیاده\", \"شمشیرزن\", \"ردیاب\", \"رعد\", \"کاهن سواره\", \"شوالیه گول\", \"دژکوب\", \"منجنیق\", \"رئیس قبیله\", \"مهاجر\", \"قهرمان\"];\n\t\taLangAttackType = [\"پشتیبانی\", \"حمله عادی\", \"حمله غارت\"];\n\t\tbreak;\n\n\tcase \"ae\": // By Dream1, SnTraL (2011.02.24)\n\t\taLangAllBuildWithId = [\"الحطاب\", \"حفرة الطين\", \"منجم حديد\", \"حقل القمح\", \"\", \"معمل النجاره\", \"مصنع البلوك\", \"مصنع الحديد\", \"المطاحن\", \"المخابز\", \"المخزن\", \"مخزن الحبوب\", \"الحداد\", \"مستودع الدروع\", \"ساحة البطولة\", \"المبنى الرئيسي\", \"نقطة التجمع\", \"السوق\", \"السفارة\", \"الثكنه\", \"الإسطبل\", \"المصانع الحربية\", \"الأكاديمية الحربية\", \"المخبأ\", \"البلدية\", \"السكن\", \"القصر\", \"الخزنة\", \"المكتب التجاري\", \"الثكنة الكبيرة\", \"الإسطبل الكبير\", \"حائط المدينة\", \"الحائط الأرضي\", \"الحاجز\", \"الحجّار\", \"المعصرة\", \"الصياد\", \"قصر الأبطال\", \"المخزن الكبير\", \"مخزن الحبوب الكبير\", \"معجزة العالم\", \"بِئْر سقي الخيول\"];\n\t\taLangAllBuildAltWithId = [\"الحطاب\", \"حفرة الطين\", \"منجم حديد\", \"حقل القمح\", \"\", \"معمل النجاره\", \"مصنع البلوك\", \"مصنع الحديد\", \"المطاحن\", \"المخابز\", \"المخزن\", \"مخزن الحبوب\", \"الحداد\", \"مستودع الدروع\", \"ساحة البطولة\", \"المبنى الرئيسي\", \"نقطة التجمع\", \"السوق\", \"السفارة\", \"الثكنه\", \"الإسطبل\", \"المصانع الحربية\", \"الأكاديمية الحربية\", \"المخبأ\", \"البلدية\", \"السكن\", \"القصر\", \"الخزنة\", \"المكتب التجاري\", \"الثكنة الكبيرة\", \"الإسطبل الكبير\", \"حائط المدينة\", \"الحائط الأرضي\", \"الحاجز\", \"الحجّار\", \"المعصرة\", \"الصياد\", \"قصر الأبطال\", \"المخزن الكبير\", \"مخزن الحبوب الكبير\", \"معجزة العالم\", \"بِئْر سقي الخيول\"];\n\t\taLangAddTaskText = [\"أضافة مهمة\", \"النمط\", \"القرية النشطة\", \"المهمة المستهدفة\", \"الى\", \"نمط\", \"دعم للبناء\", \"تكثيف الموارد\", \"تحريك للاعلى\", \"تحريك للاسفل\", \"حذف\", \"&#160;&#160;&#160;محتوى المهمه\", \"تحريك \", \"حذف جميع المهام\"];\n\t\taLangTaskKind = [\"تطوير\", \"تشييد مبنى\", \"هجوم\", \"بحث\", \"تدريب\", \"نقل\", \"تاجر المبادله\", \"هدم\", \"الاحتفال\"];\n\t\taLangGameText = [\"مستوى\", \"التجار\", \"المعرف\", \"العاصمة\", \"بداية الوقت\", \"هذا الاعداد في الوقت الحالي عديم الفائدة.\", \" إلى\", \"القرية\", \"نقل\", \"من\", \"نقل الى\", \"نقل من\", \"العودة من\", \"الموارد\", \"المباني\", \"تشييد\", \"فارغ\", \"المستوى\"];\n\t\taLangRaceName = [\"الرومان\", \"الجرمان\", \"الإغريق\"];\n\t\taLangTaskOfText = [\"الجدول الزمني للترقية\", \"الجدول الزمني لبناء جديد\", \"التطوير التلقائي\", \"لايعمل\", \"بدأ\", \"أبتداء\", \"توقف مؤقتا\", \"الحقول / المباني توزيع لقرية \", \"النقل التلقائي\", \"لم يتم فتح النقل التلقائي\", \"فتح\", \"تم النقل بنجاح\", \"قائمة المهام\", \"Trans_In_limit\", \"أفتراضي\", \"تعديل\", \"خشب/طين/حديد\", \"قمح\", \"الجدول الزمني للهدم\",\n\t\t\t\"الجدول الزمني للهجوم\", \"نوع الهجوم\", \"وقت الذهاب\", \"عدد مرات التكرار\", \"الفاصل الزمني\",\"00:30:00\",\"هدف المقاليع\",\"عشوائي\", \"غير معروف\", \"مرات\", \"شهر\", \"يوم\", \"القوات ارسلت\", \"الجدول الزمني للتدريب\",\"مكان تدريب\",\"مهمة التدريب تمت\",\"الجدول الزمني للنقل\",\"إعداد الفاصل الزمني للتحديث\",\"هذا هو الفاصل الزمني لتحديث الصفحة ,\\n الافتراضي هو 20 دقيقة,يرجى وضع فاصل زمني جديد:\\n\\n\",\"Trans_Out_Rmn\",\"الجدول الزمني للإحتفال\",\"إحتفال صغير\",\"إحتفال كبير\",\"تعيين الفاصل الزمني لتركيز الموارد\",\n\t\t\t\"دقائق\", \"متوقف\", \"يعمل\", \"تشغيل\", \"أيقاف\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"الموارد قليلة جداً.\", \"العمال مشغولون الآن.\", \"البناء منجز\", \"بدء البناء\", \"في التطوير\", \"يجب رفع مستوى المخزن أولاً \", \"يجب رفع مستوى مخزن الحبوب أولاً \", \"الموارد كافية\",\"\",\"يوجد احتفال جارية بالفعل\"];\n\t\taLangOtherText = [\"ملاحظات هامه\", \"فقط حقول الموارد في العاصمة <br/>يتم ترقيتهم الى مستوى 20 .<br/> لم يتم معرفة العاصمه. يرجاء زيارة بطاقة العضويه.\", \"الاختصار هنا ^_^\", \"أكتمال الإعدادات\", \"ألغي\", \"بدء المهام\", \"تم التطوير بنجاح\", \"تم التشغيل بنجاح\", \"القبيلة غير معروفه, لابد من معرفة نوع القوات. <br/>يرجاء زيارة بطاقة العضويه لتحديد نوع القبيله.<br/>\", \"يرجاء ايضاً زيارة قصر الابطال<br/> لتحديد سرعة ونوع بطلك.\"];\n\t\taLangResources=[\"الخشب\",\"الطين\",\"الحديد\",\"القمح\"];\n\t\taLangTroops[0] = [\"جندي أول\", \" حراس الإمبراطور\", \"جندي مهاجم\", \"فرقة تجسس\", \"سلاح الفرسان\", \"فرسان القيصر\", \"الكبش\", \"المقلاع الناري\", \"حكيم\", \"مستوطن\", \"البطل\"]; //الرومان\n\t\taLangTroops[1] = [\"مقاتل بهراوة\", \"مقاتل برمح\", \"مقاتل بفأس\", \"الكشاف\", \"مقاتل القيصر\", \"فرسان الجرمان\", \"محطمة الأبواب\", \"المقلاع\", \"الزعيم\", \"مستوطن\", \"البطل\"]; //الجرمان\n\t\taLangTroops[2] = [\"الكتيبة\", \"مبارز\", \"المستكشف\", \"رعد الجرمان\", \"فرسان السلت\", \"فرسان الهيدوانر\", \"محطمة الأبواب الخشبية\", \"المقلاع الحربي\", \"رئيس\", \"مستوطن\", \"البطل\"]; //الإغريق\n\t\taLangAttackType = [\"مساندة\", \"هجوم: كامل\", \"هجوم: للنهب\"];\n\t\tbreak;\n\n\tcase \"gr\": // by adonis_gr (2011.03.30)\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Οπλοποιείο\", \"Πανοπλοποιείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκεντρώσεως\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Οπλοποιείο\", \"Πανοπλοποιείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκέντρωσης\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAddTaskText = [\"Προσθηκη Εργασίας\", \"Style\", \"Ενεργό χωριό\", \"στοχος εργασίας\", \"Προς\", \"λειτουργία\", \"Construction support\", \"Resources concentration\", \"Μετακίνηση πάνω\", \"Μετακίνηση κάτω\", \"Διαγραφή\", \" Περιεχομενο εργασιών\", \"Move \", \"Διαγραφή όλων των εργασιών\"];\n\t\t\t\taLangTaskKind = [\"αναβάθμισης\", \"Κατασκευή κτηρίου\", \"Επίθεση\", \"Έρευνα\", \"εκπαίδευση\", \"αποστολή\", \"NPC\", \"κατεδάφιση\", \"γιορτή\"];\n\t\t\t\taLangGameText = [\"επίπεδο\", \"Έμποροι\", \"ID\", \"Πρωτεύουσα\", \"Start time\", \"this timeseting is unuseful now.\", \"προς\", \"χωριό\", \"αποστολή\", \"από\", \"αποστολή προς\", \"αποστολή απο\", \"Επιστροφή απο\", \"πρώτες ύλες\", \"κτήριο\", \"Κατασκευή νέου κτηρίου\", \"κενό\", \"επίπεδο\"];\n\t\t\t\taLangRaceName = [\"Ρωμαίοι\", \"Τεύτονες\", \"Γαλάτες\"];\n\t\t\t\taLangTaskOfText = [\"Πρόγραμμα αναβάθμισης\", \"Πρόγραμμα Κατασκευή νέου κτηρίου\", \"Αυτοματη Αναβ. Υλών\", \"Not_run\", \"Έναρξη\", \"Ξεκίνησε\", \"Αναστολή\", \"The resource fields distribution of this village is \", \"Αυτοματη αποστολή\", \"αύτοματη αποστολή είναι ανενεργή\", \"Ανοιχτό\", \"αποστολή επιτυχής\", \"Λίστα Εργασιών\", \"Trans In limit\", \"Προεπιλογή\", \"Τροποποίηση\", \"Ξύλο/Πηλός/Σιδήρος\", \"Σιτάρι\", \"Πρόγραμμα κατεδάφισης\",\n\t\t\t\t\t\t\"Προγραμματισμος επίθεσης\", \"Τυπος επίθεσης\", \"διάρκεια\", \"επανάληψεις\", \"Ενδιάμεσο χρονικό διάστημα\", \"00:30:00\", \"Στόχος καταπέλτη\", \"Τυχαίος\", \"Άγνωστο\", \"φορές\", \"Μήνας\", \"Ημέρα\", \"Στρατεύματα εστάλησαν\",\n\t\t\t\t\t\t\"Προγραμματησμος εκπαίδευσης\", \"Μέρος εκπαίδευσης\", \"εκπαίδευση Ολοκληρώθηκε\", \"προσαρμοσμένη αποστολή\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"Προγραμματισμος γιορτων\", \"Μικρή γιορτή\", \"Μεγάλη Γιορτή\", \"Set Interval of Resources concentration\",\n\t\t\t\t\t\t\"λεπτά\", \".\", \".\", \"Έναρξη\", \"Διακοπή\", \"Schedule Improve\", \"Βελτίωση Επίθεσης\", \"Βελτίωση άμυνας\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Πάρα πολύ λίγες πρώτες ύλες\", \"Ήδη εκτελούνται εργασίες\", \"Κατασκευή ολοκληρώθηκε\", \"Εναρξη Κατασκευής\", \"Σε εξέλιξη\", \"Η Αποθήκη πρώτων υλών σας ειναι πολύ μικρή. Παρακαλώ αναβάθμιστε την Αποθήκη πρώτων υλών για να συνεχιστεί η κατασκευή σας\", \"Η Σιταποθήκη σας ειναι πολύμικρή. Παρακαλώ αναβάθμιστε την σιταποθήκη για να συνεχιστεί η κατασκευή σας\", \"Αρκετες Πρώτες ύλες\", \"Έλλειψη τροφής: Αναβαθίστε πρώτα ενα Χωράφι σιταριού\", \"Πραγματοποιείται ήδη μία γιορτή\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Μονο οι ύλες της Πρωτεύουσας μπορούν να αναβάθμιστουν στο επίπεδο 20. Now your Πρωτεύουσα is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Ακυρωμένο\", \"Έναρξη των εργασιών\", \"Επιτυχής αναβάθμιση\", \"Εκτελέστηκε με επιτυχία\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Περιοχή ηρώων to determine the speed and the type of your hero.\"];\n\t\t\t\taLangResources = [\"Ξύλο\", \"Πηλός\", \"Σίδερο\", \"Σιτάρι\"];\n\t\t\t\taLangTroops[0] = [\"Λεγεωνάριοι\", \"Πραιτοριανός\", \"Ιμπεριανός\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Πολιορκητικός κριός\", \"Καταπέλτης φωτιάς\", \"Γερουσιαστής\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Μαχητές με ρόπαλα\", \"Μαχητής με Ακόντιο\", \"Μαχητής με Τσεκούρι\", \"Ανιχνευτής\", \"Παλατινός\", \"Τεύτονας ιππότης\", \"Πολιορκητικός κριός\", \"Καταπέλτης\", \"Φύλαρχος\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Φάλαγγες\", \"Μαχητής με Ξίφος\", \"Ανιχνευτής\", \"Αστραπή του Τουτατή\", \"Δρυίδης\", \"Ιδουανός\", \"Πολιορκητικός κριός\", \"Πολεμικός καταπέλτης\", \"Αρχηγός\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Ενίσχυση\", \"Επίθεση: Κανονική\", \"Επίθεση: Επιδρομή\"];\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Σιδηρουργείο\", \"Σιδηρουργείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκεντρώσεως\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Σιδηρουργείο\", \"Σιδηρουργείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκέντρωσης\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAddTaskText = [\"Προσθηκη Εργασίας\", \"Style\", \"Ενεργό χωριό\", \"στοχος εργασίας\", \"Προς\", \"λειτουργία\", \"Construction support\", \"Resources concentration\", \"Μετακίνηση πάνω\", \"Μετακίνηση κάτω\", \"Διαγραφή\", \" Περιεχομενο εργασιών\", \"Move \", \"Διαγραφή όλων των εργασιών\"];\n\t\t\t\taLangTaskKind = [\"αναβάθμισης\", \"Κατασκευή κτηρίου\", \"Επίθεση\", \"Έρευνα\", \"εκπαίδευση\", \"αποστολή\", \"NPC\", \"κατεδάφιση\", \"γιορτή\"];\n\t\t\t\taLangGameText = [\"επίπεδο\", \"Έμποροι\", \"ID\", \"Πρωτεύουσα\", \"Start time\", \"this timeseting is unuseful now.\", \"προς\", \"χωριό\", \"αποστολή\", \"από\", \"αποστολή προς\", \"αποστολή απο\", \"Επιστροφή απο\", \"πρώτες ύλες\", \"κτήριο\", \"Κατασκευή νέου κτηρίου\", \"κενό\", \"επίπεδο\"];\n\t\t\t\taLangRaceName = [\"Ρωμαίοι\", \"Τεύτονες\", \"Γαλάτες\"];\n\t\t\t\taLangTaskOfText = [\"Πρόγραμμα αναβάθμισης\", \"Πρόγραμμα Κατασκευή νέου κτηρίου\", \"Αυτοματη Αναβ. Υλών\", \"Not_run\", \"Έναρξη\", \"Ξεκίνησε\", \"Αναστολή\", \"The resource fields distribution of this village is \", \"Αυτοματη αποστολή\", \"αύτοματη αποστολή είναι ανενεργή\", \"Ανοιχτό\", \"αποστολή επιτυχής\", \"Λίστα Εργασιών\", \"Trans In limit\", \"Προεπιλογή\", \"Τροποποίηση\", \"Ξύλο/Πηλός/Σιδήρος\", \"Σιτάρι\", \"Πρόγραμμα κατεδάφισης\",\n\t\t\t\t\t\t\"Προγραμματισμος επίθεσης\", \"Τυπος επίθεσης\", \"διάρκεια\", \"επανάληψεις\", \"Ενδιάμεσο χρονικό διάστημα\", \"00:30:00\", \"Στόχος καταπέλτη\", \"Τυχαίος\", \"Άγνωστο\", \"φορές\", \"Μήνας\", \"Ημέρα\", \"Στρατεύματα εστάλησαν\",\n\t\t\t\t\t\t\"Προγραμματησμος εκπαίδευσης\", \"Μέρος εκπαίδευσης\", \"εκπαίδευση Ολοκληρώθηκε\", \"προσαρμοσμένη αποστολή\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"Προγραμματισμος γιορτων\", \"Μικρή γιορτή\", \"Μεγάλη Γιορτή\", \"Set Interval of Resources concentration\",\n\t\t\t\t\t\t\"λεπτά\", \".\", \".\", \"Έναρξη\", \"Διακοπή\", \"Schedule Improve\", \"Βελτίωση Επίθεσης\", \"Βελτίωση άμυνας\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Πάρα πολύ λίγες πρώτες ύλες\", \"Ήδη εκτελούνται εργασίες\", \"Κατασκευή ολοκληρώθηκε\", \"Εναρξη Κατασκευής\", \"Σε εξέλιξη\", \"Η Αποθήκη πρώτων υλών σας ειναι πολύ μικρή. Παρακαλώ αναβάθμιστε την Αποθήκη πρώτων υλών για να συνεχιστεί η κατασκευή σας\", \"Η Σιταποθήκη σας ειναι πολύμικρή. Παρακαλώ αναβάθμιστε την σιταποθήκη για να συνεχιστεί η κατασκευή σας\", \"Αρκετές πρώτες\", \"Έλλειψη τροφής : Αναβαθμίστε πρώτα ένα χωράφι σιταριού\", \"Πραγματοποιείται ήδη μία γιορτή\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Μονο οι ύλες της Πρωτεύουσας μπορούν να αναβάθμιστουν στο επίπεδο 20. Now your Πρωτεύουσα is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Ακυρωμένο\", \"Έναρξη των εργασιών\", \"Επιτυχής αναβάθμιση\", \"Εκτελέστηκε με επιτυχία\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Περιοχή ηρώων to determine the speed and the type of your hero.\"];\n\t\t\t\taLangResources = [\"Ξύλο\", \"Πηλός\", \"Σίδερο\", \"Σιτάρι\"];\n\t\t\t\taLangTroops[0] = [\"Λεγεωνάριοι\", \"Πραιτοριανός\", \"Ιμπεριανός\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Πολιορκητικός κριός\", \"Καταπέλτης φωτιάς\", \"Γερουσιαστής\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Μαχητές με ρόπαλα\", \"Μαχητής με Ακόντιο\", \"Μαχητής με Τσεκούρι\", \"Ανιχνευτής\", \"Παλατινός\", \"Τεύτονας ιππότης\", \"Πολιορκητικός κριός\", \"Καταπέλτης\", \"Φύλαρχος\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Φάλαγγες\", \"Μαχητής με Ξίφος\", \"Ανιχνευτής\", \"Αστραπή του Τουτατή\", \"Δρυίδης\", \"Ιδουανός\", \"Πολιορκητικός κριός\", \"Πολεμικός καταπέλτης\", \"Αρχηγός\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Ενίσχυση\", \"Επίθεση: Κανονική\", \"Επίθεση: Επιδρομή\"];\n\t\t\t\tbreak;\n\t\t}\n}\n\nJOINEDaLangAllBuildWithId = aLangAllBuildWithId.slice(0) ;\nJOINEDaLangAllBuildWithId = cleanString(JOINEDaLangAllBuildWithId);\n\t\t\nJOINEDaLangAllBuildAltWithId = aLangAllBuildAltWithId.slice(0);\nJOINEDaLangAllBuildAltWithId = cleanString(JOINEDaLangAllBuildAltWithId);\ninitializeLangSpecificDependentVars();\n\n}", "onLanguageClicked(){\r\n\r\n }", "translate(itemName){\n\t\titemName = this.idCorrection(itemName);\n\t\tvar res=\"\";\n\t\tlet index = this.globalTables.search(\"translate\");\n\t\tif (index!=-1){\n\t\t\tthis.globalTables[index].array.forEach(function(item){\n\t\t\t\tif (itemName===item.itemName)\n\t\t\t\t\tres = item.itemTranslate;\n\t\t\t});\n\t\t}\n\t\telse{\n\t\t\tconsole.error(`Global table ${itemName} isnt found`);\n\t\t}\n\t\treturn res;\n\t}", "function q(a){var c=g(a);if(c.id){\n// get the related l10n object\nvar d=n(c.id,c.args);if(!d)return void console.warn(\"#\"+c.id+\" is undefined.\");\n// translate element (TODO: security checks?)\nif(d[v]){// XXX\nif(0===r(a))a[v]=d[v];else{for(var e=a.childNodes,f=!1,h=0,i=e.length;i>h;h++)3===e[h].nodeType&&/\\S/.test(e[h].nodeValue)&&(f?e[h].nodeValue=\"\":(e[h].nodeValue=d[v],f=!0));\n// if no (non-empty) textNode is found, insert a textNode before the\n// first element child.\nif(!f){var j=b.createTextNode(d[v]);a.insertBefore(j,a.firstChild)}}delete d[v]}for(var k in d)a[k]=d[k]}}", "function addLanguages() {}", "__init14() {this.translations = new Map()}", "function localize(l10n, array)\n{\n for(var i = 0 ; i < array.length ; i++)\n {\n try\n {\n var node = document.querySelector('[data-l10n-id=' + array[i] + ']');\n if(node != null)\n {\n node.textContent = l10n.entities[array[i]].value;\n }\n }\n catch(e)\n {\n console.log(\"ERROR: cannot translate string \" + array[i]);\n }\n }\n}" ]
[ "0.78237504", "0.77589774", "0.77589774", "0.77589774", "0.76902324", "0.76902324", "0.7437776", "0.68515146", "0.6838039", "0.67411757", "0.6649431", "0.6579866", "0.6566981", "0.6552186", "0.65230167", "0.6468058", "0.6468058", "0.6456392", "0.64158654", "0.6398815", "0.6398815", "0.6397608", "0.63942707", "0.6324704", "0.6316244", "0.6274399", "0.62417877", "0.6228727", "0.6184638", "0.61786216", "0.6178294", "0.6175923", "0.6174534", "0.6143162", "0.6138333", "0.61232203", "0.61232203", "0.61208725", "0.61110425", "0.6078161", "0.60640204", "0.6061792", "0.6058567", "0.60569584", "0.6033604", "0.60322213", "0.6031081", "0.6030583", "0.6028779", "0.6028133", "0.60237366", "0.60193294", "0.60023206", "0.59921604", "0.5991556", "0.5973901", "0.5965032", "0.5965032", "0.5964269", "0.5962448", "0.5960902", "0.59538877", "0.59447956", "0.5930002", "0.59281397", "0.5926494", "0.59263974", "0.59141254", "0.59075576", "0.589641", "0.5894898", "0.58948255", "0.5892115", "0.5888594", "0.5888293", "0.5886156", "0.5884086", "0.5883074", "0.58642024", "0.58596575", "0.5857766", "0.5855508", "0.58470136", "0.5846741", "0.5843305", "0.5843305", "0.583716", "0.58358705", "0.5834796", "0.5834796", "0.5834796", "0.5828806", "0.581748", "0.5810136", "0.58080983", "0.5803394", "0.58022666", "0.57982224", "0.5796792", "0.57899994", "0.5773386" ]
0.0
-1
Round number to x35 Ball Size
function roundBall (x) { return (x % 35) >= 17.5 ? parseInt(x / 35) * 35 + 35 : parseInt(x / 35) * 35; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dxt35Size(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;\n }", "grid(number) {\n const sizeInRem = parseFloat(number) * (12 / 16);\n // e.g. 1 = 1 column of 12px\n return sizeInRem.toString() + 'rem';\n }", "function round5(num, strokeWidth) {\r\n var ret;\r\n strokeWidth = numb(strokeWidth);\r\n if (strokeWidth%2) {\r\n ret = num;\r\n }\r\n else {\r\n ret = Math.round(num - .5) + .5;\r\n }\r\n return ret;\r\n }", "function round5(x)\n{\n return Math.ceil(x/5)*5;\n}", "grid(number) {\n const sizeInRem = parseFloat(number) * (12 / 16);\n // e.g. 1 = 1 column of 12px\n return sizeInRem.toString() + 'rem';\n }", "function round5(x)\n{ return Math.round(x/5)*5; }", "function bytesToRoundedKilobytes_(val) {\n return (val / 1024).toFixed(1);\n }", "function roundByteSize(bytes){\r\n\t\tvar powers = [6, 3, 0, -3],\r\n\t\t\tsuffixes = [\"MB\", \"KB\", \"B\", \"mB\"],\r\n\t\t\tDECIMAL_PLACES_TO_SHOW = 1;\r\n\t\t\r\n\t\tfor(var i = 0, len = powers.length, lim; i < len; i++){\r\n\t\t\tlim = Math.pow(10, powers[i]);\r\n\t\t\t\r\n\t\t\tif(bytes >= lim)\r\n\t\t\t\treturn (bytes / lim).toFixed(DECIMAL_PLACES_TO_SHOW) + suffixes[i];\r\n\t\t}\r\n\t}", "function balls() {\n return Math.floor(innerHeight / 100 + innerWidth / 200);\n}", "function roundToTenth(value) {\r\n return Math.round(value * 10) / 10;\r\n}", "function HGC_roundup(value) {\n\tvar decplaces = config.get(\"hgc_decimal_places\", 5);\n\treturn Math.ceil(value * Math.pow(10, decplaces)) / Math.pow(10, decplaces);\n}", "function round(number) {\n return floor(number + 0.5);\n}", "function sizeRanger(sz) {\n let szGrp = 8;\n if (sz > 6) szGrp = 16;\n if (sz > 24) szGrp = 32;\n if (sz > 72) szGrp = 48;\n return szGrp;\n }", "function toGB(value,floatSize){\n if(floatSize===undefined)\n floatSize = 0;\n var GBRaw = value / 1024 / 1024 / 1024;\n fsmod = Math.pow(10,floatSize);\n GBRaw = Math.round(GBRaw*fsmod)/fsmod;\n return GBRaw;\n}", "function dxt1etc1Size(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n }", "function snap(value, gridSize, roundFunction) {\n if (roundFunction === undefined) roundFunction = Math.round;\n return gridSize * roundFunction(value / gridSize);\n}", "function convertToStone(weightInPounds) {\n weight = weightInPounds/14\n return Math.round(weight)\n}", "function fitBrushStepSize(value) {\n return Math.round(value / brushStepSize) * brushStepSize;\n}", "function ROUND(dt, state) {\n var stack = state.stack;\n var n = stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'ROUND[]');\n }\n\n stack.push(state.round(n / 0x40) * 0x40);\n }", "static roundToNearestPixel(layoutSize: number): number {\n const ratio = PixelRatio.get();\n return Math.round(layoutSize * ratio) / ratio;\n }", "function ROUND(dt, state) {\n const stack = state.stack;\n const n = stack.pop();\n\n if (exports.DEBUG) console.log(state.step, 'ROUND[]');\n\n stack.push(state.round(n / 0x40) * 0x40);\n}", "function roundToNext5Multiple(num){\n return Math.ceil(num / 5) * 5;\n}", "getStepSize(totalSize) {\n const val = Math.min(\n Math.max(Math.round((totalSize - this.defaultRenderCount) / 5), 5),\n totalSize - this.defaultRenderCount\n );\n return val;\n }", "function roundUp10(x) {\n return Math.ceil(x / 10) * 10;\n}", "function roundToNearestHundreth(x){\n return (x).toFixed(2);\n }", "function quickRound (num) {\n return (0.5 + num) << 0;\n}", "function getSize(magnitude) {\n return magnitude * 5\n}", "function roundTo(n, r, s){\r\n return (Math.floor((n-s)/r)*r)+s\r\n}", "function getSize(intSize){\n\tvar ret = 0.16; \n\tswitch(intSize){\n\t\tcase 1 : ret = 0.09;break;\n\t\tcase 2 : ret = 0.10;break;\n\t\tcase 3 : ret = 0.11;break;\n\t\tcase 4 : ret = 0.12;break;\n\t\tcase 5 : ret = 0.13;break;\n\t\tcase 6 : ret = 0.14;break;\n\t\tcase 7 : ret = 0.15;break;\n\t\tcase 8 : ret = 0.16;break;\n\t\tcase 9 : ret = 0.17;break;\n\t\tcase 10 : ret = 0.18;break;\n\t}\n\treturn ret;\n}", "function ROUND(dt, state) {\n var stack = state.stack;\n var n = stack.pop();\n\n if (DEBUG) console.log(state.step, 'ROUND[]');\n\n stack.push(state.round(n / 0x40) * 0x40);\n}", "function roundTo(value, x) {\n return Math.round(value / x) * x;\n}", "function roundNum(num){\n return Math.round(num * 10) / 10;\n }", "function roundTiny(n){\n if(Math.abs(n) < Number.EPSILON)\n return 0;\n return n;\n}", "function box_capacity(length, width, height) {\n const crate = 1.33333333333; //in feet\n const totalCrates = (length / crate) * (width / crate) * (height / crate);\n //output to round to whole num\n const rounded = Math.round(totalCrates);\n //returns num boxes fit\n return rounded;\n}", "function round(n) {\n return Math.round(n * 10000) / 10000;\n}", "function getRoundFigureCoinValue(x) {\n return (x * 10 - ((x * 10) % 10)) / 10;\n}", "function brickCalculator(numOfFloor) {\n\tlet oneToTenth = 10 * 15;\n\tlet tenToTwentieth = 10 * 12;\n\tlet restOfFloors = 0;\n\n\tlet totalFeet = 0;\n\tlet totalBrick = 0;\n\n\tif (numOfFloor > 20) {\n\t\trestOfFloors = (numOfFloor - 20) * 10;\n\t\ttotalFeet = oneToTenth + tenToTwentieth + restOfFloors;\n\t} else {\n\t\tif (numOfFloor > 10) {\n\t\t\trestOfFloors = (numOfFloor - 10) * 12;\n\t\t\ttotalFeet = oneToTenth + restOfFloors;\n\t\t} else {\n\t\t\ttotalFeet = numOfFloor * 15;\n\t\t}\n\t}\n\n\ttotalBrick = totalFeet * 1000;\n\treturn `🏠 Brick needed = ${totalBrick}`;\n}", "function roundTo(value, base){\n\t\t\treturn Math.floor((value + base / 2) / base) * base;\n\t\t}", "function imperial(num) {\n let total = num + selector(58,14);\n let feet = Math.floor(total / 12);\n let inches = total % 12;\n return config.height = feet + \"'\" + inches + '\"';\n }", "function round(num){\n return Math.round(num*10) / 10;\n }", "function getVWSize(num) {\n return 1.08 / (num / 100);\n}", "function round(x) {\n return Math.round( x * 1000) / 1000;\n }", "function Bsize(bytes, decimals=0) {\n for(var i=0, d=1; i < decimals; i++) { d *= 10; }\n if (bytes >= PB) return Math.round(d*bytes/PB)/d+' PB'\n else if (bytes >= TB) return Math.round(d*bytes/TB)/d+' TB'\n else if (bytes >= GB) return Math.round(d*bytes/GB)/d+' GB'\n else if (bytes >= MB) return Math.round(d*bytes/MB)/d+' MB'\n else if (bytes >= KB) return Math.round(d*bytes/KB)/d+' KB'\n else return bytes+' bytes';\n}", "getDrawSize () {\r\n return Math.ceil(this.calories / this.gestation * 10)\r\n }", "function brickCalculator(numOfFloor) {\n let n = Math.abs(parseInt(numOfFloor));\n const perFloor_1to10 = 15000;\n const perFloor_11to20 = 12000;\n const perFloor_21above = 10000;\n\n if (n > 0 && n <= 10) {\n let totalBrick = perFloor_1to10 * n;\n return totalBrick;\n } else if (n > 10 && n <= 20) {\n let totalBrick = n - 10;\n totalBrick = totalBrick * perFloor_11to20 + perFloor_1to10 * 10;\n return totalBrick;\n } else {\n let totalBrick = n - 20;\n totalBrick =\n totalBrick * perFloor_21above +\n perFloor_11to20 * 10 +\n perFloor_1to10 * 10;\n return totalBrick;\n }\n}", "function roundSquare(r) {\n return r * r * 3.14;\n}", "round(place = 0) {\r\n const factor = Math.pow(10, place)\r\n return FNumber(Math.round(this.data * factor) / factor)\r\n }", "function humanSize(size) {\n\t\tvar i, units = ['B','KB','MB','GB','TB'];\n\t\tfor (i = 0; size > 1024; i++) {\n\t\t\tsize /= 1024;\n\t\t}\n\t\treturn Math.round(size*10)/10 + units[i];\n\t}", "function humanToBytes(size) {\n var powers = {'k': 1, 'm': 2, 'g': 3, 't': 4};\n var regex = /(\\d+(?:\\.\\d+)?)\\s?(k|m|g|t)?b?/i;\n\n alert(size);\n var res = regex.exec(size);\n\n if (res[2] !== undefined) {\n return res[1] * Math.pow(1024, powers[res[2].toLowerCase()]);\n }\n else {\n return size;\n }\n }", "function radiusSize(magnitude) {\n return magnitude * 20000;\n }", "roundToNearestTens(number) {\n if (number > 10) {\n return Math.ceil(number / 10) * 10;\n }\n return number;\n }", "function roundToEightMax(num) {\n return +(Math.round(num + \"e+8\") + \"e-8\");\n}", "function roundIt(value) {\n let places = 100;\n if (value < 100) {\n places = 10000;\n } else if (value < 0.001) {\n places = 1000000;\n }\n return Math.round((value + Number.EPSILON) * places) / places;\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function getGridCellSize() {\n return (min(width, height) / 2 - 50) / gridSize;\n}", "function number_to_human_size(bytes) {\n var thresh = 1000;\n if(bytes < thresh) return bytes + ' B';\n var units = ['kB','MB','GB','TB','PB'];\n var u = -1;\n do {\n bytes /= thresh;\n ++u;\n } while(bytes >= thresh);\n return bytes.toFixed(1)+' '+units[u];\n }", "function round( nr ) {\n\t\treturn Math.round( 100*nr )/100;\n\t}", "convert(value) {\n const factor = this._useGb ? 1000 : 1024;\n return (value / factor / factor / factor).toFixed(2);\n }", "function calc_size(bsize) {\n\n var defs = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n var counter = 0;\n\n while(bsize > 1024) {\n bsize /= 1024;\n counter++;\n }\n\n console.log((Math.round(bsize * 100) / 100) + defs[counter]);\n\n}", "function round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function rounding (number) {\n return Math.round(number)\n}", "function circleSize(magnitude) {\n return magnitude * 20000;\n}", "function round5(percent) {\n return (percent % 5) >= 2.5 ? parseInt(percent / 5) * 5 + 5 : parseInt(percent / 5) * 5;\n}", "function round(number,X) {\n X = (!X ? 2 : X);\n return Math.round(number*Math.pow(10,X))/Math.pow(10,X);\n }", "floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }", "function round(x) {\n\treturn Math.round( x * 1000) / 1000;\n}", "function round(a) {\n\treturn parseInt(a*1E+5)/1E+5;\n}", "function roundit(num,dex) {\n return parseFloat(num).toFixed(dex);\n }", "function getDisplayableSize (size) {\n\n var unitChangeLimit = 1024;\n var units = [\n \"B\",\n \"kiB\",\n \"MiB\",\n \"GiB\",\n \"TiB\",\n \"PiB\",\n \"EiB\",\n \"ZiB\",\n \"YiB\",\n ];\n\n var displayableSize = parseFloat(size);\n var unit = 0;\n\n if (size < unitChangeLimit) {\n return size + ' ' + units[0];\n }\n\n while (parseFloat(displayableSize/unitChangeLimit) >= parseFloat(1) && unit < 9) {\n displayableSize /= unitChangeLimit;\n unit += 1;\n }\n\n return displayableSize.toFixed(2) + ' ' + units[unit];\n\n }", "function round4( num ) {\n return Math.floor(num * 1000) / 1000;\n }", "function prettySize(size) {\n\t\tvar i, units = ['B','KB','MB','GB','TB'];\n\t\tfor (i = 0; size > 1024; i++) {\n\t\t\tsize /= 1024;\n\t\t}\n\t\treturn Math.round(size*10)/10 + units[i];\n\t}", "function toBottles(shots){\n\treturn toMl(shots) / BOTTLE_SIZE;\n}", "findSize() {\n var height = window.innerHeight - 180;\n var width = window.innerWidth;\n this.csize = height/width > 1 ? Math.floor(0.9 * width / 4) : Math.floor(0.9 * height / 4);\n }", "function halfUp(x) { return Math.round(x) + 0.5; }", "function round(n) {\n return Math.round(n * 100) / 100;\n }", "round(value) {\n const context = this.context;\n\n // eslint-disable-next-line\n if (value instanceof window.JQX.Utilities.BigNumber && typeof value._d === 'bigint') {\n return value;\n }\n else if (value instanceof window.JQX.Utilities.BigNumber === false ||\n !context._wordLengthNumber || context._wordLengthNumber < 64) {\n return new JQX.Utilities.BigNumber(Math.round(value.toString()));\n }\n\n const fraction = value.mod(1);\n\n if (!(fraction._d.length === 1 && fraction._d[0] === 0)) {\n // if the entered number is with a decimal value, it is rounded up or down to its nearest integer equivalent\n\n value = value.intPart();\n if (!value._s) {\n // round positive number\n if (fraction._d[1] > 4) {\n value = value.add(1);\n }\n }\n else {\n // round negative number\n if (fraction._d[1] > 5 ||\n fraction._d[1] === 5 && fraction._d[2]) {\n value = value.add(-1);\n }\n }\n }\n return value;\n }", "function formatSize(size) {\n let kb = Math.round(size / 1000 * 100) / 100;\n\n if (kb >= 1000) {\n kb = Math.floor(kb);\n }\n\n let color;\n\n if (kb < 15) {\n color = 'green';\n } else if (kb < 30) {\n color = 'yellow';\n } else {\n color = 'red';\n }\n\n return colors[color](`${kb} KB`.padEnd(SIZE_COLUMN_WIDTH));\n}", "ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }", "function roundBy(decimalPlaces, num) {\n var scale = Math.pow(10, decimalPlaces);\n return Math.round(scale * num) / scale;\n }", "function mb2Gb(mb_size){\n return mb_size * 9.765625 * Math.pow(10, -4);\n}", "function round(num, places) {\n var multiplier = Math.pow(10, places);\n return Math.round(num * multiplier) / multiplier;\n }", "function radiusSize(magnitude) {\n return magnitude * 3.5;\n }", "function calcBoxes(bottles, boxCapacity){\n let boxesCount = Math.ceil(bottles / boxCapacity);\n return boxesCount;\n }", "_round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function brickCalculator(numOfFloor){\n const brickPerFeet = 1000;\n var totalAmountOfBricks=0;\n for(var floorNo=1; floorNo<=numOfFloor; floorNo++){\n if(floorNo<=10){\n var j=0;\n j++;\n totalAmountOfBricks = totalAmountOfBricks + (j * (15 * brickPerFeet));\n }\n else if(floorNo<=20){\n var k=0;\n k++;\n totalAmountOfBricks = totalAmountOfBricks + (k * (12 * brickPerFeet));\n }\n else{\n var l=0;\n l++;\n totalAmountOfBricks = totalAmountOfBricks + (l * (10 * brickPerFeet));\n }\n }\n return totalAmountOfBricks;\n}", "function brickCalculator(floor) {\n var bricks;\n if(floor<=10)\n bricks = 1000*15*floor; // 1-10 floors are 15feet and each feet needed 1000 bricks,\n else if(floor>=11&&floor<=20)\n bricks = 1000*12*floor; // 11-20 floors are 12feet and each feet needed 1000 bricks,\n else\n bricks = 1000*10*floor; // more than 20 floors are 10feet and as always its also needed 1000 bricks\n return bricks //returns total bricks;\n}", "function setB(l) {\n w = Math.pow(2, l);\n b = 5 * 5 * w;\n rounds = 12 + 2 * l;\n document.getElementById('b').innerText = b;\n}", "function roundNumber(rnum, rlength) {\r\n var newnumber = Math.round(rnum * Math.pow(10, rlength)) / Math.pow(10, rlength);\r\n return parseFloat(newnumber); \r\n}", "function round(num, places) {\n var multiplier = Math.pow(10, places);\n return Math.round(num * multiplier) / multiplier;\n}", "function round(number) {\n return Math.round(number * 100) / 100;\n}", "function round(number) {\n return Math.round(number * 100) / 100;\n}", "function round_hundreth(n) {\n return n;//(Math.round(n*100)/100)\n }", "function circleSize(mag) {\n return mag * 10000;\n}", "function roundg(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "snapToGrip (val) {\n return parseFloat((this.gridResolution * Math.round(val / this.gridResolution)).toFixed(2));\n }", "function round(number) {\n return Math.round(number * 100) / 100;\n}" ]
[ "0.64935464", "0.6266777", "0.6255168", "0.62466186", "0.621668", "0.6128024", "0.6125321", "0.6071111", "0.60450405", "0.6044182", "0.601271", "0.59848076", "0.59829056", "0.59644765", "0.59400874", "0.5939498", "0.5922163", "0.59056735", "0.58998793", "0.5896174", "0.5884968", "0.5875694", "0.58707803", "0.58652115", "0.58448523", "0.5840618", "0.58395934", "0.58260894", "0.58106565", "0.58034986", "0.5789619", "0.57871705", "0.5779148", "0.5777199", "0.57697237", "0.57555395", "0.57352877", "0.57320595", "0.5714646", "0.5704157", "0.56940377", "0.5689082", "0.56890434", "0.5677371", "0.5669009", "0.5668555", "0.5667745", "0.5660434", "0.5651912", "0.5646323", "0.56460166", "0.5627089", "0.56240195", "0.5614628", "0.5614628", "0.5614628", "0.5614628", "0.5612152", "0.559932", "0.5592745", "0.558497", "0.55757487", "0.55731535", "0.55731535", "0.55670166", "0.55667144", "0.555979", "0.5557971", "0.5556188", "0.55529183", "0.5550349", "0.5544531", "0.5523116", "0.55148196", "0.551293", "0.55073816", "0.55054885", "0.5504781", "0.54962546", "0.5490846", "0.5480849", "0.5479764", "0.547279", "0.54560024", "0.5455185", "0.54467577", "0.5445344", "0.5442605", "0.54360497", "0.54328984", "0.5431272", "0.54230225", "0.54226315", "0.54173964", "0.54173964", "0.5412647", "0.54045916", "0.54030097", "0.5397785", "0.53856534" ]
0.69166565
0
Check if Player Win the Game.
function wonGame (side) { hand = false; shooters.fadeOut('slow'); info.html(side + ' Won this hand ..!'); // Log Move console.log(side +' is Winner !'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForWin() {\n\n var d = $vast.MathUtil.getPointDistance(mainPlayer.x, mainPlayer.y, goal.x, goal.y);\n if (d <= 1) {\n mainPlayer.setPosition(64, 64);\n }\n }", "function checkWin(currentPlayer) {\n return winCombos.some((combination) => {\n return combination.every((index) => {\n return SQUARES[index].classList.contains(currentPlayer.getSign());\n });\n });\n }", "function checkForWin() {\n\t// Check if all cards contain the class 'match', if so then game is won\n\tconst fullDeck = document.querySelectorAll('.card');\n\tconst win = Array.prototype.every.call(fullDeck, function(item){\n\t\treturn item.classList.contains('match');\n\t});\n\n\tif (win) {\n\t\tgameWon = true;\n\t\tclearInterval(intervalId);\n\t\tshowModal();\n\t}\n}", "#determineIfGameOver() {\n const p1victory = this.players[1].gameboard.allShipsSunk();\n const p2victory = this.players[0].gameboard.allShipsSunk();\n \n if (p1victory) {\n this.#page.setDialog(GAME_STATE.p1victory);\n this.#isWinnerP1 = true;\n } else if (p2victory) {\n this.#page.setDialog(GAME_STATE.p2victory);\n this.#isWinnerP1 = false;\n }\n\n if (p1victory || p2victory) {\n this.#gameOver = true;\n this.#endGame();\n }\n }", "function checkPlayer() {\n return (gInfo.playerList[gInfo.currentPlayer].uid==currentUID);\n}", "function checkWinner() {\n if(playerPosition <= 0) {\n alert('Player 1 Wins!')\n } else if(compPosition <= 0) {\n alert('Computer Wins!')\n }\n }", "checkifGameOver(){\n\t\t//Checks if all players are dead\n\t\tvar gameOver = false;\t\t\n\t\tif(this.player.dead && this.otherPlayer.dead){\n\t\t\tgameOver = true;\n\t\t}\n\n\t\n\t\tif(gameOver) this.gameOver();\n\t}", "function isWin() {\n\t//only after the game has been started and shuffling that we judge\n\tif (gameon && shuffling) {\n\t\tfor (var i = 0; i < squares.length; i++) {\n\t\t\tif (squares[i].position !== squares[i].identity) return false;\n\t\t}\n\t\treturn true;\n\t}\n}", "gameOver(){\n for(var key in this.playerObjects){\n let Player = this.playerObjects[key];\n if(Player.active){\n return false;\n }\n }\n return true;\n }", "function check() {\n if (win(player)) {\n playFlag = false;\n displayWinner();\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n } else if (win(computer)) {\n playFlag = false;\n displayWinner();\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n } else if (\n (player.length == 5 && computerTurn === true) ||\n (computer.length == 5 && computerTurn === false)\n ) {\n playFlag = false;\n winner.innerHTML = 'Draw';\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n }\n playGame();\n}", "checkForWin() {\n if (this.numMafia <= 0) { this.gameState = TOWN_WIN; }\n if (this.getInnocentPlayerCount() <= 0) { this.gameState = MAFIA_WIN; }\n }", "function winCheck() {\n if (userScore === computerPick) {\n wins++;\n $(\"#wins\").html(\"Wins: \" + wins);\n alert(\"Winning isn’t everything, it’s the ONLY thing\");\n newGame();\n }\n\n else if (userScore > computerPick) {\n losses++;\n $(\"#losses\").html(\"Losses: \" + losses);\n alert(\"...if you ain't first, you're last\");\n newGame();\n };\n }", "function isGameOver (){\n if (whoWon()) return true\n return false\n}", "function checkWin(player) {\n // Variables to keep track of win, start at true and are proved false\n var horizontalWin = true;\n var verticalWin = true;\n var d1Win = true;\n var d2Win = true;\n\n // Check horizontally\n for(var cIndex = 0; cIndex < NUM_COLS; cIndex++) {\n // Check each column at the same row value\n if(!boxes[row][cIndex].classList.contains(player)) {\n horizontalWin = false;\n }\n }\n\n // Check vertically\n for(var rIndex = 0; rIndex < NUM_ROWS; rIndex++) {\n // Check each row at the same column value\n if(!boxes[rIndex][column].classList.contains(player)) {\n verticalWin = false;\n }\n }\n\n // Check if the latest piece was placed in a position that could win\n // diagonally\n if((row === column) || (Math.abs(row - column) === NUM_ROWS - 1)) {\n for(var d = 0; d < NUM_ROWS; d++) {\n // Check diagonally from top left to bottom right\n if(!boxes[d][d].classList.contains(player)) {\n d1Win = false;\n }\n\n // Check diagonally from bottom left to top right\n if(!boxes[NUM_ROWS - d - 1][d].classList.contains(player)) {\n d2Win = false;\n }\n }\n }\n\n // Couldn't have won diagonally\n else {\n d1Win = false;\n d2Win = false;\n }\n\n //console.log(\"H: \" + horizontalWin + \", V: \" + verticalWin + \", D: \" + d1Win + \", \" + d2Win);\n\n // Player wins\n if(horizontalWin || verticalWin || d1Win || d2Win) {\n if(player === xClass) {\n victoryText.textContent = \"X Player Wins!\";\n // Increase score of X player\n xScore.textContent = Number(xScore.textContent) + 1\n }\n else {\n victoryText.textContent = \"O Player Wins!\";\n // Increase score of O player\n oScore.textContent = Number(oScore.textContent) + 1\n }\n\n $(victoryText).show('slow');\n gameOver = true;\n return true;\n }\n\n // If all spaces are taken and nobody has won\n if(boxCount === NUM_ROWS * NUM_COLS) {\n victoryText.textContent = \"Cat's Game\";\n $(victoryText).show('slow');\n gameOver = true;\n }\n\n // Didn't win... yet\n return false;\n\n }", "function checkForWin(player) {\n\tlet g = gameBoard.bigGrid;\n\n\t// Check for 3 in a row on big board\n\tif (\n\t\t(g.A1 === g.A2 && g.A1 === g.A3 && g.A1) ||\n\t\t(g.B1 === g.B2 && g.B1 === g.B3 && g.B1) ||\n\t\t(g.C1 === g.C2 && g.C1 === g.C3 && g.C1) ||\n\t\t(g.A1 === g.B1 && g.A1 === g.C1 && g.A1) ||\n\t\t(g.A2 === g.B2 && g.A2 === g.C2 && g.A2) ||\n\t\t(g.A3 === g.B3 && g.A3 === g.C3 && g.A3) ||\n\t\t(g.A1 === g.B2 && g.A1 === g.C3 && g.A1) ||\n\t\t(g.C1 === g.B2 && g.C1 === g.A3 && g.C1)\n\t) {\n\t\t$('#turn').text(`${player} Wins`);\n\t}\n\n\t// Check for tie game on big board\n\telse if (\n\t\tg.A1 && g.A2 && g.A3 && g.B1 && g.B2 && g.B3 && g.C1 && g.C2 && g.C3\n\t) {\n\t\t$('#turn').text(`It's a Tie Game!`);\n\t}\n\n\t$('#gameBoard').css('background-color', 'rgb(128, 128, 128)');\n}", "function hasWinner(player) {\n if (player.health > 0) {\n return false;\n } else {\n return true;\n }\n }", "function checkWin(player, board) {\n let playerOccupied = board.reduce((a, e, i) => (e==player) ? a.concat(i) : a, []);\n // true or false\n return WINNING_COMBINATIONS.some(combination => {\n return combination.every(index => {\n return playerOccupied.includes(index);\n });\n });\n}", "isGameover() {\n if (this.player1Pieces === 0 || this.player2Pieces === 0) {\n let message = this.player2Pieces === 0 ? 'Player 1 won!' : 'Player 2 won!';\n this.currentPlayerUI.innerHTML = message;\n this.currentPlayerUI.style.color = \"grey\";\n return true;\n }\n return false;\n }", "function checkForWin() {\r\n if (game_1.isWinningState(board)) {\r\n var winner = game_1.detectWinner(board);\r\n view_1.displayGameOver(winner);\r\n }\r\n else if (game_1.isDrawState(board)) {\r\n view_1.displayGameOver(null);\r\n }\r\n}", "checkForWinner() {\n if (this.primaryWinConditionsCheck()) {\n this.endGame();\n }\n }", "function checkIfWin(){\n console.log(\"check win:\");\n if (counterNumber == goalNumber) {\n wins += 1;\n alert(\"You won!\");\n startGame();\n }\n\n if (counterNumber > goalNumber) {\n losses += 1;\n alert(\"You lost. If you're having trouble, you can pay to help your chances via micro-transactions. Coming soon!\");\n startGame();\n }\n}", "function checkWin(x, y, player) {\r\n\t//on part du principe que l'on gagne\r\n\tvar verticalWin = true;\r\n\tvar horizontalWin = true;\r\n\tvar diagonaleDroite = true;\r\n\tvar diagonaleGauche = true;\r\n\tvar egality = true;\r\n\t\r\n\tfor(i=0; i<3; i++) {\r\n\t\tif(morpion[x][i] != player) {verticalWin = false};\r\n\t\tif(morpion[i][y] != player) {horizontalWin = false};\r\n\t\tif(morpion[i][i] != player) {diagonaleGauche = false};\r\n\t\tif(morpion[2-i][i] != player) {diagonaleDroite = false};\r\n\t\tfor(j=0; j<3; j++) {if(morpion[i][j] == 0) {egality = false}}; //tant que toutes les cases ne sont pas joués egalité possible\r\n\t}\r\n\t\r\n\tif(verticalWin || horizontalWin || diagonaleDroite || diagonaleGauche){ //si gagné\r\n\t\tgameEnded(player); \r\n\t} else if(egality) { //sinon si egalité\r\n\t\tgameEnded(0)\r\n\t};\r\n}", "function checkWinOrLoss() {\n if (totalScore === randomNumToGuess) { // We have a winner\n wins++;\n initializeGame()\n }\n else if (totalScore > randomNumToGuess) { // We have a loser\n losses++;\n initializeGame();\n }\n else {\n updateUI;\n }\n }", "function checkWin() {\n //check if there is a winner\n return WINARR.some(function (arr) {\n return (\n playerChoices[arr[0]] === playerChoices[arr[1]] &&\n playerChoices[arr[0]] === playerChoices[arr[2]] &&\n playerChoices[arr[2]]\n );\n });\n}", "function checkWin() {\n if (userScore === numToMatch) {\n wins++;\n $(\"#wins\").text(\"Success: \" + wins);\n reset();\n } else if (userScore > numToMatch) {\n losses++\n $(\"#losses\").text(\"Fails: \" + losses);\n reset();\n }\n }", "function checkWinningCondition() {\n\tif (matchedCards.length === 16) {\n\t\tstopTimer();\n\t\toverlay();\n\t} else {\n\t\treturn false;\n\t}\n}", "function checkWin(board, player) {\r\n let plays = board.reduce((a, e, i) => (e === player) ? a.concat(i) : a, []);\r\n let gameWon = null;\r\n for (let [index, win] of winCombos.entries()) {\r\n if (win.every(elem => plays.indexOf(elem) > -1)) {\r\n gameWon = {index: index, player: player};\r\n break;\r\n }\r\n }\r\n return gameWon;\r\n}", "function checkWin(board, player) {\n\n // Reduce to find array containing the indexes of cell that matches the player\n // i.e., moves of player\n\tlet plays = board.reduce((a, e, i) =>\n\t\t(e === player) ? a.concat(i) : a, []);\n\n\tlet gameWon = null;\n\n // Find if moves of player qualify for win\n // If yes than break from loop and return gameWon\n for (let [index, win] of winCombos.entries()) {\n\t\tif (win.every(elem => plays.indexOf(elem) > -1)) {\n\t\t\tgameWon = {index: index, player: player};\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn gameWon;\n}", "function gameHasWinner(game) {\n return game.winner !== undefined;\n}", "checkWinner() {\n this.checkInHorizontal(player.getPlayerColor()[0]);\n this.checkInVertical(player.getPlayerColor()[0]);\n this.checkInDiagonalTopLeftBottomRight(player.getPlayerColor()[0]);\n this.checkInDiagonalTopRightBottomLeft(player.getPlayerColor()[0]);\n\n //If board is full of pawns and no-one win then send that is draw \n const drawMessage = 'Game ended with draw';\n if (this.checkdraw()) {\n socket.emit('gameEnded', {\n room: this.getRoomId(),\n message: drawMessage,\n });\n this.endGameMessage(drawMessage);\n }\n }", "function checkWin(player) {\r\n var y;\r\n \r\n if (G_debugFlg) window.alert(\"checkWin board for player \" + player + \"=\" + G_player[player]);\r\n \r\n y = G_player[player] & (G_player[player] >> G_boardRows);\r\n if (y & (y >> (2*G_boardRows))) return(true);\r\n \r\n y = G_player[player] & (G_player[player] >> G_boardColumns);\r\n if (y & (y >> (2*G_boardColumns))) return(true); \r\n \r\n y = G_player[player] & (G_player[player] >> (G_boardColumns + 1));\r\n if (y & y >> (2*(G_boardColumns + 1))) return(true);\r\n \r\n y = G_player[player] & (G_player[player] >> 1);\r\n if (y & (y >> 2)) return(true);\r\n \r\n return(false);\r\n}", "function checkWhoWon(player) {\n\n\tif(checkWinAlgo($box1, $box2, $box3, player)) {\n\t\treturn true;\n\t} else if (checkWinAlgo($box4, $box5, $box6, player)) {\n\t\treturn true;\n\t} else if (checkWinAlgo($box7, $box8, $box9, player)) {\n\t\treturn true;\n\t} else if (checkWinAlgo($box1, $box4, $box7, player)) {\n\t\treturn true;\n\t} else if (checkWinAlgo($box2, $box5, $box8, player)) {\n\t\treturn true;\n\t} else if (checkWinAlgo($box1, $box5, $box9, player)) {\n\t\treturn true;\n\t} else if (checkWinAlgo($box3, $box5, $box7, player)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "checkWin(owner) {\n const playerCanWin = owner === 'opponent';\n const board = playerCanWin ? this.opponentBoard : this.playerBoard;\n const discoveredShips = board.cells\n .flat()\n .filter(\n (cell) => cell.classList.contains('ship') && cell.children[0].disabled\n ).length;\n const win = this.totalCells === discoveredShips;\n if (win)\n new GameOverView({\n win: playerCanWin,\n }).render(this.container);\n return win;\n }", "function checkForWin() {\n\tfunction _win(cells) {\n\t\t// Check four cells to see if they're all color of current player\n\t\t// - cells: list of four (y, x) cells\n\t\t// - returns true if all are legal coordinates & all match currPlayer\n\n\t\treturn cells.every(([ y, x ]) => y >= 0 && y < HEIGHT && x >= 0 && x < WIDTH && board[y][x] === currPlayer);\n\t}\n\n\tfor (let y = 0; y < HEIGHT; y++) {\n\t\tfor (let x = 0; x < WIDTH; x++) {\n\t\t\tlet horiz = [ [ y, x ], [ y, x + 1 ], [ y, x + 2 ], [ y, x + 3 ] ];\n\t\t\tlet vert = [ [ y, x ], [ y + 1, x ], [ y + 2, x ], [ y + 3, x ] ];\n\t\t\tlet diagDR = [ [ y, x ], [ y + 1, x + 1 ], [ y + 2, x + 2 ], [ y + 3, x + 3 ] ];\n\t\t\tlet diagDL = [ [ y, x ], [ y + 1, x - 1 ], [ y + 2, x - 2 ], [ y + 3, x - 3 ] ];\n\n\t\t\tif (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}", "function joinGameAsPlayer() {\n // check if ingame true\n\n}", "checkForWin() {\n const hiddenLetters = document.getElementsByClassName(\"hide letter\"); //Total hidden litters which are set by Phrase class\n if (hiddenLetters.length > 0) {\n //if more than zero, not winning yet if 0 return true and player won\n return false;\n } else {\n return true;\n }\n }", "function checkWin(board, player) {\n let plays = board.reduce((a, e, i) =>\n (e === player) ? a.concat(i) : a, []);\n let gameWon = null;\n for (let [index, win] of winCombos.entries()) {\n if (win.every(elem => plays.indexOf(elem) > -1)) {\n gameWon = {index: index, player: player}; \n break;\n }\n }\n //if the loops show a win then \n return gameWon;\n}", "function checkWinningPlayer(player){\n if(player.score === 3){\n document.getElementById('main-content').style.display = 'none'\n let gameOverModal = document.getElementById('gameOverModal')\n gameOverModal.style.display = 'block'\n document.getElementById('winner-container').innerText = `${player.name} won the game!`\n document.getElementById('restart-button').addEventListener('click', restartGame)\n return true\n }\n return false\n}", "checkWin() {\n\t\tthis.detectCollision();\n\t\treturn this.y < this.canvasWinZone ? true : false;\n\t}", "function checkWin(board, player) {\n // Get every cell the player has currently selected\n let plays = board.reduce(\n (acc, nxt, idx) => (nxt === player ? acc.concat(idx) : acc),\n []\n );\n // loop through every single winning pattern to check if a winning pattern has been played\n let gameWon = null;\n for (let [index, win] of winCombos.entries()) {\n // check if this winning pattern has been played by the player\n if (win.every(elem => plays.indexOf(elem) > -1)) {\n gameWon = { index: index, player: player };\n break;\n }\n }\n return gameWon;\n}", "function isGameWon () {\n console.log('checking if you won the game')\n return gameState.enemiesLeft === 0\n}", "checkIfWin() {\n if (this.score === 10) {\n this.started = false;\n allEnemies = [];\n showWinModal();\n }\n }", "function winCheck() {\n if (winGameVertical(0,0) == true || winGameHorizontal(0,0) == true || winGameLeftToRight(2,0) == true || winGameRightToLeft(0,0) == true) {\n gamewon = true;\n if (symbol == playerOne.symbol) {\n P1Wins.innerHTML = (Number(P1Wins.textContent) + 1);\n turn.textContent = \"Player \" + playerOne.name + \" is the winner!\";\n } else {\n P2Wins.innerHTML = (Number(P2Wins.textContent) + 1);\n turn.textContent = \"Player \" + playerTwo.name + \" is the winner!\";\n }\n fillBoard();\n tictacbingo = false;\n symbol = \"O\";\n } else if (symbol == playerOne.symbol) {\n turn.textContent = \"Your turn player \" + playerTwo.name + \": O\";\n } else {\n turn.textContent = \"Your turn player \" + playerOne.name + \": X\";\n }\n return gamewon\n}", "check_GameOver() {\n if (this.model.winner == 0) {\n if (this.currentPlayerBot == 0) {\n this.scene.undo_play = false;\n this.state = 'WAIT_UNDO';\n }\n else\n this.state = 'CHANGE_PLAYER';\n }\n else{\n this.state = 'GAME_OVER';\n this.scene.showGameMovie = false;\n this.view.incWinsPlayer(this.model.winner);\n }\n }", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n for (let y = 0; y < HEIGHT; y++) { // loops through columns\n for (let x = 0; x < WIDTH; x++) { // loops through rows\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]]; // coordinates assigned to this constant will check for a horizontal win\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]]; // coordinates assigned to this constant will check for a vertical win\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]]; // coordinates assigned to this constant will check for a diagonal win moving to the right\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]]; // coordinates assigned to this constant will check for a diagonal win moving to the left\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) { // if any of the coordinates pass _win(), then the game is over.\n return true;\n }\n }\n }\n}", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // \n // iterate through y axis\n for (let y = 0; y < HEIGHT; y++) {\n // while going through x axis\n for (let x = 0; x < WIDTH; x++) {\n // coordinates for a horizontal win\n let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n // coordinates for a vertical win\n let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n // coordinates for a diagonal right win\n let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n // coordinates for diagonal left win\n let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n// if a win in any direction return true\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "function checkWin() {\n\n for (let player in playerSpaces) {\n for (let i = 0; i < winningCombos.length; ++i) {\n let win = true\n\n for (let j = 0; j < winningCombos[i].length; ++j) {\n if (!playerSpaces[player].includes(winningCombos[i][j])) {\n win = false\n }\n }\n\n if (win) {\n gameOver = true\n return `Game over! Player ${playerTurn + 1} wins!`\n }\n }\n }\n}", "gameOver() {\n if ((this.playerOneScore >= 4 || this.playerTwoScore >= 4) && Math.abs(this.playerOneScore - this.playerTwoScore) >= 2) {\n return true\n }\n return false;\n }", "function checkWin(board, player){\r\n if (\r\n // top row win\r\n board[0][0] === board[0][1] && board[0][1] === board[0][2] && board[0][2] === player ||\r\n // middle row win\r\n board[1][0] === board[1][1] && board[1][1] === board[1][2] && board[1][2] === player ||\r\n // bottom row win\r\n board[2][0] === board[2][1] && board[2][1] === board[2][2] && board[2][2] === player ||\r\n // left column win\r\n board[0][0] === board[1][0] && board[1][0] === board[2][0] && board[2][0] === player ||\r\n // middle column win\r\n board[0][1] === board[1][1] && board[1][1] === board[2][1] && board[2][1] === player ||\r\n // right column win\r\n board[0][2] === board[1][2] && board[1][2] === board[2][2] && board[2][2] === player ||\r\n // diagonal top left to bottom right win\r\n board[0][0] === board[1][1] && board[1][1] === board[2][2] && board[2][2] === player ||\r\n // diagonal top right to bottom left win\r\n board[0][2] === board[1][1] && board[1][1] === board[2][0] && board[2][0] === player\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n}", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // Checks all cells to see if a win starts there.\n\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "function checkWinCondition() {\n if (gameScore === targetNum) {\n alert(\"You win!\");\n wins++;\n gameScore = 0;\n crystalValues.length = 0;\n theGame();\n }\n\n //lose condition, effects\n else if (gameScore >= targetNum) {\n alert(\"You lose!\");\n losses++;\n gameScore = 0;\n crystalValues.length = 0;\n theGame();\n }\n }", "function checkUserWin() {\n const openedDivs = document.querySelectorAll('.row div.opened');\n if (!gameOver && openedDivs.length + Object.keys(mineMap).length === (sizeX * sizeY)) {\n handleMessage(\"Congrats!!! You won!! Game over, we'd love to see you again!!\");\n revealMines();\n }\n }", "function checkWin () {\n\t\tif (scores[0] === 10) {\n \t\treturn player1;\n } else if (scores[1] === 10) {\n \t\treturn player2;\n } else {\n \t\treturn null;\n }\n}", "function checkGame() {\n\tif (playerScore==compScore){\n\t\twins++;\n\t\tdocument.getElementById(\"wins\").innerHTML = wins;\n\t\tstartGame();\n\t}else if(playerScore>compScore){\n\t\tlosses++\n\t\tdocument.getElementById(\"losses\").innerHTML = losses;\n\t\tstartGame();\n\t}\n}", "function checkWin(board, player) \n {\n let gameWon=null;\n\n for (var i=0;i<8;i++)\n {\n \n if (board[winCombos[i][0]]==board[winCombos[i][1]]&&board[winCombos[i][1]]==board[winCombos[i][2]])\n {\n gameWon= {index: i, player:board[winCombos[i][0]]};\n break;\n }\n }\n return(gameWon);\n }", "function checkForWin()\n{\n\tvar cardsLeft = document.querySelectorAll('.unmatchedCard');\n\n\tif (cardsLeft.length === 0)\n\t{\n\t\tconsole.log(\"you win!\");\n\n\t\t// get final score\n\t\tgameEnd = Date.now();\n\n\t\tvar score = gameEnd - gameStart;\n\n\t\tvar minutes = Math.floor(score/1000/60);\n\t\tvar seconds = Math.floor((score/1000) - (minutes * 60));\n\t\tvar milliseconds = Math.floor((score - (minutes*60*1000) - (seconds*1000)))\n\n\t\tconsole.log(\"Score: \" + minutes + \" minutes \" + seconds + \".\" + milliseconds + \" seconds.\");\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function checkForWin() {\n\t// check four cells to see if they're all color of current player\n\t// • cells: list of four (y, x) cells\n\t// • returns true if all are legal coordinates & all match currPlayer\n\tfunction _win(cells) {\n\t\treturn cells.every(([y, x]) =>\n\t\t\ty >= 0 &&\n\t\t\ty < HEIGHT &&\n\t\t\tx >= 0 &&\n\t\t\tx < WIDTH &&\n\t\t\tboard[y][x] === currPlayer\n\t\t);\n\t}\n\n\tfor (let y = 0; y < HEIGHT; y++) {\n\t\tfor (let x = 0; x < WIDTH; x++) {\n\t\t\t// get \"check list\" of 4 cells (starting here) for each of the different ways to win\n\t\t\tconst horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n\t\t\tconst vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n\t\t\tconst diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n\t\t\tconst diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n\t\t\t// find winner (only checking each win-possibility as needed)\n\t\t\tif (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) return true;\n\t\t}\n\t}\n}", "function checkIfWin(currentPlayer){\r\n return winningCombinations.some(function(combination) {\r\n return combination.every(function(index) {\r\n return currentStateOfTheBoard[index] == currentPlayer;\r\n });\r\n });\r\n}", "function checkGameStatus() {\n\tnumTurns++; // count turn\n\t\n\t// check for a Win\n\tif (checkWin()) {\n\t\tgameStatus = currentPlayer + \" wins!\";\n\t} // if\n\t\n\t// check for tie\n\tif (numTurns == 9) {\n\t\tgameStatus = \"Tie Game!\";\n\t} // if\n\t\n\t// switch current player\n\tcurrentPlayer = (currentPlayer == \"X\" ? \"O\" : \"X\");\n\t\n\t// game is over\n\tif(gameStatus != \"\"){\n\t\tsetTimeout(function() {showLightBox(gameStatus, \"Game Over.\");}, 500);\n\t} // if\n\n} // checkGameStatus()", "function checkWin(turn) {\n\t\tif (\n\t\t board[0] === board[1] && board[0] === board[2] ||\n\t\t board[0] === board[3] && board[0] === board[6] ||\n\t\t board[0] === board[4] && board[0] === board[8] ||\n\t\t board[1] === board[4] && board[1] === board[7] ||\n\t\t board[2] === board[4] && board[2] === board[6] ||\n\t\t board[2] === board[5] && board[2] === board[8] ||\n\t\t board[3] === board[4] && board[3] === board[5] ||\n\t\t board[6] === board[7] && board[2] === board[8]\n\t\t ) {\n\t\t\tupdateBoard();\n\t\t\tboard = [1,2,3,4,5,6,7,8,9];\n\t\t\tturnNumber = 1;\n\t\t\tplayerTurn = true;\n\t\t\tplayer = turn ? 'Player \"X\"': 'Player \"O\"';\n\t\t\tconsole.log(player + 'won');\n\t\t\tupdateBoard();\n\t\t\tpopup(player);\n\t\t}\n\t}", "hasCollision() {\n const players = window.gameEngine.playerManager.players\n for(let i=0;i<players.length;i++) {\n if(players[i].id!=this.playerId&&Utils.distance(this.position,players[i].position) < 50) return true\n }\n return false\n }", "function checkForWin() {\n // define a win\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n // if the y and x coordinates are vaild playable coordinates within the grid return true else return false\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // TODO: read and understand this code. Add comments to help you.\n // determining a win with four of the same pieces vertically, horizonally, diagDR, diagDL\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // TODO: read and understand this code. Add comments to help you.\n\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every( //check every cell on the board for a 1 or 2 (piece played)\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n for (var y = 0; y < HEIGHT; y++) { \n for (var x = 0; x < WIDTH; x++) {\n var horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]]; //horizonal win\n var vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]]; //vertical win\n var diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]]; //diagonal to the right win\n var diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]]; //diagonal to the left win\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) { //if any of these win situations are true, return true\n return true;\n }\n }\n }\n}", "function checkForWin() {\n var winner = true;\n var youWin = document.getElementById(\"win\");\n for (var i = 0; i < board.cells.length; i++) {\n if (board.cells[i].isMine === true && board.cells[i].isMarked === false) {\n return \"\";\n }\n if (board.cells[i].isMine === false && board.cells[i].hidden === true) {\n return \"\";\n }\n }\n lib.displayMessage(\"You win!\");\n youWin.play();\n document.getElementById(\"fireworks.wav\").play();\n }", "function checkWon() {\n isPlayerWon = playerGuess.value.toUpperCase() === computerBase;\n isComputerWon = computerGuess.value === playerBase;\n}", "function playerWon() {\n var rows = board.length;\n var cols = board[0].length;\n var currPlayer = players[currPlayerIndex];\n\n // Check rows, columns, and diagonals\n var isDiag1WinState = true;\n var isDiag2WinState = true;\n for (var i = 0; i < rows; i++) {\n var isRowWinState = true;\n var isColWinState = true;\n for (var j = 0; j < cols; j++) {\n if (board[i][j] !== currPlayer)\n isRowWinState = false;\n if (board[j][i] !== currPlayer)\n isColWinState = false;\n if (i === j && board[i][j] !== currPlayer)\n isDiag1WinState = false;\n if (i === (cols-1)-j && board[i][j] !== currPlayer)\n isDiag2WinState = false;\n }\n if (isRowWinState || isColWinState) return true;\n }\n\n return isDiag1WinState || isDiag2WinState;\n}", "function winCheck() {\n\tif(matches === 8){\n\t\ttimerEnd();\n\t\taddRating(moves);\n\t\tpopUpModal();\n\t\tpopUp.classList.remove('display-none');\n\t}\n}", "function playerWin() {\n game.isPlayersTurn = false;\n holdButtonFunctons = true;\n updateLED('WIN!');\n blinkLED(3);\n setTimeout(function() {\n holdButtonFunctons = false;\n startGame();\n }, 4000);\n}", "checkWin(c){\n if ((arr[0][0]==c && arr[0][1]==c && arr[0][2]==c)\n || (arr[1][0]==c && arr[1][1]==c && arr[1][2]==c)\n || (arr[2][0]==c && arr[2][1]==c && arr[2][2]==c)\n || (arr[0][0]==c && arr[1][0]==c && arr[2][0]==c)\n || (arr[0][1]==c && arr[1][1]==c && arr[2][1]==c)\n || (arr[0][2]==c && arr[1][2]==c && arr[2][2]==c)\n || (arr[0][0]==c && arr[1][1]==c && arr[2][2]==c)\n || (arr[0][2]==c && arr[1][1]==c && arr[2][0]==c)){\n\n if(c=='x')\n {\n console.log(\"Player won\");\n } \n else {\n console.log(\"System won\");\n }\n showGame();\n check=false;\n }\n\n }", "static isWin(playResult) {\n if ((playResult[0] === playResult[1] && playResult[1] === playResult[2]) || (playResult[0] !== playResult[1] && playResult[1] !== playResult[2] && playResult[0] !== playResult[2])) {\n return true;\n } else {\n return false;\n }\n }", "function checkWin() {\n\t\tif (pairsRemain === 0) {\n\t\t\t\ttimerOff();\n\t\t\t\topenModal();\n\t\t};\n}", "function __playerWon(player) {\n var playerScores = [], winningPlayer, lostPlayers = [];\n\n for (var i = 0; i < __players.length; i++) {\n var p = __players[i],\n playerScore = p.getScore();\n\n if (p === player) {\n playerScore++;\n }\n\n playerScores.push(playerScore);\n\n }\n\n //console.log()\n\n //__setGamePauseStatus(true);\n __resetGame(playerScores);\n\n for (var i = 0; i < __players.length; i++) {\n var p = __players[i];\n\n if (player.getName() === p.getName()) {\n winningPlayer = p;\n }\n else {\n lostPlayers.push(p);\n }\n\n p.setScore(playerScores[i]);\n }\n\n __eventCallbacks['gameWin'].call(__game, winningPlayer, lostPlayers);\n\n //__showTitleScreen();\n\n }", "function checkWin() {\n if (scores[activePlayer] >= winningScore) {\n document.getElementById(\"applause\").play()\n alert(\"player \" + (activePlayer + 1) + \" wins\")\n init()\n }\n}", "function didSomeoneWin() {\n if (playerScore === 5 || computerScore === 5) {\n gameOverMan();\n }\n}", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // TODO: read and understand this code. Add comments to help you.\n\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // TODO: read and understand this code. Add comments to help you.\n\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "function winning(board, player) {\n if(\n (board[0] == player && board[1] == player && board[2] == player) ||\n (board[3] == player && board[4] == player && board[5] == player) ||\n (board[6] == player && board[7] == player && board[8] == player) ||\n (board[0] == player && board[3] == player && board[6] == player) ||\n (board[1] == player && board[4] == player && board[7] == player) ||\n (board[2] == player && board[5] == player && board[8] == player) ||\n (board[0] == player && board[4] == player && board[8] == player) ||\n (board[2] == player && board[4] == player && board[6] == player)\n ) {\n return true;\n } else {\n return false;\n }\n }", "function checkWin() {\n\n}", "function checkGameStatus(){\r\n\tnumTurns++; //count turn\r\n\t\r\n\tif (checkWin()) {\r\n\t\tgameStatus = currentPlayer + \" Wins\";\r\n\t\tconsole.log(\"Game status: \" + gameStatus);\r\n\t}else if (numTurns == 9) {\r\n\t\tgameStatus = \"TIE\";\r\n\t\tconsole.log(\"Game status: \" + gameStatus);\r\n\t}\r\n\t\r\n\tcurrentPlayer = (currentPlayer == \"X\" ? \"O\" : \"X\");\r\n\t\r\n\tif (gameStatus != \"\"){\r\n\t\tshowLightBox(\"Game is Over: \", gameStatus);\r\n\t\tconsole.log(\"Game is Over: \" + gameStatus);\r\n\t}\r\n} // checkGameStatus", "function checkForWin() {\n\tfunction _win(cells) {\n\t\t// Check four cells to see if they're all color of current player\n\t\t// - cells: list of four (y, x) cells\n\t\t// - returns true if all are legal coordinates & all match currPlayer\n\n\t\treturn cells.every(([ y, x ]) => y >= 0 && y < HEIGHT && x >= 0 && x < WIDTH && board[y][x] === currPlayer);\n\t}\n\n\t// TODO: read and understand this code. Add comments to help you.\n\t// this part will check each cell if the current player has 4 tokens together horizontically,vertically,and diagonally(right or left), and will return true so i can activate the endgame function.\n\n\tfor (let y = 0; y < HEIGHT; y++) {\n\t\tfor (let x = 0; x < WIDTH; x++) {\n\t\t\tconst horiz = [ [ y, x ], [ y, x + 1 ], [ y, x + 2 ], [ y, x + 3 ] ];\n\t\t\tconst vert = [ [ y, x ], [ y + 1, x ], [ y + 2, x ], [ y + 3, x ] ];\n\t\t\tconst diagDR = [ [ y, x ], [ y + 1, x + 1 ], [ y + 2, x + 2 ], [ y + 3, x + 3 ] ];\n\t\t\tconst diagDL = [ [ y, x ], [ y + 1, x - 1 ], [ y + 2, x - 2 ], [ y + 3, x - 3 ] ];\n\n\t\t\tif (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}", "function winning(board, player) {\n if (\n (board[0] == player && board[1] == player && board[2] == player) ||\n (board[3] == player && board[4] == player && board[5] == player) ||\n (board[6] == player && board[7] == player && board[8] == player) ||\n (board[0] == player && board[3] == player && board[6] == player) ||\n (board[1] == player && board[4] == player && board[7] == player) ||\n (board[2] == player && board[5] == player && board[8] == player) ||\n (board[0] == player && board[4] == player && board[8] == player) ||\n (board[2] == player && board[4] == player && board[6] == player)\n ) {\n return true;\n } else {\n return false;\n }\n }", "function checkPlayerCondition() {\r\n\r\n\tif (player.health < 1) {\r\n\t\tplayer.lives--;\r\n\t\tplayer.initCheckpoint();\r\n\t}\r\n\r\n\tif (player.y > 1350) {\r\n\t\t\r\n\t\tSounds.yell.play();\r\n\t\tplayer.lives--;\r\n\t\tplayer.grounded = true;\r\n\t\tplayer.airborne = false;\r\n\t\tplayer.jumping = false;\r\n\t\tplayer.velY = 0;\r\n\t\tplayer.health = 3;\r\n\t\t\r\n\t\tif (player.lives > 0) {\r\n\t\t\tplayer.init(-25, 546);\r\n\t\t}\r\n\r\n\t\r\n\t}\r\n\t\r\n\tif (player.lives < 1) {\r\n\t\tplayer.init(-200,-200);\r\n\t\tgameOver = true;\r\n\t}\r\n\r\n}", "checkWin(player) {\n for (let i = 0; i < 3; i++) {\n //check horizontal wins\n if (player._letter === this._board[i][0] &&\n player._letter === this._board[i][1] &&\n player._letter === this._board[i][2]) {\n return true;\n }\n //check vertical wins\n if (player._letter === this._board[0][i] &&\n player._letter === this._board[1][i] &&\n player._letter === this._board[2][i]) {\n return true;\n }\n }\n\n //check wins on the diagonals\n if (player._letter === this._board[0][0] &&\n player._letter === this._board[1][1] &&\n player._letter === this._board[2][2]) {\n return true;\n }\n\n if (player._letter === this._board[0][2] &&\n player._letter === this._board[1][1] &&\n player._letter === this._board[2][0]) {\n return true;\n }\n\n //Check for a tie\n if (this._board.toString().length === 17) {\n return 'tie';\n }\n }", "function checkWin()\r\n{\r\n if(userTurn[userTurn.length-1]===computerTurn[userTurn.length-1])\r\n {\r\n if(userTurn.length===computerTurn.length)\r\n {\r\n turn.innerHTML=\"LEVEL PASSED\";\r\n currentScore++;\r\n setTimeout(computer,1500);\r\n }\r\n }\r\n else{\r\n gameOver();\r\n }\r\n}", "function _checkWin() {\n\t//add X to score\n\t_score += 50;\n\t_bossScore += 50;\n\t$score.text(_score);\n\n\t_hideItems();\n\tvar newCutScene = '<div class=\"cutSceneBg\"></div>';\n\t$('.gameboard').append(newCutScene);\n\tvar newVid = _cutSceneVids[_currentCharger - 1];\n\t$('.cutSceneBg').append(newVid);\n\t$('.cutSceneBg').fadeIn('fast');\n\t$('.cutScene')[0].play();\n\t_clockRate = 0;\n\t$('.cutScene')[0].addEventListener('ended', function() {\n\t\t$('.cutScene')[0].removeEventListener('ended');\n\t\t$('.cutSceneBg').fadeOut('fast', function() {\n\t\t\tvar left = 'only ' + (_numChargers - _currentCharger + 1) + ' chargers left!';\n\t\t\t$game.statusUpdate({message:left,input:'status',screen: true,log:false});\n\t\t\t_clockRate = 1;\n\t\t\t$('.cutSceneBg').remove();\n\t\t});\n\t\tif(_currentCharger >= 4 && _bossScore === 200) {\n\t\t\t_pause = true;\n\t\t\t_currentSlide = 4;\n\t\t\t_addContent();\n\t\t\t$bossArea.show();\n\t\t} else {\n\t\t\t_placeCharger();\n\t\t}\n\t});\n}", "function checkWinGame() {\n //check if player has won\n if (document.querySelectorAll('.match').length === 16) {\n //show hidden congrats modal\n document.querySelector('.modal').classList.remove('hidden');\n //display move number\n document.querySelector('.winMoves').textContent = moves;\n stopTimer();\n }\n}", "function winning(player){\n\treturn (\n\t\t(board[0] == player && board[1] == player && board[2] == player) ||\n\t\t(board[3] == player && board[4] == player && board[5] == player) ||\n\t\t(board[6] == player && board[7] == player && board[8] == player) ||\n\t\t(board[0] == player && board[3] == player && board[6] == player) ||\n\t\t(board[1] == player && board[4] == player && board[7] == player) ||\n\t\t(board[2] == player && board[5] == player && board[8] == player) ||\n\t\t(board[0] == player && board[4] == player && board[8] == player) ||\n\t\t(board[2] == player && board[4] == player && board[6] == player)\n\t)\n\t\t\n}", "gameWon() {\n if (this._gameBoard[0] == this._currentPlayer && this._gameBoard[1] == this._currentPlayer && this._gameBoard[2] == this._currentPlayer ||\n this._gameBoard[3] == this._currentPlayer && this._gameBoard[4] == this._currentPlayer && this._gameBoard[5] == this._currentPlayer ||\n this._gameBoard[6] == this._currentPlayer && this._gameBoard[7] == this._currentPlayer && this._gameBoard[8] == this._currentPlayer ||\n this._gameBoard[0] == this._currentPlayer && this._gameBoard[3] == this._currentPlayer && this._gameBoard[6] == this._currentPlayer ||\n this._gameBoard[1] == this._currentPlayer && this._gameBoard[4] == this._currentPlayer && this._gameBoard[7] == this._currentPlayer ||\n this._gameBoard[2] == this._currentPlayer && this._gameBoard[5] == this._currentPlayer && this._gameBoard[8] == this._currentPlayer ||\n this._gameBoard[0] == this._currentPlayer && this._gameBoard[4] == this._currentPlayer && this._gameBoard[8] == this._currentPlayer ||\n this._gameBoard[2] == this._currentPlayer && this._gameBoard[4] == this._currentPlayer && this._gameBoard[6] == this._currentPlayer) {\n this._gameOver = true;\n if (this._currentPlayer == 'X') {\n this._xWins += 1;\n } else {\n this._yWins += 1; \n }\n }\n //checks to see if the game is tied\n var isTie = true;\n for (var i = 0; i < this._gameBoard.length; i++) {\n if (this._gameBoard[i] == \"\") { //there is an empty spot on the board\n isTie = false; \n }\n }\n if (isTie) {\n this._gameOver = true;\n this._ties += 1;\n }\n this._tiedGame = isTie;\n }", "function checkWinner() {\n if (winnerCalled()) {\n gameOver();\n }\n}", "function checkForWin() {\n let youWin = true;\n for (let i = 0; i < board.cells.length; i++) {\n if (board.cells[i].isMine === true && board.cells[i].ismarked === false) {\n youWin = false;\n }\n if (board.cells[i].isMine !== true && board.cells[i].hidden === true) {\n youWin = false;\n // console.log(youWin)\n }\n }\n // detected that they've won.\n if (youWin) {\n lib.displayMessage(\"You win!\");\n }\n}", "function checkForWin() {\n\tfunction _win(cells) {\n\t\t// Check four cells to see if they're all color of current player\n\t\t// - cells: list of four (y, x) cells\n\t\t// - returns true if all are legal coordinates & all match currPlayer\n\n\t\treturn cells.every(([ y, x ]) => y >= 0 && y < HEIGHT && x >= 0 && x < WIDTH && board[y][x] === currPlayer);\n\t}\n\n\t// TODO: read and understand this code. Add comments to help you.\n\t//for each y coordinate and each x coordinate,\n\t//check to see if the four surrounding coordinates are filled horizontally, vertically, or either direction diagonally.\n\t// if there are four coordinates filled of the same color, return true\n\tfor (let y = 0; y < HEIGHT; y++) {\n\t\tfor (let x = 0; x < WIDTH; x++) {\n\t\t\tlet horiz = [ [ y, x ], [ y, x + 1 ], [ y, x + 2 ], [ y, x + 3 ] ];\n\t\t\tlet vert = [ [ y, x ], [ y + 1, x ], [ y + 2, x ], [ y + 3, x ] ];\n\t\t\tlet diagDR = [ [ y, x ], [ y + 1, x + 1 ], [ y + 2, x + 2 ], [ y + 3, x + 3 ] ];\n\t\t\tlet diagDL = [ [ y, x ], [ y + 1, x - 1 ], [ y + 2, x - 2 ], [ y + 3, x - 3 ] ];\n\n\t\t\tif (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}", "function checkForWin() {\n var isWinner = true\n\n for (let i = 0; i < board.cells.length; i++) {\n var cell = board.cells[i]\n\n if (cell.isMine && !cell.isMarked || cell.hidden && !cell.isMine) {\n isWinner = false\n }\n }\n\n if (isWinner) {\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n lib.displayMessage('You win!');\n winAudio.play();\n }\n}", "primaryWinConditionsCheck() {\n super.primaryWinConditionsCheck();\n // <<-- Creer-Merge: primary-win-conditions -->>\n const alivePianos = this.game.furnishings.filter((f) => !f.isDestroyed && f.isPiano);\n if (alivePianos.length === 0) { // game over\n this.secondaryWinConditions(\"all pianos destroyed.\");\n }\n // check to see if one player has more score than the other can possibly get\n const winning = this.game.players[0].score > this.game.players[1].score\n ? this.game.players[0]\n : this.game.players[1];\n // this assumes they play every piano on every remaining turn\n const remainingTurns = this.game.maxTurns - this.game.currentTurn;\n const maxAdditionalScore = Math.ceil(alivePianos.length * remainingTurns / 2);\n if (winning.score > winning.opponent.score + maxAdditionalScore) {\n // then the losing player can't catch up to the winner's score,\n // so end the game early\n this.declareWinner(`Score (${winning.score}) high enough that the opponent can't `\n + `win in the remaining turns (${remainingTurns}).`, winning);\n this.declareLoser(\"Score too low to catch up to the winner in the number of remaining turns.\", winning.opponent);\n return true;\n }\n // <<-- /Creer-Merge: primary-win-conditions -->>\n return false; // If we get here no one won on this turn.\n }", "function winCheck() {\n\n // Traverses the entire grid and checks for any discrepancy between the current grid and the answer grid, if there is then the player has not won yet\n for (var row = 0; row < 9; row++) {\n for (var col = 0; col < 9; col++) {\n if (grid[row][col].textContent != answerGrid[row][col]) {\n return false;\n }\n }\n }\n return true;\n}", "function checkgamewining() {\n console.log('CheckWining Start>');\n let personOnSide2 = side2.childElementCount;\n let personOnSide1 = side1.childElementCount;\n if ((personOnSide2 == '6') || (personOnSide1 == '0')) {\n alert(`You Won The Game\\n Time Played: ${playingHours}:${playingMinutes}:${playingSeconds}`);\n updateLeaderBoard();\n resetTheGame();\n startTheMatch();\n return true;\n } else {\n function checkboth(side_of, person_length) {\n let v = 0;//number of villans\n let s = 0;//number of saints\n let div_s = side_of.getElementsByTagName('div');\n for (let i = 0; i < person_length; i++) {\n if (div_s[i].innerHTML[0] == 'S') s += 1;\n else v += 1\n }\n if (s == 0) s = 4;\n if (person_length >= 2) return v > s; //if more than 1 person is on side\n return false;\n }\n if (checkboth(side2, personOnSide2) || checkboth(side1, personOnSide1)) {\n console.log('Lose');\n alert('You Loose the Game');\n return resetTheGame();//use to restart the game\n }\n }\n return false;\n}", "function gameOver(){\n\tif ((playerScore === 5) || (computerScore === 5)){\n\t\treturn true;\n\t}\n\treturn false;\n}", "function checkGameOver() {\r\n if (lives == 0) {\r\n console.log(\"game over\");\r\n return true;\r\n }\r\n return false;\r\n}", "function gameCheck(){\n\tif (randomNumGen == userValue){\n\t\twins++;\n\t\t$('.winLossAlert').html(\"You Won!\");\n\t\t$('#win').html(\"Wins:\" + \" \" + wins);\n\t\treset();\n\t} else if (randomNumGen < userValue){\n\t\tloss++;\n\t\t$('.winLossAlert').html(\"You Lost! Try Again!\");\n\t\t$('#loss').html(\"Losses:\" + \" \" + loss);\n\t\treset();\n\t};\n}", "gameIsWon(board, player) {\n if ( (board[0] == player && board[1] == player && board[2] == player) || //Horizontals\n (board[3] == player && board[4] == player && board[5] == player) ||\n (board[6] == player && board[7] == player && board[8] == player) ||\n\n (board[0] == player && board[3] == player && board[6] == player) || //Verticals\n (board[1] == player && board[4] == player && board[7] == player) ||\n (board[2] == player && board[5] == player && board[8] == player) ||\n\n (board[0] == player && board[4] == player && board[8] == player) || //Diagonals\n (board[2] == player && board[4] == player && board[6] == player) )\n {\n return true;\n }\n return false;\n }", "checkForPlayer (id) {\n return this.turns.indexOf(id) >= 0\n }" ]
[ "0.73942417", "0.7335883", "0.7319909", "0.7318273", "0.73145324", "0.72821105", "0.72162926", "0.7197219", "0.7183024", "0.71531975", "0.71497726", "0.7140183", "0.71295965", "0.71164185", "0.7105305", "0.71047807", "0.7082425", "0.7070454", "0.706073", "0.7055957", "0.7047298", "0.7036756", "0.70317596", "0.70250785", "0.7009134", "0.7004848", "0.6983136", "0.6973802", "0.6946472", "0.6929343", "0.6923789", "0.69233316", "0.6918191", "0.68985695", "0.68940866", "0.68919474", "0.6888243", "0.6888191", "0.6885874", "0.6885663", "0.68831366", "0.6856913", "0.6851901", "0.6848982", "0.6847939", "0.6846252", "0.68461853", "0.68254143", "0.6806334", "0.68050194", "0.6804468", "0.6796808", "0.6795402", "0.6794671", "0.67932284", "0.6790461", "0.67871195", "0.6784824", "0.67728245", "0.6767791", "0.6764839", "0.6764828", "0.67646015", "0.67627764", "0.6757347", "0.6752887", "0.67486393", "0.6747758", "0.6741119", "0.67398804", "0.67325866", "0.6731816", "0.6730705", "0.67297953", "0.67290515", "0.6728835", "0.6728835", "0.67272335", "0.6725686", "0.6721739", "0.6711363", "0.6710685", "0.6705509", "0.6704021", "0.6689645", "0.668782", "0.6678127", "0.6665447", "0.66649", "0.6662006", "0.665865", "0.6658377", "0.6658361", "0.6657918", "0.66491234", "0.6648916", "0.6639788", "0.66380477", "0.66376966", "0.66335124", "0.66302204" ]
0.0
-1
Turn Hand to Other Player.
function turnHand (turn) { info.html('Ball <span class="ballid">' +ballId + '</span> Shooted, Now <span class="'+turn+'">'+ turn + '</span> Turn '); hand = turn; shooter = (hand == 'Left') ? homeRight : homeLeft; homeLeft.animate({opacity: 1}, 1); homeRight.animate({opacity: 1}, 1); shooter.animate({opacity: 0.3}, 5); ballId++; // Log Turn console.log('Ball ' +ballId + ' Shooted, Now '+ turn + ' Turn '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "switchTurn() {\n if (!this.extraTurn) {\n this.playerOne.isTurn = !this.playerOne.isTurn;\n this.playerTwo.isTurn = !this.playerTwo.isTurn;\n }\n else {this.extraTurn = false;}\n }", "function switchPlayer(){\n\t\tif (player === 'X') {\n\t\t\tplayer = 'O'\n\t\t}else{\n\t\t\tplayer = 'X'\n\t\t}\n\t\tdisplay.innerText = `Player:${player}'s turn`\n\t}", "function switchTurn() {\n\tif (!gameOver) {\n\t\tif (activePlayer == player1) {\n\t\t\tactivePlayer = player2;\n\t\t} else {\n\t\t\tdecideWinner();\n\t\t}\n\t}\n}", "function connectPlayerOther(data) {\n let player = components.PlayerRemote();\n player.initialize(data);\n playerOthers[data.clientId] = player;\n activePlayerCount++;\n }", "function switchTurn(){\n\tif (checkForWinner (player1)){\n\t\tsetMessage (player1 + \" wins!!\");\n\t\tdocument.winner = player1;\n\t} \telse if (player1 == \"X\") {\n\t\t\tplayer1 = \"O\";\n\t\t\tsetMessage(player1 + \"'s turn to pick!\");\n\t\t}else {\n\t\t\tplayer1 = \"X\"\n\t\t\tsetMessage(player1 + \"'s turn to pick!\");\n\t\t\t}\n}", "switchPlayer() {\n this.currentPlayer = this.currentPlayer === this.player1 ? this.player2 : this.player1;\n }", "function switchPlayers() {\n currPlayer === player1\n ? (currPlayer = player2)\n : (currPlayer = player1);\n playerTurn();\n }", "function connectToPeer() {\n\t//Connect to the opponent.\n\tconnection = peer.connect(gameState.opponentID)\n\tconnection.on('open', () => {\n\t\tgameState.connected = true\n\t\tplayerShip = new Ship(playerOne, true)\n\t\tconnection.send({ action: 'init', payload: playerOne })\n\t})\n\tconnection.on('data', data => {\n\t\t//Update the playerTwo object with the new data.\n\t\tplayerTwo = Object.assign(playerTwo, data.payload)\n\t\tswitch (data.action) {\n\t\t\tcase 'init':\n\t\t\t\topponentShip = new Ship(playerTwo, false)\n\t\t\t\tbreak\n\t\t\tcase 'fire':\n\t\t\t\topponentShip.fire({\n\t\t\t\t\tshooter: playerTwo,\n\t\t\t\t\ttarget: playerOne,\n\t\t\t\t\tgameState\n\t\t\t\t})\n\t\t\t\tbreak\n\t\t\tcase 'move':\n\t\t\t\topponentShip.move(playerTwo)\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tbreak\n\t\t}\n\t})\n}", "turn(player) {\n const message =\n player === 'opponent'\n ? 'Where do you want to fire?'\n : 'Where did your opponent fire?';\n this.dialog.innerHTML = `<h2>${message}</h2>`;\n if(player == 'player'){\n this.AIGuess();\n this.turn('opponent');\n }\n if(player === 'opponent'){\n this.container.setAttribute('data-focus', player);\n }\n }", "function switchPlayer() {\n if (currentPlayer === player1){\n currentPlayer = player2;\n }\n else {\n currentPlayer = player1;\n }\n}", "playTurn() {\n\n console.log('Play turn.');\n\n this.endTurn();\n\n }", "function changePlayer() {\n\tif (whoPlayer === \"playerOne\") {\n\t\twhoPlayer = \"playerTwo\";\n\t} else if (whoPlayer === \"playerTwo\") {\n\t\twhoPlayer = \"playerOne\";\n\t}\n}", "function _takeTurn() {\n var pot = [],\n playerOneCard,\n playerTwoCard,\n winner;\n\n _turn++;\n\n playerOneCard = _playerOne.playCard();\n playerTwoCard = _playerTwo.playCard();\n\n pot = _addToPot(pot, playerOneCard);\n pot = _addToPot(pot, playerTwoCard);\n\n _log(\n _playerOne.name +\n \" played the \" +\n playerOneCard.rank +\n \" of \" +\n playerOneCard.suit +\n \".\"\n );\n _log(\n _playerTwo.name +\n \" played the \" +\n playerTwoCard.rank +\n \" of \" +\n playerTwoCard.suit +\n \".\"\n );\n\n _settle(pot, playerOneCard, playerTwoCard);\n }", "function switchActivePlayer () {\n activePlayerIndex = players[activePlayerIndex].symbol === players[0].symbol ? 1 : 0;\n var activePlayer = players[activePlayerIndex];\n\n if (gameType === \"Computer\" && activePlayer.symbol === players[1].symbol) {\n setTimeout(getComputerMove, 500);\n }\n}", "switchPlayersTurn(){\n if (this.currPlayerTurn === 1)\n this.playerTurn = 2;\n else\n this.playerTurn = 1;\n }", "function switchTurns(turn, player1Obj, player2Obj) {\n if (turn === 0 || turn%2 === 0) {\n return player2Obj;\n } else {\n return player1Obj;\n }\n}", "function switchPlayer() {\n if (currentPlayer === xPlayer) {\n currentPlayer = oPlayer;\n playerTurn.textContent = currentPlayer;\n console.log(currentPlayer);\n } else if (currentPlayer === oPlayer) {\n currentPlayer = xPlayer;\n playerTurn.textContent = currentPlayer;\n console.log(currentPlayer);\n }\n}", "function stand(player) {\n player.turnOver = true;\n}", "function switchTurn(){\n\n\t// update marker for the next player (X is 1, O is -1)\n\tplayerTurn *= -1;\n\tshowStatus(playerTurn)\n\n\tif (determinePlayer(playerTurn) == 'computer'){\n\t\t// update DOM to reflect new player\n\t\tfor (let i = 0; i < squares.length; i++){\n\t\t\tif (squares[i].className != 'square played'){\n\t\t\t\tsquares[i].firstChild.classList.remove('open-x')\n\t\t\t\tsquares[i].firstChild.classList.remove('open-o')\n\t\t\t}\n\t\t}\n\t\t// play computer turn\n\t\tcomputerTurn(gameState, playerTurn)\n\t} else {\n\t\t// update DOM to reflect new player\n\t\tfor (let i = 0; i < squares.length; i++){\n\t\t\tif (squares[i].className != 'square played'){\n\t\t\t\tif (playerTurn == 1){\n\t\t\t\t\tsquares[i].firstChild.classList.add('open-x')\n\t\t\t\t\tsquares[i].firstChild.classList.remove('open-o')\n\t\t\t\t} else {\n\t\t\t\t\tsquares[i].firstChild.classList.remove('open-x')\n\t\t\t\t\tsquares[i].firstChild.classList.add('open-o')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function takeTurn()\r\n {\r\n player1 = !player1;\r\n\r\n if(currentPlayer() == 1)\r\n {\r\n $(\".turn\").html(\"<p>It is <span class=X>Player1</span>'s turn.</p>\");\r\n }\r\n else\r\n {\r\n $(\".turn\").html(\"<p>It is <span class=O>Player2</span>'s turn.</p>\");\r\n }\r\n }", "function playerTurn() {\n if (player === 1) {\n player = 2;\n }else {\n player = 1;\n }\n}", "function turn(player) {\r\n if (player.sign === playerOne.sign) {\r\n return playerTwo;\r\n }\r\n return playerOne;\r\n}", "function runPlayerTurn(currentPlayer, myPlayer, p1, p2, database) {\n\n //check if both players have made moves\n if (p1.move !== '' && p2.move !== '') {\n checkWinner(p1, p2, currentPlayer, database);\n } else if (currentPlayer.name === p1.name) {\n highLight('#playerOne', '#playerTwo');\n if (myPlayer.name === currentPlayer.name) {\n $('#message').text(\"It's your turn!\")\n } else {\n $('#message').text(\"Waiting for \" + p1.name + \" to choose\");\n }\n } else if (currentPlayer.name === p2.name) {\n highLight('#playerTwo', '#playerOne');\n if (myPlayer.name === currentPlayer.name) {\n $('#message').text(\"It's your turn!\")\n } else {\n $('#message').text(\"Waiting for \" + p2.name + \" to choose\");\n }\n\n }\n}", "switchSide() {\n this.player_side = this.player_side == PLAYER_1 ? PLAYER_2 : PLAYER_1;\n this.updateColor();\n }", "function nextTurn() {\n if (currentPlayer == player1) {\n currentPlayer = player2;\n } else {\n currentPlayer = player1;\n }\n}", "function togglePlayer() {\n if (activePlayer === \"X\") {\n activePlayer = \"O\";\n nonActivePlayer =\"X\";\n } else {\n activePlayer = \"X\";\n nonActivePlayer = \"O\";\n } //if active player is x then it changegs to O & vice versa\n }", "function set_player_hand(Player, hand) {\n Player.player_hand = hand;\n return Player;\n}", "function switchTurn()\n{\n if(huidige_speler === SPELER1) {\n huidige_speler = SPELER2;\n } else {\n huidige_speler = SPELER1;\n }\n\n showCurrentPlayer();\n}", "function play() {\n\t\n\t var playerOneCard = cards_player_1[0];\n\t var playerTwoCard = cards_player_2[0];\n\t // card1 for player 1 deck, card2 for player 2 deck\n\t var winningCard = war(playerOneCard, playerTwoCard);\n\t \n\t if (winningCard === playerOneCard) {\n\t\tvar firstCard = cards_player_1.shift();\n\t\tvar secondCard = cards_player_2.shift();\n\t\tcards_player_1.push(firstCard, secondCard);\n\t }\n\t else if (winningCard === playerTwoCard) {\n\t var firstCard = cards_player_1.shift();\n\t\tvar secondCard = cards_player_2.shift();\n\t\tcards_player_2.push(firstCard, secondCard);\n\t }\n\t // In case of a tie\n\t \n\t else if (winningCard === false) {\n\t winningCard = war(cards_player_1[3], cards_player_2[3]);\n\t\t\n\t\tif (winningCard === cards_player_1[3]) {\n\t\t var cardsToRemove1 = cards_player_1.slice(0, 4);\n\t\t var cardsToRemove2 = cards_player_2.slice(0, 4);\n\t\t cards_player_2.splice(0, 4);\n\t\t cards_player_1.push(cardsToRemove1, cardsToRemove2);\n\t\t}\n\t\telse if (winningCard === cards_player_2[3]) {\n\t\t var cardsToRemove1 = cards_player_1.slice(0, 4);\n\t\t var cardsToRemove2 = cards_player_2.slice(0, 4);\n\t\t cards_player_1.splice(0, 4);\n\t\t cards_player_2.push(cardsToRemove1, cardsToRemove2);\n\t\t}\n\t }\n\t // Assign cards to winning player\n\t //this function (defined below) will continue to the next turn\n\t advance();\n\t}", "changePlayer() {\n if (this._currentPlayer == 'X') {\n this._currentPlayer = 'Y'; \n } else {\n this._currentPlayer = 'X'; \n }\n }", "function playerswitch() {}", "function switchTurn() {\n if (turn === \"X\") {\n turn = \"O\";\n } else {\n turn = \"X\";\n }\n turnCounter++;\n tracker(); \n }", "function switchCurrentPlayer() {\n\tcurrent = (current.id === 1) ? player2 : player1;\n}", "function nextTurn(){\n\tchangeDiscard();\n\tplayerTurnIs();\n}", "play(playerOne, playerTwo) {\n switch (playerOne.move.sign + playerTwo.move.sign) {\n case \"rockscissors\":\n case \"scissorspaper\":\n case \"paperrock\":\n playerOne.win();\n gametext.innerHTML = `${playerOne.name} wins! Next round!`;\n playerOne.move = \"\";\n playerTwo.move = \"\";\n break;\n case \"rockpaper\":\n case \"scissorsrock\":\n case \"paperscissors\":\n playerTwo.win();\n playerOne.move = \"\";\n playerTwo.move = \"\";\n gametext.innerHTML = `${playerTwo.name} wins! Next round!`;\n break;\n default:\n playerOne.move = \"\";\n playerTwo.move = \"\";\n gametext.innerHTML = `It's a draw! Next round!`;\n break;\n }\n }", "function switchPlayerTurn() {\r\n if ( $playerOne.hasClass('active') ) {\r\n $playerOne.removeClass(\"active\");\r\n $playerTwo.addClass(\"active\");\r\n $play1NameInput.removeClass('active');\r\n $play2NameInput.addClass('active');\r\n } else {\r\n $playerTwo.removeClass(\"active\");\r\n $playerOne.addClass(\"active\");\r\n $play2NameInput.removeClass('active');\r\n $play1NameInput.addClass('active');\r\n }\r\n }", "@on('playerCommand', x => x === 'endTurn')\n passTurn(command, toPlayerId = null, player)\n {\n let id = toPlayerId;\n\n // implicit just pass to the other player\n if (toPlayerId === null) {\n if (this.players.length !== 2) {\n throw new Error('to field required when not 2 players');\n }\n\n const toPlayer = this.players.find(x => x.id !== player.id);\n id = toPlayer.id;\n }\n\n const action = new PassTurn(id, player.id);\n this.queue.push(action);\n this.queue.processUntilDone();\n }", "function playerSwitch(){\n\n\tif(gameOver() == false){\n\n\t\tcountDownTimer();\n\n\t\tif(currentPlayer == 0){\n\t\t\t\tcurrentPlayer = 1;\n\t\t\t\t$(\".playerOne\").css('color', 'black');\n\t\t\t\t$(\".playerTwo\").css('color', 'red');\n\t\t\t} \n\t\t\t\n\t\telse {\n\t\t\t\tcurrentPlayer = 0;\n\t\t\t\t$(\".playerTwo\").css('color', 'black');\n\t\t\t\t$(\".playerOne\").css('color', 'red');\n\t\t\t}\n\n\t\tsetTimeout(revert, 1000);\t\n\n\t\t}\n\n}", "function setTurn() {\r\n\t\t// We generate a number between 1 or two\r\n\t\tvar random = Math.floor((Math.random() * 2) + 1);\r\n\t\t//Set the winner to zero so we know the game hasn't started yet\r\n\t\twinner = 0;\r\n\t\t// check if the random number is one\r\n\t\tif (random === 1) {\r\n\t\t\t//then we give the turn to player 2\r\n\t\t\tturn = player2Name;\r\n\t\t\t// we send a message telling the players who will start first by invoking the function msg\r\n\t\t\tmsg(player2Name + \"'s turn now!\");\r\n\r\n\t\t} else {\r\n\r\n\t\t\tturn = player1Name;\r\n\t\t\tmsg(player1Name + \"'s turn now!\");\r\n\r\n\t\t}\r\n\t}", "function switchTurn(){\n\t\tif (checkForWinner(document.turn)){\n\t\t\tsetMessage(\"Congratulations \" + document.turn +\"! IronMan wins!\");\n\t\t\tdocument.winner = document.turn;\n\t\t} else if (document.turn == \"X\") {\n\t\t\tdocument.turn = \"O\";\n\t\t\tsetMessage(\"It's \" + document.turn + \"'s turn\");\n\t\t} else {\n\t\t\tdocument.turn = \"X\";\n\t\t\tsetMessage(\"It's \" + document.turn + \"'s turn\");\n\t\t}\n\t\n\t}", "function playRound(hand) {\n /* eslint-enable no-unused-vars */\n // get p1 hand\n player1.hand = hand;\n // get p2 hand\n player2.hand = getHand();\n const messageBox = document.querySelector('.messageBox');\n const rockText = document.querySelector('.rockText');\n const paperText = document.querySelector('.paperText');\n const scissorsText = document.querySelector('.scissorsText');\n const shootText = document.querySelector('.shootText');\n const player1Hand = document.querySelector('.leftHand');\n const player2Hand = document.querySelector('.rightHand');\n const selectorOptions = document.querySelectorAll('button.selectorOption');\n // Disable the buttons so the user can't accidentally trigger them when they're off screen\n /* eslint-disable no-restricted-syntax, no-undef */\n for (selector of selectorOptions) {\n if (!selector.hasAttribute('disabled')) {\n selector.setAttribute('disabled', 'disabled');\n }\n }\n /* eslint-enable no-restricted-syntax, no-undef */\n // Clear the message box and reset the hands to fists\n messageBox.innerHTML = '';\n changeHand('rock', player1Hand);\n changeHand('rock', player2Hand);\n const tl = new TimelineMax();\n // The animation for the rocking effect of the fists\n tl.to('.selector', 1, {\n bottom: '-350px'\n });\n tl.to('.hand > svg', 0.75, {\n rotation: 10\n });\n tl.addCallback(() => {\n rockText.classList.remove('visuallyhidden');\n });\n tl.to('.hand > svg', 0.75, {\n rotation: -25\n });\n tl.to('.hand > svg', 0.75, {\n rotation: 10\n });\n tl.addCallback(() => {\n rockText.classList.add('visuallyhidden');\n paperText.classList.remove('visuallyhidden');\n });\n tl.to('.hand > svg', 0.75, {\n rotation: -25\n });\n tl.to('.hand > svg', 0.75, {\n rotation: 10\n });\n tl.addCallback(() => {\n paperText.classList.add('visuallyhidden');\n scissorsText.classList.remove('visuallyhidden');\n });\n tl.to('.hand > svg', 0.75, {\n rotation: -25\n });\n tl.to('.hand > svg', 0.75, {\n rotation: 0\n });\n tl.addCallback(() => {\n // Run the function to determine the winner\n play(player1, player2);\n scissorsText.classList.add('visuallyhidden');\n shootText.classList.remove('visuallyhidden');\n });\n tl.to('.hand > svg', 1, {});\n tl.addCallback(() => {\n shootText.classList.add('visuallyhidden');\n });\n}", "function wonGame (side) {\n hand = false;\n shooters.fadeOut('slow');\n info.html(side + ' Won this hand ..!');\n // Log Move\n console.log(side +' is Winner !');\n}", "playTurn(data) {\n\t\tlet user;\n\t\tlet opp;\n\t\tthis.players.map(x => {\n\t\t\tif (x.name === data.name) {\n\t\t\t\tuser = x;\n\t\t\t}\n\t\t\tif (x.name !== data.name) {\n\t\t\t\topp = x;\n\t\t\t}\n\t\t});\n\t\t// client player\n\t\tif (user.name === data.name) {\n\t\t\tuser.setCurrentTurn(false);\n\t\t\tuser.updateScore(data.total);\n\t\t\tuser.updateMovesPlayed();\n\t\t\tthis.updateTotal(data.total);\n\t\t\tthis.checkWin(user);\n\t\t}\n\t\t// not client player\n\t\tif (opp.name !== data.name) {\n\t\t\topp.setCurrentTurn(true);\n\t\t}\n\t}", "pass() {\n\t\tthis.state.server.emit('move', {\n\t\t\tplayerId: this.state.playerId,\n\t\t\ttype: 'PASS'\n\t\t});\n\t}", "function swapPlayer(){\r\n circleTurn = !circleTurn;\r\n}", "function changeTurn(){\n\tif(winner == ''){\n\t\tif(turn == 'user'){\n\t\t\tturn = 'comp';\n\t\t\tsetPlayerToComp();\n\t\t}\n\t\telse{\n\t\t\tturn = 'user';\n\t\t\tradioChange = false;\t\t\n\t\t}\n\t}\t\n}//end changeTurn", "function takeTurn () {}", "switchTurn() {\n\t\tif (this.turn == Const.TEAM.B) {\n\t\t\tthis.turn = Const.TEAM.W;\n\t\t}\n\t\telse {\n\t\t\tthis.turn = Const.TEAM.B;\n\t\t}\n\t}", "switchTurn() {\n\t\tif (this.turn == Const.TEAM.B) {\n\t\t\tthis.turn = Const.TEAM.W;\n\t\t}\n\t\telse {\n\t\t\tthis.turn = Const.TEAM.B;\n\t\t}\n\t}", "function playerPass() {\n let currentPlayerNumber = GameManager.playPass();\n // Send it to all players\n io.emit('nextTurn', currentPlayerNumber, GameManager.lastPlayed);\n}", "function playHand(){\n let sendCards = [];\n let playersHand = hand[0];\n for(let i = 0; i < playersHand.length; i++){\n if(cardsToPlay[playersHand[i]]){\n sendCards.push(playersHand[i]);\n } \n }\n reset();\n if(sendCards.length === 0){\n socket.emit(\"pass\");\n } else{\n socket.emit(\"play_cards\", sendCards)\n }\n }", "function playerTurn(){\n\tif (playerCounter%2 === 0) {\n\t\treturn \"player1\";\n\t} else return \"player2\";\n}", "function play() {\n\t\t\n\t\t//this function (defined below) will continue to the next turn\n\t\tadvance();\n\t}", "sendOpponentsTurn(turn) {\n this.socket.emit('opponent', turn);\n }", "deal(firstPlayer, secondPlayer) {\n firstPlayer.hand = [...this.deck.slice(0,26)];\n secondPlayer.hand = [...this.deck.slice(26, 52)];\n }", "function nextTurn() {\r\n if (turnX === true) {\r\n turnX = false;\r\n turnO = true;\r\n $(\"#currentPlayer\").text(\"Current player: O\");\r\n } else if (turnO === true) {\r\n turnO = false;\r\n turnX = true;\r\n $(\"#currentPlayer\").text(\"Current player: X\");\r\n }\r\n }", "function nextPlayer(){\n\t\tif (isWinner()){\n\t\t\talert(\"CONGRATS, We have a winner!\"); \n\t\t\tclearButton.innerText = \"Play Again\"; \n\t\t\treturn;\n\t\t}\n\t\tif (turn === \"x\"){\n\t\t\tturn = \"o\";\n\t\t\tboxColor = \"DarkOrange\";\n\t\t}else {\n\t\t\tturn = \"x\";\n\t\t\tboxColor = \"DarkCyan\";\n\t\t}\n\t}", "CukasPlayer(initialHand) {\n this.hand = initialHand;\n }", "function whos_turn()\n{\n\tconsole.log(\"who's turn run\");\n\tif (player_index == 0){\n\t\t$(\".Xplayer\").addClass(\"playerTurn\");\n\t\t$(\".Oplayer\").removeClass(\"playerTurn\");\n\t}\n\telse {\n\t\t$(\".Xplayer\").removeClass(\"playerTurn\");\n\t\t$(\".Oplayer\").addClass(\"playerTurn\");\n\t}\n}", "function switchTurn() {\n\tvar playerBoxX = document.getElementById(\"playerX\");\n var playerBoxO = document.getElementById(\"playerO\");\n\tif (turn === \"X\") {\n\t\tturn=\"O\"; \n\t\tplayerBoxO.style.visibility = \"visible\";\n\t\tplayerBoxX.style.visibility = \"hidden\";\n\t} else {\n\t\tturn = \"X\";\n\t\tplayerBoxX.style.visibility = \"visible\";\n\t\tplayerBoxO.style.visibility = \"hidden\";\n\t}\n}", "endTurn() {\n if (this.inProgress) {\n // Switch to next player's turn\n this.currentPlayer = this.getOtherPlayer(this.currentPlayer);\n this.startTurn();\n }\n }", "startTurn() {\n this.pendingChip = new Chip({ player: this.currentPlayer });\n if (this.currentPlayer.getNextMove) {\n this.currentPlayer.getNextMove({ game: this }).then((nextMove) => {\n this.emit('async-player:get-next-move', {\n player: this.currentPlayer,\n nextMove\n });\n });\n }\n }", "alternateTurns() {\n this.turn = (this.turn === 'X' ? 'O' : 'X');\n }", "function playerTurn() {\n if (turn % 2 !== 0) {\n playerTurn1.content = '';\n playerTurn2.content = 'Player 2';\n } else {\n playerTurn1.content = 'Player 1';\n playerTurn2.content = '';\n }\n}", "function playerTurn () {\n if (move % 2 !== 0) {\n playerTurnO.style.color = 'springgreen';\n playerTurnX.style.color = 'white';\n playerTurnO.style.boxShadow = 'springgreen 3px 3px';\n playerTurnX.style.boxShadow = 'none';\n playerTurnO.style.textDecoration = 'underline';\n playerTurnX.style.textDecoration = 'none';\n }\n else {\n playerTurnX.style.color = 'springgreen';\n playerTurnO.style.color = 'white';\n playerTurnX.style.boxShadow = 'springgreen 3px 3px';\n playerTurnO.style.boxShadow = 'none';\n playerTurnX.style.textDecoration = 'underline';\n playerTurnO.style.textDecoration = 'none';\n }\n}", "transfer(object){\n if (object === this.encounter.playerShip) this.encounter.win();\n }", "function turnswitcher() {\n\t\"use strict\";\n if (turnswitch === 2) {\n\t\tcharacter = character_O;\n\t\tturnswitch = 1;\n\t\tvarprint = \"Its \" + P_one + \" it's turn\";\n\t} else {\n\t\tcharacter = character_X;\n\t\tturnswitch = 2;\n\t\tvarprint = \"Its \" + P_two + \" it's turn\";\n\t}\n}", "function moveOnToNextPlayer(gamestate) {\n gamestate.currentPlayer = -gamestate.currentPlayer\n gamestate.computerIsThinking = !gamestate.computerIsThinking\n}", "otherPlayer(p) {\n if (p === this.playerID) {\n return this.opponentID;\n } else {\n return this.playerID;\n }\n }", "loseTurn(){\n this.playerTurn = (this.playerTurn % 2) + 1;\n this.scene.rotateCamera();\n this.previousBishops = ['LostTurn'];\n this.activeBishop = null;\n }", "function onStepMade() {\r\n if (turn == PLAYER) {\r\n turn = OPPONENT;\r\n setTimeout(makeStepOppenent, 700);\r\n } else {\r\n //turn = PLAYER;\r\n }\r\n}", "function playGame() {\n if (freezePlay) return;\n if (this === cardOne) return;\n $(this).addClass(\"flip\");\n // Sets first card in play as CardOne and activates turnsCounter(); and boardCheck();\n if (!isFlippedCard) {\n isFlippedCard = true;\n cardOne = this;\n turns++;\n turnsCounter();\n boardCheck();\n\n // If this is the second flip of a turn, activates isPair(); and clearCardInPlay(); to decrement the card in play lists\n } else {\n isFlippedCard = false;\n cardTwo = this;\n clearCardInPlay();\n isPair();\n }\n }", "function letBotMoveProceed(callback) {\n if ((current_turn === tictactoe.first_player) && (player1.type === 'bot')) {\n var move_made = bot_move();\n callback(current_turn, move_made)\n toggleTurn();\n }\n }", "function playAsUser() {\n var userHand = new Hand();\n var askHit = confirm( \"In hand: \" + userHand.printHand() + \". Would you like to hit? Press cancel to stay.\" );\n while( askHit ) {\n userHand.hitMe();\n askHit = confirm( \"In hand: \" + userHand.printHand() + \". Would you like to hit? Press cancel to stay.\" );\n }\n return userHand;\n}", "function WorngCards() {\n card1.classList.remove('flip');\n card2.classList.remove('flip');\n isBoardLocked = false;\n isCardsMatch = false;\n //switch turns if worng \n !leftPlayerTurn ? RightPlayerTurn() : LeftPlayerTurn();\n}", "function swapPlayer(){\n const players = {...state.players};\n players.one.selected = [];\n players.two.selected = [];\n\n players.one.isComputer = !players.one.isComputer;\n players.two.isComputer = !players.two.isComputer;\n\n const oneScoreHolder = players.one.score;\n const oneHighScoreHolder = players.one.highScore;\n\n players.one.score = players.two.score;\n players.one.highScore = players.two.highScore;\n\n players.two.score = oneScoreHolder;\n players.two.highScore = oneHighScoreHolder;\n\n players.one.displayName = players.one.isComputer ? `Player 1 - Computer` : `Player 1`;\n players.two.displayName = players.two.isComputer ? `Player 2 - Computer` : `Player 2`;\n\n dispatch({\n type: 'RESET_GAME',\n payload: {\n players,\n currentPlayerTurn: PLAYER_ONE_CODE,\n board: initBoardArray\n }\n });\n }", "function player() {\n return turn % 2 == 0 ? \"X\" : \"O\"\n}", "function takeTurn() {\n\t\n\t\t//alert(\"In takeTurn\");\n\t\t\n\t\tif (activePlayer.type == \"Human\") {\n\t\t\t\n\t\t\t//alert(\"Player is Human\");\n\t\t\t\n\t\t\tactivateSquareClickedListener();\n\t\t}\n\t\telse {\n\t\t\n\t\t\t//alert(\"Player is Computer\");\n\t\t\t\n\t\t\tsetTimeout(function() {\n\t\t\t\n\t\t\t\tcomputerTurnControl();\n\t\t\t\t\n\t\t\t}, 1000);\n\t\t\t\n\t\t}\n\t}", "function connectPlayerSelf({ player, otherPlayers, timeBeforeStart }) {\n playerSelf.initialize(player);\n activePlayerCount++;\n\n for (let i = 0; i < otherPlayers.length; i++) {\n connectPlayerOther(otherPlayers[i]);\n }\n\n showCountdown(timeBeforeStart);\n }", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function turn(atkType) {\n console.log(\"Kachow\");\n let coinFlip = Math.floor(Math.random() * 2);\n if (coinFlip === 0) {\n character1.attack(character2, atkType);\n //display the messages set to console.log in the atk function in the message space.\n if (character2.hp === 0) {\n endGame();\n }\n character2.attack(character1, atkType);\n //display the messages set to console.log in the atk function in the message space.\n if (character1.hp === 0) {\n endGame();\n }\n } else {\n character2.attack(character1, atkType);\n //display the messages set to console.log in the atk function in the message space.\n if (character1.hp === 0) {\n endGame();\n }\n character1.attack(character2, atkType);\n //display the messages set to console.log in the atk function in the message space.\n if (character2.hp === 0) {\n endGame();\n }\n }\n return;\n }", "takeTurn() {}", "function switchPlayer(_event) {\n // Current mouseposition\n let mousePosition = new Soccer.Vector(_event.offsetX, _event.offsetY);\n // Get the player who is at the current mouseposition\n let playerAtMousePosition = getPlayerAtMousePosition(mousePosition);\n if (playerAtMousePosition && draggedPlayer) {\n // Switch only if player are from the same team\n if (draggedPlayer.team == playerAtMousePosition.team) {\n // Save startpositions of player to be exchanged\n let draggedPlayerStartposition = draggedPlayer.startPosition;\n let playerStartposition = playerAtMousePosition.startPosition;\n // Exchange their start positions\n draggedPlayer.startPosition = playerStartposition;\n playerAtMousePosition.startPosition = draggedPlayerStartposition;\n // Set the position of the field player to its new startposition so that he appears outside the field\n playerAtMousePosition.position = draggedPlayerStartposition;\n // Remove dragged player, otherwise it will stick to the cursor\n draggedPlayer = undefined;\n }\n else {\n // If the conditions for the switch are not given, set dragged player back to its startposition\n draggedPlayer.position = draggedPlayer.startPosition;\n draggedPlayer = undefined;\n }\n }\n }", "function runComputerTurn() {\n const boardState = checkBoard();\n const compTile = ohs ? 'ohs' : 'exes';\n const bestMove = findBestMove(boardState, compTile);\n\n if (exes) {\n $('#' + bestMove).css('background', primaryColor);\n $('#' + bestMove).text('');\n $('#' + bestMove).append('<i class=\\'fa fa-times\\'></i>');\n $('#' + bestMove).addClass('active ex');\n\n checkWinner();\n exes = false;\n ohs = true;\n playerTurn = true;\n } else if (ohs) {\n $('#' + bestMove).css('background', secondaryColor);\n $('#' + bestMove).text('');\n $('#' + bestMove).append('<i class=\\'fa fa-circle-o\\'></i>');\n $('#' + bestMove).addClass('active oh');\n\n checkWinner();\n exes = true;\n ohs = false;\n playerTurn = true;\n }\n}", "function swapTurns(turn) {\n\tif ($playerOne.turn === true) {\n\t\t$playerOne.turn = false;\n\t\t$(\".prompts\").html($playerTwo.name + \" choose a square.\");\n\t\t$(\"#player-two\").css(\"background-color\", \"#ffff66\");\n\t\t$(\"#player-one\").css(\"background-color\", \"white\");\n\t} else if ($playerOne.turn === false) {\n\t\t$playerOne.turn = true;\n\t\t$(\".prompts\").html($playerOne.name + \" choose a square.\")\n\t\t$(\"#player-one\").css(\"background-color\", \"#ffff66\");\n\t\t$(\"#player-two\").css(\"background-color\", \"white\");\n\t} else if ($playerTwo.turn === true) {\n\t\t$playerTwo.turn = false;\n\t\t$(\".prompts\").html($playerOne.name + \" choose a square.\")\n\t\t$(\"#player-one\").css(\"background-color\", \"#ffff66\");\n\t\t$(\"#player-two\").css(\"background-color\", \"white\");\n\t} else if ($playerTwo.turn === false) {\n\t\t$playerTwo.turn = true;\n\t\t$(\".prompts\").html($playerTwo.name + \" choose a square.\")\n\t\t$(\"#player-two\").css(\"background-color\", \"#ffff66\");\n\t\t$(\"#player-one\").css(\"background-color\", \"white\");\n\t}\n}", "function switcher() {\n //if time is odd player 1 asks and player 2 answers and viceversa\n if (isOdd(time) == true) {\n player1.role = \"question\"\n player2.role = \"answer\"\n } else {\n player1.role = \"answer\"\n player2.role = \"question\"\n }\n}", "function switchPlayers(){\r\n if(currentPlayer === 1){\r\n currentPlayer = 2;\r\n restingPlayer = 1;\r\n }\r\n else {\r\n currentPlayer = 1;\r\n restingPlayer = 2;\r\n }\r\n document.getElementById(\"infoDisplay\").innerHTML = \"It is Player: \" + currentPlayer + \"'s turn\";\r\n}", "function turn(squareId, player){\n \n //the selected cell take the symbole of the current player (X or O)\n originalBoard[squareId] = player;\n document.getElementById(squareId).innerText = player;\n \n //test if Game is Won\n let gameWon = checkWin(originalBoard, player);\n //call Game Over if the game is Won\n if(gameWon) gameOver(gameWon);\n}", "function playerTwo() {\n if (!gameOver) {\n //setTimeout makes it take a moment to move so we don't feel so insecure about how long it takes us humans to think!\n setTimeout(function() {\n secureWin();\n thwartWin(); \n genericMove();\n \n }, 700);\n}\n \n}", "playerSwitchComplete(){\n this.switchPlayer();\n }", "function changePlayer() {\n player = player + 1;\n }", "function changePlayer() {\r\n if(player === 1) {\r\n player = 2;\r\n $('#player').html(\"<h2>\" + player2 + \" (Black) it is your turn</h2>\")\r\n } else if (player === 2){\r\n player = 1;\r\n $('#player').html(\"<h2>\" + player1 + \" (Red) it is your turn</h2>\");\r\n }\r\n return; \r\n}", "translateToPlayerHand(): void {\n const x = -this.canvasPosition.x + PLAYER_HAND_COORD_X;\n const y = -this.canvasPosition.y + PLAYER_HAND_COORD_Y;\n this.translate(x, y);\n this.canvasPosition = { x: PLAYER_HAND_COORD_X, y: PLAYER_HAND_COORD_Y };\n }", "function playerTurn(pIndex){\n\n\t//setTimeout(playerRespond, 10000);\n\n\tconsole.log('player ' + pIndex + ' turn');\n\n\tif(typeof SOCKET_LIST[pIndex] != 'undefined') {\n\n\tSOCKET_LIST[pIndex].emit('yourTurn', {msg: 'Your Turn'});\n\t\n\t}else{\n\t\tconsole.log('player ' +pIndex+' does not exist');\n\t\tif(players.length < 2){\n\t\t\tendGame();\n\t\t}else{\n\t\t\tif(typeof pIndex != 'undefined'){\n\t\t\t\tendTurn();\n\t\t\t} else{\n\t\t\t\tendTurn();\n\t\t\t}\n\t\t}\t\n\t}\n\n\t//wait for response\n\n\n\n}", "function blackjackDeal(){\n if(blackjackGame.turnsOver === true && blackjackGame.player_1 === false){\n blackjackGame.turnsOver === false;\n blackjackGame.player_2 = false;\n let winner = computeWinner();\n showResult(winner);\n}}", "function switchTurns(){\n if(turn=== 'H'){\n turn = 'G';\n }\n else{\n turn = 'G';\n for (let i = 0; i < turnCount; i++) {\n turn += '-';\n }\n turnCount++;\n\n }\n //add logic so that game ends after every player goes\n nextRound();\n }", "collectWinnings( otherPlayer ) {\n this.hand = this.hand.concat( this.currentCards, otherPlayer.currentCards )\n this.currentCards = []\n otherPlayer.currentCards = []\n }", "changeTurn() {\n let view = new View();\n\n if (moveMadeCount % 2 == 0) {\n this.move = 'X';\n view.togglePlayerActiveTurn(this.playerOne, this.playerTwo);\n } else {\n this.move = 'O';\n view.togglePlayerActiveTurn(this.playerTwo, this.playerOne);\n }\n }", "function toggleRaisedHand(player) {\n let playerId = player.get('_id');\n let handState = raisedHands[playerId];\n\n if (handState)\n lowerHand(player);\n else\n raiseHand(player);\n }", "function switchPlayers() {\n setTimeout(function() {\n $cards.removeClass('backside')\n $cards.removeClass('matched')\n $cards.off();\n }, exposeTime)\n if (currentPlayer == game.player1) {\n currentPlayer = game.player2\n } else {\n checkWinner();\n currentPlayer = game.player1\n }\n $('.start-game').html(currentPlayer.name)\n $('.start-game').one('click', startRound);\n matches = 0\n time = 0\n}", "forward() {\n this._platformStrategy.forward();\n }" ]
[ "0.6998644", "0.671709", "0.6703266", "0.666196", "0.6554206", "0.6467016", "0.63960004", "0.63847643", "0.6372689", "0.63328445", "0.62752694", "0.62499815", "0.623674", "0.62093663", "0.62032026", "0.6189294", "0.6155482", "0.6132459", "0.6111025", "0.6089528", "0.60598934", "0.60541445", "0.60399675", "0.6025453", "0.60063684", "0.60009664", "0.5992166", "0.5992125", "0.59894013", "0.5989103", "0.5983925", "0.597485", "0.59704846", "0.59675026", "0.5955154", "0.59386003", "0.59371704", "0.5909638", "0.59086025", "0.5895383", "0.58896726", "0.58890325", "0.5873444", "0.5861624", "0.585823", "0.5850963", "0.5830457", "0.5809257", "0.5809257", "0.5801289", "0.578857", "0.5786538", "0.57786214", "0.5778488", "0.57743263", "0.5772615", "0.5768863", "0.5766029", "0.57600695", "0.57573736", "0.5754026", "0.57538396", "0.57398385", "0.5729684", "0.5720861", "0.5698412", "0.56943995", "0.569079", "0.5683195", "0.5666001", "0.56634086", "0.56603587", "0.5654945", "0.56472224", "0.5646534", "0.5644261", "0.5630654", "0.56274885", "0.5616415", "0.5603408", "0.55992746", "0.55913335", "0.55913275", "0.55813783", "0.5579004", "0.55760413", "0.5575911", "0.55755204", "0.55700874", "0.5564485", "0.5561558", "0.55450094", "0.55448425", "0.5540585", "0.5540086", "0.5537512", "0.5533875", "0.55172265", "0.5498492", "0.54954916", "0.5494272" ]
0.0
-1
Diff the expected and the actual when the expected is primitive
function diffPrimitive(context, expected, actual) { if (_.isEqual(expected, actual)) return; context.throw(`diff value, ${JSON.stringify(expected)} ≠ ${JSON.stringify(actual)}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subtracttest(v1, v2, expected) {\n results.total++;\n var r = calculator.subtraction(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "notBeConstantValueOf() {\n this._processArguments(arguments);\n this._printActualForFailure = false;\n\n let passed = true;\n let passDetail;\n let failDetail;\n let differences = {};\n\n let actual = this._actual;\n let expected = this._expected;\n for (let index = 0; index < actual.length; ++index) {\n if (actual[index] !== expected)\n differences[index] = actual[index];\n }\n\n let numberOfDifferences = Object.keys(differences).length;\n passed = numberOfDifferences > 0;\n\n if (passed) {\n let valueString = numberOfDifferences > 1 ? 'values' : 'value';\n passDetail = '${actual} is not constantly ${expected} (contains ' +\n numberOfDifferences + ' different ' + valueString + ').';\n } else {\n failDetail = '${actual} should have contain at least one value ' +\n 'different from ${expected}.';\n }\n\n return this._assert(passed, passDetail, failDetail);\n }", "function diffObject(context, expected, actual, strict) {\n diffType(context, expected, actual);\n let expectedKeys = Object.keys(expected);\n let actualKeys = Object.keys(actual);\n\n if (strict) {\n matchKeys(context, expectedKeys, actualKeys);\n }\n\n expectedKeys.forEach(function(key) {\n diff(context.enter(key), expected[key], actual[key]);\n });\n}", "assertSame(expected, actual)\n {\n Tester.valid(expected, 'mixed')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (\n Tester.is(expected, 'object') &&\n Tester.is(actual, 'object') ||\n Tester.is(expected, 'array') &&\n Tester.is(actual, 'array')\n ) {\n expected = JSON.stringify({\n keys: Object.keys(expected).sort(),\n values: Object.values(expected).sort()\n })\n actual = JSON.stringify({\n keys: Object.keys(actual).sort(),\n values: Object.values(actual).sort()\n })\n } else if (\n Tester.is(expected, 'function') &&\n Tester.is(actual, 'function') ||\n Tester.is(expected, 'regexp') &&\n Tester.is(actual, 'regexp')\n ) {\n expected = expected.toString()\n actual = actual.toString()\n }\n\n if (expected !== actual) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function compare (expected, actual) {\n return () => {\n deepEqual(expected, actual)\n }\n}", "assertEqual(expected, actual)\n {\n Tester.valid(expected, 'mixed')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (\n Tester.is(expected, 'object') &&\n Tester.is(actual, 'object') ||\n Tester.is(expected, 'array') &&\n Tester.is(actual, 'array')\n ) {\n expected = JSON.stringify(Object.keys(expected).sort())\n actual = JSON.stringify(Object.keys(actual).sort())\n } else if (\n Tester.is(expected, 'function') &&\n Tester.is(actual, 'function') ||\n Tester.is(expected, 'regexp') &&\n Tester.is(actual, 'regexp')\n ) {\n expected = expected.toString()\n actual = actual.toString()\n }\n\n if (expected != actual) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function diff(a, b) {\n totalDifference += Math.abs(a - b);\n }", "ExactValue()\n {\n return this.Expected == this.Actual ? \"no error\" : `Expected ${this.Expected} but found ${this.Actual}`\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n const aType = (0, _jestGetType2.default)(a);\n let expectedType = aType;\n let omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== Symbol.for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return (\n ' Comparing two different types of values.' +\n ` Expected ${_chalk2.default.green(expectedType)} but ` +\n `received ${_chalk2.default.red((0, _jestGetType2.default)(b))}.`\n );\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n}", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n var multiline = MULTILINE_REGEXP.test(a) && b.indexOf('\\n') !== -1;\n if (multiline) {\n return (0, _diff_strings2.default)(a, b, options);\n }\n return null;\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);}\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n }", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (typeof Buffer !== \"undefined\" && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {\n if (actual.length !== expected.length) {\n return false;\n }\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) {\n return false;\n }\n }\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (isString(actual) && isString(expected) && actual !== expected) {\n return false;\n } else if (typeof actual !== 'object' && typeof expected !== 'object') {\n return actual === expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "function dividetest(v1, v2, expected) {\n results.total++;\n var r = calculator.division(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == \"object\",\n // equivalence is determined by ==.\n } else if (typeof actual != 'object' && typeof expected != 'object') {\n return actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical \"prototype\" property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "function compare(a, b)\n{\n\tif (!isArray(a) || !isArray(b) || a.length !== b.length)\n\t\treturn \"error\";\n\n\tvar wrongList = [];\n\tfor (var i = 0; i < a.length; i++)\n\t{\n var fa = parseFloat(a[i]);\n var fb = parseFloat(b[i]);\n\n // Allow for non-numeric answers\n if (isNaN(fa) || isNaN(fb))\n {\n console.log(\"One of the inputs is not a number\");\n if (a[i] != b[i])\n wrongList.push(i);\n continue;\n }\n\n trunc = truncate(fa, fb);\n// console.log(\"aTrunk = \" + trunc[0] + \"; bTrunk = \" + trunc[1] + \"; d = \" + trunc[2]);\n\n if (checkEquiv(trunc[0], trunc[1], trunc[2]) === false)\n wrongList.push(i);\n\t}\n\n\treturn {\n iscorrect: (wrongList.length === 0),\n\t\twrong: wrongList,\n equiv: (wrongList.length === 0 ? \"correct\" : \"incorrect\")\n };\n/* \n {\n\t\tequiv: (wrongList.length === 0),\n\t\twrong: wrongList\n\t};\n*/\t\n}", "function diffArray(context, expected, actual, strict) {\n diffType(context, expected, actual);\n let sameLength = expected.length === actual.length;\n if (strict && !sameLength) {\n context.throw(`diff size , ${expected.length} ≠ ${actual.length}`);\n }\n expected.forEach(function(elem, index) {\n diff(context.enter(`[${index}]`), elem, actual[index]);\n });\n}", "function diff(a: any, b: any, options: ?DiffOptions): ?string {\n if (a === b) {\n return NO_DIFF_MESSAGE;\n }\n\n const aType = getType(a);\n let expectedType = aType;\n let omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== Symbol.for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== getType(b)) {\n return (\n ' Comparing two different types of values.' +\n ` Expected ${chalk.green(expectedType)} but ` +\n `received ${chalk.red(getType(b))}.`\n );\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n const multiline = MULTILINE_REGEXP.test(a) && b.indexOf('\\n') !== -1;\n if (multiline) {\n return diffStrings(a, b, options);\n }\n return null;\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n}", "function expect(result, expected) {\n const correct = (result.length!==0) && JSON.stringify(result) === JSON.stringify(expected);;\n if (correct) {\n console.info('Pass!');\n } else {\n console.error(`Failed: ${ result } does not match ${expected }`);\n }\n}", "notBeEqualTo() {\n this._processArguments(arguments);\n return this._assert(\n this._actual !== this._expected,\n '${actual} is not equal to ${expected}.',\n '${actual} should not be equal to ${expected}.');\n }", "function assertSimilar(actual, expected, message) {\n assertOk(JSON.stringify(actual) === JSON.stringify(expected), message);\n }", "function compareNumericProperty(a, b) {\n return b[1] - a[1];\n}", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "beEqualTo() {\n this._processArguments(arguments);\n return this._assert(\n this._actual === this._expected, '${actual} is equal to ${expected}.',\n '${actual} is not equal to ${expected}.');\n }", "function verify (expected, converter, input) {\n let argArr = Object.values(arguments)\n let actual, message = ''\n if (arguments.length >= 3) {\n actual = converter.apply(this, argArr.slice(2))\n message = 'Input: '\n argArr.slice(2).forEach(a =>\n message += shrinkText('' + a) + '\\n'\n )\n } else if (arguments.length == 2) {\n actual = arguments[1]\n input = actual\n }\n\n message += 'Expected: ' + expected + '\\n Actual: ' + actual\n\n if (expected === actual || expected == actual || ('' + expected) == ('' + actual)) {\n pass(message)\n } else {\n error('Comparison Fail\\n' + message)\n }\n}", "ValueType() { \n\n return typeof this.Expected == typeof this.Actual ? this.ExactType() : `Expected type ${typeof this.Expected} but found type ${typeof this.Actual}`\n }", "function multiplytest(v1, v2, expected) {\n results.total++;\n var r = calculator.multiplication(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "compare(expected) {\n return UNEQUAL;\n }", "function shallowEqual(actual, expected) {\n var keys = Object.keys(expected);\n\n var _arr2 = keys;\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var key = _arr2[_i2];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "_areDifferent(a, b) {\n if (a instanceof Date) {\n if (b instanceof Date) {\n return a.getTime() !== b.getTime();\n }\n else if (typeof b === 'string') {\n try {\n return a.getTime() !== new Date(b).getTime();\n }\n catch (err) {\n //\n }\n }\n\n return true;\n }\n\n if (b instanceof Date) {\n if (typeof a === 'string') {\n try {\n return b.getTime() !== new Date(a).getTime();\n }\n catch (err) {\n //\n }\n }\n return true;\n }\n\n if (typeof a !== 'object' || typeof a !== typeof b) {\n if (a !== b) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n if (JSON.stringify(a) !== JSON.stringify(b)) {\n return true;\n }\n else {\n return false;\n }\n }\n }", "function shallowEqual(actual, expected) {\n\t var keys = _Object$keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n\t var key = _arr2[_i3];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function allSame(actual, expected){\n\t\tfor(var l = expected.length; l--;){\n\t\t\tassert.same(expected[l], actual[l]);\n\t\t}\n\t}", "function allSame(actual, expected){\n\t\tfor(var l = expected.length; l--;){\n\t\t\tassert.same(expected[l], actual[l]);\n\t\t}\n\t}", "function equal2() {\n var a = v6; //set number value to a\n var b = v3; //set number value to b\n return a - b;\n}", "function shallowEqual(actual, expected) {\n var keys = _Object$keys(expected);\n\n var _arr2 = keys;\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var key = _arr2[_i3];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "function compareEquality(a, b) {\n if (a === b) {\n //typeconversion, === not converting\n return \"Equal\";\n }\n return \"Not equal\";\n}", "function hasDifferences(a, b) {\n return JSON.stringify(a) !== JSON.stringify(b)\n }", "function difference(a, b) {\n return Math.abs(a - b);\n }", "function testNotEqual(val) {\n if (val!=22) { //Change this line FYI != type convertion\n return \"Not Equal\";\n }\n return \"Equal\";\n}", "function sameValueBoth(a, b) {\n var result = sameValue(a, b);\n assertTrue(result === sameValueZero(a, b));\n return result;\n}", "function cmpval(a,b)\n{ \n if(typeof(a)=== typeof(b))\n {\n console.log(`Result of comparison is ${a===b}`);\n }\n else\n {\n console.log(`Type mismatch`)\n }\n //console.log(`${typeof(a)===typeof(b)}`);\n}", "function diff(a, b) {\n if (a == null || b == null || isNaN(a) || isNaN(b))\n return undefined;\n else if (a<b)\n return undefined; // int rolled over, ignore the value\n else\n return a - b;\n}", "function addtest(v1, v2, expected) {\n results.total++;\n var r = calculator.addition(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t }", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t }", "function equal2(){\n return v4 - v2;\n}", "__equals(actual, expected) {\n if (helpers_1.isEmpty(actual) && helpers_1.isEmpty(expected)) {\n return true;\n }\n else if (typeof actual === 'string' ||\n typeof expected === 'string' ||\n typeof actual === 'number' ||\n typeof expected === 'number' ||\n typeof actual === 'boolean' ||\n typeof expected === 'boolean') {\n return actual === expected;\n }\n else {\n throw new Error(\n // tslint:disable-next-line:max-line-length\n `${this.constructor.name}.__equals is missing an implementation for type '${typeof actual}' of values: ${actual}, ${expected}`);\n }\n }", "function diff(a, b) {\n if (a == null || b == null || isNaN(a) || isNaN(b))\n return 0;\n else\n return Math.max(a - b, 0);\n}", "isAlmostEqual(other) { return this.isAlmostEqualNoPeriodShift(other); }", "function shallowEqual(actual, expected) {\n\t var keys = _Object$keys(expected);\n\n\t for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {\n\t var _ref3;\n\n\t if (_isArray3) {\n\t if (_i3 >= _iterator3.length) break;\n\t _ref3 = _iterator3[_i3++];\n\t } else {\n\t _i3 = _iterator3.next();\n\t if (_i3.done) break;\n\t _ref3 = _i3.value;\n\t }\n\n\t var key = _ref3;\n\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function difference(a, b) {\n // console.log(Math.abs(a - b))\n a = parseInt(a)\n b = parseInt(b)\n return Math.abs(a - b);\n}", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t}", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t}", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t}", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t}", "function compareActualAndExpected(test, actual, expected, patch, file) {\n const actualString = actual.toString();\n const expectedString = expected.toString();\n if (testIsFlaky) {\n try {\n assert.equal(actualString, expectedString, (patch ? patch + '/' : patch) + file + ' is different between actual and expected');\n }\n catch (e) {\n console.log(\"\\nFlaky test error!\\n\");\n console.log(\"MESSAGE:\\n\" + e.message, '\\n');\n console.log('EXPECTED:\\n', e.expected, '\\n');\n console.log(\"ACTUAL:\\n\", e.actual, '\\n');\n }\n }\n else {\n assert.equal(actualString, expectedString, (patch ? patch + '/' : patch) + file + ' is different between actual and expected');\n }\n}", "assertType(expected, actual)\n {\n Tester.valid(expected, 'string')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (Tester.type(actual) !== expected) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function test(actual, expected) {\n if (JSON.stringify(actual) === JSON.stringify(expected)) {\n console.log(\"Yay! Test PASSED.\");\n } else {\n console.error(\"Test FAILED. Keep trying!\");\n console.log(\" actual: \", actual);\n console.log(\" expected: \", expected);\n console.trace();\n }\n}", "function testPrimitives() {\n let x = true;\n let y = 10;\n let z = \"Hello\";\n\n let xy = x + y;\n let yz = y + z;\n let xz = x + z;\n\n console.log(\"xy: \" + xy);\n console.log(\"xz: \" + xz);\n console.log(\"yz: \" + yz);\n console.log(xy);\n console.log(xz);\n console.log(yz);\n}", "function assertEquals(expected, received, description) {\n if(expected.compare)\n console.assert(expected.compare(received), description,\n `\\nExpected: '${expected}'\\tReceived: '${received}'`);\n else\n console.assert(expected == received, description,\n `\\nExpected: '${expected}'\\tReceived: '${received}'`);\n}", "function compares(x, y){\n if (x /0 === y/0){\n console.log(\"Yes they are the same\");\n console.log(x / y);\n } else {\n console.log(\"no they are not equal\");\n }\n}", "beConstantValueOf() {\n this._processArguments(arguments);\n this._printActualForFailure = false;\n\n let passed = true;\n let passDetail, failDetail;\n let errors = {};\n\n let actual = this._actual;\n let expected = this._expected;\n for (let index = 0; index < actual.length; ++index) {\n if (actual[index] !== expected)\n errors[index] = actual[index];\n }\n\n let numberOfErrors = Object.keys(errors).length;\n passed = numberOfErrors === 0;\n\n if (passed) {\n passDetail = '${actual} contains only the constant ${expected}.';\n } else {\n let counter = 0;\n failDetail =\n '${actual}: Expected ${expected} for all values but found ' +\n numberOfErrors + ' unexpected values: ';\n failDetail += '\\n\\tIndex\\tActual';\n for (let errorIndex in errors) {\n failDetail += '\\n\\t[' + errorIndex + ']' +\n '\\t' + errors[errorIndex];\n if (++counter >= this._options.numberOfErrors) {\n failDetail +=\n '\\n\\t...and ' + (numberOfErrors - counter) + ' more errors.';\n break;\n }\n }\n }\n\n return this._assert(passed, passDetail, failDetail);\n }", "function compare(a, b)\n{\n\tif (!isArray(a) || !isArray(b) || a.length !== b.length)\n\t\treturn \"error\";\n\n\tvar wrongList = [];\n\tfor (var i = 0; i < a.length; i++)\n\t{\n\t\tif (checkEquiv(a[i], b[i], defSigDig) === false)\n\t\t\twrongList.push(i);\n\t}\n\n\treturn {\n iscorrect: (wrongList.length === 0),\n\t\twrong: wrongList,\n equiv: (wrongList.length === 0 ? \"correct\" : \"incorrect\")\n };\n/* {\n\t\tequiv: (wrongList.length === 0),\n\t\twrong: wrongList\n\t};\n*/\t\n}", "function compare(expected, result){\n for(var key in expected){\n if(expected.hasOwnProperty(key)){\n if(!result.hasOwnProperty(key) || result[key] !== expected[key]){ \n return false;\n }\n }\n }\n return true;\n}", "function areEqual(a, b) { \r\n var r = a - b;\r\n return (r >= 0 && r < .00001) || (r < 0 && r > -.00001); \r\n }", "function compatibility(arr1, arr2) {\n var totalDiff = 0;\n for (let i in arr1) {\n totalDiff = totalDiff + difference(arr1[i], arr2[i])\n }\n return totalDiff\n}", "function assertEq(v1, v2, m)\n{\n if (!SameValue(v1, v2))\n {\n throw \"assertion failed: \" +\n \"got \" + uneval(v1) + \", expected \" + uneval(v2) +\n (m ? \": \" + m : \"\");\n }\n}", "function EXPECT_EQ(x1, x2, stringOnFail) {\n if (isNaN(x1) || isNaN(x2) || x1 != x2) {\n LOG('EXPECT_EQ FAILED');\n LOG('x1: ' + x1);\n LOG('x2: ' + x2);\n LOG(stringOnFail);\n numErrors_ += 1;\n }\n}", "function assertBNEquals (message, expected, actual) {\n assert (\n message + \" (expected: \" + expected + \", actual: \" + actual + \")\",\n web3.toBigNumber(expected).eq (web3.toBigNumber (actual)));\n}", "function looseEqual(a, b) {\n return true;\n }", "function diff(a, b)\n{\n if (a == null || b == null)\n return 0;\n else\n return Math.max(a - b, 0);\n}", "function diff(a, b)\n{\n if (a == null || b == null)\n return 0;\n else\n return Math.max(a - b, 0);\n}", "function testTrueLooseEqualityComparison(){\n var strOne = \"1\";\n var numOne = 1;\n\n return strOne == numOne;\n}", "function assertRectsEqual(expected, actual) {\n if (!goog.math.Rect.equals(expected, actual)) {\n assertEquals(expected, actual);\n }\n}", "function diff(v1, v2) {\n return {\n x: v1.x - v2.x,\n y: v1.y - v2.y\n };\n}", "function assertArrayEquals(a, b, desc) {\n const arrayA = JSON.stringify(a);\n const arrayB = JSON.stringify(b);\n if (arrayA !== arrayB) {\n console.log(`${desc} ... FAIL: ${arrayA} != ${arrayB}`)\n } else {\n console.log(`${desc} ... PASS`);\n }\n}", "function assertEqual(actual, expected) {\n if (actual === expected) { \n console.log('passed');\n } else {\n console.log('FAILED expected ' + expected + ', but got ' + actual);\n }\n}", "function equal(expected, actual, _errors, _path) {\t\n\tvar errors = _errors || [];\n\tvar initialErrors = errors.length;\n\tvar path = _path || [\"root\"];\n\tif(typeof path == 'string')\n\t path = [path];\n\tfunction getPathString(path) {\n\t\tvar pathString = \"\";\n\t\tfor(var i=0; i<path.length; i++) {\n\t\t\tpathString += path[i];\n\t\t}\n\t\treturn pathString;\n\t}\n\t\n\tif(typeof expected != typeof actual) {\n\t\terrors.push(\"Actual type '\"+typeof actual+\"' doesn't match expected type '\"+typeof expected+\"' at \"+getPathString(path));\n\t}\t\n\tif(expected instanceof Array) {\n\t\tif(expected.length!=actual.length)\n\t\t\terrors.push(\"Actual array has length: \"+actual.length+\" but expected length is: \"+expected.length+\" at \"+getPathString(path));\n\t\telse {\n\t\t\tfor(var i=0; i<expected.length; i++) {\n\t\t\t\tpath.push(\"[\"+i+\"]\");\n\t\t\t\tequal(expected[i], actual[i], errors, path);\n\t\t\t\tpath.pop();\n\t\t\t}\n\t\t}\n\t}\n\telse if(typeof expected=='object') {\n\t\tfor(var p in expected) {\n\t\t\tpath.push(\".\"+p);\n\t\t\tif(actual.hasOwnProperty(p))\n\t\t\t\tequal(expected[p], actual[p], errors, path);\n\t\t\telse {\n\t\t\t \terrors.push(\"Object is missing expected property '\"+p+\"' at \"+getPathString(path));\n\t\t\t}\n\t\t\tpath.pop();\n\t\t}\n\t}\n\telse if(expected!==actual) {\n\t\terrors.push(\"Actual value (\"+actual+\") doesn't match expected value (\"+expected+\") at \"+getPathString(path));\n\t}\n\treturn !errors.length>initialErrors;\n}", "function compareGoldens(actual, expected) {\n const newCircularDeps = [];\n const fixedCircularDeps = [];\n actual.forEach(a => {\n if (!expected.find(e => isSameCircularDependency(a, e))) {\n newCircularDeps.push(a);\n }\n });\n expected.forEach(e => {\n if (!actual.find(a => isSameCircularDependency(e, a))) {\n fixedCircularDeps.push(e);\n }\n });\n return { newCircularDeps, fixedCircularDeps };\n}", "cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }", "function compareNumeric(a, b) {\r\n return b - a;\r\n}", "function shallowEqual(actual /*: Object*/, expected /*: Object*/) /*: boolean*/ {\n\t var keys = _Object$keys(expected);\n\n\t for (var _iterator3 = (keys /*: Array<string>*/), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {\n\t var _ref3;\n\n\t if (_isArray3) {\n\t if (_i3 >= _iterator3.length) break;\n\t _ref3 = _iterator3[_i3++];\n\t } else {\n\t _i3 = _iterator3.next();\n\t if (_i3.done) break;\n\t _ref3 = _i3.value;\n\t }\n\n\t var key = _ref3;\n\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "ExactType() { \n switch (`${typeof this.Expected}`) {\n case 'number': \n case 'string':\n return this.ExactValue()\n break; \n case 'object': \n return this.ArrayLength()\n break; \n default: \n return `Unexpected data type ${typeof this.Expected} found, this program can only handle strings, numbers, and arrays`\n }\n }", "function jequal(o1, o2) {\n expect(normalize(o1)).toEqual(normalize(o2));\n}", "function compare(a, b) {\n if (a.totalDifference < b.totalDifference) {\n return -1;\n }\n if (a.totalDifference > b.totalDifference) {\n return 1;\n }\n return 0;\n }", "function assertObjectsEqual(actual, expected, testName) {\n // your code here\n var check = 0;\n if ( Object.keys(actual).length === Object.keys(expected).length) {\n for ( var key in actual ) {\n if( actual[key] === expected[key] ) {\n check ++;\n }\n }\n if( Object.keys(actual).length === check ) {\n console.log('passed');\n }\n }\n console.log('FAILED ' + testName + ' expected: ' + JSON.stringify(expected) + ' instead got ' + JSON.stringify(actual));\n}", "function looseEqual(a,b){var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){return JSON.stringify(a)===JSON.stringify(b);}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "function SameValue(x, y) {\n if (typeof x !== typeof y) return false;\n switch (typeof x) {\n case 'undefined':\n return true;\n case 'number':\n if (x !== x && y !== y) return true;\n if (x === 0 && y === 0) return 1/x === 1/y;\n return x === y;\n case 'boolean':\n case 'string':\n case 'object':\n default:\n return x === y;\n }\n }", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}" ]
[ "0.61451936", "0.60641617", "0.60108227", "0.5935327", "0.5932052", "0.59303796", "0.59246814", "0.59134644", "0.5905881", "0.59023505", "0.59019244", "0.59019244", "0.58855927", "0.5878998", "0.5865687", "0.5859692", "0.5855156", "0.58326507", "0.580832", "0.5803507", "0.5772113", "0.5750167", "0.5741619", "0.5741619", "0.57193846", "0.57167625", "0.5715576", "0.5713106", "0.56997406", "0.56996316", "0.56822133", "0.568174", "0.5676036", "0.5676036", "0.5658501", "0.5634603", "0.5621922", "0.5621576", "0.5597275", "0.5584949", "0.557013", "0.55342525", "0.55218774", "0.55175084", "0.5508683", "0.5508683", "0.5496836", "0.5496827", "0.5464854", "0.5462059", "0.54516673", "0.5448635", "0.5446215", "0.5446215", "0.5446215", "0.5446215", "0.54361296", "0.5435786", "0.5434222", "0.54252386", "0.54223835", "0.541448", "0.54018545", "0.5393767", "0.5389201", "0.5369759", "0.5368245", "0.53660953", "0.53596103", "0.53546435", "0.5350475", "0.53475875", "0.53475875", "0.5342671", "0.53403443", "0.5340292", "0.53393286", "0.5332262", "0.5318473", "0.5316971", "0.53167355", "0.5313538", "0.53025186", "0.5298964", "0.52879363", "0.5285319", "0.527786", "0.5267307", "0.52659976", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033" ]
0.78268546
0
Diff the expected and the actual when the expected is primitive
function diffArray(context, expected, actual, strict) { diffType(context, expected, actual); let sameLength = expected.length === actual.length; if (strict && !sameLength) { context.throw(`diff size , ${expected.length} ≠ ${actual.length}`); } expected.forEach(function(elem, index) { diff(context.enter(`[${index}]`), elem, actual[index]); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diffPrimitive(context, expected, actual) {\n if (_.isEqual(expected, actual)) return;\n context.throw(`diff value, ${JSON.stringify(expected)} ≠ ${JSON.stringify(actual)}`);\n}", "function subtracttest(v1, v2, expected) {\n results.total++;\n var r = calculator.subtraction(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "notBeConstantValueOf() {\n this._processArguments(arguments);\n this._printActualForFailure = false;\n\n let passed = true;\n let passDetail;\n let failDetail;\n let differences = {};\n\n let actual = this._actual;\n let expected = this._expected;\n for (let index = 0; index < actual.length; ++index) {\n if (actual[index] !== expected)\n differences[index] = actual[index];\n }\n\n let numberOfDifferences = Object.keys(differences).length;\n passed = numberOfDifferences > 0;\n\n if (passed) {\n let valueString = numberOfDifferences > 1 ? 'values' : 'value';\n passDetail = '${actual} is not constantly ${expected} (contains ' +\n numberOfDifferences + ' different ' + valueString + ').';\n } else {\n failDetail = '${actual} should have contain at least one value ' +\n 'different from ${expected}.';\n }\n\n return this._assert(passed, passDetail, failDetail);\n }", "function diffObject(context, expected, actual, strict) {\n diffType(context, expected, actual);\n let expectedKeys = Object.keys(expected);\n let actualKeys = Object.keys(actual);\n\n if (strict) {\n matchKeys(context, expectedKeys, actualKeys);\n }\n\n expectedKeys.forEach(function(key) {\n diff(context.enter(key), expected[key], actual[key]);\n });\n}", "assertSame(expected, actual)\n {\n Tester.valid(expected, 'mixed')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (\n Tester.is(expected, 'object') &&\n Tester.is(actual, 'object') ||\n Tester.is(expected, 'array') &&\n Tester.is(actual, 'array')\n ) {\n expected = JSON.stringify({\n keys: Object.keys(expected).sort(),\n values: Object.values(expected).sort()\n })\n actual = JSON.stringify({\n keys: Object.keys(actual).sort(),\n values: Object.values(actual).sort()\n })\n } else if (\n Tester.is(expected, 'function') &&\n Tester.is(actual, 'function') ||\n Tester.is(expected, 'regexp') &&\n Tester.is(actual, 'regexp')\n ) {\n expected = expected.toString()\n actual = actual.toString()\n }\n\n if (expected !== actual) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function compare (expected, actual) {\n return () => {\n deepEqual(expected, actual)\n }\n}", "assertEqual(expected, actual)\n {\n Tester.valid(expected, 'mixed')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (\n Tester.is(expected, 'object') &&\n Tester.is(actual, 'object') ||\n Tester.is(expected, 'array') &&\n Tester.is(actual, 'array')\n ) {\n expected = JSON.stringify(Object.keys(expected).sort())\n actual = JSON.stringify(Object.keys(actual).sort())\n } else if (\n Tester.is(expected, 'function') &&\n Tester.is(actual, 'function') ||\n Tester.is(expected, 'regexp') &&\n Tester.is(actual, 'regexp')\n ) {\n expected = expected.toString()\n actual = actual.toString()\n }\n\n if (expected != actual) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function diff(a, b) {\n totalDifference += Math.abs(a - b);\n }", "ExactValue()\n {\n return this.Expected == this.Actual ? \"no error\" : `Expected ${this.Expected} but found ${this.Actual}`\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n const aType = (0, _jestGetType2.default)(a);\n let expectedType = aType;\n let omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== Symbol.for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return (\n ' Comparing two different types of values.' +\n ` Expected ${_chalk2.default.green(expectedType)} but ` +\n `received ${_chalk2.default.red((0, _jestGetType2.default)(b))}.`\n );\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n}", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n var multiline = MULTILINE_REGEXP.test(a) && b.indexOf('\\n') !== -1;\n if (multiline) {\n return (0, _diff_strings2.default)(a, b, options);\n }\n return null;\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);}\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n }", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (typeof Buffer !== \"undefined\" && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {\n if (actual.length !== expected.length) {\n return false;\n }\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) {\n return false;\n }\n }\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (isString(actual) && isString(expected) && actual !== expected) {\n return false;\n } else if (typeof actual !== 'object' && typeof expected !== 'object') {\n return actual === expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "function dividetest(v1, v2, expected) {\n results.total++;\n var r = calculator.division(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == \"object\",\n // equivalence is determined by ==.\n } else if (typeof actual != 'object' && typeof expected != 'object') {\n return actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical \"prototype\" property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "function compare(a, b)\n{\n\tif (!isArray(a) || !isArray(b) || a.length !== b.length)\n\t\treturn \"error\";\n\n\tvar wrongList = [];\n\tfor (var i = 0; i < a.length; i++)\n\t{\n var fa = parseFloat(a[i]);\n var fb = parseFloat(b[i]);\n\n // Allow for non-numeric answers\n if (isNaN(fa) || isNaN(fb))\n {\n console.log(\"One of the inputs is not a number\");\n if (a[i] != b[i])\n wrongList.push(i);\n continue;\n }\n\n trunc = truncate(fa, fb);\n// console.log(\"aTrunk = \" + trunc[0] + \"; bTrunk = \" + trunc[1] + \"; d = \" + trunc[2]);\n\n if (checkEquiv(trunc[0], trunc[1], trunc[2]) === false)\n wrongList.push(i);\n\t}\n\n\treturn {\n iscorrect: (wrongList.length === 0),\n\t\twrong: wrongList,\n equiv: (wrongList.length === 0 ? \"correct\" : \"incorrect\")\n };\n/* \n {\n\t\tequiv: (wrongList.length === 0),\n\t\twrong: wrongList\n\t};\n*/\t\n}", "function diff(a: any, b: any, options: ?DiffOptions): ?string {\n if (a === b) {\n return NO_DIFF_MESSAGE;\n }\n\n const aType = getType(a);\n let expectedType = aType;\n let omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== Symbol.for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== getType(b)) {\n return (\n ' Comparing two different types of values.' +\n ` Expected ${chalk.green(expectedType)} but ` +\n `received ${chalk.red(getType(b))}.`\n );\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n const multiline = MULTILINE_REGEXP.test(a) && b.indexOf('\\n') !== -1;\n if (multiline) {\n return diffStrings(a, b, options);\n }\n return null;\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n}", "function expect(result, expected) {\n const correct = (result.length!==0) && JSON.stringify(result) === JSON.stringify(expected);;\n if (correct) {\n console.info('Pass!');\n } else {\n console.error(`Failed: ${ result } does not match ${expected }`);\n }\n}", "notBeEqualTo() {\n this._processArguments(arguments);\n return this._assert(\n this._actual !== this._expected,\n '${actual} is not equal to ${expected}.',\n '${actual} should not be equal to ${expected}.');\n }", "function assertSimilar(actual, expected, message) {\n assertOk(JSON.stringify(actual) === JSON.stringify(expected), message);\n }", "function compareNumericProperty(a, b) {\n return b[1] - a[1];\n}", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "beEqualTo() {\n this._processArguments(arguments);\n return this._assert(\n this._actual === this._expected, '${actual} is equal to ${expected}.',\n '${actual} is not equal to ${expected}.');\n }", "function verify (expected, converter, input) {\n let argArr = Object.values(arguments)\n let actual, message = ''\n if (arguments.length >= 3) {\n actual = converter.apply(this, argArr.slice(2))\n message = 'Input: '\n argArr.slice(2).forEach(a =>\n message += shrinkText('' + a) + '\\n'\n )\n } else if (arguments.length == 2) {\n actual = arguments[1]\n input = actual\n }\n\n message += 'Expected: ' + expected + '\\n Actual: ' + actual\n\n if (expected === actual || expected == actual || ('' + expected) == ('' + actual)) {\n pass(message)\n } else {\n error('Comparison Fail\\n' + message)\n }\n}", "ValueType() { \n\n return typeof this.Expected == typeof this.Actual ? this.ExactType() : `Expected type ${typeof this.Expected} but found type ${typeof this.Actual}`\n }", "function multiplytest(v1, v2, expected) {\n results.total++;\n var r = calculator.multiplication(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "compare(expected) {\n return UNEQUAL;\n }", "function shallowEqual(actual, expected) {\n var keys = Object.keys(expected);\n\n var _arr2 = keys;\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var key = _arr2[_i2];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "_areDifferent(a, b) {\n if (a instanceof Date) {\n if (b instanceof Date) {\n return a.getTime() !== b.getTime();\n }\n else if (typeof b === 'string') {\n try {\n return a.getTime() !== new Date(b).getTime();\n }\n catch (err) {\n //\n }\n }\n\n return true;\n }\n\n if (b instanceof Date) {\n if (typeof a === 'string') {\n try {\n return b.getTime() !== new Date(a).getTime();\n }\n catch (err) {\n //\n }\n }\n return true;\n }\n\n if (typeof a !== 'object' || typeof a !== typeof b) {\n if (a !== b) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n if (JSON.stringify(a) !== JSON.stringify(b)) {\n return true;\n }\n else {\n return false;\n }\n }\n }", "function shallowEqual(actual, expected) {\n\t var keys = _Object$keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n\t var key = _arr2[_i3];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function allSame(actual, expected){\n\t\tfor(var l = expected.length; l--;){\n\t\t\tassert.same(expected[l], actual[l]);\n\t\t}\n\t}", "function allSame(actual, expected){\n\t\tfor(var l = expected.length; l--;){\n\t\t\tassert.same(expected[l], actual[l]);\n\t\t}\n\t}", "function equal2() {\n var a = v6; //set number value to a\n var b = v3; //set number value to b\n return a - b;\n}", "function shallowEqual(actual, expected) {\n var keys = _Object$keys(expected);\n\n var _arr2 = keys;\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var key = _arr2[_i3];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "function compareEquality(a, b) {\n if (a === b) {\n //typeconversion, === not converting\n return \"Equal\";\n }\n return \"Not equal\";\n}", "function hasDifferences(a, b) {\n return JSON.stringify(a) !== JSON.stringify(b)\n }", "function difference(a, b) {\n return Math.abs(a - b);\n }", "function testNotEqual(val) {\n if (val!=22) { //Change this line FYI != type convertion\n return \"Not Equal\";\n }\n return \"Equal\";\n}", "function sameValueBoth(a, b) {\n var result = sameValue(a, b);\n assertTrue(result === sameValueZero(a, b));\n return result;\n}", "function cmpval(a,b)\n{ \n if(typeof(a)=== typeof(b))\n {\n console.log(`Result of comparison is ${a===b}`);\n }\n else\n {\n console.log(`Type mismatch`)\n }\n //console.log(`${typeof(a)===typeof(b)}`);\n}", "function diff(a, b) {\n if (a == null || b == null || isNaN(a) || isNaN(b))\n return undefined;\n else if (a<b)\n return undefined; // int rolled over, ignore the value\n else\n return a - b;\n}", "function addtest(v1, v2, expected) {\n results.total++;\n var r = calculator.addition(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t }", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t }", "function equal2(){\n return v4 - v2;\n}", "__equals(actual, expected) {\n if (helpers_1.isEmpty(actual) && helpers_1.isEmpty(expected)) {\n return true;\n }\n else if (typeof actual === 'string' ||\n typeof expected === 'string' ||\n typeof actual === 'number' ||\n typeof expected === 'number' ||\n typeof actual === 'boolean' ||\n typeof expected === 'boolean') {\n return actual === expected;\n }\n else {\n throw new Error(\n // tslint:disable-next-line:max-line-length\n `${this.constructor.name}.__equals is missing an implementation for type '${typeof actual}' of values: ${actual}, ${expected}`);\n }\n }", "function diff(a, b) {\n if (a == null || b == null || isNaN(a) || isNaN(b))\n return 0;\n else\n return Math.max(a - b, 0);\n}", "isAlmostEqual(other) { return this.isAlmostEqualNoPeriodShift(other); }", "function shallowEqual(actual, expected) {\n\t var keys = _Object$keys(expected);\n\n\t for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {\n\t var _ref3;\n\n\t if (_isArray3) {\n\t if (_i3 >= _iterator3.length) break;\n\t _ref3 = _iterator3[_i3++];\n\t } else {\n\t _i3 = _iterator3.next();\n\t if (_i3.done) break;\n\t _ref3 = _i3.value;\n\t }\n\n\t var key = _ref3;\n\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function difference(a, b) {\n // console.log(Math.abs(a - b))\n a = parseInt(a)\n b = parseInt(b)\n return Math.abs(a - b);\n}", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t}", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t}", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t}", "function looseIdentical(a, b) {\n\t return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n\t}", "function compareActualAndExpected(test, actual, expected, patch, file) {\n const actualString = actual.toString();\n const expectedString = expected.toString();\n if (testIsFlaky) {\n try {\n assert.equal(actualString, expectedString, (patch ? patch + '/' : patch) + file + ' is different between actual and expected');\n }\n catch (e) {\n console.log(\"\\nFlaky test error!\\n\");\n console.log(\"MESSAGE:\\n\" + e.message, '\\n');\n console.log('EXPECTED:\\n', e.expected, '\\n');\n console.log(\"ACTUAL:\\n\", e.actual, '\\n');\n }\n }\n else {\n assert.equal(actualString, expectedString, (patch ? patch + '/' : patch) + file + ' is different between actual and expected');\n }\n}", "assertType(expected, actual)\n {\n Tester.valid(expected, 'string')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (Tester.type(actual) !== expected) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function test(actual, expected) {\n if (JSON.stringify(actual) === JSON.stringify(expected)) {\n console.log(\"Yay! Test PASSED.\");\n } else {\n console.error(\"Test FAILED. Keep trying!\");\n console.log(\" actual: \", actual);\n console.log(\" expected: \", expected);\n console.trace();\n }\n}", "function testPrimitives() {\n let x = true;\n let y = 10;\n let z = \"Hello\";\n\n let xy = x + y;\n let yz = y + z;\n let xz = x + z;\n\n console.log(\"xy: \" + xy);\n console.log(\"xz: \" + xz);\n console.log(\"yz: \" + yz);\n console.log(xy);\n console.log(xz);\n console.log(yz);\n}", "function assertEquals(expected, received, description) {\n if(expected.compare)\n console.assert(expected.compare(received), description,\n `\\nExpected: '${expected}'\\tReceived: '${received}'`);\n else\n console.assert(expected == received, description,\n `\\nExpected: '${expected}'\\tReceived: '${received}'`);\n}", "function compares(x, y){\n if (x /0 === y/0){\n console.log(\"Yes they are the same\");\n console.log(x / y);\n } else {\n console.log(\"no they are not equal\");\n }\n}", "beConstantValueOf() {\n this._processArguments(arguments);\n this._printActualForFailure = false;\n\n let passed = true;\n let passDetail, failDetail;\n let errors = {};\n\n let actual = this._actual;\n let expected = this._expected;\n for (let index = 0; index < actual.length; ++index) {\n if (actual[index] !== expected)\n errors[index] = actual[index];\n }\n\n let numberOfErrors = Object.keys(errors).length;\n passed = numberOfErrors === 0;\n\n if (passed) {\n passDetail = '${actual} contains only the constant ${expected}.';\n } else {\n let counter = 0;\n failDetail =\n '${actual}: Expected ${expected} for all values but found ' +\n numberOfErrors + ' unexpected values: ';\n failDetail += '\\n\\tIndex\\tActual';\n for (let errorIndex in errors) {\n failDetail += '\\n\\t[' + errorIndex + ']' +\n '\\t' + errors[errorIndex];\n if (++counter >= this._options.numberOfErrors) {\n failDetail +=\n '\\n\\t...and ' + (numberOfErrors - counter) + ' more errors.';\n break;\n }\n }\n }\n\n return this._assert(passed, passDetail, failDetail);\n }", "function compare(a, b)\n{\n\tif (!isArray(a) || !isArray(b) || a.length !== b.length)\n\t\treturn \"error\";\n\n\tvar wrongList = [];\n\tfor (var i = 0; i < a.length; i++)\n\t{\n\t\tif (checkEquiv(a[i], b[i], defSigDig) === false)\n\t\t\twrongList.push(i);\n\t}\n\n\treturn {\n iscorrect: (wrongList.length === 0),\n\t\twrong: wrongList,\n equiv: (wrongList.length === 0 ? \"correct\" : \"incorrect\")\n };\n/* {\n\t\tequiv: (wrongList.length === 0),\n\t\twrong: wrongList\n\t};\n*/\t\n}", "function compare(expected, result){\n for(var key in expected){\n if(expected.hasOwnProperty(key)){\n if(!result.hasOwnProperty(key) || result[key] !== expected[key]){ \n return false;\n }\n }\n }\n return true;\n}", "function areEqual(a, b) { \r\n var r = a - b;\r\n return (r >= 0 && r < .00001) || (r < 0 && r > -.00001); \r\n }", "function compatibility(arr1, arr2) {\n var totalDiff = 0;\n for (let i in arr1) {\n totalDiff = totalDiff + difference(arr1[i], arr2[i])\n }\n return totalDiff\n}", "function assertEq(v1, v2, m)\n{\n if (!SameValue(v1, v2))\n {\n throw \"assertion failed: \" +\n \"got \" + uneval(v1) + \", expected \" + uneval(v2) +\n (m ? \": \" + m : \"\");\n }\n}", "function EXPECT_EQ(x1, x2, stringOnFail) {\n if (isNaN(x1) || isNaN(x2) || x1 != x2) {\n LOG('EXPECT_EQ FAILED');\n LOG('x1: ' + x1);\n LOG('x2: ' + x2);\n LOG(stringOnFail);\n numErrors_ += 1;\n }\n}", "function assertBNEquals (message, expected, actual) {\n assert (\n message + \" (expected: \" + expected + \", actual: \" + actual + \")\",\n web3.toBigNumber(expected).eq (web3.toBigNumber (actual)));\n}", "function looseEqual(a, b) {\n return true;\n }", "function diff(a, b)\n{\n if (a == null || b == null)\n return 0;\n else\n return Math.max(a - b, 0);\n}", "function diff(a, b)\n{\n if (a == null || b == null)\n return 0;\n else\n return Math.max(a - b, 0);\n}", "function testTrueLooseEqualityComparison(){\n var strOne = \"1\";\n var numOne = 1;\n\n return strOne == numOne;\n}", "function assertRectsEqual(expected, actual) {\n if (!goog.math.Rect.equals(expected, actual)) {\n assertEquals(expected, actual);\n }\n}", "function diff(v1, v2) {\n return {\n x: v1.x - v2.x,\n y: v1.y - v2.y\n };\n}", "function assertArrayEquals(a, b, desc) {\n const arrayA = JSON.stringify(a);\n const arrayB = JSON.stringify(b);\n if (arrayA !== arrayB) {\n console.log(`${desc} ... FAIL: ${arrayA} != ${arrayB}`)\n } else {\n console.log(`${desc} ... PASS`);\n }\n}", "function assertEqual(actual, expected) {\n if (actual === expected) { \n console.log('passed');\n } else {\n console.log('FAILED expected ' + expected + ', but got ' + actual);\n }\n}", "function equal(expected, actual, _errors, _path) {\t\n\tvar errors = _errors || [];\n\tvar initialErrors = errors.length;\n\tvar path = _path || [\"root\"];\n\tif(typeof path == 'string')\n\t path = [path];\n\tfunction getPathString(path) {\n\t\tvar pathString = \"\";\n\t\tfor(var i=0; i<path.length; i++) {\n\t\t\tpathString += path[i];\n\t\t}\n\t\treturn pathString;\n\t}\n\t\n\tif(typeof expected != typeof actual) {\n\t\terrors.push(\"Actual type '\"+typeof actual+\"' doesn't match expected type '\"+typeof expected+\"' at \"+getPathString(path));\n\t}\t\n\tif(expected instanceof Array) {\n\t\tif(expected.length!=actual.length)\n\t\t\terrors.push(\"Actual array has length: \"+actual.length+\" but expected length is: \"+expected.length+\" at \"+getPathString(path));\n\t\telse {\n\t\t\tfor(var i=0; i<expected.length; i++) {\n\t\t\t\tpath.push(\"[\"+i+\"]\");\n\t\t\t\tequal(expected[i], actual[i], errors, path);\n\t\t\t\tpath.pop();\n\t\t\t}\n\t\t}\n\t}\n\telse if(typeof expected=='object') {\n\t\tfor(var p in expected) {\n\t\t\tpath.push(\".\"+p);\n\t\t\tif(actual.hasOwnProperty(p))\n\t\t\t\tequal(expected[p], actual[p], errors, path);\n\t\t\telse {\n\t\t\t \terrors.push(\"Object is missing expected property '\"+p+\"' at \"+getPathString(path));\n\t\t\t}\n\t\t\tpath.pop();\n\t\t}\n\t}\n\telse if(expected!==actual) {\n\t\terrors.push(\"Actual value (\"+actual+\") doesn't match expected value (\"+expected+\") at \"+getPathString(path));\n\t}\n\treturn !errors.length>initialErrors;\n}", "function compareGoldens(actual, expected) {\n const newCircularDeps = [];\n const fixedCircularDeps = [];\n actual.forEach(a => {\n if (!expected.find(e => isSameCircularDependency(a, e))) {\n newCircularDeps.push(a);\n }\n });\n expected.forEach(e => {\n if (!actual.find(a => isSameCircularDependency(e, a))) {\n fixedCircularDeps.push(e);\n }\n });\n return { newCircularDeps, fixedCircularDeps };\n}", "cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }", "function compareNumeric(a, b) {\r\n return b - a;\r\n}", "function shallowEqual(actual /*: Object*/, expected /*: Object*/) /*: boolean*/ {\n\t var keys = _Object$keys(expected);\n\n\t for (var _iterator3 = (keys /*: Array<string>*/), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {\n\t var _ref3;\n\n\t if (_isArray3) {\n\t if (_i3 >= _iterator3.length) break;\n\t _ref3 = _iterator3[_i3++];\n\t } else {\n\t _i3 = _iterator3.next();\n\t if (_i3.done) break;\n\t _ref3 = _i3.value;\n\t }\n\n\t var key = _ref3;\n\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "ExactType() { \n switch (`${typeof this.Expected}`) {\n case 'number': \n case 'string':\n return this.ExactValue()\n break; \n case 'object': \n return this.ArrayLength()\n break; \n default: \n return `Unexpected data type ${typeof this.Expected} found, this program can only handle strings, numbers, and arrays`\n }\n }", "function jequal(o1, o2) {\n expect(normalize(o1)).toEqual(normalize(o2));\n}", "function compare(a, b) {\n if (a.totalDifference < b.totalDifference) {\n return -1;\n }\n if (a.totalDifference > b.totalDifference) {\n return 1;\n }\n return 0;\n }", "function assertObjectsEqual(actual, expected, testName) {\n // your code here\n var check = 0;\n if ( Object.keys(actual).length === Object.keys(expected).length) {\n for ( var key in actual ) {\n if( actual[key] === expected[key] ) {\n check ++;\n }\n }\n if( Object.keys(actual).length === check ) {\n console.log('passed');\n }\n }\n console.log('FAILED ' + testName + ' expected: ' + JSON.stringify(expected) + ' instead got ' + JSON.stringify(actual));\n}", "function looseEqual(a,b){var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){return JSON.stringify(a)===JSON.stringify(b);}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "function SameValue(x, y) {\n if (typeof x !== typeof y) return false;\n switch (typeof x) {\n case 'undefined':\n return true;\n case 'number':\n if (x !== x && y !== y) return true;\n if (x === 0 && y === 0) return 1/x === 1/y;\n return x === y;\n case 'boolean':\n case 'string':\n case 'object':\n default:\n return x === y;\n }\n }", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}", "function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}" ]
[ "0.78268546", "0.61451936", "0.60641617", "0.60108227", "0.5935327", "0.5932052", "0.59303796", "0.59246814", "0.59134644", "0.5905881", "0.59023505", "0.59019244", "0.59019244", "0.58855927", "0.5878998", "0.5865687", "0.5859692", "0.58326507", "0.580832", "0.5803507", "0.5772113", "0.5750167", "0.5741619", "0.5741619", "0.57193846", "0.57167625", "0.5715576", "0.5713106", "0.56997406", "0.56996316", "0.56822133", "0.568174", "0.5676036", "0.5676036", "0.5658501", "0.5634603", "0.5621922", "0.5621576", "0.5597275", "0.5584949", "0.557013", "0.55342525", "0.55218774", "0.55175084", "0.5508683", "0.5508683", "0.5496836", "0.5496827", "0.5464854", "0.5462059", "0.54516673", "0.5448635", "0.5446215", "0.5446215", "0.5446215", "0.5446215", "0.54361296", "0.5435786", "0.5434222", "0.54252386", "0.54223835", "0.541448", "0.54018545", "0.5393767", "0.5389201", "0.5369759", "0.5368245", "0.53660953", "0.53596103", "0.53546435", "0.5350475", "0.53475875", "0.53475875", "0.5342671", "0.53403443", "0.5340292", "0.53393286", "0.5332262", "0.5318473", "0.5316971", "0.53167355", "0.5313538", "0.53025186", "0.5298964", "0.52879363", "0.5285319", "0.527786", "0.5267307", "0.52659976", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033", "0.52601033" ]
0.5855156
17
Diff the expected and the actual when the expected is object
function diffObject(context, expected, actual, strict) { diffType(context, expected, actual); let expectedKeys = Object.keys(expected); let actualKeys = Object.keys(actual); if (strict) { matchKeys(context, expectedKeys, actualKeys); } expectedKeys.forEach(function(key) { diff(context.enter(key), expected[key], actual[key]); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == \"object\",\n // equivalence is determined by ==.\n } else if (typeof actual != 'object' && typeof expected != 'object') {\n return actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical \"prototype\" property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (typeof Buffer !== \"undefined\" && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {\n if (actual.length !== expected.length) {\n return false;\n }\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) {\n return false;\n }\n }\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (isString(actual) && isString(expected) && actual !== expected) {\n return false;\n } else if (typeof actual !== 'object' && typeof expected !== 'object') {\n return actual === expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "assertSame(expected, actual)\n {\n Tester.valid(expected, 'mixed')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (\n Tester.is(expected, 'object') &&\n Tester.is(actual, 'object') ||\n Tester.is(expected, 'array') &&\n Tester.is(actual, 'array')\n ) {\n expected = JSON.stringify({\n keys: Object.keys(expected).sort(),\n values: Object.values(expected).sort()\n })\n actual = JSON.stringify({\n keys: Object.keys(actual).sort(),\n values: Object.values(actual).sort()\n })\n } else if (\n Tester.is(expected, 'function') &&\n Tester.is(actual, 'function') ||\n Tester.is(expected, 'regexp') &&\n Tester.is(actual, 'regexp')\n ) {\n expected = expected.toString()\n actual = actual.toString()\n }\n\n if (expected !== actual) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function shallowEqual(actual, expected) {\n var keys = Object.keys(expected);\n\n var _arr2 = keys;\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var key = _arr2[_i2];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "toBeObject(expected) {\n if (typeof expected === \"object\" && !Array.isArray(expected)) {\n // typeof is not safe. Must explicitidly check null values and arrays too.\n return {\n message: \"Is Object\",\n pass: true,\n };\n }\n return {\n message: () => `This is not an object, it's::::${typeof expect}`,\n pass: false,\n };\n }", "function shallowEqual(actual, expected) {\n\t var keys = _Object$keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n\t var key = _arr2[_i3];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "_areDifferent(a, b) {\n if (a instanceof Date) {\n if (b instanceof Date) {\n return a.getTime() !== b.getTime();\n }\n else if (typeof b === 'string') {\n try {\n return a.getTime() !== new Date(b).getTime();\n }\n catch (err) {\n //\n }\n }\n\n return true;\n }\n\n if (b instanceof Date) {\n if (typeof a === 'string') {\n try {\n return b.getTime() !== new Date(a).getTime();\n }\n catch (err) {\n //\n }\n }\n return true;\n }\n\n if (typeof a !== 'object' || typeof a !== typeof b) {\n if (a !== b) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n if (JSON.stringify(a) !== JSON.stringify(b)) {\n return true;\n }\n else {\n return false;\n }\n }\n }", "assertEqual(expected, actual)\n {\n Tester.valid(expected, 'mixed')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (\n Tester.is(expected, 'object') &&\n Tester.is(actual, 'object') ||\n Tester.is(expected, 'array') &&\n Tester.is(actual, 'array')\n ) {\n expected = JSON.stringify(Object.keys(expected).sort())\n actual = JSON.stringify(Object.keys(actual).sort())\n } else if (\n Tester.is(expected, 'function') &&\n Tester.is(actual, 'function') ||\n Tester.is(expected, 'regexp') &&\n Tester.is(actual, 'regexp')\n ) {\n expected = expected.toString()\n actual = actual.toString()\n }\n\n if (expected != actual) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function diffPrimitive(context, expected, actual) {\n if (_.isEqual(expected, actual)) return;\n context.throw(`diff value, ${JSON.stringify(expected)} ≠ ${JSON.stringify(actual)}`);\n}", "function check_equal(expected, actual, stack)\n {\n stack.push(actual);\n\n for (p in actual)\n {\n var message = make_message(\n \"assert_object_equals\", description,\n \"unexpected property ${p}\", {p:p});\n\n assert(expected.hasOwnProperty(p), message);\n\n if (typeof actual[p] === \"object\" && actual[p] !== null)\n {\n if (stack.indexOf(actual[p]) === -1)\n {\n check_equal(actual[p], expected[p], stack);\n }\n }\n else\n {\n message = make_message(\n \"assert_object_equals\", description,\n \"property ${p} expected ${expected} got ${actual}\",\n {p:p, expected:expected, actual:actual});\n\n assert(actual[p] === expected[p], message);\n }\n }\n for (p in expected)\n {\n var message = make_message(\n \"assert_object_equals\", description,\n \"expected property ${p} missing\", {p:p});\n\n assert(actual.hasOwnProperty(p), message);\n }\n stack.pop();\n }", "function shallowEqual(actual, expected) {\n var keys = _Object$keys(expected);\n\n var _arr2 = keys;\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var key = _arr2[_i3];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "function isObjDifferent(objA, objB) {\n return JSON.stringify(objA) !== JSON.stringify(objB);\n }", "function check_equal(actual, expected, stack)\n {\n stack.push(actual);\n\n var p;\n for (p in actual)\n {\n assert(expected.hasOwnProperty(p), \"assert_object_equals\", description,\n \"unexpected property ${p}\", {p:p});\n\n if (typeof actual[p] === \"object\" && actual[p] !== null)\n {\n if (stack.indexOf(actual[p]) === -1)\n {\n check_equal(actual[p], expected[p], stack);\n }\n }\n else\n {\n assert(same_value(actual[p], expected[p]), \"assert_object_equals\", description,\n \"property ${p} expected ${expected} got ${actual}\",\n {p:p, expected:expected, actual:actual});\n }\n }\n for (p in expected)\n {\n assert(actual.hasOwnProperty(p),\n \"assert_object_equals\", description,\n \"expected property ${p} missing\", {p:p});\n }\n stack.pop();\n }", "function assertObjectsEqual(actual, expected, testName) {\n // your code here\n var check = 0;\n if ( Object.keys(actual).length === Object.keys(expected).length) {\n for ( var key in actual ) {\n if( actual[key] === expected[key] ) {\n check ++;\n }\n }\n if( Object.keys(actual).length === check ) {\n console.log('passed');\n }\n }\n console.log('FAILED ' + testName + ' expected: ' + JSON.stringify(expected) + ' instead got ' + JSON.stringify(actual));\n}", "function assertSimilar(actual, expected, message) {\n assertOk(JSON.stringify(actual) === JSON.stringify(expected), message);\n }", "function shallowEqual(object1, object2) {\n if(\n (object1['searchTerm'] !== object2['searchTerm']) ||\n (object1['richtext'] !== object2['richtext']) ||\n (object1['buttonsCount'] !== object2['buttonsCount']) ||\n (object1['imagesCount'] !== object2['imagesCount']) ||\n (object1['links'] !== object2['links']) ||\n (object1['listing'] !== object2['listing']) ||\n (object1['typeName'] !== object2['typeName'])\n ) {\n return false\n } else {\n return true\n }\n }", "function shallowEqual(actual, expected) {\n\t var keys = _Object$keys(expected);\n\n\t for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {\n\t var _ref3;\n\n\t if (_isArray3) {\n\t if (_i3 >= _iterator3.length) break;\n\t _ref3 = _iterator3[_i3++];\n\t } else {\n\t _i3 = _iterator3.next();\n\t if (_i3.done) break;\n\t _ref3 = _i3.value;\n\t }\n\n\t var key = _ref3;\n\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function hasDifferences(a, b) {\n return JSON.stringify(a) !== JSON.stringify(b)\n }", "function shallowEqual(actual /*: Object*/, expected /*: Object*/) /*: boolean*/ {\n\t var keys = _Object$keys(expected);\n\n\t for (var _iterator3 = (keys /*: Array<string>*/), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {\n\t var _ref3;\n\n\t if (_isArray3) {\n\t if (_i3 >= _iterator3.length) break;\n\t _ref3 = _iterator3[_i3++];\n\t } else {\n\t _i3 = _iterator3.next();\n\t if (_i3.done) break;\n\t _ref3 = _i3.value;\n\t }\n\n\t var key = _ref3;\n\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function compare(expected, result){\n for(var key in expected){\n if(expected.hasOwnProperty(key)){\n if(!result.hasOwnProperty(key) || result[key] !== expected[key]){ \n return false;\n }\n }\n }\n return true;\n}", "function compare (expected, actual) {\n return () => {\n deepEqual(expected, actual)\n }\n}", "function assertEquals(obj1, obj2) {\n checkEquals(obj1, obj2, \"(top)\");\n\n function checkEquals(obj1, obj2, objName) {\n var t1 = typeFunctions.type(obj1);\n var t2 = typeFunctions.type(obj2);\n\n if (t1 != t2) {\n throw new Exception(\"at \" + objName + \" \" + t1 + \" .vs. \" + t2);\n }\n switch (t1) {\n case \"object\":\n for (var name in obj1) {\n if (hasValue(obj1[name]) && !hasValue(obj2[name])) {\n throw new Exception(name + \".\" + namet1 + \" .is missing\");\n }\n }\n for (var name in obj2) {\n if (hasValue(obj2[name]) && !hasValue(obj1[name])) {\n throw new Exception(name + \".\" + namet1 + \" .is missing\");\n }\n checkEquals(obj1[name], obj2[name], objName + \".\" + name);\n }\n break;\n\n case 'array':\n if (obj1.length != obj2.length) {\n throw new Exception(\"different array lengths at \" + objName);\n }\n obj1.forEach(function(row, index) {\n checkEquals(row, obj2[index], objName + \"[\" + index + \"]\");\n })\n break;\n\n default:\n if (obj1 != obj2) {\n throw new Exception(\"at \" + objName + \" \" + obj1 + \" .vs. \" + obj2);\n }\n break;\n }\n }\n}", "isObjectEqual(a, b) {\n return a && b && a.foo === b.foo;\n }", "function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if((typeof objA==='undefined'?'undefined':_typeof(objA))!=='object'||objA===null||(typeof objB==='undefined'?'undefined':_typeof(objB))!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty.call(objB,keysA[i])||!is(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if(typeof objA!=='object'||objA===null||typeof objB!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty.call(objB,keysA[i])||!is(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if((typeof objA==='undefined'?'undefined':_typeof4(objA))!=='object'||objA===null||(typeof objB==='undefined'?'undefined':_typeof4(objB))!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\r\n\tfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty.call(objB,keysA[i])||!is(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function looseEqual(a,b){var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){return JSON.stringify(a)===JSON.stringify(b);}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "function difference(oldObj, newObj) {\n return lodash.transform(oldObj, (result, value, key) => {\n if (!lodash.isEqual(value, newObj[key])) {\n result[key] = lodash.isObject(value) && lodash.isObject(newObj[key]) ? difference(value, newObj[key]) : newObj[key];\n }\n });\n}", "function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if((typeof objA===\"undefined\"?\"undefined\":_typeof3(objA))!=='object'||objA===null||(typeof objB===\"undefined\"?\"undefined\":_typeof3(objB))!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;} // Test for A's keys different from B.\n\tfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty.call(objB,keysA[i])||!is(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if((typeof objA===\"undefined\"?\"undefined\":_typeof2(objA))!=='object'||objA===null||(typeof objB===\"undefined\"?\"undefined\":_typeof2(objB))!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;} // Test for A's keys different from B.\n\tfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty.call(objB,keysA[i])||!is(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if((typeof objA==='undefined'?'undefined':_typeof(objA))!=='object'||objA===null||(typeof objB==='undefined'?'undefined':_typeof(objB))!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty$1.call(objB,keysA[i])||!is(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function deepEqual(obj1, obj2) {\n // Your code here\n}", "function shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if ((typeof objA === \"undefined\" ? \"undefined\" : _typeof(objA)) !== \"object\" || objA === null || (typeof objB === \"undefined\" ? \"undefined\" : _typeof(objB)) !== \"object\" || objB === null) {\n // console.log('shallowEqual: not object??');\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 // console.log('!shallowEqual: different keys 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 // console.log(`!shallowEqual: different ${keysA[i]} - ${objA[keysA[i]]} vs. ${objB[keysA[i]]}`);\n return false;\n }\n }\n\n return true;\n}", "deepEqual(a, b) {\n // If two \n if(a === b) {\n return true\n }; \n\n // Check for any condition that would cause args not to be equal\n if(a === null || b === null || typeof a != 'object' || typeof b != 'object') {\n return false\n };\n\n // Check for equality in number of properties and properties themselves\n var propsA = 0, \n propsB = 0;\n\n for(var prop in a) {\n propsA += 1;\n\n for (var prop in b) {\n propsB += 1;\n if (!(prop in a) || !this.deepEqual(a[prop], b[prop])) {\n return false;\n }\n }\n }\n\n return propsInA == propsInB;\n }", "function same(obj, obj2) {\n\treturn JSON.stringify(obj) === JSON.stringify(obj2)\n}", "function deepCompare(actual, expect) {\n return (\n actual === expect ||\n Object.is(actual, expect) ||\n (Object(actual) === actual &&\n Object(expect) === expect &&\n ((Array.isArray(actual) &&\n Array.isArray(expect) &&\n actual.length === expect.length &&\n expect.every((expect, index) => deepCompare(actual[index], expect))) ||\n (Object.keys(actual).length === Object.keys(expect).length &&\n Object.keys(expect).every((key) =>\n deepCompare(actual[key], expect[key])\n ))))\n );\n}", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n const aType = (0, _jestGetType2.default)(a);\n let expectedType = aType;\n let omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== Symbol.for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return (\n ' Comparing two different types of values.' +\n ` Expected ${_chalk2.default.green(expectedType)} but ` +\n `received ${_chalk2.default.red((0, _jestGetType2.default)(b))}.`\n );\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n}", "function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if(_typeof(objA)!=='object'||objA===null||_typeof(objB)!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty$1.call(objB,keysA[i])||!is(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function shallowEqual(objA,objB){if(objectIs(objA,objB)){return true;}if(typeof objA!=='object'||objA===null||typeof objB!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty$2.call(objB,keysA[i])||!objectIs(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function shallowEqual(objA,objB){if(objectIs(objA,objB)){return true;}if(typeof objA!=='object'||objA===null||typeof objB!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty$2.call(objB,keysA[i])||!objectIs(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function shallowEqual(objA,objB){if(objectIs(objA,objB)){return true;}if(typeof objA!=='object'||objA===null||typeof objB!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty$2.call(objB,keysA[i])||!objectIs(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n }", "function shallowEqual(objA,objB){if(objectIs(objA,objB)){return true;}if(_typeof(objA)!=='object'||objA===null||_typeof(objB)!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty$2.call(objB,keysA[i])||!objectIs(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function shallowEqual(objA,objB){if(objectIs(objA,objB)){return true;}if(_typeof(objA)!=='object'||objA===null||_typeof(objB)!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty$2.call(objB,keysA[i])||!objectIs(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "function shallowEqual(objA, objB) {\n\t\t if (is(objA, objB)) {\n\t\t return true;\n\t\t }\n\t\t\n\t\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t\t return false;\n\t\t }\n\t\t\n\t\t var keysA = Object.keys(objA);\n\t\t var keysB = Object.keys(objB);\n\t\t\n\t\t if (keysA.length !== keysB.length) {\n\t\t return false;\n\t\t }\n\t\t\n\t\t // Test for A's keys different from B.\n\t\t for (var i = 0; i < keysA.length; i++) {\n\t\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t\t return false;\n\t\t }\n\t\t }\n\t\t\n\t\t return true;\n\t\t}", "function shallowEqual(objA, objB) {\n\t\t if (is(objA, objB)) {\n\t\t return true;\n\t\t }\n\t\t\n\t\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t\t return false;\n\t\t }\n\t\t\n\t\t var keysA = Object.keys(objA);\n\t\t var keysB = Object.keys(objB);\n\t\t\n\t\t if (keysA.length !== keysB.length) {\n\t\t return false;\n\t\t }\n\t\t\n\t\t // Test for A's keys different from B.\n\t\t for (var i = 0; i < keysA.length; i++) {\n\t\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t\t return false;\n\t\t }\n\t\t }\n\t\t\n\t\t return true;\n\t\t}", "function diffObj(a, b, props) {\n const diffs = {};\n\n // TODO: maybe implement two versions of this algo, one if props is present, one if it isn't,\n // because it's probably faster to outerloop props if it is present\n\n for (const prop in a) {\n if (!a.hasOwnProperty(prop) || (props && !props[prop])) {\n continue;\n }\n\n const av = a[prop],\n bv = b[prop];\n\n if (!Tyr.isEqual(av, bv)) {\n if (bv === undefined) {\n diffs[prop] = O_DELETE;\n } else {\n if (isArray(av)) {\n if (isArray(bv)) {\n diffs[prop] = [T_ARRAY, diffArr(av, bv)];\n } else {\n diffs[prop] = [bv];\n }\n } else if (isArray(bv)) {\n diffs[prop] = [bv];\n } else if (Tyr.isObject(av) && Tyr.isObject(bv)) {\n diffs[prop] = [T_OBJECT, diffObj(av, bv)];\n } else {\n diffs[prop] = [bv];\n }\n }\n }\n }\n\n for (const prop in b) {\n if (!b.hasOwnProperty(prop) || (props && !props[prop])) {\n continue;\n }\n\n if (!(prop in a)) {\n const bv = b[prop];\n\n diffs[prop] = [bv];\n }\n }\n\n return diffs;\n}", "function shallowEqual(objA, objB) {\n\t\t if (is(objA, objB)) {\n\t\t return true;\n\t\t }\n\n\t\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t\t return false;\n\t\t }\n\n\t\t var keysA = Object.keys(objA);\n\t\t var keysB = Object.keys(objB);\n\n\t\t if (keysA.length !== keysB.length) {\n\t\t return false;\n\t\t }\n\n\t\t // Test for A's keys different from B.\n\t\t for (var i = 0; i < keysA.length; i++) {\n\t\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t\t return false;\n\t\t }\n\t\t }\n\n\t\t return true;\n\t\t}", "function compareObjectArrays(a, b) {\n expect(a.length).toEqual(b.length);\n\n for (var i = 0, l = a.length; i < l; i++) {\n for (var prop in a[i]) {\n if ( hasOwnProp.call(a[i], prop) ) {\n expect(b[i][prop]).toBeDefined();\n expect(a[i][prop]).toEqual(b[i][prop]);\n }\n }\n }\n }", "function diff(oldObj, newObj) {\n const V = 'Version';\n const out = {};\n let hasChange = false;\n for(const key in newObj) {\n if(key.substr(key.length - V.length) === V) { continue; }\n\n if(typeof newObj[key] === 'object') {\n if(newObj[key + V]) {\n if(newObj[key + V] !== oldObj[key + V]) {\n out[key] = 1;\n hasChange = true;\n }\n }\n else if(JSON.stringify(oldObj[key]) !== JSON.stringify(newObj[key])) {\n out[key] = 1;\n hasChange = true;\n }\n }\n else if(oldObj[key] !== newObj[key]) {\n out[key] = 1;\n hasChange = true;\n }\n }\n return hasChange && out;\n}", "function diff(oldObj, newObj) {\n const V = 'Version';\n const out = {};\n let hasChange = false;\n for(const key in newObj) {\n if(key.substr(key.length - V.length) === V) { continue; }\n\n if(typeof newObj[key] === 'object') {\n if(newObj[key + V]) {\n if(newObj[key + V] !== oldObj[key + V]) {\n out[key] = 1;\n hasChange = true;\n }\n }\n else if(JSON.stringify(oldObj[key]) !== JSON.stringify(newObj[key])) {\n out[key] = 1;\n hasChange = true;\n }\n }\n else if(oldObj[key] !== newObj[key]) {\n out[key] = 1;\n hasChange = true;\n }\n }\n return hasChange && out;\n}", "function diff(v1, v2) {\n return {\n x: v1.x - v2.x,\n y: v1.y - v2.y\n };\n}", "function compare(obj1, obj2) {\n return JSON.stringify(obj1) === JSON.stringify(obj2);\n}", "function deepEqual(obj1,obj2) {\n return areObjects(obj1,obj2) && equalProp(obj1,obj2);\n}", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n var multiline = MULTILINE_REGEXP.test(a) && b.indexOf('\\n') !== -1;\n if (multiline) {\n return (0, _diff_strings2.default)(a, b, options);\n }\n return null;\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);}\n }", "function assertEqualJSON(actual, expected) {\n this.deepEqual(sortKeys(actual), sortKeys(expected));\n}", "function shallowEqual(objA, objB) {\r\n\t if (is(objA, objB)) {\r\n\t return true;\r\n\t }\r\n\t\r\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\r\n\t return false;\r\n\t }\r\n\t\r\n\t var keysA = Object.keys(objA);\r\n\t var keysB = Object.keys(objB);\r\n\t\r\n\t if (keysA.length !== keysB.length) {\r\n\t return false;\r\n\t }\r\n\t\r\n\t // Test for A's keys different from B.\r\n\t for (var i = 0; i < keysA.length; i++) {\r\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\r\n\t return false;\r\n\t }\r\n\t }\r\n\t\r\n\t return true;\r\n\t}", "beEqualTo() {\n this._processArguments(arguments);\n return this._assert(\n this._actual === this._expected, '${actual} is equal to ${expected}.',\n '${actual} is not equal to ${expected}.');\n }", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function diffObject( now, last, diff ){\n\n\n\t if(!diff){\n\n\t for( var j in now ){\n\t if( last[j] !== now[j] ) return true\n\t }\n\n\t for( var n in last ){\n\t if(last[n] !== now[n]) return true;\n\t }\n\n\t }else{\n\n\t var nKeys = _.keys(now);\n\t var lKeys = _.keys(last);\n\n\t /**\n\t * [description]\n\t * @param {[type]} a [description]\n\t * @param {[type]} b){ return now[b] [description]\n\t * @return {[type]} [description]\n\t */\n\t return diffArray(nKeys, lKeys, diff, function(a, b){\n\t return now[b] === last[a];\n\t });\n\n\t }\n\n\t return false;\n\n\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n if (objectIs(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 } // Test for A's keys different from B.\n\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n }", "function shallowEqual(objA, objB) {\n if (objectIs(objA, objB)) {\n return true;\n }\n\n if (\n typeof objA !== 'object' ||\n objA === null ||\n typeof objB !== 'object' ||\n objB === null\n ) {\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 } // Test for A's keys different from B.\n\n for (var i = 0; i < keysA.length; i++) {\n if (\n !hasOwnProperty$2.call(objB, keysA[i]) ||\n !objectIs(objA[keysA[i]], objB[keysA[i]])\n ) {\n return false;\n }\n }\n\n return true;\n }", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function shallowEqual(objA, objB) {\n\t if (is(objA, objB)) {\n\t return true;\n\t }\n\t\n\t if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}", "function diffArray(context, expected, actual, strict) {\n diffType(context, expected, actual);\n let sameLength = expected.length === actual.length;\n if (strict && !sameLength) {\n context.throw(`diff size , ${expected.length} ≠ ${actual.length}`);\n }\n expected.forEach(function(elem, index) {\n diff(context.enter(`[${index}]`), elem, actual[index]);\n });\n}", "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 } // Test for A's keys different from B.\n\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n }", "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 } // Test for A's keys different from B.\n\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n }", "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 } // Test for A's keys different from B.\n\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n }", "function deepEqual(object1, object2) {\n //for each element in the object, make a comparison\n //figure out how to traverse the object\n\n //if one of the objects is null then return false\n if(object1 === null || object2 === null) {\n return false;\n }\n //find out if they are pointing to the same place in memory\n if (object1 === object2 && object1 !== null) {\n return true;\n }\n\n //count the number of properties, if they are not the same then return false\n //figure out how to count the number of properties\n\n // if the types are the same and the values of the properties are the same then return true. Do I access the properties by naming them with 'here' and 'object' or does it need to be more generic than that?\n if (typeof object1 === typeof object2) {\n\n }\n\n\n}", "function deepEqual(a,b) \n{\n//two inputs ob ojects\n\tif (a === b) return true; //this is true when these share same value prop.\n\tif (a == null || typeof a !=\"object\" || b == null || typeof b !=\"object\" ) //Null =/ null\n\t\treturn false; //this checks if they dont equal\n\n\tvar a_count = 0, b_count = 0; //counters for loop iteration\n\tfor(var properties in a)\n\t\ta_count++;\n\tfor( var properties in b) \n\t{\n\t\tb_count++;\n\t\n\tif(!(properties in a) || !deepEqual(a[properties], b[properties]))\n\t\treturn false;\n\t}\nreturn a_count === b_count;\n}", "function shallowEqual(objA, objB) {\n\t\t\tif (is(objA, objB)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar keysA = Object.keys(objA);\n\t\t\tvar keysB = Object.keys(objB);\n\n\t\t\tif (keysA.length !== keysB.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Test for A's keys different from B.\n\t\t\tfor (var i = 0; i < keysA.length; i++) {\n\t\t\t\tif (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "function looseEqual (a, b) {\n\t var isObjectA = isObject(a);\n\t var isObjectB = isObject(b);\n\t if (isObjectA && isObjectB) {\n\t return JSON.stringify(a) === JSON.stringify(b)\n\t } else if (!isObjectA && !isObjectB) {\n\t return String(a) === String(b)\n\t } else {\n\t return false\n\t }\n\t}", "function looseEqual (a, b) {\n\t var isObjectA = isObject(a);\n\t var isObjectB = isObject(b);\n\t if (isObjectA && isObjectB) {\n\t return JSON.stringify(a) === JSON.stringify(b)\n\t } else if (!isObjectA && !isObjectB) {\n\t return String(a) === String(b)\n\t } else {\n\t return false\n\t }\n\t}", "function compareObjects(obj1, obj2) {\n return JSON.stringify(obj1) === JSON.stringify(obj2);\n}", "function shallowCompare(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (let key in obj1) {\n if (obj1[key] !== obj2[key]) {\n return false;\n }\n }\n return true;\n}" ]
[ "0.6894458", "0.6778054", "0.6700734", "0.6700734", "0.6696655", "0.6632594", "0.66102976", "0.658458", "0.65817195", "0.6562065", "0.65209377", "0.64989775", "0.64959455", "0.64913374", "0.64876384", "0.64370275", "0.63828546", "0.63554484", "0.6318232", "0.6309705", "0.6294542", "0.6246193", "0.62104577", "0.6205884", "0.6169808", "0.6168569", "0.6154695", "0.61407095", "0.6131373", "0.61273146", "0.61253613", "0.6099599", "0.6091395", "0.6070534", "0.60632396", "0.60631764", "0.6041945", "0.60390204", "0.60382736", "0.6033663", "0.6012938", "0.6012938", "0.6012938", "0.6008776", "0.6008776", "0.5979129", "0.5979129", "0.59772104", "0.59772104", "0.59660083", "0.59653586", "0.596524", "0.5963292", "0.5963292", "0.59521514", "0.5944738", "0.59296936", "0.5927543", "0.5921601", "0.59178156", "0.5902296", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.5891907", "0.58914363", "0.5883504", "0.5873298", "0.58693147", "0.5858566", "0.5858566", "0.58572805", "0.5853009", "0.5853009", "0.5853009", "0.58505255", "0.584915", "0.58427805", "0.5828794", "0.5828794", "0.58281577", "0.5827281" ]
0.72513825
0
Wheter the expected and the actual have same properties
function matchKeys(context, expected, actual) { let excludes = _.difference(expected, actual); let includes = _.difference(actual, expected); if (excludes.length === 0 && includes.length === 0) return; let errMsg = ``; if (excludes.length) { errMsg += `, ++ ${excludes.join('|')}`; } if (includes.length) { errMsg += `, -- ${includes.join('|')}`; } context.throw(`diff properties` + errMsg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertSimilar(actual, expected, message) {\n assertOk(JSON.stringify(actual) === JSON.stringify(expected), message);\n }", "function assertObjectsEqual(actual, expected, testName) {\n // your code here\n var check = 0;\n if ( Object.keys(actual).length === Object.keys(expected).length) {\n for ( var key in actual ) {\n if( actual[key] === expected[key] ) {\n check ++;\n }\n }\n if( Object.keys(actual).length === check ) {\n console.log('passed');\n }\n }\n console.log('FAILED ' + testName + ' expected: ' + JSON.stringify(expected) + ' instead got ' + JSON.stringify(actual));\n}", "function compare(expected, result){\n for(var key in expected){\n if(expected.hasOwnProperty(key)){\n if(!result.hasOwnProperty(key) || result[key] !== expected[key]){ \n return false;\n }\n }\n }\n return true;\n}", "function check_equal(expected, actual, stack)\n {\n stack.push(actual);\n\n for (p in actual)\n {\n var message = make_message(\n \"assert_object_equals\", description,\n \"unexpected property ${p}\", {p:p});\n\n assert(expected.hasOwnProperty(p), message);\n\n if (typeof actual[p] === \"object\" && actual[p] !== null)\n {\n if (stack.indexOf(actual[p]) === -1)\n {\n check_equal(actual[p], expected[p], stack);\n }\n }\n else\n {\n message = make_message(\n \"assert_object_equals\", description,\n \"property ${p} expected ${expected} got ${actual}\",\n {p:p, expected:expected, actual:actual});\n\n assert(actual[p] === expected[p], message);\n }\n }\n for (p in expected)\n {\n var message = make_message(\n \"assert_object_equals\", description,\n \"expected property ${p} missing\", {p:p});\n\n assert(actual.hasOwnProperty(p), message);\n }\n stack.pop();\n }", "function check_equal(actual, expected, stack)\n {\n stack.push(actual);\n\n var p;\n for (p in actual)\n {\n assert(expected.hasOwnProperty(p), \"assert_object_equals\", description,\n \"unexpected property ${p}\", {p:p});\n\n if (typeof actual[p] === \"object\" && actual[p] !== null)\n {\n if (stack.indexOf(actual[p]) === -1)\n {\n check_equal(actual[p], expected[p], stack);\n }\n }\n else\n {\n assert(same_value(actual[p], expected[p]), \"assert_object_equals\", description,\n \"property ${p} expected ${expected} got ${actual}\",\n {p:p, expected:expected, actual:actual});\n }\n }\n for (p in expected)\n {\n assert(actual.hasOwnProperty(p),\n \"assert_object_equals\", description,\n \"expected property ${p} missing\", {p:p});\n }\n stack.pop();\n }", "assertEqual(expected, actual)\n {\n Tester.valid(expected, 'mixed')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (\n Tester.is(expected, 'object') &&\n Tester.is(actual, 'object') ||\n Tester.is(expected, 'array') &&\n Tester.is(actual, 'array')\n ) {\n expected = JSON.stringify(Object.keys(expected).sort())\n actual = JSON.stringify(Object.keys(actual).sort())\n } else if (\n Tester.is(expected, 'function') &&\n Tester.is(actual, 'function') ||\n Tester.is(expected, 'regexp') &&\n Tester.is(actual, 'regexp')\n ) {\n expected = expected.toString()\n actual = actual.toString()\n }\n\n if (expected != actual) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function allSame(actual, expected){\n\t\tfor(var l = expected.length; l--;){\n\t\t\tassert.same(expected[l], actual[l]);\n\t\t}\n\t}", "function allSame(actual, expected){\n\t\tfor(var l = expected.length; l--;){\n\t\t\tassert.same(expected[l], actual[l]);\n\t\t}\n\t}", "assertSame(expected, actual)\n {\n Tester.valid(expected, 'mixed')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (\n Tester.is(expected, 'object') &&\n Tester.is(actual, 'object') ||\n Tester.is(expected, 'array') &&\n Tester.is(actual, 'array')\n ) {\n expected = JSON.stringify({\n keys: Object.keys(expected).sort(),\n values: Object.values(expected).sort()\n })\n actual = JSON.stringify({\n keys: Object.keys(actual).sort(),\n values: Object.values(actual).sort()\n })\n } else if (\n Tester.is(expected, 'function') &&\n Tester.is(actual, 'function') ||\n Tester.is(expected, 'regexp') &&\n Tester.is(actual, 'regexp')\n ) {\n expected = expected.toString()\n actual = actual.toString()\n }\n\n if (expected !== actual) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function shallowEqual(actual, expected) {\n var keys = Object.keys(expected);\n\n var _arr2 = keys;\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var key = _arr2[_i2];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "deepEqual(a, b) {\n // If two \n if(a === b) {\n return true\n }; \n\n // Check for any condition that would cause args not to be equal\n if(a === null || b === null || typeof a != 'object' || typeof b != 'object') {\n return false\n };\n\n // Check for equality in number of properties and properties themselves\n var propsA = 0, \n propsB = 0;\n\n for(var prop in a) {\n propsA += 1;\n\n for (var prop in b) {\n propsB += 1;\n if (!(prop in a) || !this.deepEqual(a[prop], b[prop])) {\n return false;\n }\n }\n }\n\n return propsInA == propsInB;\n }", "function shallowEqual(actual, expected) {\n\t var keys = _Object$keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n\t var key = _arr2[_i3];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "beEqualTo() {\n this._processArguments(arguments);\n return this._assert(\n this._actual === this._expected, '${actual} is equal to ${expected}.',\n '${actual} is not equal to ${expected}.');\n }", "function shallowEqual(actual, expected) {\n var keys = _Object$keys(expected);\n\n var _arr2 = keys;\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var key = _arr2[_i3];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (typeof Buffer !== \"undefined\" && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {\n if (actual.length !== expected.length) {\n return false;\n }\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) {\n return false;\n }\n }\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (isString(actual) && isString(expected) && actual !== expected) {\n return false;\n } else if (typeof actual !== 'object' && typeof expected !== 'object') {\n return actual === expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == \"object\",\n // equivalence is determined by ==.\n } else if (typeof actual != 'object' && typeof expected != 'object') {\n return actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical \"prototype\" property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "haveOwnProperty() {\n this._processArguments(arguments);\n\n return this._assert(\n this._actual.hasOwnProperty(this._expected),\n '${actual} has an own property of \"${expected}\".',\n '${actual} does not own the property of \"${expected}\".');\n }", "function productsShouldBeSame(product, other) {\n product.name.should.equal(other.name);\n product.description.should.equal(other.description);\n product.url.should.equal(other.url);\n product.categoryId.should.eql(other.categoryId);\n product.shopzillaId.should.eql(other.shopzillaId);\n if (product.images) {\n ['fourHundred','oneSixty','oneHundred','sixty'].forEach(function (size) {\n if (product[size]) product.images[size].should.equal(other.images[size])\n })\n }\n product.price.min.should.eql(other.price.min);\n product.price.max.should.eql(other.price.max);\n product.related.join('').should.eql(other.related.join(''));\n}", "function shallowEqual(actual, expected) {\n\t var keys = _Object$keys(expected);\n\n\t for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {\n\t var _ref3;\n\n\t if (_isArray3) {\n\t if (_i3 >= _iterator3.length) break;\n\t _ref3 = _iterator3[_i3++];\n\t } else {\n\t _i3 = _iterator3.next();\n\t if (_i3.done) break;\n\t _ref3 = _i3.value;\n\t }\n\n\t var key = _ref3;\n\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "notBeEqualTo() {\n this._processArguments(arguments);\n return this._assert(\n this._actual !== this._expected,\n '${actual} is not equal to ${expected}.',\n '${actual} should not be equal to ${expected}.');\n }", "function attributesEquivalent(expected, given) {\n var attributes1 = _.reject(expected.attributes, ignorableAttributes.contains);\n var attributes2 = _.reject(given.attributes, ignorableAttributes.contains);\n if (attributes1.length !== attributes2.length) {\n return false;\n }\n for (var i = 0; i < attributes1.length; i++) {\n var attr1 = attributes1[i];\n var attr2 = attributes2[i];\n if (attr1.name !== attr2.name) {\n return false;\n }\n if (attr1.value !== attr2.value) {\n return false;\n }\n }\n return true;\n}", "function hasSameProperties(a, b) {\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n if (aProps.length !== bProps.length) {\n return false;\n }\n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n return true;\n}", "function hasSameProperties(a, b) {\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n if (aProps.length !== bProps.length) {\n return false;\n }\n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n return true;\n}", "containValues() {\n this._processArguments(arguments);\n this._printActualForFailure = false;\n\n let passed = true;\n let indexedActual = [];\n let firstErrorIndex = null;\n\n // Collect the unique value sequence from the actual.\n for (let i = 0, prev = null; i < this._actual.length; i++) {\n if (this._actual[i] !== prev) {\n indexedActual.push({index: i, value: this._actual[i]});\n prev = this._actual[i];\n }\n }\n\n // Compare against the expected sequence.\n let failMessage =\n '${actual} expected to have the value sequence of ${expected} but ' +\n 'got ';\n if (this._expected.length === indexedActual.length) {\n for (let j = 0; j < this._expected.length; j++) {\n if (this._expected[j] !== indexedActual[j].value) {\n firstErrorIndex = indexedActual[j].index;\n passed = false;\n failMessage += this._actual[firstErrorIndex] + ' at index ' +\n firstErrorIndex + '.';\n break;\n }\n }\n } else {\n passed = false;\n let indexedValues = indexedActual.map(x => x.value);\n failMessage += `${indexedActual.length} values, [${\n indexedValues}], instead of ${this._expected.length}.`;\n }\n\n return this._assert(\n passed,\n '${actual} contains all the expected values in the correct order: ' +\n '${expected}.',\n failMessage);\n }", "function hasDifferences(a, b) {\n return JSON.stringify(a) !== JSON.stringify(b)\n }", "static isEquivalent(a, b) \n {\n // Create arrays of property names\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n \n // If number of properties is different,\n // objects are not equivalent\n if (aProps.length != bProps.length) {\n return false;\n }\n \n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n \n // If values of same property are not equal,\n // objects are not equivalent\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n \n // If we made it this far, objects\n // are considered equivalent\n return true;\n }", "function shallowEqual(actual /*: Object*/, expected /*: Object*/) /*: boolean*/ {\n\t var keys = _Object$keys(expected);\n\n\t for (var _iterator3 = (keys /*: Array<string>*/), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {\n\t var _ref3;\n\n\t if (_isArray3) {\n\t if (_i3 >= _iterator3.length) break;\n\t _ref3 = _iterator3[_i3++];\n\t } else {\n\t _i3 = _iterator3.next();\n\t if (_i3.done) break;\n\t _ref3 = _i3.value;\n\t }\n\n\t var key = _ref3;\n\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function expect(result, expected) {\n const correct = (result.length!==0) && JSON.stringify(result) === JSON.stringify(expected);;\n if (correct) {\n console.info('Pass!');\n } else {\n console.error(`Failed: ${ result } does not match ${expected }`);\n }\n}", "function compare(a, b) {\r\n\t\t\t\tvar prop;\r\n\t\t\t\tif (props) {\r\n\t\t\t\t\tfor (var j = 0; j < props.length; j++) {\r\n\t\t\t\t\t\tprop = props[j];\r\n\r\n\t\t\t\t\t\tif (a[prop] != b[prop]) return false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfor (prop in a) {\r\n\t\t\t\t\t\tif (a[prop] != b[prop]) return false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}", "function assertEqualJSON(actual, expected) {\n this.deepEqual(sortKeys(actual), sortKeys(expected));\n}", "function test(actual, expected) {\n if (JSON.stringify(actual) === JSON.stringify(expected)) {\n console.log(\"Yay! Test PASSED.\");\n } else {\n console.error(\"Test FAILED. Keep trying!\");\n console.log(\" actual: \", actual);\n console.log(\" expected: \", expected);\n console.trace();\n }\n}", "notHaveOwnProperty() {\n this._processArguments(arguments);\n\n return this._assert(\n !this._actual.hasOwnProperty(this._expected),\n '${actual} does not have an own property of \"${expected}\".',\n '${actual} has an own the property of \"${expected}\".')\n }", "function compareProps(obj1, obj2) {\n for (let prop in obj1) {\n /////// if ne demek istiyorr!(......)\n if (!(prop in obj2) || obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}", "function compareChainState(state, expected) {\n assert.strictEqual(state.startHeight, expected.startHeight);\n assert.bufferEqual(state.startHash, expected.startHash);\n assert.strictEqual(state.height, expected.height);\n assert.strictEqual(state.marked, expected.marked);\n}", "function compareTableData(expected, actual) {\n log.debug('comparing expected: ', expected);\n log.debug('with actual: ', actual);\n\n expect(actual.length).to.eql(expected.length);\n\n function tokenize(row) {\n const tokens = row.split(' ');\n\n let geohashIndex;\n let countIndex;\n let latIndex;\n let lonIndex;\n if (tokens.length === 8) {\n // table row aggregations: geohash_grid -> count -> geocentroid\n geohashIndex = 0;\n countIndex = 1;\n latIndex = 4;\n lonIndex = 6;\n } else if (tokens.length === 9) {\n // table row aggregations: filter -> geohash_grid -> count -> geocentroid\n geohashIndex = 1;\n countIndex = 2;\n latIndex = 5;\n lonIndex = 7;\n } else {\n log.error(`Unexpected number of tokens contained in spy table row: ${row}`);\n }\n return {\n geohash: tokens[geohashIndex],\n count: tokens[countIndex],\n lat: Math.floor(parseFloat(tokens[latIndex])),\n lon: Math.floor(parseFloat(tokens[lonIndex]))\n };\n }\n\n expect(actual.map(tokenize)).to.eql(expected.map(tokenize));\n }", "_areDifferent(a, b) {\n if (a instanceof Date) {\n if (b instanceof Date) {\n return a.getTime() !== b.getTime();\n }\n else if (typeof b === 'string') {\n try {\n return a.getTime() !== new Date(b).getTime();\n }\n catch (err) {\n //\n }\n }\n\n return true;\n }\n\n if (b instanceof Date) {\n if (typeof a === 'string') {\n try {\n return b.getTime() !== new Date(a).getTime();\n }\n catch (err) {\n //\n }\n }\n return true;\n }\n\n if (typeof a !== 'object' || typeof a !== typeof b) {\n if (a !== b) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n if (JSON.stringify(a) !== JSON.stringify(b)) {\n return true;\n }\n else {\n return false;\n }\n }\n }", "function compare (expected, actual) {\n return () => {\n deepEqual(expected, actual)\n }\n}", "compare(expected) {\n return UNEQUAL;\n }", "function equalProp(obj1,obj2) {\n if (Object.keys(obj1).length === Object.keys(obj2).length) {\n for (let prop in obj1) {\n if (!obj2.hasOwnProperty(prop) || !areEqual(obj1[prop],obj2[prop])) return false;\n }\n return true;\n } else {\n return false;\n }\n}", "function isSameDesc(desc1, desc2) {\n // for conflicting properties, don't compare values because\n // the conflicting property values are never equal\n if (desc1.conflict && desc2.conflict) {\n return true;\n } else {\n return ( desc1.get === desc2.get\n && desc1.set === desc2.set\n && identical(desc1.value, desc2.value)\n && desc1.enumerable === desc2.enumerable\n && desc1.required === desc2.required\n && desc1.conflict === desc2.conflict); \n }\n }", "__equals(actual, expected) {\n if (helpers_1.isEmpty(actual) && helpers_1.isEmpty(expected)) {\n return true;\n }\n else if (typeof actual === 'string' ||\n typeof expected === 'string' ||\n typeof actual === 'number' ||\n typeof expected === 'number' ||\n typeof actual === 'boolean' ||\n typeof expected === 'boolean') {\n return actual === expected;\n }\n else {\n throw new Error(\n // tslint:disable-next-line:max-line-length\n `${this.constructor.name}.__equals is missing an implementation for type '${typeof actual}' of values: ${actual}, ${expected}`);\n }\n }", "function paramsAreEqual(oldParams, newParams) {\n let newParamsArray = Object.getOwnPropertyNames(newParams)\n .filter((prop) => {\n return newParams[prop] !== null && prop !== 'bbox';\n })\n .map((prop) => {\n return [prop, newParams[prop]];\n });\n let oldParamsArray = Object.getOwnPropertyNames(oldParams)\n .filter((prop) => {\n return oldParams[prop] !== null && prop !== 'bbox';\n })\n .map((prop) => {\n return [prop, oldParams[prop]];\n });\n return JSON.stringify(newParamsArray.sort()) ===\n JSON.stringify(oldParamsArray.sort());\n }", "function arePropertiesEqual(p1, p2) {\n if (Array.isArray(p1) && Array.isArray(p2)) {\n if (p1.length != p2.length) {\n return false;\n }\n\n for (var i = 0; i < p1.length; i++) {\n var found = false;\n for (var j = 0; j < p2.length; j++) {\n if (arePropertiesEqual(p1[i], p2[j])) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n return false;\n }\n }\n\n return true;\n }\n else if (typeof p1 == 'object' && typeof p2 == 'object') {\n var areEqual = (p1 != null);\n if (areEqual) {\n radiant.each(p1, function (k, v) {\n if (!areEqual) {\n return;\n }\n areEqual = arePropertiesEqual(v, p2 && p2[k]);\n });\n }\n\n return areEqual;\n }\n\n return p1 == p2;\n}", "function equal(expected, actual, _errors, _path) {\t\n\tvar errors = _errors || [];\n\tvar initialErrors = errors.length;\n\tvar path = _path || [\"root\"];\n\tif(typeof path == 'string')\n\t path = [path];\n\tfunction getPathString(path) {\n\t\tvar pathString = \"\";\n\t\tfor(var i=0; i<path.length; i++) {\n\t\t\tpathString += path[i];\n\t\t}\n\t\treturn pathString;\n\t}\n\t\n\tif(typeof expected != typeof actual) {\n\t\terrors.push(\"Actual type '\"+typeof actual+\"' doesn't match expected type '\"+typeof expected+\"' at \"+getPathString(path));\n\t}\t\n\tif(expected instanceof Array) {\n\t\tif(expected.length!=actual.length)\n\t\t\terrors.push(\"Actual array has length: \"+actual.length+\" but expected length is: \"+expected.length+\" at \"+getPathString(path));\n\t\telse {\n\t\t\tfor(var i=0; i<expected.length; i++) {\n\t\t\t\tpath.push(\"[\"+i+\"]\");\n\t\t\t\tequal(expected[i], actual[i], errors, path);\n\t\t\t\tpath.pop();\n\t\t\t}\n\t\t}\n\t}\n\telse if(typeof expected=='object') {\n\t\tfor(var p in expected) {\n\t\t\tpath.push(\".\"+p);\n\t\t\tif(actual.hasOwnProperty(p))\n\t\t\t\tequal(expected[p], actual[p], errors, path);\n\t\t\telse {\n\t\t\t \terrors.push(\"Object is missing expected property '\"+p+\"' at \"+getPathString(path));\n\t\t\t}\n\t\t\tpath.pop();\n\t\t}\n\t}\n\telse if(expected!==actual) {\n\t\terrors.push(\"Actual value (\"+actual+\") doesn't match expected value (\"+expected+\") at \"+getPathString(path));\n\t}\n\treturn !errors.length>initialErrors;\n}", "ExactValue()\n {\n return this.Expected == this.Actual ? \"no error\" : `Expected ${this.Expected} but found ${this.Actual}`\n }", "function assert_response_equals(actual, expected, description) {\n assert_class_string(actual, \"Response\", description);\n [\"type\", \"url\", \"status\", \"ok\", \"statusText\"].forEach(function(attribute) {\n assert_equals(actual[attribute], expected[attribute],\n description + \" Attributes differ: \" + attribute + \".\");\n });\n assert_header_equals(actual.headers, expected.headers, description);\n}", "function assertEquals(obj1, obj2) {\n checkEquals(obj1, obj2, \"(top)\");\n\n function checkEquals(obj1, obj2, objName) {\n var t1 = typeFunctions.type(obj1);\n var t2 = typeFunctions.type(obj2);\n\n if (t1 != t2) {\n throw new Exception(\"at \" + objName + \" \" + t1 + \" .vs. \" + t2);\n }\n switch (t1) {\n case \"object\":\n for (var name in obj1) {\n if (hasValue(obj1[name]) && !hasValue(obj2[name])) {\n throw new Exception(name + \".\" + namet1 + \" .is missing\");\n }\n }\n for (var name in obj2) {\n if (hasValue(obj2[name]) && !hasValue(obj1[name])) {\n throw new Exception(name + \".\" + namet1 + \" .is missing\");\n }\n checkEquals(obj1[name], obj2[name], objName + \".\" + name);\n }\n break;\n\n case 'array':\n if (obj1.length != obj2.length) {\n throw new Exception(\"different array lengths at \" + objName);\n }\n obj1.forEach(function(row, index) {\n checkEquals(row, obj2[index], objName + \"[\" + index + \"]\");\n })\n break;\n\n default:\n if (obj1 != obj2) {\n throw new Exception(\"at \" + objName + \" \" + obj1 + \" .vs. \" + obj2);\n }\n break;\n }\n }\n}", "function sameProps(objA, objB) {\n var keysA = Object.keys(objA)\n var keysB = Object.keys(objB)\n\n if (keysA.length !== keysB.length)\n return false\n\n for (var i = 0; i < keysA.length; i++) {\n if (keysA[i] !== keysB[i])\n return false\n }\n\n return true\n}", "function assertArrayEquals(a, b, desc) {\n const arrayA = JSON.stringify(a);\n const arrayB = JSON.stringify(b);\n if (arrayA !== arrayB) {\n console.log(`${desc} ... FAIL: ${arrayA} != ${arrayB}`)\n } else {\n console.log(`${desc} ... PASS`);\n }\n}", "function objectProperties(a, b) {\n\tvar key;\n\tfor (key in b) {\n\t\tif (a[key] !== b[key]) return false;\n\t}\n\treturn true;\n}", "function sameProperties(objA, objB) {\n var keysA = Object.keys(objA).sort()\n var keysB = Object.keys(objB).sort()\n\n if (keysA.length !== keysB.length)\n return false\n\n for (var i = 0; i < keysA.length; i++)\n if (keysA[i] !== keysB[i] || objA[keysA[i]] !== objB[keysB[i]])\n return false\n\n return true\n}", "function compareObjectArrays(a, b) {\n expect(a.length).toEqual(b.length);\n\n for (var i = 0, l = a.length; i < l; i++) {\n for (var prop in a[i]) {\n if ( hasOwnProp.call(a[i], prop) ) {\n expect(b[i][prop]).toBeDefined();\n expect(a[i][prop]).toEqual(b[i][prop]);\n }\n }\n }\n }", "function check(actual, expected) {\n assertEq(actual.length, expected.length);\n for (var i = 0; i < expected.length; i++)\n assertEq(actual[i], expected[i]);\n}", "function assertEquals(expected, received, description) {\n if(expected.compare)\n console.assert(expected.compare(received), description,\n `\\nExpected: '${expected}'\\tReceived: '${received}'`);\n else\n console.assert(expected == received, description,\n `\\nExpected: '${expected}'\\tReceived: '${received}'`);\n}", "function diffObject(context, expected, actual, strict) {\n diffType(context, expected, actual);\n let expectedKeys = Object.keys(expected);\n let actualKeys = Object.keys(actual);\n\n if (strict) {\n matchKeys(context, expectedKeys, actualKeys);\n }\n\n expectedKeys.forEach(function(key) {\n diff(context.enter(key), expected[key], actual[key]);\n });\n}", "function shallowCompare(a, b) {\r\n return checkProperties(a, b) && checkProperties(b, a);\r\n}", "function shallowCompare(a, b) {\r\n return checkProperties(a, b) && checkProperties(b, a);\r\n}", "isIdenticalPropertyValue_ (propName, val1, val2) {\n const comparator = this.constructor.propertyComparators[propName];\n return comparator ? comparator(val1, val2) : false;\n }", "toBeObject(expected) {\n if (typeof expected === \"object\" && !Array.isArray(expected)) {\n // typeof is not safe. Must explicitidly check null values and arrays too.\n return {\n message: \"Is Object\",\n pass: true,\n };\n }\n return {\n message: () => `This is not an object, it's::::${typeof expect}`,\n pass: false,\n };\n }", "function areEquals(a, b) {\n\n\tlet aProps = Object.getOwnPropertyNames(a);\n let bProps = Object.getOwnPropertyNames(b);\n\n if (bProps.length !== aProps.length)\n \treturn false;\n\n for (let key of aProps) {\n \tif (!bProps.includes(key) || b[key] !== a[key])\n \t\treturn false;\n }\n\n for (let key of bProps) {\n \tif (!aProps.includes(key) || b[key] !== a[key])\n \t\treturn false;\n }\n\n return true;\n}", "function testEquality(objA, objB, properties) {\n var equal = true;\n for (var i = 0; (i < properties.length) && equal; ++i) {\n if (Object.prototype.hasOwnProperty.call(objA, properties[i]) && Object.prototype.hasOwnProperty.call(objB, properties[i])) {\n equal = (objA[properties[i]] == objB[properties[i]]);\n }\n }\n return equal;\n}", "beEqualToArray() {\n this._processArguments(arguments);\n this._printActualForFailure = false;\n\n let passed = true;\n let passDetail, failDetail;\n let errorIndices = [];\n\n if (this._actual.length !== this._expected.length) {\n passed = false;\n failDetail = 'The array length does not match.';\n return this._assert(passed, passDetail, failDetail);\n }\n\n let actual = this._actual;\n let expected = this._expected;\n for (let index = 0; index < actual.length; ++index) {\n if (actual[index] !== expected[index])\n errorIndices.push(index);\n }\n\n passed = errorIndices.length === 0;\n\n if (passed) {\n passDetail = '${actual} is identical to the array ${expected}.';\n } else {\n let counter = 0;\n failDetail =\n '${actual} expected to be equal to the array ${expected} ' +\n 'but differs in ' + errorIndices.length + ' places:' +\n '\\n\\tIndex\\tActual\\t\\t\\tExpected';\n for (let index of errorIndices) {\n failDetail += '\\n\\t[' + index + ']' +\n '\\t' + this._actual[index].toExponential(16) + '\\t' +\n this._expected[index].toExponential(16);\n if (++counter >= this._options.numberOfErrors) {\n failDetail += '\\n\\t...and ' + (errorIndices.length - counter) +\n ' more errors.';\n break;\n }\n }\n }\n\n return this._assert(passed, passDetail, failDetail);\n }", "function test_hasProperty_null (){ assertFalse( compare.hasProperty( null, 'a' ) ) }", "isObjectEqual(a, b) {\n return a && b && a.foo === b.foo;\n }", "function checkIIP(real, expected) {\n chai.expect(expected).to.have.property('source');\n chai.expect(expected).to.have.property('target');\n chai.expect(expected).to.have.property('data');\n\n chai.expect(real).to.have.property('target');\n chai.expect(real).to.have.property('data');\n\n // check source structure\n chai.expect(real.source).to.have.property('port');\n\n // check target structure\n chai.expect(real.target).to.have.property('id');\n chai.expect(real.target).to.have.property('port');\n chai.expect(real.target).to.eql(expected.target);\n\n // check data\n chai.expect(real.data).to.eql(expected.data);\n\n // copy id and compare both together\n // expected.source.id = real.source.id;\n\n // do not care that much about metadata.title at the moment..\n expected.metadata = real.metadata;\n\n chai.expect(real).to.eql(expected);\n\n}", "function equal(a, b) {\n\n if (Object.is(a, b))\n return true;\n\n\t// Dates must have equal time values\n\tif (isDate(a) && isDate(b))\n\t\treturn a.getTime() === b.getTime();\n\n\t// Non-objects must be strictly equal (types must be equal)\n\tif (!isObject(a) || !isObject(b))\n\t\treturn a === b;\n\n\t// Prototypes must be identical. getPrototypeOf may throw on\n\t// ES3 engines that don't provide access to the prototype.\n\ttry {\n\n\t if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n\t\t return false;\n\n\t} catch (err) {}\n\n\tvar aKeys = Object.keys(a),\n\t\tbKeys = Object.keys(b);\n\n\t// Number of own properties must be identical\n\tif (aKeys.length !== bKeys.length)\n\t\treturn false;\n\n\tfor (var i$0 = 0; i$0 < aKeys.length; ++i$0) {\n\n\t\t// Names of own properties must be identical\n\t\tif (!OP_hasOwnProperty.call(b, aKeys[i$0]))\n\t\t\treturn false;\n\n\t\t// Values of own properties must be equal\n\t\tif (!equal(a[aKeys[i$0]], b[aKeys[i$0]]))\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "function deepCompare(actual, expect) {\n return (\n actual === expect ||\n Object.is(actual, expect) ||\n (Object(actual) === actual &&\n Object(expect) === expect &&\n ((Array.isArray(actual) &&\n Array.isArray(expect) &&\n actual.length === expect.length &&\n expect.every((expect, index) => deepCompare(actual[index], expect))) ||\n (Object.keys(actual).length === Object.keys(expect).length &&\n Object.keys(expect).every((key) =>\n deepCompare(actual[key], expect[key])\n ))))\n );\n}", "function deepEqual(a,b) \n{\n//two inputs ob ojects\n\tif (a === b) return true; //this is true when these share same value prop.\n\tif (a == null || typeof a !=\"object\" || b == null || typeof b !=\"object\" ) //Null =/ null\n\t\treturn false; //this checks if they dont equal\n\n\tvar a_count = 0, b_count = 0; //counters for loop iteration\n\tfor(var properties in a)\n\t\ta_count++;\n\tfor( var properties in b) \n\t{\n\t\tb_count++;\n\t\n\tif(!(properties in a) || !deepEqual(a[properties], b[properties]))\n\t\treturn false;\n\t}\nreturn a_count === b_count;\n}", "compare(){\n\t\tvar diff = 0,\n\t\t\tself = this;\n\t\tattributesArray_String.map( ( attr )=>{\n\t\t\tdiff+= self.snapshots[attr] == self.object[attr] ? 0 : 1;\n\t\t});\n\t\treturn diff <= 0;\n\t}", "function EXPECT_EQ(x1, x2, stringOnFail) {\n if (isNaN(x1) || isNaN(x2) || x1 != x2) {\n LOG('EXPECT_EQ FAILED');\n LOG('x1: ' + x1);\n LOG('x2: ' + x2);\n LOG(stringOnFail);\n numErrors_ += 1;\n }\n}", "isEqual(comp) {\n return this.die1 === comp.die1 && this.die2 === comp.die2;\n }", "function shallowCompare(a, b) {\n return checkProperties(a, b) && checkProperties(b, a);\n}", "function shallowCompare(a, b) {\n return checkProperties(a, b) && checkProperties(b, a);\n}", "function shallowCompare(a, b) {\n return checkProperties(a, b) && checkProperties(b, a);\n}", "function shallowCompare(a, b) {\n return checkProperties(a, b) && checkProperties(b, a);\n}", "function diffPrimitive(context, expected, actual) {\n if (_.isEqual(expected, actual)) return;\n context.throw(`diff value, ${JSON.stringify(expected)} ≠ ${JSON.stringify(actual)}`);\n}", "function assertEquals(p1,p2){\nif (p1===p2)\n\t// return true\n\nconsole.log(\"Ok\");\nelse {\n\tconsole.log( \"the two values are not the same:\")\n\tconsole.log( \"p1-->\", p1)\n\tconsole.log( \"p2-->\", p2)\n}\n\n}", "function assertSame(expected, actual, message = undefined) {\n if (message !== undefined) {\n actual;\n expected;\n String(message);\n } else {\n actual;\n expected;\n }\n}", "function matching(actual, expected) {\n if (actual === expected)\n return true\n return false\n}", "function assert_header_equals(actual, expected, description) {\n assert_class_string(actual, \"Headers\", description);\n var header;\n var actual_headers = [];\n var expected_headers = [];\n for (header of actual)\n actual_headers.push(header[0] + \": \" + header[1]);\n for (header of expected)\n expected_headers.push(header[0] + \": \" + header[1]);\n assert_array_equals(actual_headers, expected_headers,\n description + \" Headers differ.\");\n}", "function equalOwnProperties(left, right, equalityComparer) {\n if (left === right)\n return true;\n if (!left || !right)\n return false;\n for (var key in left)\n if (hasOwnProperty.call(left, key)) {\n if (!hasOwnProperty.call(right, key) === undefined)\n return false;\n if (equalityComparer ? !equalityComparer(left[key], right[key]) : left[key] !== right[key])\n return false;\n }\n for (var key in right)\n if (hasOwnProperty.call(right, key)) {\n if (!hasOwnProperty.call(left, key))\n return false;\n }\n return true;\n }", "ArrayContent()\n { \n let ExpectedArray = [];\n let ActualArray = [];\n\n for (let index = 0; index < this.Expected.length; index++) {\n if(this.Expected[index] !== this.Actual[index])\n {\n ExpectedArray.push(this.Expected[index])\n ActualArray.push(this.Actual[index])\n }\n } \n \n return !ExpectedArray.length ? 'no error' : `Expected ${ExpectedArray.join(\" \")} but found ${ActualArray.join(\" \")}`\n }", "function assertRectsEqual(expected, actual) {\n if (!goog.math.Rect.equals(expected, actual)) {\n assertEquals(expected, actual);\n }\n}", "function assertEquals (p1,p2){\n if (p1 === p2){\n console.log(\"ok->\" + p1);\n return true;\n }\n console.log(\"The two values are not the same.\" );\n console.log(\"p1--> \" + p1);\n console.log(\"p2--> \" + p2);\n return false;\n}", "function assertEqual(actual, expected) {\n if (actual === expected) { \n console.log('passed');\n } else {\n console.log('FAILED expected ' + expected + ', but got ' + actual);\n }\n}", "function assertEqual( checksum1, checksum2 ) {\n if ( checksum1.length !== checksum2.length || checksum1.length !== 4 ) {\n return false;\n }\n for ( var i = 0; i < checksum1.length; ++i ) {\n if ( checksum1[ i ] !== checksum2[ i ] ) return false;\n }\n return true;\n }", "function isEqual(actual, expected, actualStack, expectedStack) {\n var i, index, key, actualValue, expectedValue, actualKeys, expectedKeys;\n\n if (actual === expected) {\n return true;\n }\n\n // handle NaN\n if (expected !== expected) {\n return actual !== actual;\n }\n\n if (typeof actual !== typeof expected) {\n return false;\n }\n\n // non-object values can be evaluated with the `===` operator\n if (typeof expected !== 'object' || expected === null) {\n return actual === expected;\n }\n\n if (expected instanceof Buffer) {\n if (actual.length !== expected.length) {\n return false;\n }\n\n for (i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n if (expected instanceof Array) {\n if (actual.length !== expected.length) {\n return false;\n }\n\n for (i = 0; i < expected.length; i++) {\n actualValue = actual[i];\n expectedValue = expected[i];\n\n // see if we have visited this value before\n index = expectedStack.indexOf(expectedValue);\n if (index !== -1) {\n return actualStack.indexOf(actualValue) === index;\n }\n\n actualStack.push(actualValue);\n expectedStack.push(expectedValue);\n\n if (!isEqual(actualValue, expectedValue, actualStack, expectedStack)) {\n return false;\n }\n\n actualStack.pop();\n expectedStack.pop();\n }\n\n return true;\n }\n\n // we don't care about `x.lastIndex`\n if (expected instanceof RegExp) {\n return actual instanceof RegExp &&\n actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.ignoreCase === expected.ignoreCase;\n }\n\n if (expected instanceof Date) {\n return actual instanceof Date &&\n actual.getTime() === expected.getTime();\n }\n\n // from this point forward we'll treat the value like an object literal\n (expectedKeys = Object.keys(expected)).sort();\n (actualKeys = Object.keys(actual)).sort();\n\n if (expectedKeys.length !== actualKeys.length) {\n return false;\n }\n\n for (i = 0; i < expectedKeys.length; i++) {\n key = expectedKeys[i];\n\n if (actualKeys[i] !== key) {\n return false;\n }\n\n actualValue = actual[key];\n expectedValue = expected[key];\n\n // is the value an object lower down in the stack?\n index = expectedStack.indexOf(expectedValue);\n if (index !== -1) {\n return actualStack.indexOf(actualValue) === index;\n }\n\n actualStack.push(actualValue);\n expectedStack.push(expectedValue);\n\n if (!isEqual(actualValue, expectedValue, actualStack, expectedStack)) {\n return false;\n }\n\n actualStack.pop();\n expectedStack.pop();\n }\n\n return true;\n}", "notBeConstantValueOf() {\n this._processArguments(arguments);\n this._printActualForFailure = false;\n\n let passed = true;\n let passDetail;\n let failDetail;\n let differences = {};\n\n let actual = this._actual;\n let expected = this._expected;\n for (let index = 0; index < actual.length; ++index) {\n if (actual[index] !== expected)\n differences[index] = actual[index];\n }\n\n let numberOfDifferences = Object.keys(differences).length;\n passed = numberOfDifferences > 0;\n\n if (passed) {\n let valueString = numberOfDifferences > 1 ? 'values' : 'value';\n passDetail = '${actual} is not constantly ${expected} (contains ' +\n numberOfDifferences + ' different ' + valueString + ').';\n } else {\n failDetail = '${actual} should have contain at least one value ' +\n 'different from ${expected}.';\n }\n\n return this._assert(passed, passDetail, failDetail);\n }", "function assertEquals(a,b) {\n\tif (a === b) {\n\t\treturn true;\n\t} \n\t\n\tconsole.log(\"***the two values are not the same\", \"\\n p1-->\"+a, \"\\n p2-->\" +b);\n\treturn false;\n\n}", "testAdvanced() {\n var a = 3;\n var b = a;\n this.assertIdentical(a, b, \"A rose by any other name is still a rose\");\n this.assertInRange(\n 3,\n 1,\n 10,\n \"You must be kidding, 3 can never be outside [1,10]!\"\n );\n }", "assertType(expected, actual)\n {\n Tester.valid(expected, 'string')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (Tester.type(actual) !== expected) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function isEqual(a, b) {\n if (a.Subtype !== b.Subtype || a.Params.CheckSum.toString() !== b.Params.CheckSum.toString() || a.Params.Size !== b.Params.Size || a.Params.CreationDate !== b.Params.CreationDate || a.Params.ModDate !== b.Params.ModDate) {\n return false;\n }\n\n return true;\n}", "function isEquivalent(a, b) {\n // Create arrays of property names\n let aProps = Object.getOwnPropertyNames(a);\n let bProps = Object.getOwnPropertyNames(b);\n\n // If number of properties is different,\n // objects are not equivalent\n if (aProps.length != bProps.length) {\n return false;\n }\n\n for (let i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n\n // If values of same property are not equal,\n // objects are not equivalent\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n\n // If we made it this far, objects\n // are considered equivalent\n return true;\n}", "function partialDeepEqual(a, b) {\r\n if (a === b) {\r\n return true;\r\n }\r\n\r\n if (typeof a !== typeof b) {\r\n return false;\r\n }\r\n\r\n if (a && b && typeof a === 'object' && typeof b === 'object') {\r\n return !Object.keys(b).some(function (key) {\r\n return !partialDeepEqual(a[key], b[key]);\r\n });\r\n }\r\n\r\n return false;\r\n}", "toContainOnly(received, expectedArray) {\n const receivedArray = Array.from(received);\n let pass = true;\n if (receivedArray.length !== expectedArray.length) {\n pass = false;\n } else {\n for (const expectedItem of expectedArray) {\n if (!receivedArray.some((receivedItem) => isEqual(receivedItem, expectedItem))) {\n pass = false;\n break;\n }\n }\n for (const receivedItem of receivedArray) {\n if (!expectedArray.some((expectedItem) => isEqual(receivedItem, expectedItem))) {\n pass = false;\n break;\n }\n }\n }\n return {\n pass,\n actual: receivedArray,\n message: () => {\n const diffString = diff(expectedArray, receivedArray, { expand: this.expand });\n return `${this.utils.matcherHint(pass ? \".not.toContainOnly\" : \".toContainOnly\")}\\n\\nExpected value${\n pass ? \" not\" : \"\"\n } to contain only:\\n ${this.utils.printExpected(expectedArray)}\\nReceived:\\n ${this.utils.printReceived(\n receivedArray\n )}\\n\\nDifference:\\n\\n${diffString}`;\n },\n };\n }", "toContainOnly(received, expectedArray) {\n const receivedArray = Array.from(received);\n let pass = true;\n if (receivedArray.length !== expectedArray.length) {\n pass = false;\n } else {\n for (const expectedItem of expectedArray) {\n if (!receivedArray.some((receivedItem) => isEqual(receivedItem, expectedItem))) {\n pass = false;\n break;\n }\n }\n for (const receivedItem of receivedArray) {\n if (!expectedArray.some((expectedItem) => isEqual(receivedItem, expectedItem))) {\n pass = false;\n break;\n }\n }\n }\n return {\n pass,\n actual: receivedArray,\n message: () => {\n const diffString = diff(expectedArray, receivedArray, { expand: this.expand });\n return `${this.utils.matcherHint(pass ? \".not.toContainOnly\" : \".toContainOnly\")}\\n\\nExpected value${\n pass ? \" not\" : \"\"\n } to contain only:\\n ${this.utils.printExpected(expectedArray)}\\nReceived:\\n ${this.utils.printReceived(\n receivedArray\n )}\\n\\nDifference:\\n\\n${diffString}`;\n },\n };\n }", "function moviePropsAreEqual(prevMovie, nextMovie) {\n return (\n prevMovie.title === nextMovie.title &&\n prevMovie.releaseDate === nextMovie.releaseDate\n );\n}", "function areEqualMappings(a, b) {\n\t return (\n\t // sorted by selectivity\n\t a.generatedColumn == b.generatedColumn &&\n\t a.originalColumn == b.originalColumn &&\n\t a.name == b.name &&\n\t a.generatedLine == b.generatedLine &&\n\t a.originalLine == b.originalLine &&\n\t a.source == b.source\n\t );\n\t}" ]
[ "0.7080603", "0.70543015", "0.7050365", "0.7003055", "0.6955575", "0.69348603", "0.6872712", "0.6872712", "0.6806349", "0.6806349", "0.6805955", "0.6789299", "0.6759444", "0.675652", "0.6695409", "0.6669557", "0.6650413", "0.66113466", "0.6550676", "0.64478105", "0.64477533", "0.6444965", "0.643738", "0.6380481", "0.6380481", "0.6352462", "0.63421845", "0.63301057", "0.6318007", "0.62945026", "0.6273591", "0.6198352", "0.6198186", "0.6181797", "0.6179162", "0.61642945", "0.6157514", "0.6155138", "0.6142593", "0.6137547", "0.61366004", "0.6127708", "0.6127447", "0.61225486", "0.6122343", "0.612234", "0.61124194", "0.61031955", "0.6102401", "0.60990405", "0.60884315", "0.6083768", "0.60715157", "0.60683393", "0.6057928", "0.60512376", "0.6049793", "0.60408837", "0.60408837", "0.60219216", "0.6009469", "0.5994966", "0.596913", "0.5962734", "0.59624565", "0.5942862", "0.59345907", "0.5922375", "0.59204775", "0.59161925", "0.59160876", "0.59110403", "0.5907586", "0.5900347", "0.5900347", "0.5900347", "0.5900347", "0.5898696", "0.58854157", "0.5884493", "0.588407", "0.58793956", "0.5878567", "0.586233", "0.5852044", "0.5847323", "0.58448297", "0.584107", "0.58369064", "0.58242834", "0.58238757", "0.57952785", "0.5789584", "0.57836056", "0.578303", "0.57794416", "0.57776254", "0.57776254", "0.5766577", "0.57652724" ]
0.65479594
19
sftp = new Sftp(credential);
function uploadAll(){ sftp.load(credential).then(function () { console.log('\n --> config success ... '); fs.readdir(__dirname + '/uploads', (err, files) => { files.forEach(file => { //console.log(file); sftp.put(__dirname + '/uploads/' + file, '/Test Backup/NodeTest/' + file).then(function (list) { console.log('\n --> ls success \n', list); fs.appendFile(__dirname + '/results/success.txt', file +'\n', function (err) { if (err) throw err; //console.log('Saved!'); }); }).catch(function (error) { console.log('\n --> ls failed ', error); fs.appendFile(__dirname + '/results/failure.txt', file +'\n', function (err) { if (err) throw err; //console.log('Saved!'); }); }); }); }); }).catch(function (error) { console.log('\n --> error : ', error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sftp() {\n if (!this.ready) {\n throw 'connection not ready';\n }\n return this.client.sftpAsync().then(sftp => {\n return BPromise.promisifyAll(sftp);\n });\n }", "function getFtpConnection() { \n return ftp.create({\n host: hostAddress,\n user: userName,\n password: userPass,\n parallel: 5,\n log: gutil.log\n });\n}", "function getFtpConnection() { \r\n return ftp.create({\r\n host: host,\r\n port: port,\r\n user: user,\r\n password: password,\r\n parallel: 5,\r\n log: gutil.log\r\n });\r\n}", "function check_sftp(resource, conn, cb) {\n var workdir = common.getworkdir(null, resource);\n conn.sftp(function(err, sftp) {\n if(err) return cb(err);\n //logger.debug(\"reading directory:\"+workdir);\n /*\n var t = setTimeout(function() {\n t = null;\n cb(null, \"failed\", \"workdir is inaccessible (timeout)\");\n }, 5000);\n */\n //sftp.readdir(workdir, function(err, list) {\n logger.debug(\"reading dir \"+workdir);\n var to = setTimeout(()=>{\n logger.error(\"readdir timeout\"); \n cb(null, \"failed\", \"readdir timeout - filesytem is offline?\");\n }, 5000);\n sftp.readdir(workdir, function(err, list) {\n clearTimeout(to);\n logger.debug(\"got dir\", list);\n //if(t == null) return; //timeout already called\n if(err) {\n //console.log(\"failed to readdir:\"+workdir);\n //maybe it doesn't exist yet.. try to create it\n sftp.opendir(workdir, function(err) {\n if(err) return cb(err); //truely bad..\n cb(null, \"ok\", \"ssh connection is good and workdir is accessible (created)\");\n });\n }\n //clearTimeout(t);\n cb(null, \"ok\", \"ssh connection is good and workdir is accessible\");\n });\n });\n}", "async access(options = {}) {\n var _a, _b;\n const useExplicitTLS = options.secure === true;\n const useImplicitTLS = options.secure === \"implicit\";\n let welcome;\n if (useImplicitTLS) {\n welcome = await this.connectImplicitTLS(options.host, options.port, options.secureOptions);\n }\n else {\n welcome = await this.connect(options.host, options.port);\n }\n if (useExplicitTLS) {\n // Fixes https://github.com/patrickjuchli/basic-ftp/issues/166 by making sure\n // host is set for any future data connection as well.\n const secureOptions = (_a = options.secureOptions) !== null && _a !== void 0 ? _a : {};\n secureOptions.host = (_b = secureOptions.host) !== null && _b !== void 0 ? _b : options.host;\n await this.useTLS(secureOptions);\n }\n await this.login(options.user, options.password);\n await this.useDefaultSettings();\n return welcome;\n }", "async #client() {\n const { host, user, password, port, verbose } = this.options;\n const client = new ftp.Client();\n client.ftp.verbose = verbose;\n await client.access({ host, user, password, port, secure: true });\n return client;\n }", "function getFtpConnection() {\r\n return ftp.create({\r\n host: ftpSettings.host,\r\n port: ftpSettings.port,\r\n user: ftpSettings.username,\r\n password: ftpSettings.password,\r\n parallel: 5,\r\n log: console.log\r\n });\r\n}", "function _connect(opts) {\n var deferred = Q.defer(),\n ssh = grunt.template.process(lodashTemplates.ssh, {data: opts});\n //\n shell.on('ready', function () {\n deferred.resolve(true);\n\n }).on('error', function (err) {\n deferred.reject(err);\n\n });\n shell.connect({\n host: opts.host,\n port: opts.port,\n username: opts.user,\n password: opts.password\n });\n return deferred.promise;\n }", "getRepositoryPipelineSshKeyPair(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The repository.\n /*let username = \"username_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ apiInstance.getRepositoryPipelineSshKeyPair(\n incomingOptions.username,\n incomingOptions.repoSlug,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "function FtpServer(host, options) {\n var self = this;\n EventEmitter.call(self);\n\n self.host = host;\n\n self.options = options;\n\n if (!self.options.maxStatsAtOnce) {\n self.options.maxStatsAtOnce = 5;\n }\n\n if (!options.getInitialCwd) {\n throw new Error(\"'getInitialCwd' option of FtpServer must be set\");\n }\n\n if (!options.getRoot) {\n throw new Error(\"'getRoot' option of FtpServer must be set\");\n }\n\n self.getInitialCwd = options.getInitialCwd;\n self.getRoot = options.getRoot;\n\n self.getUsernameFromUid = options.getUsernameFromUid || function(uid, cb) {\n cb(null, 'ftp');\n };\n\n self.getGroupFromGid = options.getGroupFromGid || function(gid, cb) {\n cb(null, 'ftp');\n };\n\n self.debugging = options.logLevel || 0;\n self.useWriteFile = options.useWriteFile;\n self.useReadFile = options.useReadFile;\n self.uploadMaxSlurpSize = options.uploadMaxSlurpSize || 0;\n self.server = net.createServer();\n\n self.server.on('connection', function(socket) {\n self._onConnection(socket);\n });\n\n self.server.on('error', function(err) {\n self.emit('error', err);\n });\n\n self.server.on('close', function() {\n self.emit('close');\n });\n}", "function getFtpConnection() {\n return ftp.create({\n host: host,\n port: port,\n user: user,\n password: password,\n parallel: 5,\n log: gutil.log\n });\n}", "function getFtpConnection() {\n return ftp.create({\n host,\n port,\n user,\n password,\n parallel: 5,\n log: gutil.log\n });\n}", "async function initPrivateGit(credentials) {\n await execa_1.default('git', [\n 'config',\n '--global',\n 'credential.helper',\n `store --file ${path_1.join(os_1.homedir(), '.git-credentials')}`,\n ]);\n await fs_extra_1.writeFile(path_1.join(os_1.homedir(), '.git-credentials'), credentials);\n}", "function getFtpConnection() {\n return ftp.create({\n host: host,\n port: port,\n user: user,\n password: password,\n parallel: 5,\n log: gutil.log,\n })\n}", "_authenticateSingleConnection(sendAuthCommand, connection, credentials, callback) {\n // TODO: Destructure this\n const username = credentials.username;\n const password = credentials.password;\n const mechanismProperties = credentials.mechanismProperties;\n const gssapiServiceName =\n mechanismProperties['gssapiservicename'] ||\n mechanismProperties['gssapiServiceName'] ||\n 'mongodb';\n\n SSIPAuthenticate(\n this,\n kerberos.processes.MongoAuthProcess,\n username,\n password,\n gssapiServiceName,\n sendAuthCommand,\n connection,\n mechanismProperties,\n callback\n );\n }", "credentials(url, userName) {\n return Git.Cred.sshKeyFromAgent(userName);\n }", "connect() {\n if(!this.username || !this.password) {\n return;\n }\n slsk.connect({\n user: this.username,\n pass: this.password,\n }, (err, client) => this.onConnected(err, client));\n }", "function uploadWithPromise(host, user, file, remote) {\n \n var deferred = Q.defer();\n var scp = setupSCP(host, user) \n \n scp.upload(file, remote, deferred.resolve);\n \n return deferred.promise;\n}", "setAwsCredentials(){\n\n\t}", "function downloadWithPromise(host, user, remoteFile, localDir) {\n \n var deferred = Q.defer();\n var scp = setupSCP(host, user) \n \n scp.download(remoteFile, localDir, deferred.resolve);\n \n return deferred.promise;\n}", "function UsernamePasswordCredentials(username, password) {\n this.username = username;\n this.password = password;\n}", "listSshKeys() {\n return new Promise((resolve, reject) => {\n this._client.account.listSshKeys((err, result) => {\n if (err) reject(err);\n resolve(result);\n });\n });\n }", "_authenticateSingleConnection(sendAuthCommand, connection, credentials, callback) {\n const source = credentials.source;\n const username = credentials.username;\n const password = credentials.password;\n const mechanismProperties = credentials.mechanismProperties;\n const gssapiServiceName =\n mechanismProperties['gssapiservicename'] ||\n mechanismProperties['gssapiServiceName'] ||\n 'mongodb';\n\n GSSAPIInitialize(\n this,\n kerberos.processes.MongoAuthProcess,\n source,\n username,\n password,\n source,\n gssapiServiceName,\n sendAuthCommand,\n connection,\n mechanismProperties,\n callback\n );\n }", "function init() {\n checkCredentials();\n}", "function check_ssh(resource, cb) {\n var conn = new Client();\n var ready = false;\n var nexted = false;\n conn.on('ready', function() {\n ready = true;\n conn.exec('whoami', function(err, stream) {\n if (err) {\n conn.end();\n nexted = true;\n return cb(err);\n }\n var ret_username = \"\";\n stream.on('close', function(code, signal) {\n //conn.end();\n nexted = true;\n if(ret_username.trim() == resource.config.username) {\n check_sftp(resource, conn, function(err, status, msg) {\n //console.log(\"check_sftp cb -------------------------- \"+resource._id);\n conn.end();\n if(err) return cb(err);\n cb(null, status, msg);\n });\n } else {\n conn.end();\n //I need to fail if user is outputing something on the terminal (right now, it kills ssh2/sftp)\n cb(null, \"failed\", \"ssh connection good but whoami reports:\"+ret_username+\" which is different from \"+resource.config.username+\" Please make sure your .bashrc is not outputting any content for non-interactive session.\"); \n }\n }).on('data', function(data) {\n ret_username += data;\n }).stderr.on('data', function(data) {\n //I get \\n stuff occasionally\n logger.debug('whoami error: ');\n });\n })\n });\n conn.on('end', function() {\n logger.debug(\"ssh connection ended\");\n });\n conn.on('close', function() {\n logger.debug(\"ssh connection closed\");\n if(!ready && !nexted) cb(null, \"failed\", \"Connection closed before becoming ready.. probably in maintenance mode?\");\n });\n conn.on('error', function(err) {\n nexted = true;\n cb(null, \"failed\", err.toString());\n });\n\n //clone resource so that decrypted content won't leak out of here\n var decrypted_resource = JSON.parse(JSON.stringify(resource));\n common.decrypt_resource(decrypted_resource);\n logger.debug(\"check_ssh / decrypted\");\n var detail = config.resources[resource.resource_id];\n try {\n conn.connect({\n host: resource.config.hostname || detail.hostname,\n username: resource.config.username,\n privateKey: decrypted_resource.config.enc_ssh_private,\n //no need to set keepaliveInterval(in millisecond) because checking resource should take less than a second\n });\n } catch (err) {\n cb(null, \"failed\", err.toString());\n }\n}", "requestAuthentication() {\n\t\treturn vscode.window.showInputBox({\n\t\t\tignoreFocusOut: true,\n\t\t\tpassword: true,\n\t\t\tprompt: i18n.t('sftp_enter_ssh_pass')\n\t\t});\n\t}", "function init(){\n transport = nodemailer.createTransport({\n host: \"smtp.gmail.com\",\n port: 465,\n secure: true,\n auth:{ // extract this\n user: \"[email protected]\",\n pass: process.env.GMAIL_PASSWORD\n }\n })\n console.log(\"Notification Service started\")\n}", "generateCredentials () {\n // Generate the Basic Authentication header for a private instance of SLPDB.\n const username = 'BITBOX'\n const password = SLPDB_PASS\n const combined = `${username}:${password}`\n var base64Credential = Buffer.from(combined).toString('base64')\n var readyCredential = `Basic ${base64Credential}`\n\n const options = {\n headers: {\n authorization: readyCredential\n },\n timeout: 15000\n }\n\n return options\n }", "openUploadStream(filename, options) {\n return new upload_1.GridFSBucketWriteStream(this, filename, options);\n }", "function run(imgurl) {\n getCredentials(imgurl);\n}", "createChannel(url) {\n let c = NetUtil.newChannel({\n uri: url,\n loadUsingSystemPrincipal: true,\n });\n\n return c;\n }", "function connectToFilesystem() {\n var pwd = $('#connect-pwd').val();\n if (pwd.length == 0) {\n $('#connect-error').html('<b>Password is required!</b>');\n } else {\n metadataInit(pwd);\n downloadMetadata();\n }\n}", "constructor(\n user = config.user,\n password = config.password,\n host = config.host\n ) {\n this.user = user;\n this.password = password;\n this.host = host;\n }", "updateRepositoryPipelineKeyPair(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The repository // PipelineSshKeyPair | The created or updated SSH key pair.\n /*let username = \"username_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ /*let body = new Bitbucket.PipelineSshKeyPair();*/ apiInstance.updateRepositoryPipelineKeyPair(\n incomingOptions.username,\n incomingOptions.repoSlug,\n incomingOptions.body,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "constructor(username, password) {\n this.username = username;\n this.password = password;\n }", "readdir(session, path, sftpSession) {\n const sftp = sftpSession ? new SFTPClient() : new SFTPClient(session);\n return sftp.ls(path, sftpSession)\n .catch(parseError)\n .then((directory) => {\n if(!directory) return Promise.reject('Unable to list remote dir');\n return directory.entries.reduce((memo, entry) => {\n if(this.showHiddenFile || !entry.filename.startsWith('.')) {\n memo.push({\n size: entry.attrs.size,\n modified: entry.attrs.mtime,\n name: entry.filename,\n isDir: entry.longname.startsWith('d'),\n mime: Mime.lookup(entry.filename)\n });\n }\n return memo;\n }, []);\n });\n }", "_checkAndGenerateSSHKeys() {\n var file = config('agent:vm:ssh_key');\n return fsAsync.exists(file).then((exist) => {\n if (!exist) {\n this.info('configure.generating_key');\n var script = `\n set -x;\n ssh-keygen -t rsa -f ${file} -N ''; result=$?;\n set +x;\n echo \"\";\n exit $result;\n `;\n return this.execSh(script).then((code) => {\n if (code !== 0) {\n throw new DependencyError('ssh_keygen');\n } else {\n return code;\n }\n });\n }\n });\n }", "async PutFile(localFile, remoteFile) {\n let thisNsHost = this;\n let ssh = new node_ssh();\n\n await ssh.connect({\n host: thisNsHost.mgmtIP,\n username: 'nsroot',\n privateKey: thisNsHost.sshKeyFileName,\n algorithms: {\n serverHostKey: ['ssh-rsa', 'ssh-dss']\n }\n });\n\n let resultsObj = await ssh.putFile(localFile, remoteFile);\n ///Done\\n((?:.*\\n)*) Done$/.test(resultsObj['stdout']);\n ssh.dispose();\n //return RegExp.$1 || resultsObj['stderr'];\n return \"Complete\";\n }", "function _user(){\n\t//userconfig = getCredentials();\n\tvar userconfig = cloudfn.users.cli.get();\n\n\tvar schema = {\n\t\tproperties: {\n\t\t\tusername: {\n\t\t\t\tdescription: colors.green(\"Username\"),\n\t\t\t\tvalidator: /^[a-zA-Z]+$/,\n\t\t\t\twarning: 'Username must be only letters',\n\t\t\t\tdefault: userconfig.username,\n\t\t\t\trequired: true,\n\t\t\t\tminLength: 2,\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\temail: {\n\t\t\t\tdescription: colors.green(\"Email\"),\n\t\t\t\tdefault: userconfig.email,\n\t\t\t\trequired: true,\n\t\t\t\tconform: function(value){\n\t\t\t\t\treturn isemail.validate(value);\n\t\t\t\t},\n\t\t\t\t//format: 'email', // too sloppy\n\t\t\t\twarning: 'Email address required, see: http://isemail.info/_system/is_email/test/?all',\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tdescription: colors.green(\"Password\"),\n\t\t\t\thidden: true,\n\t\t\t\trequired: true,\n\t\t\t\treplace: '*',\n\t\t\t\tminLength: 5,\n\t\t\t\twarning: \"Password must be at least 6 characters\"\n\t\t\t}\n\t\t}\n\t};\n\n\tprompt.start();\n\n\tprompt.get(schema, function (err, result) {\n\t\tif (err) {\n\t\t\tconsole.log(\"\");\n\t\t\treturn 1;\n\t\t}\n\t\tif( debug ) console.log('Command-line input received:');\n\t\tif( debug ) console.log(' Username: ' + result.username);\n\t\tif( debug ) console.log(' Email: ' + result.email);\n\t\tif( debug ) console.log(' Password: ' + result.password);\n\n\t\t//console.log(\"getNearestCredentialsFile():\", getNearestCredentialsFile() );\n\n\t\t// Credentials to store locally: username, email\n\t\tvar local = {\n\t\t\tusername: result.username,\n\t\t\temail: result.email\n\t\t};\n\n\t\t/// Credentials to store on the server: username, email, hash of [username, email, password]\n\t\tvar userdata = {\n\t\t\tusername: result.username,\n\t\t\temail: result.email,\n\t\t\thash: getHash({\n\t\t\t\tusername: result.username,\n\t\t\t\temail: result.email,\n\t\t\t\tpass: result.password\n\t\t\t})\n\t\t};\n\n\t\tvar url = [remote, '@', 'u', result.username, userdata.hash].join('/');\n\t\tif( debug ) console.log('@user url', url); \n\t\trequest.get({url:url, formData: userdata}, (err, httpResponse, body) => {\n\t\t\tparse_net_response(err, httpResponse, body, (body) => {\n\t\t\t\t\n\t\t\t\tif( debug ) console.log(\"@user: http-response:\", body.msg);\n\n\t\t\t\tif( body.msg === 'allow' ){\n\t\t\t\t\tconsole.log(\"Credentials verified. Now using account '\"+ chalk.green(result.username) +\"'\");\n\t\t\t\t\t//fs.writeFileSync( getNearestCredentialsFile(), local);\n\t\t\t\t\tcloudfn.users.cli.set( local );\n\n\t\t\t\t}else if( body.msg === 'deny' ){\n\t\t\t\t\tconsole.log(\"Login failed. (TODO: reset password... contact [email protected] for now... thanks/sorry.\");\n\t\t\t\t\n\t\t\t\t}else if( body.msg === 'new' ){\n\t\t\t\t\tconsole.log(\"Created account for user:\", chalk.green(result.username) );\n\t\t\t\t\t//fs.writeFileSync( getNearestCredentialsFile(), local);\n\t\t\t\t\tcloudfn.users.cli.set( local );\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t});\n}", "function setUserCredentails(username, password){\n this.username = username;\n this.password = password;\n}", "function activate(context) {\n\t\n\tvar syncHelper, currentConfig;\n\tvar ftpConfig = require('./modules/ftp-config');\n\t\n\tvar getSyncHelper = function() {\n\t\tvar oldConfig = currentConfig;\n\t\tcurrentConfig = ftpConfig.getSyncConfig();\n\t\t\n\t\tif(!syncHelper)\n\t\t\tsyncHelper = require('./modules/sync-helper')();\n\t\telse if(ftpConfig.connectionChanged(oldConfig)) \n\t\t\tsyncHelper.disconnect();\n\t\t\n\t\tsyncHelper.useConfig(currentConfig)\n\t\t\n\t\treturn syncHelper;\n\t}\n\t\n\tvar initCommand = vscode.commands.registerCommand('extension.ftpsyncinit', require('./modules/init-command'));\n\tvar syncCommand = vscode.commands.registerCommand('extension.ftpsyncupload', function() { require('./modules/sync-command')(true, getSyncHelper) });\n\tvar downloadCommand = vscode.commands.registerCommand('extension.ftpsyncdownload', function() { require('./modules/sync-command')(false, getSyncHelper) });\n\tvar commitCommand = vscode.commands.registerCommand('extension.ftpsynccommit', function() { require('./modules/commit-command')(getSyncHelper) });\n\tvar singleCommand = vscode.commands.registerTextEditorCommand('extension.ftpsyncsingle', function(editor) { require('./modules/sync-single-command')(editor, getSyncHelper) });\n\tvar uploadcurrentCommand = vscode.commands.registerCommand(\"extension.ftpsyncuploadselected\", function(fileUrl) { require('./modules/uploadcurrent-command')(fileUrl, getSyncHelper) });\n\n\tvar onSave = require('./modules/on-save');\n\tvscode.workspace.onDidSaveTextDocument(function(file) {\n\t\tonSave(file, getSyncHelper);\n\t});\n\t\n\tcontext.subscriptions.push(initCommand);\n\tcontext.subscriptions.push(syncCommand);\n\tcontext.subscriptions.push(downloadCommand);\n\tcontext.subscriptions.push(commitCommand);\n\tcontext.subscriptions.push(singleCommand);\n\tcontext.subscriptions.push(uploadcurrentCommand);\n}", "function misc_UploadSetup(strLocalDir, strRemoteDir, strUploadFile, rptObj)\n{\n\t// Create some commonly used objects.\n\tvar fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\n\t// Check that the file exists\n\tif (!fso.FileExists(fso.BuildPath(strLocalDir, strUploadFile)))\n\t{\n\t\tvar err = new Error;\n\t\terr.number = 1;\n\t\terr.description = \"Unable to open \" + fso.BuildPath(strLocalDir, strUploadFile);\n\t\tthrow(err);\n\t}\n\n\t// Create new ftp command file in temp folder\n\tvar strTempFile = fso.BuildPath(fso.GetSpecialFolder(ksfTemp), fso.GetTempName());\n\tvar tsoTempFile = fso.OpenTextFile(strTempFile, kForWrite, kCreateFile);\n\trptObj.echoItVerbose(\"TmpFile Name:\" + strTempFile);\n\n\t// Write commands to file\n\ttsoTempFile.WriteLine(\"open gamma.sil.org\");\n\ttsoTempFile.WriteLine(\"user Soft_Admin Cortez\");\n\ttsoTempFile.WriteLine(\"binary\");\n\ttsoTempFile.WriteLine(\"lcd \" + strLocalDir);\n\ttsoTempFile.WriteLine(\"cd \" + strRemoteDir);\n\ttsoTempFile.WriteLine(\"delete \" + strUploadFile);\n\ttsoTempFile.WriteLine(\"put \" + strUploadFile);\n\ttsoTempFile.WriteLine(\"bye\");\n\n\t// Close file\n\ttsoTempFile.Close();\n\n\t// Execute ftp with command file\n\tmisc_RunExtProg(\"ftp\", \"-n -i -s:\" + strTempFile, null, rptObj, null, true);\n\n\t// Delete temporary command file\n\tfile_DeleteFile(strTempFile);\n}", "function getCredentialsContext (hostname /*eg. www.github.com*/, cb) {\n sys.log(\"attempting to find credentials for:\" + hostname)\n //check if credentials already exist\n hostname_cred = creds[hostname]\n\n if (hostname_cred){\n sys.log('found creds already existing')\n cb(null, crypto.createCredentials({\n key: fs.readFileSync(hostname_cred.key),\n cert: fs.readFileSync(hostname_cred.cert),\n ca: fs.readFileSync('ca.crt')\n }).context)\n }\n else{\n genCredentials(hostname, cb)\n }\n\n}", "constructor ({srcDir, remote, verbose}) {\n this.srcDir = srcDir\n this.remote = remote\n this.verbose = verbose\n this.newSyncNeeded = false\n }", "setPasswordSalt(passwordSalt) {\n this.passwordSalt_ = passwordSalt;\n }", "constructor() {\n // Initialise a new connection.\n this.connection = new driver.Connection(process.env.APP_URL, {\n app_id: process.env.APP_ID,\n app_key: process.env.APP_KEY,\n });\n //this.connection = new driver.Connection(process.env.APP_URL);\n\n this.currentIdentity = this.generateKeypair(\"ftf\");\n }", "async useTLS(options = {}, command = \"AUTH TLS\") {\n const ret = await this.send(command);\n this.ftp.socket = await (0, netUtils_1.upgradeSocket)(this.ftp.socket, options);\n this.ftp.tlsOptions = options; // Keep the TLS options for later data connections that should use the same options.\n this.ftp.log(`Control socket is using: ${(0, netUtils_1.describeTLS)(this.ftp.socket)}`);\n return ret;\n }", "function getFiles(connection, serverPath, localPath, callback) {\n return new Promise(function (resolve, reject) {\n connection\n .then(() => {\n return sftp.list(serverPath);\n })\n .then((data) => {\n\n // get list of downloaded server filenames\n var downloadedFiles = _.map(logFile.downloadedFiles, function(lf){\n return lf.serverFilename;\n });\n\n // filter out filenames of things we already have\n var filesToGet = _.filter(data, function (file) {\n return downloadedFiles.indexOf(serverPath + \"/\" +file.name) == -1;\n });\n\n // for each file we need to get -> drill down and get everything\n var getFilesPromiseMap = Promise.map(filesToGet, function (fileInfo) {\n return new Promise(function (resolveMap, rejectMap) {\n\n var serverFilename = serverPath + \"/\" + fileInfo.name;\n var localFilename = localPath + \"/\" + fileInfo.name;\n\n // if file is not directory -> download it\n if (fileInfo.type != \"d\") {\n try {\n log.infoLog(\"\\nDownload Started: \" +\n \"\\n\\tServer Filename: \" + serverFilename +\n \"\\n\\tLocal Filename: \" + localFilename);\n\n // start timer to show progress:\n // show progress bar : start at 0\n\n var progressUpdateInterval;\n var progressString = ' downloading [:bar] :rate/bps :percent :etas';\n var bar = new ProgressBar(progressString, {\n complete: '=',\n incomplete: ' ',\n width: 50,\n total: fileInfo.size,\n callback:function(){\n var stats = fs.statSync(localFilename);\n var fileSizeInBytes = stats.size;\n log.infoLog(\"Downloaded: [local:\"+ fileSizeInBytes + \", server: \"+ fileInfo.size +\"]\");\n clearInterval(progressUpdateInterval);\n }\n });\n\n setTimeout(function(){\n\n var previousFileSize;\n progressUpdateInterval = setInterval(function(){\n\n // check local file byte size and divide by total byte size for percentage\n var stats = fs.statSync(localFilename);\n var fileSizeInBytes = stats.size;\n var sizeStep = fileSizeInBytes;\n\n if(previousFileSize){\n sizeStep = fileSizeInBytes - previousFileSize;\n }\n previousFileSize = fileSizeInBytes;\n\n var percentage = fileSizeInBytes / fileInfo.size;\n percentage = parseFloat(Math.round(percentage * 100)).toFixed(2);\n // console.log(\"Filename: \"+ localFilename +\" percentage: \" + percentage);\n bar.tick(sizeStep);\n\n }, 250); // every half sec\n\n }, NUM_SECS * 1000);\n\n ssh.getFile(connectionOptions,\n serverFilename, localFilename,\n (err, server, connection) => {\n if (err) log.errorLog(\"getFile Error: \" + err);\n else {\n // console.log(\"\\nFile Download Success: \" +\n // \"\\n\\tServer Filename: \" + serverFilename +\n // \"\\n\\tLocal Filename: \" + localFilename);\n\n // add to list of files that already downloaded\n logFile.downloadedFiles.push({serverFilename:serverFilename, localFilename:localFilename, size:fileInfo.size});\n updateLogFile();\n }\n resolveMap();\n });\n\n } catch (e) {\n log.errorLog(\"Download Failed with exception: \" + e);\n }\n\n } else {\n // if local directory doesnt exist yet create it\n mkdirp(localFilename,\n function (err) {\n\n if (err) {\n log.errorLog(\"mkdir Error: \" + err);\n resolveMap();\n } else {\n log.successLog(\"Downloading files for: [\" + serverFilename + \" -> \" + localFilename + \" ]\");\n // if its a directory -> call recursively\n getFiles(connection, serverFilename, localFilename)\n .then(resolveMap, rejectMap);\n }\n });\n }\n\n });\n }, {concurrency: MAX_SIMULTANEOUS_FILE_DOWNLOADS});\n\n // after map completes downloading\n getFilesPromiseMap.then(function () {\n resolve();\n }, function () {\n reject();\n });\n\n })\n .catch((err) => {\n log.errorLog(err, 'catch error');\n });\n });\n}", "constructor(publickey,privatekey){\n this.publickey = p\n this.privatekey = k\n\n}", "static initialize(obj, name, ftpServer, ftpPort, ftpDirectory) { \n obj['name'] = name;\n obj['ftpServer'] = ftpServer;\n obj['ftpPort'] = ftpPort;\n obj['ftpDirectory'] = ftpDirectory;\n }", "constructor(authenticationDetailsProvider) {\n this.authenticationDetailsProvider = authenticationDetailsProvider;\n this.delegationToken = \"\";\n this.privateKey = \"\";\n let options = {};\n if (this.authenticationDetailsProvider.getPassphrase()) {\n Object.assign(options, { passphrase: this.authenticationDetailsProvider.getPassphrase() });\n }\n // We can skip parsing private Key if we have an auth type that is not file based authentication.\n // We will also set DefaultRequestSigner's delegation token from authenticationDetailsProvider before\n // authenticationDetialsProvider gets changed to its true authentication provider.\n if (this.authenticationDetailsProvider.getAuthType &&\n this.authenticationDetailsProvider.getAuthType()) {\n this.privateKeyBuffer = null;\n const delegationToken = this.authenticationDetailsProvider.getDelegationToken();\n this.delegationToken = delegationToken;\n return;\n }\n this.privateKey = this.authenticationDetailsProvider.getPrivateKey();\n this.privateKeyBuffer = sshpk_1.parsePrivateKey(this.authenticationDetailsProvider.getPrivateKey(), \"auto\", options).toBuffer(\"pem\", {});\n }", "function BaseChannelAuth () {}", "function sshConnect() {\n\tconsole.log(\"##Connecting to \" + remoteHost + \" as \" + remoteUsername + \"...\");\n\tssh.connect({\n\t\t// TODO: ADD YOUR IP ADDRESS BELOW (e.g. '12.34.5.67')\n\t\thost: remoteHost,\n\t\tusername: remoteUsername,\n\t\tprivateKey: remotePrivateKey\n\t})\n\t.then(function() {\n\t\tconsole.log(\"SSH Connection established.\");\n // Careful, createRemoteFolder is destructive! Empty new folder...\n\t\treturn createRemoteTempFolder();\n\t})\n\t.then(function(result) {\n console.log(\"##After createRemoteTempFolder result object is \", result);\n\t\tconst failed = []\n\t\tconst successful = []\n\t\tif(result.stdout){ console.log('STDOUT: ' + result.stdout); }\n\t\tif(result.stderr || result.code ){\n\t\t\tconsole.log('STDERR: ' + result.stderr);\n let msg = \", code: \" + status.code + \" err: \" + status.stderr;\n\t\t\treturn Promise.reject(msg);\n\t\t}\n\t\treturn transferProjectToRemote(failed, successful);\n\t})\n\t.then(function(status) {\n console.log(\"##After transferProjectToRemote Status is: \", status);\n\t\tif (status.stderr || status.code) {\n let msg = \", code: \" + status.code + \" err: \" + status.stderr;\n\t\t\treturn Promise.reject(failed.join(msg));\n\t\t} else {\n\t\t\treturn stopRemoteServices();\n\t\t}\n\t})\n\t.then(function(status) {\n console.log(\"##After stopRemoteServices status is: \", status);\n\t\tif (status.stderr || status.code) {\n let msg = \", code: \" + status.code + \" err: \" + status.stderr;\n\t\t\treturn Promise.reject(failed.join(msg));\n\t\t} else {\n\t\t\treturn updateRemoteApp();\n\t\t}\n\t})\n\t.then(function(status) {\n // Weird that this status print is on 1 line and others are not.\n console.log(\"##After updateRemoteApp Status is: \", status);\n\t\tif (status.stderr || status.code) {\n let msg = \", code: \" + status.code + \" err: \" + status.stderr;\n\t\t\treturn Promise.reject(failed.join(msg));\n\t\t} else {\n\t\t\treturn startRemoteServices();\n\t\t}\n\t})\n\t.then(function(status) {\n console.log(\"##After startRemoteServices status is: \", status);\n console.log(\"##Deployment complete.\");\n\t\tprocess.exit(0);\n\t})\n\t.catch(e => {\n\t\tconsole.log(\"##FAILED deployment! \", e );\n console.log(\"##Reasons: \", failed);\n\t\tconsole.error(e);\n\t\tprocess.exit(1);\n\t})\n}", "function getCredentials(cb /*function(credentials)*/) {\n var argv = common.global.argv;\n var mmsCreds = mergeAllCredentials();\n\n common.getUserInputForCredentials(mmsCreds,function(mmsCreds) {\n\n if(!(mmsCreds.username && mmsCreds.password)) {\n common.exit('MMS credentials must be specified on the command line or in a profile.');\n }\n\n if(argv.verbose || argv.server != common.DEFAULT_SERVER) {\n console.log(\"Connecting to MMS as user \" + mmsCreds.username + \" at \" + mmsCreds.server);\n }\n\n if(!argv.allowGlobal && (mmsCreds.username === \"mms\") && (command[0] != \"log\")) {\n common.exit(\"emote cannot be run as superuser.\");\n }\n\n cb(mmsCreds);\n });\n}", "init() {\n\n return new Promise((resolve, reject) => {\n\n this.teams_dao = new TeamsDAO();\n this.teams_dao.init()\n .then(async () => { \n await this.createServer();\n resolve();\n })\n .catch((err) => {\n console.log(\"Error initialising server\", err);\n reject(err);\n });\n });\n }", "startTransfer(){\n this.client.start(this.configs)\n }", "createCredential() {\n return new Credential(this);\n }", "function Credentials (name, pass) {\n this.name = name\n this.pass = pass\n}", "function Credentials (name, pass) {\n this.name = name\n this.pass = pass\n}", "function Credentials (name, pass) {\n this.name = name\n this.pass = pass\n}", "function Credentials (name, pass) {\n this.name = name\n this.pass = pass\n}", "function Credentials (name, pass) {\n this.name = name\n this.pass = pass\n}", "function createCredentialsFile() {\n\tprompt.start();\n\tprompt.get({\n\t\tproperties: {\n\t\t\tusername: {\n\t\t\t\tdescription: 'Your Twitch.tv username',\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tdescription: 'Your Twitch.tv OAUTH token (http://www.twitchapps.com/tmi/)',\n\t\t\t\trequired: true,\n\t\t\t\thidden: false\n\t\t\t},\n\t\t\tchannel: {\n\t\t\t\tdescription: 'Twitch.tv channel to join',\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\tclient_id: {\n\t\t\t\tdescription: 'Twitch API Client ID',\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\tclient_secret: {\n\t\t\t\tdescription: 'Twitch API Client Secret',\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\tstreamtip_client_id: {\n\t\t\t\tdescription: 'StreamTip API Client ID',\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tstreamtip_client_access_token: {\n\t\t\t\tdescription: 'StreamTip API Client Access Token',\n\t\t\t\trequired: false\n\t\t\t}\n\t\t}\n\t}, function (err, result) {\n\t\tvar credentials = {\n\t\t\t'username': result.username,\n\t\t\t'password': result.password,\n\t\t\t'channel': result.channel,\n\t\t\t'client_id': result.client_id,\n\t\t\t'client_secret': result.client_secret\n\t\t};\n\t\tfs.writeFileSync('.credentials', JSON.stringify(credentials));\n\n\t\tconsole.log('Created credentials file. Restart the application\\n');\n\t\tprocess.exit();\n\t});\n}", "function authenticateCurator() {\n //READMORE: http://googlecloudplatform.github.io/gcloud-node/#/docs/v0.37.0/storage/file?method=createWriteStream\n return gcloud.storage({\n keyFilename: './auth/curatorKey.json',\n projectId : 'artist-tekuma-4a697'\n });\n console.log(\"connected art storage\");\n }", "__ssl() {\n /// TODO: nothing, I guess?\n }", "function Credentials(name, pass) {\n this.name = name\n this.pass = pass\n}", "generateCredentialsGP () {\n // Generate the Basic Authentication header for a private instance of SLPDB.\n const username = 'BITBOX'\n const password = SLPDB_PASS_GP\n const combined = `${username}:${password}`\n // console.log(`combined: ${combined}`)\n var base64Credential = Buffer.from(combined).toString('base64')\n var readyCredential = `Basic ${base64Credential}`\n\n const options = {\n headers: {\n authorization: readyCredential\n },\n timeout: 15000\n }\n\n return options\n }", "_authenticateSingleConnection(sendAuthCommand, connection, credentials, callback) {\n const username = credentials.username;\n const password = credentials.password;\n const payload = new Binary(`\\x00${username}\\x00${password}`);\n const command = {\n saslStart: 1,\n mechanism: 'PLAIN',\n payload: payload,\n autoAuthorize: 1\n };\n\n sendAuthCommand(connection, '$external.$cmd', command, callback);\n }", "function Client(stream)\n{\n this.name = null;\n this.stream = stream;\n this.remote = stream.remoteAddress + \":\" + stream.remotePort;\n this.cmdstr = \"\";\n this.tempdata = \"\";\n this.expectdatalen = 0;\n}", "constructor(key) {\n let Spotify = require('node-spotify-api');\n this.api = new Spotify(key);\n }", "_authenticateSingleConnection(sendAuthCommand, connection, credentials, callback) {\n const username = credentials.username;\n const password = credentials.password;\n const source = credentials.source;\n\n sendAuthCommand(connection, `${source}.$cmd`, { getnonce: 1 }, (err, r) => {\n let nonce = null;\n let key = null;\n\n // Get nonce\n if (err == null) {\n nonce = r.nonce;\n // Use node md5 generator\n let md5 = crypto.createHash('md5');\n // Generate keys used for authentication\n md5.update(username + ':mongo:' + password, 'utf8');\n const hash_password = md5.digest('hex');\n // Final key\n md5 = crypto.createHash('md5');\n md5.update(nonce + username + hash_password, 'utf8');\n key = md5.digest('hex');\n }\n\n const authenticateCommand = {\n authenticate: 1,\n user: username,\n nonce,\n key\n };\n\n sendAuthCommand(connection, `${source}.$cmd`, authenticateCommand, callback);\n });\n }", "constructor(pri,pub){\n this.privatekey=pri;\n this.publickey=pub;\n}", "static get(name, id, state, opts) {\n return new SshKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "function callPSCCheckSITable(PSCCredentials,PSCIP,SITableName,filter){\n var task = ctxt.createInnerTaskContext(\"custom_PSC_Check_SITable\");\n logger.addInfo(\"PSC Credentials:\"+PSCCredentials);\n task.setInput(\"PSCCredentials\",PSCCredentials);\n task.setInput(\"PSCIP\",PSCIP);\n task.setInput(\"SITableName\",SITableName);\n task.setInput(\"filter\",filter);\n task.execute();\n}", "function Dropbox(access_key) {\n this.access_key = access_key;\n}", "function remote(cmd, quotes = \"'\") {\n res = execSync(`ssh eycost-db ${quotes}${cmd}${quotes}`);\n console.log(res.toString());\n}", "constructor(fileSystem, s3Object) {\n this.fileSystem = fileSystem;\n this.s3Object = s3Object;\n }", "constructor(k,p){\n this.privatekey = k;\n this.publickey = p;\n}", "function initConn() {\n\tws = new SockJS(\"/twitter\");\n\tclient = Stomp.over(ws);\n\tvar headers = {};\n\tvar callback = {};\n\tclient.connect(headers, callback);\n}", "function uploadAndFetch (s3, stream, filename, bucket, key) {\n var deferred = when.defer();\n exports.getFileStream(filename)\n .pipe(stream)\n .on(\"error\", deferred.reject)\n .on(\"finish\", function () {\n deferred.resolve(exports.getObject(s3, bucket, key));\n });\n return deferred.promise;\n}", "function Authenticate(){\n var speakeasy = require('speakeasy');\n var key = speakeasy.generateSeceret();\n}", "workspacesGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.WorkspacesApi();\n apiInstance.workspacesGet((error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n });\n }", "constructor(asset, context, session, wsServer, token)\n {\n super(asset, \"debian_transfer\", session, wsServer, token);\n\n // POST parameters\n // ******************************\n this.public_ip = context.public_ip;\n this.username = context.username;\n this.password = context.password;\n this.fingerprint = require('crypto').createHash(\"md5\").update(this.username).digest(\"hex\");\n }", "function Credentials(name, pass) {\n this.name = name;\n this.pass = pass;\n}", "createStream () {\n\n }", "connect() {}", "function startSSHy() {\n // Initialise the window title\n //document.title = \"SSHy Client\";\n\n // Opens the websocket!\n ws = new WebSocket(wsproxyURL, 'base64');\n\n // Sets up websocket listeners\n ws.onopen = function(e) {\n transport = new SSHyClient.Transport(ws);\n\n\t\t/*\n\t\t!! Enables or disables RSA Host checking !!\n\t\tSince Linuxzoo changes host every time there is no reason to use it\n\t\t*/\n\n\t\ttransport.settings.rsaCheckEnabled = false;\n };\n\t// Send all recieved messages to SSHyClient.Transport.handle()\n ws.onmessage = function(e) {\n\t\t// Convert the recieved data from base64 to a string\n transport.parceler.handle(atob(e.data));\n };\n\t// Whenever the websocket is closed make sure to display an error if appropriate\n ws.onclose = function(e) {\n\t\tif(term){\n\t\t\t// Don't display an error if SSH transport has already detected a graceful exit\n\t\t\tif(transport.closing){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tterm.write('\\n\\n\\rWebsocket connection to ' + transport.auth.hostname + ' was unexpectedly closed.');\n\t\t\t// If there is no keepAliveInterval then inform users they can use it\n\t\t\tif(!transport.settings.keepAliveInterval){\n\t\t\t\tterm.write('\\n\\n\\rThis was likely caused by he remote SSH server timing out the session due to inactivity.\\r\\n- Session Keep Alive interval can be set in the settings to prevent this behaviour.');\n\t\t\t}\n\t\t} else {\n\t\t\t// Since no terminal exists we need to initialse one before being able to write the error\n termInit();\n term.write('WebSocket connection failed: Error in connection establishment: code ' + e.code);\n\t\t}\n };\n\t// Just a little abstraction from ws.send\n\tws.sendB64 = function(e){\n\t\tthis.send(btoa(e));\n\n\t\ttransport.parceler.transmitData += e.length;\n\t\ttransport.settings.setNetTraffic(transport.parceler.transmitData, false);\n\t};\n}", "function main() {\n\tconsole.log(\"Deployment started.\");\n // NOPE! Don't clone anything. Too distructive. Geez...\n // Just jump straight to sshConnect();\n\t// cloneRepo();\n\tsshConnect();\n}", "static igfsSecondFS(igfs, cfg = this.igfsConfigurationBean(igfs)) {\n if (igfs.secondaryFileSystemEnabled) {\n const secondFs = igfs.secondaryFileSystem || {};\n\n const bean = new Bean('org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem',\n 'secondaryFileSystem', secondFs, igfsDflts.secondaryFileSystem);\n\n bean.stringProperty('userName', 'defaultUserName');\n\n let factoryBean = null;\n\n switch (secondFs.kind || 'Caching') {\n case 'Caching':\n factoryBean = new Bean('org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory', 'fac', secondFs);\n break;\n\n case 'Kerberos':\n factoryBean = new Bean('org.apache.ignite.hadoop.fs.KerberosHadoopFileSystemFactory', 'fac', secondFs, igfsDflts.secondaryFileSystem);\n break;\n\n case 'Custom':\n if (_.get(secondFs, 'Custom.className'))\n factoryBean = new Bean(secondFs.Custom.className, 'fac', null);\n\n break;\n\n default:\n }\n\n if (!factoryBean)\n return cfg;\n\n if (secondFs.kind !== 'Custom') {\n factoryBean.stringProperty('uri')\n .pathArrayProperty('cfgPaths', 'configPaths', secondFs.cfgPaths, true);\n\n if (secondFs.kind === 'Kerberos') {\n factoryBean.stringProperty('Kerberos.keyTab', 'keyTab')\n .stringProperty('Kerberos.keyTabPrincipal', 'keyTabPrincipal')\n .longProperty('Kerberos.reloginInterval', 'reloginInterval');\n }\n\n if (_.get(secondFs, 'userNameMapper.kind')) {\n const mapper = IgniteConfigurationGenerator._userNameMapperBean(secondFs.userNameMapper);\n\n if (mapper)\n factoryBean.beanProperty('userNameMapper', mapper);\n }\n }\n\n bean.beanProperty('fileSystemFactory', factoryBean);\n\n cfg.beanProperty('secondaryFileSystem', bean);\n }\n\n return cfg;\n }", "openUploadStreamWithId(id, filename, options) {\n return new upload_1.GridFSBucketWriteStream(this, filename, { ...options, id });\n }", "constructor(props) {\n super(props);\n console.log(\"Creating FS WS connector\");\n this.store = props.store;\n this.flag = props.flag;\n this.socket = props.ws;\n }", "constructor() {\n if (\n process.env.MAIL_LOGIN == undefined ||\n process.env.MAIL_MDP == undefined ||\n process.env.MAIL_HOST == undefined\n ) {\n new Error(\"Mail server config is absent from env variables.\");\n }\n\n this.transporter = nodemailer.createTransport({\n host: process.env.HOST,\n port: 465,\n secure: true, // true for 465, false otherwise\n auth: {\n user: process.env.MAIL_LOGIN,\n pass: process.env.MAIL_MDP,\n },\n });\n }", "function PdkCredentials(config) {\n RED.nodes.createNode(this, config);\n this.user_email = config.user_email;\n this.user_info = JSON.parse(config.user_info);\n }", "function configure(alg, pswd, sto) {\n algorithm = alg;\n password = pswd;\n sessionTimeout = sto;\n}", "constructor(credentials) {\n super(credentials);\n this.name = 'bitfinex';\n\n this.minPollingDelay = 2;\n this.maxPollingDelay = 20;\n\n // start up any sockets or create API handlers here.\n this.api = new BitfinexApiv1(credentials.key, credentials.secret);\n }", "function cloneRepo() {\n\tconsole.log(\"Cloning repo...\");\n\t// delete old copy of repo. Then, clone a fresh copy of repo from GitHub\n\tcmd.get(\n\t\t'cd ~/repos; rm -rf ./hackathon-starter && git clone https://github.com/sahat/hackathon-starter.git',\n\t\tfunction(err, data, stderr){\n\t\t\tconsole.log(\"cloneRepo callback\\n\\t err: \" + err + \"\\n\\t data: \" + data + \"\\n\\t stderr: \" + stderr);\n\t\t\tif(err == null){\n\t\t\t console.log(\"No errors in cloneRepo. Trying sshConnect now...\");\n\t\t\t\tsshConnect();\n\t\t\t}\n }\n\t);\n}", "teamsUsernameRepositoriesGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.TeamsApi(); // String | This can either be the username or the UUID of the account, surrounded by curly-braces, for example: `{account UUID}`. An account is either a team or user.\n /*let username = \"username_example\";*/ apiInstance.teamsUsernameRepositoriesGet(\n incomingOptions.username,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "function startCMISSession() {\n cmisConfig.userName = login.userName;\n cmisConfig.password = login.password;\n cmisConfig.serverUrl = login.server;\n\n session = cmis.createSession(cmisConfig.serverUrl);\n session.setCredentials(cmisConfig.userName, cmisConfig.password);\n session.loadRepositories().ok(cmisLoginOk).notOk(cmisLoginFail).error(cmisLoginFail);\n}", "constructor(settings) {\n this.settings = settings;\n }", "function SpiceDisplayConn()\n{\n SpiceConn.apply(this, arguments);\n}" ]
[ "0.7122845", "0.551786", "0.54302067", "0.5346828", "0.5263898", "0.5238331", "0.5237373", "0.50734836", "0.5044842", "0.50176877", "0.4983439", "0.49187765", "0.4906311", "0.48784193", "0.48694104", "0.4837845", "0.4837476", "0.47983062", "0.4797424", "0.47334343", "0.47169474", "0.46903473", "0.46509647", "0.46489403", "0.46300027", "0.45911226", "0.45581016", "0.45539507", "0.45518726", "0.45310885", "0.45290568", "0.4527459", "0.4515921", "0.44969127", "0.44923726", "0.4479202", "0.4475603", "0.44712603", "0.44707018", "0.44696298", "0.44673082", "0.4459003", "0.44537714", "0.444252", "0.4426066", "0.44245073", "0.4422351", "0.4418582", "0.4412405", "0.44117346", "0.44070432", "0.44005346", "0.43972367", "0.43943208", "0.4386262", "0.4375686", "0.43665707", "0.43604678", "0.43604678", "0.43604678", "0.43604678", "0.43604678", "0.4342394", "0.43335724", "0.4332868", "0.43313807", "0.4331194", "0.43162674", "0.4314347", "0.43134582", "0.42977694", "0.4294766", "0.42730784", "0.42664793", "0.42664674", "0.42657456", "0.42627156", "0.42501214", "0.42444614", "0.4241904", "0.42275086", "0.4224659", "0.4224149", "0.42236167", "0.42190138", "0.4218358", "0.42125177", "0.4212334", "0.418796", "0.41847354", "0.4182572", "0.4179487", "0.4175486", "0.41521278", "0.41453296", "0.41428697", "0.41408288", "0.41389745", "0.41330174", "0.4131965" ]
0.5007549
10
Wrap FileReader in a Promise and returns it.
loadContentFromFile(content) { return new Promise((resolve, reject) => { // Rejects the Promise immediately if the `content` argument is not // a Blob object provided by a browser's file input control. if (!(content instanceof Blob)) { reject('Unable to load your file: it is not a valid file type.'); } const reader = new FileReader(); // Resolves when FileReader is completely done loading. The `load` // event can fire before the end of a file is encountered so we // listen for `loadend` instead. The Promise resolves with the value // of the file contents but also loads into the editor. reader.addEventListener('loadend', (event) => { load({ contents: event.target.result }); resolve(event.target.result); }); // If FileReader encounters an error, the Promise is rejected with // the value of the error property on the FileReader object. reader.addEventListener('error', (event) => { reject(reader.error); }); reader.readAsText(content); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readFile() {\n return new Promise((resolve, reject) => {\n fs.readFile(SOURCE, {\n encoding: 'utf-8'\n }, (err, data) => {\n if (err) {\n reject(err);\n // puts the callback given to the .catch in the Promise pending callbacks queue\n } else {\n resolve(data);\n // puts the callback given to the first .then, in the Promise pending callbacks queue\n }\n });\n });\n}", "readFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (evt) => {\n if(evt && evt.target) {\n resolve(evt.target.result);\n }\n reject();\n };\n reader.readAsDataURL(file);\n });\n }", "readFile(file) {\n return new Promise((resolve, reject) => {\n\n const reader = new FileReader();\n\n reader.onload = res => {\n resolve(res.target.result);\n };\n\n reader.onerror = err => reject(err);\n\n reader.readAsDataURL(file);\n });\n }", "function readFile(filename){\n return new Promise(function(resolve,reject){\n fs.readFile(filename,'utf8',function(err,data){\n err?reject(err):resolve(data);\n });\n })\n}", "function readData(file) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = function () { return resolve(reader.result); };\n reader.onerror = function (error) { return reject(error); };\n });\n}", "_read () {\n let { filename } = this\n return new Promise((resolve, reject) =>\n fs.readFile((filename), (err, content) => err ? reject(err) : resolve(content))\n ).then(JSON.parse)\n }", "function readBlob(blob) {\n return new Promise(function (success, error) {\n var reader = new FileReader();\n reader.onload = function (event) {\n success(reader.result);\n };\n reader.onerror = function (e) {\n error(e);\n };\n reader.readAsText(blob);\n });\n}", "function readFile(file) {\n return new Promise(function (resolve) {\n var reader = new FileReader();\n\n // This is called when finished reading\n reader.onload = function (event) {\n // Return an array with one image\n resolve({\n // These are attributes like size, name, type, ...\n lastModifiedDate: file.lastModifiedDate,\n lastModified: file.lastModified,\n name: file.name,\n size: file.size,\n type: file.type,\n\n // This is the files content as base64\n src: event.target.result\n });\n };\n\n if (file.type.indexOf('text/') === 0 || file.type === 'application/json') {\n reader.readAsText(file);\n } else if (file.type.indexOf('image/') === 0) {\n reader.readAsDataURL(file);\n } else {\n reader.readAsBinaryString(file);\n }\n });\n}", "async function readFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result);\n reader.readAsText(file);\n });\n}", "function promiseFileUpload( file, fileReadType, ...infoToPass ){\n \n let readPromise = new Promise( function( resolve, reject ){\n let reader = new FileReader\n \n reader.addEventListener('load', function(e){\n if(reader.error) {\n reject(reader.error)\n } else {\n resolve([reader.result, file, infoToPass])\n }\n });\n \n reader.addEventListener('error', reject)\n \n //implement more stringent check? switch/LUT for the four readAs funcs?\n if ( typeof reader[fileReadType] !== 'function' ) reject(`${fileReadType} is not proper FileReader method!`)\n \n reader[fileReadType](file);\n })\n \n return readPromise\n}", "static readBlobAsText(fileOrBlob) {\n return new Promise(resolve => { \n const reader = new FileReader();\n reader.onload = event => {\n resolve(event.target.result)\n }\n reader.readAsText(fileOrBlob); \n })\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 }", "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 }", "function getFile(filePath) {\n return new Promise((resolve, reject) => {\n fs.readFile(filePath, function(error, data) {\n if (error) {\n return reject(error);\n }\n return resolve(data);\n });\n });\n}", "function read(callback, file) {\r\n\tvar fileReader = new FileReader ();\r\n\tvar eventReturn;\r\n\t// Called when the FileReader as done reading\r\n\tvar p = new Promise((resolve, reject) => fileReader.onload = function () {\r\n\t\teventReturn = callback(fileReader.result, file);\r\n\t\tresolve(eventReturn)\r\n\t});\r\n\r\n\r\n\tfileReader.readAsArrayBuffer(file)\r\n\treturn p\r\n}", "function readFileStreamAsync(fs) {\n\t// https://blog.shovonhasan.com/using-promises-with-filereader/\n\tconst temporaryFileReader = new FileReader();\n\n\treturn new Promise((resolve, reject) => {\n\t\ttemporaryFileReader.onerror = () => {\n\t\t\ttemporaryFileReader.abort();\n\t\t\treject(new DOMException('Problem parsing input file.'));\n\t\t};\n\n\t\ttemporaryFileReader.onload = () => {\n\t\t\tresolve(temporaryFileReader.result);\n\t\t};\n\n\t\ttemporaryFileReader.readAsArrayBuffer(fs);\n\t});\n}", "function getFileBuffer() {\n var deferred = $.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 }", "function openFile(path) {\n\treturn new Promise(function (resolve, reject) {\n\t\tfs.readFile(path, \"utf8\", (err, data) => {\n\t\t\tif (err) reject(err);\n\t\t\tresolve(data);\n\t\t});\n\t});\n}", "function FileReader() {}", "function DFileReader(){\n\tvar fr = new FileReader();\n\tvar dfr = $.Deferred();\n\t// This is called when all callbacks are executed.\n\tvar reset = function(){\n\t\tdfr = $.Deferred();\n\t\tfr = new FileReader();\n\t}\n\t\n\t// Read a file and return an Promise Object\n\tthis.readFile = function(fi, fm, cbs_s, cbs_f){\n\t\tvar file = fi;\n\t\tvar format = (fm) ? fm : \"text\";\n\t\tvar callbacks_suc = (cbs_s && is_array(cbs_s)) ? cbs_s : [];\n\t\tvar callbacks_fail = (cbs_f && is_array(cbs_f)) ? cbs_f : [];\n\t\t\n\t\tdfr.done(callbacks_suc);\n\t\tdfr.fail(callbacks_fail);\n\t\t\n\t\tfr.onload = function(e){\n\t\t\tvar result = {\n\t\t\t\t\"type\": \"success\",\n\t\t\t\t\"name\": file.name,\n\t\t\t\t\"content\": e.target.result\n\t\t\t}\n\t\t\tdfr.resolve(result);\n\t\t\treset();\n\t\t};\n\t\t\n\t\tfr.onerror = function(e){\n\t\t\tvar result = {\n\t\t\t\t\"type\": \"error\",\n\t\t\t\t\"name\": file.name,\n\t\t\t\t\"content\": fr.error\t// An DOMError Object ({name, message})\n\t\t\t}\n\t\t\tdfr.reject(result);\n\t\t\treset();\n\t\t};\n\t\t\n\t\tfr.onabort = function(e){\n\t\t\tvar result = {\n\t\t\t\t\"type\": \"abort\",\n\t\t\t\t\"name\": file.name,\n\t\t\t}\n\t\t\tdfr.reject(result);\n\t\t\treset();\n\t\t}\n\t\t\n\t\tswitch(fm){\n\t\t\tcase \"text\":\n\t\t\t\tfr.readAsText(file);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfr.readAsText(file);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn dfr.promise();\t// Return Promise object if user want to add additional callbacks.\n\t}\n\t\n\t// Abort the reading process. And the deferred object will be rejected.\n\tthis.abort = function(){\n\t\tfr.abort();\n\t\treturn;\n\t}\n}", "function FileReader () {}", "function readFile(filename, flag) {\n return new Promise(function (complete, reject) {\n fsx.readFile(filename, function (error, data) {\n if (error) {\n reject(error);\n return;\n }\n complete(data);\n });\n });\n}", "function getShaPromise(filePath) {\n return new bluebird(function(resolve, reject) {\n var fd = fs.createReadStream(filePath);\n var hash = crypto.createHash('sha1');\n hash.setEncoding('hex');\n fd.on('end', function() {\n hash.end();\n return resolve(hash.read());\n });\n fd.on('error', function(err) {\n return reject(err);\n });\n fd.pipe(hash);\n });\n}", "async readUploadedFileAsArrayBuffer(inputFile) {\n const reader = new FileReader();\n\n return new Promise((resolve, reject) => {\n reader.onerror = () => {\n reader.abort();\n reject(new DOMException(\"Problem parsing input file.\"));\n };\n\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.readAsBinaryString(inputFile);\n });\n }", "readFile(path_to_file) {\n return new Promise((resolve, reject) => {\n let result = [],\n line_reader = readline.createInterface({\n input : fs.createReadStream(__dirname + path_to_file)\n })\n line_reader.on('line', (line) => {\n result.push(line)\n })\n line_reader.on('close', () => {\n resolve(result)\n })\n })\n }", "function loadFile(fn) {\n return new Promise ( (res, rej) => {\n fs.readFile(fn, (err, data) => {\n if (err) {\n rej(err);\n };\n res(data);\n })\n\n })\n}", "function readFromFile(file) {\n return new Promise((resolve, reject) => {\n fs.readFile(file, function (err, data) {\n if (err) {\n console.log(err);\n reject(err);\n }\n else {\n resolve(JSON.parse(data));\n }\n });\n });\n}", "_reading(path) {\n\t\tconst readResult = new Promise((resolve, reject) => {\n\t\t\tfs.stat(path, (error, file) => {\n\t\t\t\tresolve(file);\n\t\t\t\treject(error);\n\t\t\t});\n\t\t});\n\t\treturn readResult;\n\t}", "function readContentFile(filename) {\n var promise = new Promise(async function(resolve, reject) {\n fs.readFile(filename, 'utf8', function (err, data) {\n if (err) {\n reject(err);\n return;\n }\n resolve (data);\n });\n });\n return promise;\n}", "function getFile(file) {\n\treturn new Promise(function(resolve){\n\t\tfakeAjax(file,resolve);\n\t});\n}", "function getFile(file) {\n\treturn new Promise(function(resolve){\n\t\tfakeAjax(file,resolve);\n\t});\n}", "function loadFile(filename) {\n return new Promise((resolve, reject) => {\n fs.readFile(filename, 'utf8', (err, data) => {\n if (err) {\n reject(err);\n }\n resolve(data);\n });\n });\n}", "function openFile(filename)\n{\n return new LineReaderSync(filename);\n}", "function getFileData() {\n return new Promise((resolve, reject) => {\n imageFile = document.getElementById(\"image_file\").files;\n\n var fileReader = new FileReader();\n if (fileReader && imageFile && imageFile.length) {\n fileReader.readAsDataURL(imageFile[0]);\n fileReader.onload = function () {\n resolve(fileReader.result);\n };\n }\n else {\n imageUrl = document.getElementById(\"image_link\").value;\n if (imageUrl == \"\") { resolve('0'); }\n else { resolve(imageUrl); }\n }\n\n\n });\n\n}", "function createReaderSync()\n{\n return new FileReaderSync();\n}", "static pFileRead(fileprops){\n\t\tvar file = fileprops.file,\n\t\t\ttask = fileprops.task,\n\t\t\ttype = fileprops.type,\n\t\t\tfed_data = fileprops.fed_data || false;\n\n\t\treturn new Promise((resolve, reject) => {\n\n\t\t\tif (fed_data){\n\t\t\t\t//console.log(\"\")\n\t\t\t\ttry {\n\t\t\t\t\ttask(fed_data)\n\t\t\t\t\tresolve();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.log(\"error\", e);\n\t\t\t\t\treject(\"Generated data failed to process\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tvar fr = new FileReader();\n\n\t\t\t\tfr.onload = function(e){\n\t\t\t\t\ttry {\n\t\t\t \t\ttask(e.target.result);\n\t\t \t\t\tresolve();\n\n\t\t \t\t} catch(e){\n\t\t \t\t\treject(file.name + \" is not a \" + type + \", and \" + e);\n\t\t \t\t}\n\t\t \t}\n\t\t\t\tfr.readAsText(file);\n\t\t\t}\n\t\t});\n\t}", "function readFileAsPromise(path){\n return new Promise( (resolve, reject) => {\n fs.readFile(path, (err, data) => {\n if(err) reject(err);\n else {\n let gameData;\n try{\n gameData = JSON.parse(data);\n resolve(gameData);\n }\n catch(err){\n reject(err);\n }\n }\n });\n });\n }", "function readBlobAs(blob, mode) {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n resolve(e.target.result);\r\n };\r\n switch (mode) {\r\n case \"string\":\r\n reader.readAsText(blob);\r\n break;\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(blob);\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n}", "function FileReader() {\n this.result = '';\n this.onloadend = function() {\n };\n this.readAsArrayBuffer = function(mockFile) {\n this.result = mockFile;\n this.onloadend();\n }\n}", "function _gpfReadPhantomJS (path) {\n return new Promise(function (resolve, reject) {\n try {\n resolve(_gpfNodeFs.read(path));\n } catch (e) {\n // Error is a string\n reject(new Error(e));\n }\n });\n}", "read() {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest = {\n _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n _closeSteps: () => resolvePromise({ value: undefined, done: true }),\n _errorSteps: e => rejectPromise(e)\n };\n ReadableStreamDefaultReaderRead(this, readRequest);\n return promise;\n }", "function readBlobAs(blob, mode) {\n return new Promise(function (resolve, reject) {\n try {\n var reader = new FileReader();\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n switch (mode) {\n case \"string\":\n reader.readAsText(blob);\n break;\n case \"buffer\":\n reader.readAsArrayBuffer(blob);\n break;\n }\n }\n catch (e) {\n reject(e);\n }\n });\n}", "function readFile(path) {\n return new Promise((resolve, reject) => {\n fs.readFile(path, (error, data) => error ? reject(error) : resolve(data));\n })\n}", "async read(filepath) {\n try {\n return await this.reader(filepath, 'utf-8');\n } catch (error) {\n return undefined;\n }\n }", "function readFile(filePath, fmt) {\n return new Promise((resolve, reject) =>\n fs.readFile(filePath, fmt || 'utf8', (err, results) =>\n err ? reject(err) : resolve(results))\n );\n}", "function readFile(file){\n\t\t\tvar deferred = $q.defer();\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onloadend = function(e){\n\t\t\t\t// convert typed array to byte array\n\t\t\t //deferred.resolve(new Uint8Array(e.target.result));\n\t\t\t deferred.resolve(e.target.result);\n\t\t\t};\n\t\t\treader.error = function(err){\n\t\t\t\tdeferred.reject(err);\n\t\t\t};\n\t\t\t//reader.readAsArrayBuffer(file);\n\t\t\treader.readAsDataURL(file);\n\t\t\treturn deferred.promise;\n\t\t}", "constructor (inFile, outFile) {\n this.inFile = inFile\n this.outFile = outFile\n this.readFile = function readFile (inFile) {\n return new Promise((resolve, reject) => {\n fs.readFile(inFile, 'utf8', (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n }", "async function getFileContent(filePath) {\n return (await filePath) ? readFile(filePath) : null;\n}", "function readFile(file) {\n return new Promise((resolve, reject) => {\n let chunks = [];\n // Create a readable stream\n let readableStream = fs.createReadStream(file);\n \n readableStream.on('data', chunk => {\n chunks.push(chunk);\n });\n\n readableStream.on('error', err => {\n reject(err)\n })\n \n return readableStream.on('end', () => {\n resolve(chunks);\n });\n });\n}", "function getFileBuffer(file) {\n\n var deferred = $.Deferred();\n var reader = new FileReader();\n reader.onload = function (e) {\n deferred.resolve(e.target.result);\n }\n\n reader.onerror = function (e) {\n deferred.reject(e.target.error);\n }\n\n reader.readAsArrayBuffer(file);\n\n return deferred.promise();\n}", "function retriveFile(path) {\n return new Promise((resolve, reject) => {\n var request = new XMLHttpRequest();\n request.open('GET', path, true);\n request.responseType = 'text';\n request.onload = () => resolve({\n fileData: request.response\n });\n request.onerror = reject;\n request.send();\n })\n}", "function testasPromise(){\n\t\n\treturn new Promise(function(resolve,reject){\n\t\t\n\t\tfs.readFile('test4.txt', (err, data) => {\n\t\t\t if (err) throw reject(err);\n\t\t\t resolve(data);\n\t\t});\n\t\t\n\t});\n\t\n\t\n}", "async function readFileAA(file) {\n let result = undefined\n\n try {\n result = await readPromise(file, 'utf-8')\n } catch(e) {\n result = e\n }\n\n return result\n}", "function myfucntion(filePath){\n return new Promise(function fn(resolve , reject) {\n console.log(\"Hello\");\n // call back\n fs.readFile(filePath , function(err , data) {\n\n if(err){\n reject(err);\n\n } \n else {\n resolve(data);\n }\n });\n\n }) ;\n}", "function r(e){return e instanceof ArrayBuffer?a.default.resolve(e):e.toArrayBuffer?a.default.resolve(e.toArrayBuffer()):e.buffer?a.default.resolve(e.buffer):new a.default(function(t,n){var r=new FileReader;r.onload=function(){t(new Uint8Array(this.result))},r.onerror=n,r.readAsArrayBuffer(e)})}", "function read(path,method) {\n method = method || 'readAsText';\n return file(path).then(function(fileEntry) {\n return new Promise(function(resolve,reject){\n fileEntry.file(function(file){\n var reader = new FileReader();\n reader.onloadend = function(){\n resolve(this.result);\n };\n reader[method](file);\n },reject);\n });\n });\n }", "function getBase64(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = function () {\n return resolve(reader.result);\n };\n //reader.onerror\n });\n}", "function lineReaderAsync(filename, encoding = defaultEncoding) {\n return streamFileLineByLineAsync(filename, encoding);\n}", "function read (fileName) {\n return new Promise((resolve, reject) => {\n fs.readFile(fileName, \"utf8\",\n (err, textFileData) => {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(textFileData);\n }\n );\n });\n}", "function readFileAsync (file, options) {\n return new Promise(function (resolve, reject) {\n fs.readFile(file, options, function (err, data) {\n if (err) {\n reject(err)\n } else {\n resolve(data)\n }\n })\n })\n}", "function doFile(file) {\n var promise = new Promise((resolve, reject) => {\n outsideResolve = resolve;\n let reader = new FileReader();\n reader.onload = function(e) {\n\t\t\tlet doc = e.target.result;\n\t\t\tpusher(doc);\n };\n reader.readAsText(file);\n }).then(() => {\n if (i < numFiles - 1) {\n\t\t\t\ti++;\n\t\t\t\tdoFile(files[i]);\n }\n else if (i == numFiles - 1) {\n\t\t\ttrackPerformance();\n\t\t\t//downloadBlob(roots);\n }\n });\n }", "function read(path, method) {\n method = method || 'readAsText';\n return file(path).then(function (fileEntry) {\n return new Promise(function (resolve, reject) {\n fileEntry.file(function (file) {\n var reader = new FileReader();\n reader.onloadend = function () {\n resolve(this.result);\n };\n reader[method](file);\n }, reject);\n });\n });\n }", "function readFile(file, file_name, files_to_upload){\n return new Promise((resolve, reject) => {\n var fr = new FileReader(); \n fr.onload = () => {\n final_file = fr.result.split(',')[1]\n resolve(doUpload(file_name, final_file, files_to_upload - 1));\n };\n fr.readAsDataURL(file);\n });\n }", "async function readFile(){\n return new Promise((resolve,reject)=>{\n fs.readFile('../dataset/smallDataSet.csv','utf8',(err, data)=>{\n if(err) reject(err);\n resolve(data);\n });\n })\n}", "function readBlob(blob, as) {\n // readBlob(blob, \"Text\")\n // blob = new Blob([..])\n // the blob to read\n // as = \"Text\"\n // in which type to read the blob\n // Choices : \"Text\", \"ArrayBuffer\", \"DataURL\"\n var d = {},\n fr = new FileReader();\n d.promise = new Promise(function (res, rej) { d.resolve = res; d.reject = rej; });\n fr.onload = function (e) { return d.resolve(e.target.result); };\n fr.onerror = fr.onabort = function (e) { return d.reject(e.target.error); };\n d.promise.cancel = function () { fr.abort(); };\n switch (as.toLowerCase()) {\n case \"arraybuffer\": fr.readAsArrayBuffer(blob); break;\n case \"text\":\n case \"string\":\n case undefined: fr.readAsText(blob); break;\n case \"dataurl\": fr.readAsDataURL(blob); break;\n case \"binarystring\": if (fr.readAsBinaryString) { fr.readAsBinaryString(blob); break; }\n default: throw new Error(\"unhandled `as = \" + as + \"`\");\n }\n return d.promise;\n }", "function asyncGetFile(url) {\n //Your code here\n console.log(\"Getting text file\");\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(\"Get\", url);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n console.log(\"Made promise\");\n })\n\n}", "function getTextFile(theFilename){\n return new Promise($.async(function (resolve, reject) {\n try {\n $.fs.readFile(theFilename, 'utf8', function (err, theContent) {\n if (err) {\n resolve(\"\")\n } else {\n resolve(theContent);\n }\n });\n }\n catch (error) {\n resolve(\"\")\n }\n \n }));\n}", "readFile(filePath) {\n return RNFetchBlob.fs.readFile(filePath, 'utf8');\n }", "function encodeBlob(blob) {\n var $def = $.Deferred();\n var reader = new FileReader();\n reader.onload = function(event) {\n $def.resolve(event.target.result);\n };\n reader.readAsDataURL(blob);\n return $def;\n }", "function loadFile(file) {\n var cnt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (cnt !== false) {\n return Promise.resolve(cnt);\n }\n return new Promise(function (resolve, reject) {\n fs.readFile(file, function (err, result) {\n if (err) {\n reject(err);\n } else {\n resolve(result);\n }\n });\n });\n}", "async function getFile(name) {\n return new Promise(res => {\n fs.readFile(name, 'utf-8', (err, result) => {\n res(result);\n });\n });\n}", "function readAsBinaryString(file) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.onload = function () {\n resolve(reader.result);\n };\n reader.onerror = function () {\n reject(reader.error);\n };\n reader.onabort = function () {\n reject(new Error('Upload aborted.'));\n };\n reader.readAsBinaryString(file);\n });\n}", "async function readFile(path) {\n\treturn new Promise((resolve, reject) => {\n\t\tfs.readFile(path, 'utf8', function (err, data) {\n\t\t\tif (err) {\n\t\t\t\treject(err)\n\t\t\t}\n\t\t\tresolve(data)\n\t\t})\n\t})\n}", "function asyncGetFile(url) {\n console.log(\"getting text file\")\n return new Promise((resolve,reject) =>{\n const xhr = new XMLHttpRequest()\n xhr.open(\"Get\",url)\n xhr.onload = () => resolve(xhr.responseText)\n xhr.onerror = () => reject(xhr.statusText)\n xhr.send()\n console.log(\"Made promise\")\n })\n}", "function readBlobAsText(blob) {\n return new Promise((resolve, reject) => {\n var reader = new FileReader();\n\n reader.addEventListener('load', () => resolve(reader.result));\n reader.addEventListener('abort', () => reject(new Error(\"aborted\")));\n reader.addEventListener('error', () => reject(reader.error));\n\n reader.readAsText(blob);\n });\n}", "function getFile(relativePath) {\n let filePath = path.join(__dirname, relativePath);\n return new Promise((resolve, reject) => {\n fs.readFile(filePath, { encoding: 'utf8' }, function(err, data) {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n });\n}", "function getBuffer(fileData) {\n return function (resolve) {\n var reader = new FileReader();\n reader.readAsArrayBuffer(fileData);\n reader.onload = function () {\n var arrayBuffer = reader.result\n var bytes = new Uint8Array(arrayBuffer);\n resolve(bytes);\n }\n }\n}", "function getBuffer(fileData) {\n return function (resolve) {\n var reader = new FileReader();\n reader.readAsArrayBuffer(fileData);\n reader.onload = function () {\n var arrayBuffer = reader.result\n var bytes = new Uint8Array(arrayBuffer);\n resolve(bytes);\n }\n }\n}", "function read_string(filename: string): Promise<string> {\n return new Promise((resolve, reject) => {\n fs.readFile(filename, function (err: any, data: any) {\n if (err) {\n reject(err);\n } else {\n resolve(data.toString());\n }\n });\n });\n}", "async function readFile(...args) {\n const p = new Promise((resolve, reject) => {\n fs.readFile(...args, (err, data) => {\n if (err) {\n return reject(err);\n }\n resolve(data);\n });\n });\n return p;\n}", "async function readFile(...args) {\n const p = new Promise((resolve, reject) => {\n fs.readFile(...args, (err, data) => {\n if (err) {\n reject(err);\n }\n resolve(data);\n });\n });\n return p;\n}", "function readJSONFile(filename) {\n return new Promise(function (resolve, reject) {\n fs.readFile(filename, { \"encoding\": \"utf-8\" }, function (error, data) {\n if (error) {\n reject(error);\n }\n else {\n try {\n var obj = JSON.parse(data);\n resolve({ filename: filename, obj: obj });\n }\n catch (error) {\n reject(error);\n }\n }\n });\n });\n }", "function getBase64(file){return new Promise(function(resolve,reject){var reader=new FileReader();reader.readAsDataURL(file);reader.onload=function(){return resolve(reader.result);};reader.onerror=function(error){return reject(error);};});}", "function _getImageFile(fileEntry) {\n\t\t\t//wrap in $q ctor to convert from callback to promise design and get in angular scope\n\t\t\treturn $q(function(resolve, reject) {\n\t\t\t\tfileEntry.file(function(file) {\n\t\t\t\t\tresolve(file);\n\t\t\t\t}, function(error) {\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "open() {\n if (this._fd) {\n return Promise.resolve(this._fd);\n }\n return fs.open(this.filePath, 'r')\n .then((handle) => {\n this._fd = handle;\n })\n .then(() => fs.stat(this.filePath))\n .then((stat) => {\n this._size = stat.size;\n });\n }", "function loadExecutable() {\n return new Promise((resolve, reject) => {\n const input = document.createElement('input');\n input.type = 'file';\n\n input.onchange = (event) => {\n resolve(event.target.files[0]);\n }\n\n input.click();\n });\n}", "function readFileAsync$2(path, options) {\n return new Promise((resolve, reject) => fs.readFile(path, options, (err, data) => {\n if (err) {\n reject(err);\n }\n resolve(data);\n }));\n}", "static readFileToBuffer(filePath) {\n return FileSystem._wrapException(() => {\n return fsx.readFileSync(filePath);\n });\n }", "async function uploadFile(file) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader()\r\n reader.onloadend = () => {\r\n const buffer = Buffer.from(reader.result)\r\n ipfs.add(buffer)\r\n .then(files => {\r\n resolve(files)\r\n })\r\n .catch(error => reject(error))\r\n }\r\n reader.readAsArrayBuffer(file)\r\n })\r\n}", "getBase64(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result);\n reader.onerror = error => reject(error);\n });\n }", "getBase64(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result);\n reader.onerror = error => reject(error);\n });\n }", "async read (filepath, options = {}) {\n try {\n let buffer = await this._readFile(filepath, options);\n return buffer\n } catch (err) {\n return null\n }\n }", "async function readFile(path: string) {\n return new Promise<string>((resolve, reject) => {\n fs.readFile(path, {encoding: 'utf-8'}, (err, data) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(data);\n });\n });\n}", "static read(path) {\n return new Promise((resolve, reject) => {\n Jimp.read(path, function (err, image) {\n if (err instanceof Error) {\n //If this is the error, do not handle it as the api\n //already tries to read the file twice\n if (!err.message.includes('Invalid file signature')) {\n console.log('throwing error');\n reject(err);\n }\n }\n if (!image) {\n reject('Could not read image ' + path);\n }\n else {\n resolve(image);\n }\n });\n });\n }", "async function uploadFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onloadend = () => {\n const buffer = Buffer.from(reader.result)\n ipfs.add(buffer)\n .then(files => {\n resolve(files)\n })\n .catch(error => reject(error))\n }\n reader.readAsArrayBuffer(file)\n })\n}", "function createReaderAsync(testFiles)\n{\n var reader = new FileReader();\n\n reader.onloadstart = loadStarted;\n reader.onload = loaded;\n reader.onabort = logEvent;\n reader.onloadend = function(event) { loadEnded(testFiles, event); }\n reader.onerror = loadFailed;\n\n log(\"readyState: \" + reader.readyState);\n return reader;\n}", "readFile (fileName) {\n return new Promise((resolve, reject) => {\n const fullUrl = `${this.fileStoreUrl}/FS/WEB/${fileName}`\n this.counts.totalReadRequests++\n request(fullUrl, function (error, response, body) {\n if (error) {\n logger.error({ eventType: 'network_file_get_fail', fileName, error, ...this.counts })\n error.message = `Fail to retrieve ${fileName} at ${fullUrl}: error:${_.get(error, 'message')}`\n return reject(error)\n } else if (response && response.statusCode === 404) {\n logger.warn({ eventType: 'network_file_get_fail', fileName, code: response.statusCode, ...this.counts })\n return reject(new FileNotFoundError(fileName, fullUrl))\n } else if (response && response.statusCode >= 400) {\n logger.error({ eventType: 'network_file_get_fail', fileName, code: response.statusCode, ...this.counts })\n const newError = new Error(`Fail to retrieve ${fileName} at ${fullUrl}: code:${_.get(response, 'statusCode')}`)\n newError.code = response.statusCode\n return reject(newError)\n } else {\n logger.info({ eventType: 'network_file_get_success', code: response && response.statusCode, fileName, ...this.counts })\n return resolve(body)\n }\n });\n })\n }", "async function getResumeObj(documentFilePath){\n return new Promise(function(resolve,reject){\n resumeParser(documentFilePath).then((data) => {\n resolve(data);\n })\n .catch((error) => {\n console.log(error);\n reject(error);\n });\n });\n \n}", "function doAjax(method, file) {\n\n var promise = new Promise(function (resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, file, true);\n xhr.send();\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState != 4) {\n return;\n }\n console.log('resolve');\n // resolve(JSON.parse(xhr.responseText));\n\n if (xhr.status != 200 || xhr.responseText == '{}') {\n reject(xhr);\n } else {\n resolve(JSON.parse(xhr.responseText));\n }\n }\n });\n\n return promise;\n}", "function readLine() { //Reads the txt file line by line \n return new Promise((res, rej) => {\n try {\n let readed = []; \n let line;\n while ((line = liner.next())) {\n var lineString = line.toString(\"ascii\");\n const file = parseLine(lineString); //Take the line to transformt it into a JSON Format\n readed.push(file);\n }\n res(readed);\n } catch (error) {\n console.error(error);\n rej(error);\n }\n });\n}" ]
[ "0.7051898", "0.6949164", "0.69316256", "0.68050337", "0.6763172", "0.66277003", "0.65974766", "0.6508646", "0.64433646", "0.6439634", "0.63854676", "0.6362101", "0.6362101", "0.63462716", "0.63388497", "0.6333231", "0.6244455", "0.62320644", "0.6211521", "0.61395043", "0.61370033", "0.6126534", "0.609166", "0.6088666", "0.6081889", "0.6076981", "0.60766864", "0.60603464", "0.6046728", "0.60391665", "0.60391665", "0.6033228", "0.6033173", "0.60178417", "0.5947548", "0.5939331", "0.5925292", "0.59085697", "0.58912945", "0.5877684", "0.5874065", "0.5865678", "0.58653843", "0.58635426", "0.5855058", "0.58346635", "0.5827988", "0.5818358", "0.5814558", "0.58130836", "0.579683", "0.5794999", "0.5776853", "0.5773053", "0.5740776", "0.57186663", "0.57104963", "0.5709779", "0.57020044", "0.5695789", "0.56847495", "0.5683241", "0.56811315", "0.5680905", "0.5676609", "0.5655596", "0.56327176", "0.5623202", "0.5620836", "0.5614068", "0.5596144", "0.5588427", "0.55860823", "0.5579742", "0.55771893", "0.5576248", "0.5552062", "0.5552062", "0.5546756", "0.5545064", "0.5544298", "0.55406153", "0.55316234", "0.5531411", "0.55109626", "0.55065536", "0.54995435", "0.5491979", "0.54855007", "0.5452735", "0.5452735", "0.5451488", "0.5446527", "0.5414086", "0.5413975", "0.539314", "0.53724396", "0.53678274", "0.535891", "0.53514874" ]
0.6036343
31
import v4 from 'UUID'
function HogsContainer(props) { // function handleClick(event){ // // } const hogList = props.hogsObj.map(hogItem => { return < Hog key={hogItem.name} {...hogItem} /> }) return( <div> { hogList } </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UUIDjs() {\n}", "function UUID(){}", "function UUID(){}", "function UUID(){}", "function UUID(){}", "function UUID(){}", "uuidv4() { // Not crypto strong, but good enough for prototype.\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "function newUUID() {\n return uuid.v4();\n}", "generateUUIDv4()\n\t{\n\t\tlet tmpBuffer = new Array(16);\n\t\tvar tmpRandomBytes = this.randomByteGenerator.generate();\n\n\t\t// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\t\ttmpRandomBytes[6] = (tmpRandomBytes[6] & 0x0f) | 0x40;\n\t\ttmpRandomBytes[8] = (tmpRandomBytes[8] & 0x3f) | 0x80;\n\n\t\treturn this.bytesToUUID(tmpRandomBytes);\n\t}", "uuidv4() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(\n /[xy]/g,\n function (c) {\n var r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n }\n );\n }", "function uuid() {\n /* eslint-disable */\n return 'b-' + ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,a=>(a^Math.random()*16>>a/4).toString(16));\n /* eslint-enable */\n}", "uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0,\n v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "function generateUUID() {\n return uuid.v4(); // using node-uuid\n}", "static getUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = crypto.randomBytes(1)[0]%16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n }", "function uuid() {\n const s = [];\n const hexDigits = '0123456789abcdef';\n for (let i = 0; i < 36; i++) {\n s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\n }\n s[14] = '4';\n s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);\n s[8] = s[13] = s[18] = s[23] = '-';\n const uuid = s.join('');\n return uuid;\n }", "uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "static uuidv4() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (\n c\n ) {\n let r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }", "function uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n let r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}", "static uuidv4() { \n return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>\n (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n );\n }", "function uuidv4() {\r\n\t\t\t\t\t return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\r\n\t\t\t\t\t var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\r\n\t\t\t\t\t return v.toString(16);\r\n\t\t\t\t\t });}", "function uuidv4() {\n if(!uuidBase){\n if(typeof(window.crypto) !== \"undefined\" && crypto.getRandomValues){\n uuidBase = ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, function(c) {\n return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) ;\n }) ;\n }else{\n uuidBase = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n }\n return uuidBase+\"-\"+(uuidInc++) ;\n }", "function guuid() {\n return uuid_1.v1(); // return global uuid\n}", "function uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n // eslint-disable-next-line no-bitwise\n const r = Math.random() * 16 | 0;\n // eslint-disable-next-line no-bitwise, no-mixed-operators\n const v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "uuid4() {\n \treturn 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8)\n return v.toString(16)\n \t})\n }", "function uuidv4() {\n return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>\n (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n );\n}", "function uuidv4() {\n if(typeof(window.crypto) !== \"undefined\" && crypto.getRandomValues){\n return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, function(c) {\n return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) ;\n }) ;\n }else{\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n }", "function uuidv4() {\n\treturn ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>\n\t (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n\t)\n }", "function uuidv4() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === \"x\" ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}", "function uuid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}", "function CreateUUID() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, c => {\n let r = Math.random() * 16 | 0,\n v = c === \"x\" ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n} ////", "function generateUUIDv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0,\n v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}", "function uuidv4() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}", "function uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 + new Date().getTime | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "function uuid() {\n return \"uid-\" + __counter++;\n}", "static uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "function cryptoUUID() {\n var buf = new Uint16Array(8);\n getRandomValues(buf);\n var s4 = function s4(num) {\n var ret = num.toString(16);\n while (ret.length < 4) {\n ret = '0' + ret;\n }\n return ret;\n };\n return s4(buf[0]) + s4(buf[1]) + '-' + s4(buf[2]) + '-' + s4(buf[3]) + '-' + s4(buf[4]) + '-' + s4(buf[5]) + s4(buf[6]) + s4(buf[7]);\n}", "function createId(){\n return uuidv4();\n}", "function uuidv4() {\r\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\r\n (\r\n c ^\r\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))\r\n ).toString(16)\r\n );\r\n }", "function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n let r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n}", "function getUUID$1() {\n var retId; // Test never reach\n\n /* istanbul ignore if */\n\n if (isBrowserClient) {\n retId = uuid$4;\n uuid$4 += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}", "function uuidv4() {\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\n (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n );\n }", "function uuidv4 () {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "uuid() {\n let i, random;\n let uuid = '';\n\n for (i = 0; i < 32; i++) {\n random = (Math.random() * 16) | 0;\n if (i === 8 || i === 12 || i === 16 || i === 20) {\n uuid += '-';\n }\n uuid += (i === 12 ? 4 : i === 16 ? (random & 3) | 8 : random).toString(16);\n }\n\n return uuid;\n }", "function uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "function uuid() {\n return crypto.randomBytes(4).toString('hex') + '-' +\n crypto.randomBytes(2).toString('hex') + '-' +\n crypto.randomBytes(2).toString('hex').replace(/^./, '1') + '-' +\n crypto.randomBytes(2).toString('hex') + '-' +\n crypto.randomBytes(6).toString('hex')\n}", "function createUUID() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}", "static GenerateUUID() {\n // https://github.com/couchbase/couchbase-lite-net/blob/995053a919d30ec59a0d03e680160aca191018f5/src/Couchbase.Lite.Shared/Util/Misc.cs#L44\n const buffer = Buffer.from(new Array(16));\n uuid(null, buffer, 0);\n return `-${buffer.toString('base64').replace(/\\//g, '_').replace(/\\+/g, '-').substring(0, 22)}`;\n }", "function uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "generateGuid() {\n return uuid.v4();\n }", "function newUuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n}", "function uuid() {\n\t return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16));\n\t}", "function mathUUID() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}", "function generateUUID() {\n let uuid = \"\";\n for (let i = 0; i < 32; i++) {\n // Generate a random number between 0 and 15\n const randomNumber = Math.floor(Math.random() * 16);\n // Set the UUID version to 4 in the 13th position\n if (i === 12) {\n uuid += \"4\";\n }\n else if (i === 16) {\n // Set the UUID variant to \"10\" in the 17th position\n uuid += (randomNumber & 0x3) | 0x8;\n }\n else {\n // Add a random hexadecimal digit to the UUID string\n uuid += randomNumber.toString(16);\n }\n // Add hyphens to the UUID string at the appropriate positions\n if (i === 7 || i === 11 || i === 15 || i === 19) {\n uuid += \"-\";\n }\n }\n return uuid;\n}", "function generateUUID() {\n let uuid = \"\";\n for (let i = 0; i < 32; i++) {\n // Generate a random number between 0 and 15\n const randomNumber = Math.floor(Math.random() * 16);\n // Set the UUID version to 4 in the 13th position\n if (i === 12) {\n uuid += \"4\";\n }\n else if (i === 16) {\n // Set the UUID variant to \"10\" in the 17th position\n uuid += (randomNumber & 0x3) | 0x8;\n }\n else {\n // Add a random hexadecimal digit to the UUID string\n uuid += randomNumber.toString(16);\n }\n // Add hyphens to the UUID string at the appropriate positions\n if (i === 7 || i === 11 || i === 15 || i === 19) {\n uuid += \"-\";\n }\n }\n return uuid;\n}", "static generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n let r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "static generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n let r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "function isUUID(value, version) {\n return typeof value === 'string' && validator_lib_isUUID__WEBPACK_IMPORTED_MODULE_1___default()(value, version);\n}", "function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r&0x3 | 0x8);\n return v.toString(16);\n });\n}", "function generateID() {\n return v4();\n}", "function _generateToken()\n{\n return uuid.v4();\n}", "function uuid() {\n return '_mdtf_' + Math.random().toString(36).substr(2);\n}", "function uuidWeak() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (character) {\n var rand = (Math.random() * 16) | 0;\n var value = character === 'x' ? rand : (rand & 0x3) | 0x8;\n return value.toString(16);\n });\n}", "function createUUID() {\n\t\t\tif (persistence.typeMapper && persistence.typeMapper.newUuid) {\n\t\t\t\treturn persistence.typeMapper.newUuid();\n\t\t\t}\n\t\t\tvar s = [];\n\t\t\tvar hexDigits = \"0123456789ABCDEF\";\n\t\t\tfor (var i = 0; i < 32; i++) {\n\t\t\t\ts[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\n\t\t\t}\n\t\t\ts[12] = \"4\";\n\t\t\ts[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1);\n\n\t\t\tvar uuid = s.join(\"\");\n\t\t\treturn uuid;\n\t\t}", "_UUID() \n {\n return 'Sock-xyxxx-xxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "function randomUUID() {\n return uuidFunction();\n}", "function randomUUID() {\n return uuidFunction();\n}", "function genuuid() {\n var crypto = require('crypto');\n function uuidFromBytes(rnd) {\n rnd[6] = (rnd[6] & 0x0f) | 0x40;\n rnd[8] = (rnd[8] & 0x3f) | 0x80;\n rnd = rnd.toString('hex').match(/(.{8})(.{4})(.{4})(.{4})(.{12})/);\n rnd.shift();\n return rnd.join('-');\n }\n\n return uuidFromBytes(crypto.randomBytes(16));\n}", "function uuid() {\n token = decodeToken();\n if (token && token['https://linuxacademy.com/auth/uuid']) {\n return token['https://linuxacademy.com/auth/uuid'];\n } else {\n return '';\n }\n}", "function GenerateUUID() {\r\n return uuid();\r\n}", "function uuid2() {\n var accumulate = Date.now();\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, genNumber);\n\n function genNumber(char) {\n var number = (accumulate + Math.random() * 16) % 16 | 0;\n accumulate = Math.floor(accumulate / 16);\n return (char === 'x' ? number : (number & 0x3 | 0x8)).toString(16);\n }\n }", "function createUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n var r = Math.random() * 16 | 0,\n v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}", "function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n /* tslint:disable */\n var r = (Math.random() * 16) | 0;\n /* tslint:disable */\n var v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }", "function uuid() {\n var d = Date.now();\n // Use high perf timer if avail.\n /* istanbul ignore next */\n if (typeof performance !== 'undefined' && is_1.isFunction(performance.now))\n d += performance.now();\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n });\n}", "function getShortUid() {\n let x = uuidv4();\n x = x.substr(0, 6);\n return x;\n}", "function create_uuid() {\n let uuid = new Uint8Array(16);\n\n // \"Set all the ... bits to randomly (or pseudo-randomly) chosen values\".\n window.crypto.getRandomValues(uuid);\n\n // \"Set the four most significant bits ... of the time_hi_and_version\n // field to the 4-bit version number [4]\".\n uuid[6] = (uuid[6] & 0x0F) | 0x40;\n // \"Set the two most significant bits (bits 6 and 7) of\n // clock_seq_hi_and_reserved to zero and one, respectively\".\n uuid[8] = (uuid[8] & 0x3F) | 0x80;\n\n return uuid;\n}", "function createUUID() {\n // http://www.ietf.org/rfc/rfc4122.txt\n var s = [];\n var hexDigits = \"0123456789abcdef\";\n for (var i = 0; i < 36; i++) {\n    s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\n }\n // bits 12-15 of the time_hi_and_version field to 0010\n s[14] = \"4\";\n // bits 6-7 of the clock_seq_hi_and_reserved to 01 \n s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);\n s[8] = s[13] = s[18] = s[23] = \"-\";\n\n var uuid = s.join(\"\");\n return uuid;\n}", "function rawGetStrUuid4(binUuid4)\n{\n\tif(!rawIsSafeEntity(binUuid4) || !(binUuid4 instanceof Buffer)){\n\t\tbinUuid4 = rawGetBinUuid4();\n\t}\n\tvar\tparsed\t= binUuid4.toString('hex').match(/(.{8})(.{4})(.{4})(.{4})(.{12})/);\n\tparsed.shift();\t\t\t\t\t\t\t\t// first element is all, then skip it.\n\tvar\tstrUuid\t= parsed.join('-');\n\treturn strUuid;\n}", "GUID() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n return \"ss-s-s-s-sss\".replace(/s/g, s4);\n }", "getGuid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' +\n s4() + '-' + s4() + s4() + s4();\n }", "function getGuid() {\n return getUuid();\n}", "function randomUuid() {\n return uuid();\n}", "function getUUID() {\n var retId; // Test never reach\n\n /* istanbul ignore if */\n\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}", "function getUUID() {\n var retId; // Test never reach\n\n /* istanbul ignore if */\n\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}", "function getUUID() {\n var retId; // Test never reach\n\n /* istanbul ignore if */\n\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}", "function getUUID() {\n var retId; // Test never reach\n\n /* istanbul ignore if */\n\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}", "function getUUID() {\n var retId; // Test never reach\n\n /* istanbul ignore if */\n\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}", "function getUUID() {\n var retId; // Test never reach\n\n /* istanbul ignore if */\n\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}", "function getUUID() {\n var retId; // Test never reach\n\n /* istanbul ignore if */\n\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}", "function uuid() {\n let i, random;\n let uuid = '';\n\n for (i = 0; i < 32; i++) {\n random = Math.random() * 16 | 0;\n if (i === 8 || i === 12 || i === 16 || i === 20) {\n uuid += '-';\n }\n uuid += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16);\n }\n\n return uuid;\n}", "function createUUIDString()\n {\n\n // UUID Gem.\n function s4() {\n return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n\n }", "generateUUID() {\n let d = new Date().getTime();\n if (typeof performance !== 'undefined' && typeof performance.now === 'function'){\n d += performance.now(); //use high-precision timer if available\n }\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n let r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n });\n }", "function getUUID() {\n var retId;\n // Test never reach\n /* istanbul ignore if */\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n return retId;\n}", "function uuidNum(num) {\n return '00000000-0000-0000-0000-0000000000'\n + (Number(num) < 10 ? '0' + num : num);\n}", "function generateUUID() {\n // http://www.ietf.org/rfc/rfc4122.txt\n var s = [];\n var hexDigits = \"0123456789abcdef\";\n for (var i = 0; i < 36; i++) {\n s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\n }\n s[14] = \"4\"; // bits 12-15 of the time_hi_and_version field to 0010\n s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01\n s[8] = s[13] = s[18] = s[23] = \"-\";\n\n return s.join(\"\");\n }", "function createUUID() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(c) {\n var r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}", "uuid() {\n\t\t\t\treturn Math.floor((1 + Math.random()) * 0x10000).toString(16);\n\t\t\t}", "_uniqueID() {\n const chr4 = () => Math.random().toString(16).slice(-4);\n return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\n }", "function createUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n}", "function createUUID()\n{\n return [4, 2, 2, 2, 6].map(function(length) {\n var uuidpart = \"\";\n for (var i=0; i<length; i++) {\n var uuidchar = parseInt((Math.random() * 256)).toString(16);\n if (uuidchar.length == 1)\n uuidchar = \"0\" + uuidchar;\n uuidpart += uuidchar;\n }\n return uuidpart;\n }).join('-');\n}", "function uuid() \n{\n\treturn 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) \n\t{\n\t\tvar r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n\t\treturn v.toString(16);\n\t});\n}", "function newUuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }" ]
[ "0.7610103", "0.76069224", "0.76069224", "0.76069224", "0.76069224", "0.76069224", "0.73807055", "0.7344456", "0.7257235", "0.7243811", "0.7221438", "0.71958315", "0.71388555", "0.7136347", "0.7115268", "0.7113394", "0.7097397", "0.70626885", "0.70552975", "0.7040583", "0.703132", "0.70122856", "0.7009922", "0.6978907", "0.6956884", "0.6950568", "0.69395345", "0.69311404", "0.69308776", "0.6926658", "0.6919628", "0.6909761", "0.6871034", "0.6860618", "0.6850561", "0.6811596", "0.6786758", "0.6784011", "0.6781347", "0.677712", "0.6776852", "0.6746379", "0.67308205", "0.672661", "0.6710703", "0.6705172", "0.6704674", "0.6670745", "0.66376126", "0.6636696", "0.6621381", "0.66190046", "0.66146654", "0.66146654", "0.6612299", "0.6612299", "0.6609448", "0.66072226", "0.660631", "0.6602931", "0.65638936", "0.65619045", "0.655849", "0.65552646", "0.6551601", "0.6551601", "0.65488505", "0.6532456", "0.65309036", "0.6523137", "0.6517161", "0.6515937", "0.65153706", "0.65052027", "0.6501782", "0.6501771", "0.6475169", "0.6451265", "0.6442216", "0.6441833", "0.64332175", "0.64311427", "0.64311427", "0.64311427", "0.64311427", "0.64311427", "0.64311427", "0.64311427", "0.64206964", "0.64196986", "0.6407456", "0.64017427", "0.63836986", "0.6376477", "0.6370587", "0.6370562", "0.63654834", "0.6361539", "0.6355376", "0.6354796", "0.6351729" ]
0.0
-1
Cache un element HTML.
function afficherSection(nomClasse) { $("." + nomClasse).css("display", "block"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateCachedHtml() {\n if (!this.el.caching) return;\n debug('update cached html');\n var items = this.el.querySelectorAll('.gfl-item, .gfl-section');\n var html = [].map.call(items, el => el.outerHTML).join('');\n this.setCache('html', html);\n }", "function CacheEl() {\n \n }", "function html(element, unescaped) {\n return set(element, 'innerHtml', unescaped);\n}", "function _clearContents(element) {\n element.set(\"innerHTML\",\"\");\n }", "function cacheDom() {\n DOM.$quoteFeature = $('#quote');\n DOM.$quoteLink = $(document.createElement('a'));\n DOM.$author = $(document.createElement('p'));\n }", "limpiarHTML(){\n while(totalPedidoMostrar.firstChild) {\n totalPedidoMostrar.removeChild( totalPedidoMostrar.firstChild)\n }\n }", "function removePreFromHTML() {\n if (window) {\n // always remove element (refresh effect)\n let elm = document.querySelector('.orasyo-content-report')\n if (elm) elm.remove()\n }\n}", "function _cacheDom() {\n DOM.$stats = $('#stats-module');\n DOM.$p = $(document.createElement('p'));\n }", "limpiarHTML(){\n while(detPedido.firstChild) {\n detPedido.removeChild( detPedido.firstChild)\n }\n }", "function clearSetElement(elem) {\n jQTE.find(elem).each(function () {\n $(this).before($(this).html()).remove();\n });\n }", "function destroy() {\n var jqMe = element.jqSelf();\n jqMe.html();\n }", "function cacheDom() {\n DOM.$consultanttablebody = $(\"#consultanttablebody\");\n DOM.$clientMenu = $(\"#clientmenu\");\n DOM.$document = $(document);\n }", "revert() {\n this.htmlElement.innerHTML = this.initialInnerHTML;\n }", "function _cacheElements() {\r\n el.form = $('.contact-form form');\r\n el.email_input = el.form.find('#input-email');\r\n el.email_error = el.email_input.siblings('.error-message');\r\n }", "function initHtml() {\n\t\t\tcontainerElement.find(\"input.ibm-btn-go\").remove();\n\t\t}", "function clearHtml() {\n const list = document.querySelector('.products-container');\n list.innerHTML = '';\n}", "static get html() {\n return '';\n }", "function reset_html(clear) {\n\tconsole.log('reset html for: '+clear)\n $(clear).html($(clear).html());\n\tonFileChange()\n\tconsole.log('id_imgUrl.value: '+$('#id_imgUrl').attr(\"value\"))\n\tif ($('#id_imgUrl').attr(\"value\") == \"\") {\n\t\t$('#thumb_id').attr(\"src\", cUrl);\n\t\t$('#id_imgUrl').attr(\"value\", cUrl);\n\t}\n}", "limpiarHTML() {\n $('#turnos').empty();\n }", "function cleanup() {\n if ( jquery_data_key ) {\n elem.removeData( jquery_data_key );\n } else if ( id ) {\n delete cache[ id ];\n }\n }", "revert() {\n // If it's not parsed, then do nothing\n if (!this.isParsed) {\n return\n }\n\n for (let i = 0; i < this.preEls.length; i++) {\n this.preEls[i].removeAttribute('data-highlight')\n // Check content type\n if (typeof this.preElsCache[i] === 'string') {\n this.preEls[i].innerText = this.preElsCache[i]\n }\n else {\n this.preEls[i].innerHTML = ''\n this.preEls[i].appendChild(this.preElsCache[i].cloneNode(true))\n }\n }\n\n this.removeLinkEl()\n this.isParsed = false\n }", "function cacheDom() {\n DOM.background = document.getElementById('background');\n }", "remove () {\n this.html.remove();\n }", "function limpiarHTML() {\n while (containerCalc.firstChild) {\n containerCalc.removeChild(containerCalc.firstChild)\n }\n}", "function cacheDOM() {\n\n DOM.editMode = document.getElementById('EditMode');\n DOM.loader = document.getElementById('Loader');\n DOM.contactNo = document.getElementById('ContactNo');\n DOM.mobileNo1 = document.getElementById('MobileNo1');\n DOM.mobileNo2 = document.getElementById('MobileNo2');\n DOM.emailAddress = document.getElementById('EmailAddress');\n DOM.clientName = document.getElementById('ClientName');\n DOM.state = document.getElementById('State');\n DOM.city = document.getElementById('City');\n DOM.area = document.getElementById('Area');\n DOM.saveClient = document.getElementById('SaveClient'); \n }", "function cacheDOM() {\n\n DOM.loader = document.getElementById('Loader');\n DOM.viewMode = document.getElementById('ViewMode');\n DOM.editMode = document.getElementById('EditMode');\n\n DOM.searchdrugname = document.getElementById('SearchDrugName');\n DOM.todate = document.getElementById('ToDate');\n\n DOM.printstockmovementlist = document.getElementById('PrintStockMovementList');\n\n DOM.searchdruglist = document.getElementById('SearchDrugList');\n }", "function remove()\n\t\t{\n\t\t\t\n\t\t\tvar a1=$(element).find(\"#\"+lastid).get(0);\n\t\t\tvar a2=$(element).find(\"#\"+lastid.replace(\"g\",\"s\")).get(0);\n\t\t\ta2.innerHTML = \"\";\n\t\t\ta1.removeAttribute(\"style\");\n\t\t\ta1.removeAttribute(\"src\");\n\t\t\ta1.removeAttribute(\"type\");\n\t\t\ta1.removeAttribute(\"readonly\");\n\t\t\ta1.setAttribute(\"type\",\"text\");\t\n\t\t\ta1.setAttribute(\"value\",\"\");\n\t\t\ta1.value=\"\";\n\t\t\n\t\t}", "function makeHtmlElement(html){\n\t\tcallbacks = {};\n\t\tvar result = parseHtmlJson(html, callbacks);\n\n\t\t//make result not display, then add it to body so that jQuery selector\n\t\t//callbacks on it will work\n\t\tvar oldDisplay = result.style.display;\n\t\tresult.style.display = \"none\";\n\t\tdocument.body.appendChild(result);\n\n\t\tfor (var id in callbacks){\n\t\t\tvar element = getByDataId(result, id);\n\t\t\tcallbacks[id](element);\n\t\t\telement.removeAttribute(dataIdName);\n\t\t}\n\n\t\t//remove result from body, then restore its display attribute\n\t\tdocument.body.removeChild(result);\n\t\tresult.style.display = oldDisplay;\n\n\t\treturn result;\n\t}", "function noHtml(elem) {\n\t\telem.innerHTML.replace(/<.+?>/gim, '')\n\t}", "prepareHTML(html) {\n if (html instanceof HTMLElement) {\n html = html.outerHTML;\n }\n\n const target = DomHelper.createElement({\n parent: document.body,\n style: {\n visibility: 'hidden',\n position: 'absolute'\n },\n html\n });\n const elements = target.querySelectorAll('img');\n\n for (let i = 0, l = elements.length; i < l; i++) {\n elements[i].setAttribute('src', elements[i].src);\n }\n\n const result = target.innerHTML;\n target.remove();\n return result;\n }", "function stripHTML(el) {\n el.innerHTML = el.textContent;\n }", "function limpiartHtml(){\r\n\r\n while(listaCarrito.firstChild) {\r\n\r\n listaCarrito.removeChild(listaCarrito.firstChild)\r\n\r\n }\r\n\r\n}", "html(argHTML) {\n if (argHTML === undefined) return this.elementArray[0].innerHTML;\n this.each(ele => {\n ele.innerHTML = argHTML;\n });\n }", "function resetHtml()\n{\n var list = document.getElementById(\"wad-list\");\n // Purge the list\n list.innerHTML = '';\n return true;\n}", "function _reset () {\n _elements = [];\n }", "function removeElement(element) {\n\n element.outerHTML = \"\";\n delete element;\n\n}", "resetContentSrc() {\n const root = this.doc.getroot();\n let contentElement = root.find('content');\n if (!contentElement) {\n contentElement = et.SubElement(root, 'content', { src: 'index.html' });\n }\n const originalSrc = contentElement.get('original-src');\n if (originalSrc) {\n contentElement.set('src', originalSrc);\n delete contentElement.attrib['original-src'];\n }\n const navElements = root.findall(`allow-navigation[@sessionid='${this.sessionid}']`);\n for (const navElement of navElements) {\n root.remove(navElement);\n }\n }", "function clearHtml() {\n document.querySelector('.cat-container').innerHTML = '';\n}", "renderHTML() {\n let domPurify = createDomPurify(new JSDOM().window);\n return { __html: domPurify.sanitize(this.state.post.html) }; //Sanitize html so no hackers can inject\n }", "deobfuscator() {\n const $obfuscatedElements = $(`[data-${this.elementDataName}]`);\n\n if ($obfuscatedElements.length < 1) {\n return;\n }\n\n $.each($obfuscatedElements, (index, element) => {\n this.deobfuscateElement(element);\n });\n }", "clear(e) {\n if (e) {\n if (typeof e === \"string\") {\n const element = this.get(e);\n\n if (element) {\n element.innerHTML = \"\";\n }\n } else {\n e.innerHTML = \"\";\n }\n }\n }", "wipeCache() {\n\t\tthis.cached = null;\n\t}", "clean(selector) {\n\t\tdocument.querySelector(selector).innerHTML = '';\n\t}", "function cacheItems(cacheID, htmlItemsArg){\n\t\t\t\n\t\tif(htmlItemsArg){\n\t\t\tvar htmlItems = htmlItemsArg;\n\t\t\tif(htmlItems != \"noitems\")\n\t\t\t\thtmlItems = jQuery(htmlItemsArg).clone();\n\t\t}else{\n\t\t\tvar htmlItems = g_objWrapper.children().clone();\n\t\t}\n\t\t\n\t\tg_objCache[cacheID] = htmlItems;\n\t}", "clear() {\n if (this._liveElement) {\n this._liveElement.textContent = '';\n }\n }", "clear() {\n if (this._liveElement) {\n this._liveElement.textContent = '';\n }\n }", "clear() {\n if (this._liveElement) {\n this._liveElement.textContent = '';\n }\n }", "clear() {\n if (this._liveElement) {\n this._liveElement.textContent = '';\n }\n }", "function clearDOM() {\n Ul.innerHTML = \"\";\n}", "function cacheDom() {\n DOM.$background = $('#background');\n }", "function clear() {\n $(\"div\").html(\"\");\n}", "function getHtml(el) {\n return el.innerHTML;\n }", "function cacheDOM() {\n\n DOM.loader = document.getElementById('Loader');\n\n DOM.addNewGoodsReceipt = document.getElementById('AddNewGoodsReceipt');\n DOM.showGoodsReceiptList = document.getElementById('ShowGoodsReceiptList');\n DOM.viewGoodsReceipt = document.getElementById('ViewGoodsReceipt');\n DOM.editGoodsReceipt = document.getElementById('EditGoodsReceipt');\n DOM.saveGoodsReceipt = document.getElementById('SaveGoodsReceipt');\n DOM.deleteGoodsReceipt = document.getElementById('DeleteGoodsReceipt');\n DOM.printGoodsReceipt = document.getElementById('PrintGoodsReceipt');\n DOM.exportGoodsReceiptList = document.getElementById('ExportGoodsReceiptList');\n\n DOM.editMode = document.getElementById('EditMode');\n DOM.vendor = document.getElementById('Vendor');\n DOM.purchaseBillNo = document.getElementById('PurchaseBillNo'); \n DOM.financialYear = document.getElementById('FinancialYear');\n DOM.branch = document.getElementById('Branch');\n DOM.goodsReceiptNo = document.getElementById('GoodsReceiptNo');\n DOM.goodsReceiptDate = document.getElementById('GoodsReceiptDate');\n DOM.goodsReceiptDatePicker = document.getElementById('GoodsReceiptDatePicker');\n DOM.$goodsReceiptDatePicker = $('#GoodsReceiptDatePicker');\n DOM.location = document.getElementById('Location');\n\n DOM.viewMode = document.getElementById('ViewMode');\n DOM.goodsReceiptList = document.getElementById('GoodsReceiptList');\n DOM.goodsReceiptItemsList = document.getElementById('GoodsReceiptItemsList');\n }", "function cache() {\n document.documentElement.dataset.cached = true;\n var data = document.documentElement.outerHTML;\n fetch('./render-store/', { method: 'PUT', body: data }).then(function() {\n console.log('Page cached');\n });\n}", "_render(html){this.$.container.innerHTML=html}", "function _clearHtml(txt){\n txt = txt.replace(new RegExp('<','g'),'&#8249;');\n txt = txt.replace(new RegExp('>','g'),'&#8250;');\n return txt;\n }", "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n }", "function removeNodes() {\n \tconst nodes = document.removeAttribute(\".fn-remove-me\");\n \tnodes.innerHTML //este no sé cómo pintar en html una vez quitado el atributo .fn-remove-me\n}", "function _getRulaiHtml(content){\n\n}", "function render(){\n\t\t$element.find('input').val('')\n\t}", "function limpiarHTML() {\n while(listaTweets.firstChild) {\n listaTweets.removeChild(listaTweets.firstChild)\n }\n}", "function cacheDom(){\n DOM.$hoverableDropdowns = $(\"ul.hoverable\");\n DOM.$navLinksWithChildren = $(\"li.menu-item-has-children\");\n DOM.$accountNavLinksWithChildren = $(\".account-nav li.menu-item-has-children > a\");\n }", "function pagehtml(){\treturn pageholder();}", "function precacheNode(inst,node){var nativeInst=getRenderedNativeOrTextFromComponent(inst);nativeInst._nativeNode=node;node[internalInstanceKey]=nativeInst;}", "function precacheNode(inst,node){var nativeInst=getRenderedNativeOrTextFromComponent(inst);nativeInst._nativeNode=node;node[internalInstanceKey]=nativeInst;}", "function emptyElement(x){\n _(x).innerHTML = \"\";\n}", "$applyHTML() {\n\t\t// this.shadowRoot.innerHTML = `<style>${STYLE.textContent}</style>` + new XMLSerializer().serializeToString(HTML);\n\t\tthis.$view = HTML.content.cloneNode(true)\n\t\t// \tthis.$clearView();\n\t\t// this.shadowRoot.appendChild(STYLE.cloneNode(true));\n\t\t// this.shadowRoot.appendChild(HTML.content.cloneNode(true));\n\t\t// this.shadowRoot.insertAdjacentElement('afterbegin',STYLE);\n\t}", "function limpiarHTML() {\n\t//forma lenta\n\t//contenedorCarrito.innerHTML = '';\n\twhile (contenedorCarrito.firstChild) {\n\t\tcontenedorCarrito.removeChild(contenedorCarrito.firstChild);\n\t}\n}", "function clear_cache() {\n hidden_action('/admin/ajax/clearCache/true', false, false, false, false, false);\n }", "function resetHtmlVariable() {\n\t// reset the html variable so we can rebuild it after next user guess\n\thtml=\"<p><h1>\";\n\n}", "function limpiarHTML() {\n while (contenedorCarrito.firstChild) {\n contenedorCarrito.removeChild(contenedorCarrito.firstChild);\n }\n}", "get $elements() {\n if (this.#cached$elements === undefined) {\n this.#cached$elements = $(this.elements);\n }\n return this.#cached$elements;\n }", "function clearOutPutDataToHTML() {\n STATE.searchResult = [];\n render();\n}", "function handleHtmlImg(el) {\n if (el.dataset.lazySrc) {\n el.src = el.dataset.lazySrc\n delete el.dataset.lazySrc\n }\n if (el.dataset.lazySrcset) {\n el.srcset = el.dataset.lazySrcset\n delete el.dataset.lazySrcset\n }\n }", "function uuajaxexpire() {\r\n _uuajax._cache = {}; // expire If-Modified-Since cache\r\n}", "function reRender() {\n input.innerText = buffer;\n}", "function clearCache() {\n cache = undefined;\n}", "function setInnerHTML(element, html) {\n element[innerHTML()] = isRealElement(html) ? html[innerHTML()] : html;\n }", "clear() {\n Array.prototype.forEach.call(this._el, function(profile) {\n profile.innerHTML = '';\n });\n }", "function clearHtmlDom(htmlObj, jqueryObject) {\n\t$(htmlObj).detach();\n}", "function lessContent(){\n\t//var less = document.getElementById(\"less\"); same concept of why not needed as last problem\n\tless.style.display = \"none\";\n\n\t//you could also do less.HTML = \"\"; or \n\t\n}", "function cacheDom($container) {\n DOM.template = `\n <div class=\"app-shell-head\">\n <div class=\"app-shell-head-logo\">\n <h1>No Framework</h1>\n </div>\n <div class=\"app-shell-head-nav\">\n <ul>\n <li><a href=\"#\">Home</a></li>\n <li><a href=\"#/blog\">Blog</a></li>\n <li><a href=\"#/portfolio\">Portfolio</a></li>\n </ul>\n </div>\n </div>\n\n <div class=\"app-shell-main\">\n <div class=\"app-shell-main-content\"></div>\n </div>\n\n <div class=\"app-shell-foot\"></div>`;\n \n }", "clearCache(templateName) {\n var self = this;\n\n if (templateName === void 0) {\n self.renderCache = {\n 'item': {},\n 'option': {}\n };\n } else {\n self.renderCache[templateName] = {};\n }\n }", "function cacheDOM() {\r\n\t\tdom = {};\r\n\t\tdom.document = $(document);\r\n\t\tdom.mobileMenuIcon = dom.document.find('.mobile-header__icon');\r\n\t\tdom.mobileMenu = dom.document.find('.mobile-header__container--show');\r\n\t\tdom.mobileMenuClose = dom.document.find('.mobile-header__close');\r\n\t}", "function unprotectElement(element) {\n if (Array.isArray(element)) {\n return element.forEach(unprotectElement);\n }\n\n var elementObject = _pools.pools.elementObject;\n var attributeObject = _pools.pools.attributeObject;\n\n elementObject.unprotect(element);\n\n element.attributes.forEach(attributeObject.unprotect, attributeObject);\n element.childNodes.forEach(unprotectElement);\n\n _cache.NodeCache.delete(element);\n\n return element;\n}", "get html() {\n return '';\n }", "function removeElementFromTemplate(id, sig){\n // turn string to html\n var $el = $(sig);\n id = \"#\"+id;\n // remove #cell\n $el.find(id).remove();\n // turn html back to string\n sig = $el.prop('outerHTML');\n console.log(sig);\n return sig;\n}", "function clearcache() {\n dbgmsg( 'retrieveData: Internal cache contain attribute values for: ' + Object.keys( cache ).sort().join( '; ' ) );\n cache = {};\n logmsg( 'retrieveData: cache cleared.' );\n }", "function unescapeHTML(html) {\r\n return unsafeWindow.$(\"<div />\").html(html).text();\r\n}", "createMarkup(html) {\n return {\n __html: html\n };\n }", "function cachedExecute() {\n setTimeout(function() {\n if ($(imgHrefRemoved).length) {\n init();\n }\n }, 1000);\n }", "static get observers(){return[\"_render(html)\"]}", "function _clear(){\n\t\t\t_$content.off('click');\n\t\t\t_$content.empty();\n\t\t}", "function mapToDom(value) {\n if (value === undefined || value === null || value === '' || value === false) {\n return\n }\n document.querySelectorAll('.message').forEach(e => e.remove());\n value.forEach(element => {\n //add removal of expired messages\n var current = moment().valueOf();\n var diff = element.expire - current;\n if (diff <= 0) {\n element.expire = 0;\n }\n var objectToHtml = `<p class=\"meta\">${element.username} <span>${element.time}</span></p>\n <p class=\"text\">${element.text}</p>`;\n var div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = objectToHtml;\n document.querySelector('.chat-messages').appendChild(div);\n });\n deleteExpired(value);\n}", "function clearElement()\n {\n ThemerService.setElement();\n }", "cache(element) {\n if (!element.children.length) {\n return;\n }\n\n for (let i = 0; i < element.children.length; i++) {\n element.children[i].setAttribute(':index', this.index);\n this.index++;\n this.cache(element.children[i]);\n }\n }", "async refresh(html = '') {\n if (!html) {\n const res = await fetch(this.element.dataset.url);\n html = await res.text();\n }\n\n this.destroy();\n this.registry.replaceComponent(this, html);\n }", "reset() {\n this.data = $.extend(true, {}, this.cacheData);\n this.href = null;\n this.isBuilt = false;\n\n // Unsubscribe events\n this.eventBus.unsubscribeByScope(this);\n }", "function unsrced() {\n var u = document.querySelector('body #unsrced');\n if(u == null) {\n u = document.createElement('div');\n u.id = 'unsrced';\n document.querySelector('body').appendChild(u);\n }\n return u;\n}", "function listCacheClear(){\nthis.__data__=[];\nthis.size=0;\n}", "function update(tag, html) {\n var el = getElement(tag);\n\n if(el && html !== undefined) {\n el.innerHTML = html;\n }\n\n return me;\n }" ]
[ "0.70183635", "0.67558354", "0.59926915", "0.5977295", "0.5962273", "0.595558", "0.58919007", "0.58891004", "0.58357704", "0.5829128", "0.5787081", "0.56784534", "0.5672599", "0.5639562", "0.56295717", "0.5619898", "0.55908895", "0.55647546", "0.5531162", "0.5531126", "0.5518591", "0.5517746", "0.5495083", "0.5482509", "0.54820085", "0.54618806", "0.54383653", "0.54328704", "0.542314", "0.5418275", "0.54113317", "0.5401297", "0.53878266", "0.53799963", "0.5379518", "0.5356534", "0.5352259", "0.534366", "0.53266", "0.5325025", "0.5311752", "0.5310315", "0.52976686", "0.5296926", "0.52960974", "0.52960974", "0.52960974", "0.5295851", "0.5285954", "0.52741885", "0.52568597", "0.5253418", "0.5246065", "0.5246037", "0.5241163", "0.5221117", "0.52180725", "0.5216686", "0.52136964", "0.5210312", "0.5208364", "0.52051795", "0.51999986", "0.5185546", "0.5185546", "0.5181327", "0.51812965", "0.5178758", "0.5172708", "0.51683974", "0.5167043", "0.5160727", "0.51581067", "0.51500165", "0.5139161", "0.51303226", "0.5122015", "0.51219493", "0.51206285", "0.5118641", "0.5118067", "0.5111737", "0.5103937", "0.50938755", "0.5093703", "0.5089812", "0.50821", "0.50814503", "0.50803053", "0.5072336", "0.50716656", "0.5070107", "0.50652766", "0.50652236", "0.50644296", "0.50640196", "0.5062489", "0.50622904", "0.50618017", "0.5057972", "0.50563467" ]
0.0
-1
Pour activer le bouton valider.
function activerBouttonValidation(){ activerChamp(ID_BOUTON_VALIDER); $(ID_BOUTON_VALIDER).removeClass("disabled"); $(ID_BOUTON_VALIDER).click(function(){ activerChargementPage(); submit(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPaiementCb(){ \n\t\tjQuery('.payer').click(function(e) {\n\t\t\t// Open Checkout with further options:\n\t\t\thandler.open({\n\t\t\t\tname: 'SpamTonProf',\n\t\t\t\tdescription: 'Abonnement de '.concat(montant,' € par semaine'),\n\t\t\t\tzipCode: false,\n\t\t\t\tamount: montant*100,\n\t\t\t\temail : emailCheckout,\n\t\t\t\tcurrency: 'EUR'\n\t\t\t});\n\t\t\te.preventDefault();\n\t\t});\n\t}", "ready () {\n this.$biBtn.addEventListener('click', () => {\n Editor.Ipc.sendToMain('bi:bi-used-changed', {\n url: this.$biUrl.value,\n game: this.$biGame.value,\n region: this.$biRegion.value,\n channel: this.$biChannel.value,\n iOS: this.$biIOS.value,\n android: this.$biAndroid.value,\n used: this.$biUsed.checked\n })\n });\n }", "function btnClick() {\n\t//On écoute l'évènement du clic sur le bouton d'ajout au panier\n\tbouton.addEventListener(\"click\", () => {\n\t if (quantiteProduit.value >= 1 && quantiteProduit.value <= 20) { //On borne la quantité entre 1 et 20 articles\n\t\t //Si la quantité est correcte, on lance la fonction pour ajouter notre produit\n\t\t ajouterProduit();\n\t\t // Puis on réinitialise l'input de quantité à 1\n\t\t quantiteProduit.value = 1;\n\t\t} else { //Si une mauvaise quantité de produits a été entrée, on affiche un message d'erreur\n\t\terreurQte.style.color = \"#ba7894\";\n\t\terreurQte.style.fontWeight = \"bold\";\n\t\terreurQte.innerHTML = \"La quantité doit être d'au moins 1 article et ne doit pas excéder 20 articles.\";\n\t\tsetTimeout(function() {\n\t\t\terreurQte.innerHTML = \"\";\n\t\t},5000);\n\t}\n});\n}", "activate() {\n this.active = true\n this.activatedComponents.forEach(contact => {\n contact.activate(this.value < 9 ? ActivationSources.ALGEDONODE : ActivationSources.DIAL_OUTPUT)\n })\n }", "activate() {\n\n\t\tthis.arbitrate();\n\n\t}", "activate() {\n this.active = true;\n }", "activer() {\n\t\tSprite.addEventListeners(window, this.evt.window);\n console.log(this.cellule.infoDebogage());\n }", "function activate(){\n\n\t\t}", "function activar(tbody, table){\n\t\t$(tbody).on(\"click\", \"span.activar\", function(){\n var data=table.row($(this).parents(\"tr\")).data();\n statusConfirmacion('EsquemaComision/status_esquema_comision', data.id_esquema_comision, 1, \"¿Esta seguro de activar el registro?\", 'activar');\n });\n\t}", "hent() {\n // Bruker b_id'en til å hente infor om bestillingen\n s_bestilling.InfoBestilling(this.b_id, valgt => {\n this.valgt = valgt;\n });\n // Bruker b_id'en til å hente info om varene i bestillingen\n s_bestilling.InfoBestillingVarer(this.b_id, varer => {\n this.varer = varer;\n });\n this.visInfoPop();\n }", "function activacion(valor) {\n return valor >= 0 ? 1 : 0;//Devuelvo 1 o 0 dependiendo si la condicion se cumple\n }", "function activate() {\n\n\n }", "function activate() {\n\n }", "activated() {\n }", "function compagnie_acheter()\n{\n document.getElementById(\"jeu\").innerHTML = \"<h1>\" + document.getElementById(\"c\"+pos_actuelle()+\"_nom\").innerHTML + \"</h1>\" + \"<p> <input type=\\\"button\\\" id=\\\"bouton_acheter\\\" value=\\\"Acheter\\\"/></p>\";\n validation.innerHTML = bouton_passer;\n \n var b_p = document.getElementById(\"bouton_passer\");\n b_p.addEventListener(\"click\", passer,false);\n \n var b_a = document.getElementById(\"bouton_acheter\");\n b_a.addEventListener(\"click\", function()\n\t\t\t {\n\t\t\t if(joueurs[joueur_actuel].capital > 15000)\n\t\t\t {\n\t\t\t\t cases[pos_actuelle()] = {\"compagnie\" : true, \"nom\": joueurs[joueur_actuel].nom, \"id\": joueur_actuel};\n\t\t\t\t joueurs[joueur_actuel].compagnies += 1;\n\t\t\t\t joueurs[joueur_actuel].capital -= 15000;\n\t\t\t\t passer();\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t alert(\"pas assez d'argent\");\n\t\t\t }\n\t\t\t \n\t\t\t },false);\n}", "function need_money(dette)\n{\n if(joueurs[joueur_actuel].capital > dette)\n {\n\tjoueurs[joueur_actuel].capital -= dette;\n\tpasser();\n }\n else\n {\n\talert(\"pas assez d'argent\");\n\tvalidation.innerHTML = bouton_payer + \" \" + bouton_prison;\n\tvar b_p = document.getElementById(\"bouton_payer\");\n\tb_p.addEventListener(\"click\", function(x)\n\t\t\t {\n\t\t\t\t need_money(x);\n\t\t\t }.bind(this, dette), false);\n\tvar b_s = document.getElementById(\"bouton_prison\");\n\tb_s.addEventListener(\"click\", function()\n\t\t\t {\n\t\t\t\t joueurs[joueur_actuel].prison = true;\n\t\t\t\t passer();\n\t\t\t }, false);\n }\n}", "_valueChanged() {\n // Send a global refresh to the bapge body.\n var event = new Event(\"change\");\n this._root.dispatchEvent(event);\n }", "activate() {\n this.update();\n }", "function achatItem3Lvl3() {\n affichagePrixItem3Lvl3.innerHTML = \"OBTENU\";\n boutonItem3Lvl3.disabled = true;\n boutonItem3Lvl3.style.border = \"inherit\";\n clickRessource3 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item3Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item3Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl3Vide\").src= \"assets/img/pioche3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "changerJoueur() {\n this.indexJoueurActuel = !this.indexJoueurActuel;\n }", "value(value) {\n this.performAction();\n this.activeId = value;\n this.performAction();\n }", "function activate()\n {\n var initForm = () =>\n {\n if (vm.purchaseEntityComponentBindingOut)\n {\n if (vm.id && vm.id != -1)\n { \n vm.resource.loadAsResource( vm.id, \n entity => {\n vm.title = 'Compra #'+entity.number;\n vm.purchaseEntityComponentBindingOut.entity.set(entity);\n vm.purchaseEntityComponentBindingOut.showEditableFields.set(false);\n }\n );\n }\n else\n {\n vm.title = 'Nueva compra';\n\n let newPuchase = {\n idUser: vm.idUser\n }\n\n vm.purchaseEntityComponentBindingOut.entity.set(newPuchase);\n vm.purchaseEntityComponentBindingOut.showEditableFields.set(true);\n }\n }\n else\n $timeout(initForm, 100);\n \n };\n\n initForm();\n }", "function achatItem1Lvl3() {\n affichagePrixItem1Lvl3.innerHTML = \"OBTENU\";\n boutonItem1Lvl3.disabled = true;\n boutonItem1Lvl3.style.border = \"inherit\";\n clickRessource1 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item1Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item1Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem1lvl3Vide\").src= \"assets/img/lance3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function compagnie_loyer()\n{\n if(cases[pos_actuelle()].id == joueur_actuel)\n {\n\tdocument.getElementById(\"jeu\").innerHTML = \"Vous etes chez vous\";\n\tvalidation.innerHTML = bouton_passer;\n\tvar b_p = document.getElementById(\"bouton_passer\");\n\tb_p.addEventListener(\"click\", passer, false);\n }\n else\n {\n\tvar dette = \n\t document.getElementById(\"jeu\").innerHTML = des_actuel * ((joueurs[cases[pos_actuelle()].id].compagnies == 1) ? 4 : 10) * 100;\n\tjeu.innerHTML = \"Vous etes chez la compagnie de \" + cases[pos_actuelle()].nom + \", vous devez payer \" + dette + \".\";\n\tvalidation.innerHTML = \"<input type=\\\"button\\\" id=\\\"bouton_loyer\\\" value=\\\"payer\\\"/>\";\n\tb_l = document.getElementById(\"bouton_loyer\");\n\tb_l.addEventListener(\"click\", need_money.bind(this, dette), false);\n }\n}", "function activate() {\n\t\t}", "niveauSuivant()\r\n\t{\r\n\t\tthis._termine = false;\r\n\t\tthis._gagne = false;\r\n\t\tthis._niveau++;\r\n\t\tthis.demarrerNiveau();\r\n\t}", "changeMode() {\n this.attendBooths = !this.attendBooths;\n }", "function achatItem2Lvl3() {\n affichagePrixItem2Lvl3.innerHTML = \"OBTENU\";\n boutonItem2Lvl3.disabled = true;\n boutonItem2Lvl3.style.border = \"inherit\";\n clickRessource2 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item2Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item2Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem2lvl3Vide\").src= \"assets/img/hache3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function achatItem3Lvl2() {\n affichagePrixItem3Lvl2.innerHTML = \"OBTENU\";\n boutonItem3Lvl2.disabled = true;\n boutonItem3Lvl2.style.border = \"inherit\";\n clickRessource3 = 4;\n ressource1.innerHTML = ressource1.innerHTML - prix1Item3Lvl2;\n ressource2.innerHTML = ressource2.innerHTML - prix2Item3Lvl2;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl2Vide\").src= \"assets/img/pioche2Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils2();\n }", "function ajoutPb(){\n\tlet pb=prompt('Signaler un problème :');\n\t$.post(\"php/ajout-probleme.php\",{id:$(this).data('id'),pb:pb},validePb);\n}", "editarFalse1() {\n this.activarPersonal = true;\n }", "OnActivated() {}", "planConstruction(model,planConstructionNode){\n model.user.params.planConstructionActive=true;\n model.user.params.cosmogole = model.user.params.cosmogole - model.user.planConstruction.prix;\n planConstructionNode.removeEventListener(\"click\",this.planConstruction);\n planConstructionNode.remove();\n let complite = (res)=>{\n document.dispatchEvent(this.pompeEvent);\n }\n let data = \"cosmogole=\"+model.user.params.cosmogole+\"&planConstructionActive=true\";\n model.loadData(\"post\",'/update',{data,complite});\n }", "function achatItem2Lvl2() {\n affichagePrixItem2Lvl2.innerHTML = \"OBTENU\";\n boutonItem2Lvl2.disabled = true;\n boutonItem2Lvl2.style.border = \"inherit\";\n clickRessource2 = 4;\n ressource1.innerHTML = ressource1.innerHTML - prix1Item2Lvl2;\n ressource2.innerHTML = ressource2.innerHTML - prix2Item2Lvl2;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem2lvl2Vide\").src= \"assets/img/hache2Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils2();\n }", "function ActionMoi(valeur)\r\n{\r\n\tclearInterval(chrono);\r\n\ttemps = 100;\r\n\tSetActionMoi(valeur);\r\n\tTourSuivantVerification();\r\n}", "function falso(v) {\n\n boton.disabled = false;\n\n boton.addEventListener(\"click\", function () {\n isNotTrue(v);\n\n boton.style.display = \"none\";\n });\n\n}", "run() {\n if (this.active) {\n const value = this.get()\n if (\n value !== this.value\n ) {\n // set new value\n const oldValue = this.value\n this.value = value\n this.cb.call(this.vm, value, oldValue)\n }\n }\n }", "function aller_a(num_case, message)\n {\n\tdocument.getElementById(\"jeu\").innerHTML = message;\n\tvalidation.innerHTML = \"<input type=\\\"button\\\" id=\\\"bouton_validation\\\" value=\\\"Avancer\\\"/>\";\n\tjoueurs[joueur_actuel].position = num_case;\n\tvar avancer = document.getElementById(\"bouton_validation\");\n\tavancer.addEventListener(\"click\", avance, false);\n }", "function noweKonto(){\r\n clicked = true;\r\n}", "_activate(){\n\n console.log( this.reproduccion)\n\n this.id_reproduccion_actual = this._$state.params.id_reproduccion;\n\n\n this._cargarDatosVista();\n\n\n\n }", "function achatItem3Lvl1() {\n affichagePrixItem3Lvl1.innerHTML = \"OBTENU\";\n boutonItem3Lvl1.disabled = true;\n boutonItem3Lvl1.style.border = \"inherit\";\n clickRessource3 = 2;\n ressource1.innerHTML = ressource1.innerHTML - prixItem3Lvl1;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl1Vide\").src= \"assets/img/pioche1Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils1(); \n }", "clicked() {\r\n if (this.life === 0) {\r\n this.status = 1;\r\n this.life = 1;\r\n }else if (this.life === 1) {\r\n this.status = 0;\r\n this.life = 0;\r\n }\r\n }", "function achatItem1Lvl2() {\n affichagePrixItem1Lvl2.innerHTML = \"OBTENU\";\n boutonItem1Lvl2.disabled = true;\n boutonItem1Lvl2.style.border = \"inherit\";\n clickRessource1 = 4;\n ressource1.innerHTML = ressource1.innerHTML - prix1Item1Lvl2;\n ressource2.innerHTML = ressource2.innerHTML - prix2Item1Lvl2;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem1lvl2Vide\").src= \"assets/img/lance2Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils2();\n }", "function actualizarEstadoBoton(boton){\n \n if (boton.disabled){\n alert(\"true\");\n boton.disabled=\"false\";\n boton.value=\"Enviar\";\n }\n else{\n alert(\"false\");\n boton.disabled=\"true\";\n boton.value=\"Enviando\";\n }\n}", "setIsAlive(value) {\n if (value){\n this.isAlive = true;\n } else {\n this.isAlive = false;\n }\n }", "function atk(){\n\t\t\n if (butAtk.disabled == false && manaPerso.value >= manaAtk){\n\t\t\n ciblerMonstre();\n vieMonCib.value -= atkPerso;\n vieMonCib.innerHTML = vieMonCib.value;\n testMortMonstre();\n\n \n description.innerHTML = \"Il avez infligé \"+atkPerso+\" points de dégats. Il a consomé \"+manaAtk+\" points de Mana.\";\n \n\t\tbutAtk.disabled = true;\n\t\tbutDef.disabled = true;\n\t\tbutSpe.disabled = true;\n\t\t\n }\t\n else{\n description.innerHTML = \"Vous n'avez plus assez de Mana.\";\n selectionAction();\n }\n}", "function habilitarBoton(){\n\t\toFormObject = document.forms['formPalabraEncontrada'];\n\t\tvar botonEnviar = document.getElementById('botonPalabraEncontrada');\n\t\tif (palabraEncontrada == false) {\n\t\t\tbotonEnviar.disabled = true;\n\t\t}else{\n\t\t\toFormObject.elements[\"xyLetras\"].value = xyLetras;\n\t\t\toFormObject.elements[\"xy\"].value = xy;\n\t\t\toFormObject.elements[\"tamC\"].value = tamCadena;\n\t\t\tbotonEnviar.disabled = false;\n\t\t}\n\t}", "function boucleJeu() {\n\n var nouvelInterval = Date.now();\n\n\n\n //SI au premier instant du jeu on initialise le debut de l'interval a quelque chose\n if (!debutInterval) {\n debutInterval = Date.now();\n }\n\n gestionnaireObjets.repositionnerObjets(Bouteille, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Obstacle, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Voiture, nouvelInterval);\n\n\n //Si le nouveau temps est plus grand que l'accelaration souhaiter par rapport au début de l'interval\n if (nouvelInterval - debutInterval >= 20) {\n vitesseRoute += 0.005;\n\n debutInterval = nouvelInterval;\n }\n\n //Appliquer les déplacements\n gestionnaireObjets.deplacerLesObjets(vitesseRoute);\n }", "transfertConnaissance(model,transfertConnaissanceNode){\n model.user.params.transfertConnaissanceActive=true;\n model.user.params.cosmogole = model.user.params.cosmogole - model.user.transfertConnaissance.prix;\n transfertConnaissanceNode.removeEventListener(\"click\",this.transfertConnaissance);\n transfertConnaissanceNode.remove();\n let complite = (res)=>{\n document.dispatchEvent(this.pompeEvent);\n }\n let data = \"cosmogole=\"+model.user.params.cosmogole+\"&transfertConnaissanceActive=true\";\n model.loadData(\"post\",'/update',{data,complite});\n }", "function activar1(quien, objeto) {\r\n if (objeto === void 0) { objeto = 'batisenal'; }\r\n var mensaje = quien + \" activo la \" + objeto;\r\n console.log('El mensaje es: ', mensaje);\r\n}", "engage() {\n\n this.value = this.incomingSignal;\n this.incomingSignal = 0;\n\n //bias is always 1.\n if (this.type == 'b') {\n this.value = 1;\n }\n }", "function SesionActivada(val, idCurso) {\n if (val == true) {\n activarSesionCard.hide();\n ListarAsistenciasPorSesion(idCurso);\n asistEstudiantesCard.show();\n } else {\n activarSesionCard.show();\n asistEstudiantesCard.hide();\n }\n}", "function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}", "avancer() {\n\t\tlet fermee = this.cellule.ouverture(this.direction);\n\t\tif (fermee) { //il y a un mur\n\t\t\treturn this.finMouvement();\n\t\t} else if (this.verifierBlocage()===true) { //la porte est bloquee\n return this.finMouvement();\n }\n\t\tthis.visuel.style.transitionDuration = (this.animMouvement) + \"ms\";\n\t\tthis.cellule = this.cellule.voisine(this.direction);\n\n console.log(\"Déplacement: \"+[\"↑\",\"→\",\"↓\",\"←\"][this.direction]+\" / \"+this.cellule.infoDebogage());\n\n\t\tthis.visuel.addEventListener('transitionend', this.evt.visuel.transitionend);\n\t}", "awake()\n {\n }", "toMatchBetToBalanceEvent () {\n this.getInst('ControlDesktopViewHandler').toMatchBetToBalanceShow();\n }", "onActiveChange(value) {\n if (!value) {\n this.onBlur()\n }\n }", "function basculeJoueur() {\r\n //Verifie si il reste des tours\r\n endgame();\r\n //Change la valeur du joueur actif\r\n if (playerActive === 2) {\r\n playerActive = 1;\r\n } else if (playerActive === 1) {\r\n playerActive = 2;\r\n }\r\n //Reinitialise le compteur de tours du place jeton\r\n i = 0;\r\n //Rappel le tour joueur\r\n tourJoueur();\r\n}", "function OnClickObjectiveOk()\n{\n SetActive('#LO', false);\n SetActive('#MainMenu', false);\n SetActive('#L1', true);\n SetActive(i_BrainInsId,true,0.1);\n SetActive(fullBodylvlId,true,0.01);\n StopVO2('#p_objective');\n PlayVO2(click_on_brainId);\n}", "function achatItem2Lvl1() {\n affichagePrixItem2Lvl1.innerHTML = \"OBTENU\";\n boutonItem2Lvl1.disabled = true;\n boutonItem2Lvl1.style.border = \"inherit\";\n clickRessource2 = 2;\n ressource1.innerHTML = ressource1.innerHTML - prixItem2Lvl1;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem2lvl1Vide\").src= \"assets/img/hache1Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils1();\n }", "beber_cerveza(power_up){\n power_up.scene.alcohol.aumentar_ebriedad(15);\n power_up.destroy();\n }", "bestilt() {\n // Går gjennom varene og setter statusen på bestillingen til \"bestilt\" og varene til \"på lager\"\n for (var i = 0; i < this.varer.length; i++) {\n s_statuser.Bestilt(this.varer[i].v_id, this.b_id);\n }\n this.mounted();\n this.hent();\n }", "function continuaEscriure ()\r\n{\r\n this.borra ();\r\n this.actual=\"\";\r\n this.validate=0;\r\n}", "activate() {\n\t\tthis.active = true;\n\t\tthis.duration = this.savedDuration;\n\t\tif (this.partial) {\n\t\t\tthis.cycle = Math.ceil((1/this.density));\n\t\t}\n\t\telse {\n\t\t\tthis.cycle = 1;\n\t\t}\n\t\tthis.counter = 0;\n\t}", "finirLeTour() {\n switch (this.etat) {\n case ETAT_INITIALISATION:\n default:\n // Appel à \"finirLeTour\" lorsque la game est en initialisation (case ETAT_INITIALISATION)\n // OU dans un état inconnu (default case).\n console.log(\"DEFAULT CASE !\");\n break;\n case ETAT_DEPLACEMENT:\n this.changerJoueur();\n this.joueurs[this.indexJoueurActuel].casesPossiblesDeplacement();\n break;\n case ETAT_COMBAT:\n console.log(\"FIGHT CASE !\");\n // On change de joueur\n this.changerJoueur();\n\n // Pour chaque \"paire\" de boutons (1 paire par joueur)\n this.boutons.forEach((pair, idx) => {\n // On désactive les boutons si ceux-ci font partie de l'objet \"pair\"\n // qui correspond au joueur dont le tour est terminé.\n pair.attaquer[0].disabled = idx === this.indexAutreJoueur;\n pair.defendre[0].disabled = idx === this.indexAutreJoueur;\n });\n break;\n }\n }", "function onClick(e) {\n let cantSalvo = tableroSalvo.querySelectorAll(\".active\").length;\n let ajeno = tableroNaves.querySelectorAll(\".hit\").length + tableroNaves.querySelectorAll(\".fail\").length;\n let propio = tableroSalvo.querySelectorAll(\".hit\").length + tableroSalvo.querySelectorAll(\".fail\").length;\n\n if(e.target.classList.contains(\"active\")) {\n e.target.classList.remove(\"active\");\n cantSalvo--;\n } else if(cantSalvo < 5) {\n e.target.classList.add(\"active\");\n cantSalvo++;\n }\n\n if (cantSalvo < 5 || app.turnos(propio, ajeno)) {\n document.querySelector(\".btnShot\").setAttribute(\"disabled\", \"true\");\n } else {\n document.querySelector(\".btnShot\").removeAttribute(\"disabled\");\n }\n}", "function Update () { \n\tif (Input.GetMouseButton(0)){\n\t\tvar hit : RaycastHit;\n\t\tif (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), hit, 50)){\n\t\t\tif (hit.transform.tag == \"Item\"){\n\t\t\t\thit.transform.gameObject.BroadcastMessage(\"changeActivation\");\n\t\t\t}\n\t\t}\n\t\t//test.BroadcastMessage(\"changeActivation\");\n\t}\n}", "clickPay() {\n // Destructuring vehicle dalam state biar lebih ringkas\n const { vehicle } = this.state;\n\n // Menjalankan SweetAlert confirmation\n Swal.fire({\n title: `Parking ${vehicle} for ${this.props.parkDuration} hour${\n this.props.parkDuration > 1 ? \"s\" : \"\"\n }\\n(Rp ${this.props.parkPayment})`,\n text: \"Confirm payment?\",\n showCancelButton: true,\n confirmButtonColor: \"#3085d6\",\n cancelButtonColor: \"#d33\",\n confirmButtonText: \"Confirm\"\n }).then(result => {\n // Kalau klik confirmed, akan menjalankan SweetAlert\n if (result.value) {\n Swal.mixin({\n toast: true,\n position: \"center\",\n showConfirmButton: false,\n timer: 1500,\n onOpen: toast => {\n toast.addEventListener(\"mouseenter\", Swal.stopTimer);\n toast.addEventListener(\"mouseleave\", Swal.resumeTimer);\n }\n }).fire({\n text: \"Your payment has been confirmed.\",\n icon: \"success\"\n });\n\n // setelah menjalankan SweetAlert, seluruh state di reset\n this.props.paymentPark(0, 0);\n this.setState({ clicked: 0 });\n\n // kemudian menjalankan render kembali dengan INITIAL_STATE\n this.renderParkingCalc();\n }\n });\n }", "placeBet() {\n $(\"#bet\").on(\"click\", () => {\n if (this.currentBet > 0) {\n this.deal();\n this.afterPlaceBet();\n this.checkPlayerBlackjack();\n if(this.dealerHand[0].icon !== \"ace\"){\n this.checkDealerBlackjack();\n }\n }\n });\n }", "function gereTourCombat() {\r\n // SI tourJoueur1 = 0 au départ TOUR JOUEUR 1\r\n if(tourJoueur1 < 1) { // tourJoueur1 vaut 0 au début\r\n joueur2.passeSonTourAu(joueur1); // Change le texte de MON TOUR dans l'ATH des joueurs en OUI ou NON\r\n AttaqueOuDefense(); // Demande au joueur 2 de choisir si il attaque ou se défend\r\n tourJoueur1++; // mais il vaudra 1 pour la fonction et pour passer de tour\r\n } else {\r\n joueur1.passeSonTourAu(joueur2);\r\n AttaqueOuDefense();\r\n tourJoueur1--;\r\n }\r\n}", "function deactivate() {\n vaas.deactivate();\n}", "function buttonState(inputValue) {\n // necesito una variable para guardar inputValue: DONE (86)\n // necesito una variable para controlar el estado del boton: DONE (87)\n // necesito comprobar el valor de mi variable: DONE (89)\n // si mi variable tiene algo --> cambio el valor del estado del boton: DONE (90)\n\n let bState = false; //Definir el estado inicial del boton --> deshabilitado \n\n if (inputValue) { // Condicional\n bState = true; // Estado final del algoritmo\n } \n}", "champChanged(val) {\n\t\tthis.setState({\n\t\t\tchamp: val\n\t\t});\n\t}", "function activar(per_id){\n\tbootbox.confirm(\"¿Esta seguro de activar la persona?\",function(result){\n\t\tif (result) {\n\t\t\t$.post(\"../ajax/persona.php?op=activar\", {per_id : per_id}, function(e){\n\t\t\t\tbootbox.alert(e);\n\t\t\t\ttabla.ajax.reload();\n\t\t\t});\n\t\t}\n\t})\n}", "function addListenerChange(numBureauPOI) {\n\n\t\t// Affichage des bonnes données selon le bureau choisi\n\t\tvar newBureauPOI;\n\t\tvar nbAssesseurValide = 0;\n\t\tvar nbScrutateurValide = 0;\n\n\t\t// Retrait des affectation de l'evenement change\n\t\t$('#bureauxPOI'+numBureauPOI).off(\"change\");\n\n\t\t// Ajout de l'affectation de l'evenement change\n\t\t$('#bureauxPOI'+numBureauPOI).change(function(){\n\n\t\t\t// Récupération de la valeur de la liste\n\t\t\tnewBureauPOI = $( this ).val();\n\n\t\t\t// Récupération des informations sur le bureau\n\t\t\t$.ajax({\n\t\t\t url: 'bureaux/'+newBureauPOI,\n\t\t\t type: \"GET\",\n\t\t\t dataType: \"text\",\n\t\t\t contentType: \"application/json\",\n\t\t\t //async: false, // Mode synchrone\n\t\t\t cache: false,\n\t\t\t timeout: 5000,\n\n\t\t\t success: function(data) {\n\t\t\t \t// Parsage du JSON pour connaitre le nombre d'assesseurs et scrutateurs validés\n\t\t\t \tvar obj = JSON.parse(data);\n\n\t\t\t \t// Comptabilisation des assesseurs et scrutateurs\n\t\t\t \tobj.assesseurs.forEach(function(assesseur){\n\t\t\t \t\tif(assesseur.valide_assesseur==true){\n\t\t\t \t\t\tnbAssesseurValide++;\n\t\t\t \t\t}\n\t\t\t \t\tif(assesseur.valide_scrutateur==true){\n\t\t\t \t\t\tnbScrutateurValide++;\n\t\t\t \t\t}\n\t\t\t \t});\n\n\t\t\t },\n\n\t\t\t \tcomplete: function() {\n\n\t\t\t \t\t// Reinit de la partie des graphiques (évite le doubelement de taille)\n\t\t\t \t\tvar percentAss = nbAssesseurValide/NB_ASSESSEURS_MAX;\n\t\t\t \t\tvar percentScrut = nbScrutateurValide/NB_SCRUTATEURS_MAX;\n\n\t\t\t \t\t// Poucentage utilisé pour afficher le taux de remplissage d'un bureau\n\t\t\t \t\tpercentAss = adjust(percentAss);\n\t\t\t \t\tpercentScrut= adjust(percentScrut);\n\n\t\t\t \t\t// Variables concernant les graphiques\n\t\t\t \t\tvar ctxAss = document.getElementById(\"graphContenuAssesseur\"+numBureauPOI);\n\t\t\t \t\tvar ctxScrut = document.getElementById(\"graphContenuScrutateur\"+numBureauPOI);\n\n\t\t\t\t\tvar myDoughnutAss;\n\t\t\t\t\tvar myDoughnutScrut;\n\n\t\t\t\t\tvar colorAss;\n\t\t\t\t\tvar colorScrut;\n\n\t\t\t\t\tvar resteAss = getReste(NB_ASSESSEURS_MAX, nbAssesseurValide);\n\t\t\t\t\tvar resteScrut = getReste(NB_SCRUTATEURS_MAX, nbScrutateurValide);\n\n\t\t\t\t\t// Affichage du pourcentage correspondant\n\t\t\t\t\t$(\".percentAss\").text(auMillieme((percentAss*100))+\"%\");\n\t\t\t \t\t$(\".percentScrut\").text(auMillieme((percentScrut*100))+\"%\");\n\n\t\t\t \t\t$(\".nbAssesseurs\").text(nbAssesseurValide);\n\t\t\t \t\t$(\".nbScrutateurs\").text(nbScrutateurValide);\n\n\t\t\t \t\t// Attribution de la bonne couleur suivant le pourcentage\n\t\t\t\t\tcolorAss = getColor(percentAss);\n\t\t\t\t\tcolorScrut = getColor(percentScrut);\n\n\t\t\t\t\t// La construction des graphiques\n\t\t\t\t\t// Graphique assesseurs\n\t\t\t \t\tmyDoughnutAss = new Chart(ctxAss, {\n\t\t\t\t\t type: 'doughnut',\n\t\t\t\t\t data: {\n\t\t\t\t\t\t labels: [\n\t\t\t\t\t\t \"Inscrits\",\n\t\t\t\t\t\t \"Places restantes\"\n\t\t\t\t\t\t ],\n\t\t\t\t\t\t datasets: [\n\t\t\t\t\t\t {\n\t\t\t\t\t\t data: [nbAssesseurValide, resteAss],\n\t\t\t\t\t\t backgroundColor: [\n\t\t\t\t\t\t colorAss,\n\t\t\t\t\t\t \"#F2F2F2\"\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t }]\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t \t\t// Grapgique scrutateurs\n\t\t\t\t\tmyDoughnutScrut = new Chart(ctxScrut, {\n\t\t\t\t\t type: 'doughnut',\n\t\t\t\t\t data: {\n\t\t\t\t\t\t labels: [\n\t\t\t\t\t\t \"Inscrits\",\n\t\t\t\t\t\t \"Places restantes\"\n\t\t\t\t\t\t ],\n\t\t\t\t\t\t datasets: [\n\t\t\t\t\t\t {\n\t\t\t\t\t\t data: [nbScrutateurValide, resteScrut],\n\t\t\t\t\t\t backgroundColor: [\n\t\t\t\t\t\t colorScrut,\n\t\t\t\t\t\t \"#F2F2F2\"\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t }]\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tnbAssesseurValide = 0;\n\t\t\t\t\tnbScrutateurValide = 0;\n\n\t\t\t\t\t// Choix du message\n\t\t\t\t\tif ((percentAss==1)&&(percentScrut==1)) {\n\t\t\t\t\t\t$(\"#msgNeed\").text(msgNotNeedYou);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$(\"#msgNeed\").text(msgNeedYou);\n\t\t\t\t\t}\n\n\t\t\t\t\t$(\".idBureau\").attr(\"value\", newBureauPOI);\n\n\t\t\t \t},\n\t\t\t\terror: function(xhr, status, error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}", "function PopupAcciones() {\n\n this.$id_boton_checklist = $('#id_boton_checklist')\n this.$id_boton_plan_auditoria = $('#id_boton_plan_auditoria')\n this.init_Events()\n}", "quienSoy(){\n console.log(`Mi clan es: ${this.clan}`);\n console.log('Mi funcion quienSoy padre es');\n super.quienSoy();\n }", "on() {\n\t\tthis._lamps.on();\n\t}", "intentarNuevamente() {\n\t\t\tthis.$refs.componenteEvaluacion.intentarNuevamente();\n\t\t}", "intentarNuevamente() {\n\t\t\tthis.$refs.componenteEvaluacion.intentarNuevamente();\n\t\t}", "intentarNuevamente() {\n\t\t\tthis.$refs.componenteEvaluacion.intentarNuevamente();\n\t\t}", "bouger()\r\n {\r\n this.gauche += Math.cos(this.angle) * this.vitesseX;\r\n this.haut += Math.sin(this.angle) * this.vitesseY;\r\n\r\n //Fonctions annexes\r\n this.limite();\r\n this.majHTML();\r\n }", "function onWentActive() {\n currentStatus = previousStatus;\n editStatusOverlaysAndSendUpdate();\n }", "function deactivate(){}", "function setLesionAsCompleted() {\n meCompletedLesions[meCurrentLesion] = 1;\n}", "onActivate(e) {}", "updateBB() {\n this.lastBB = this.BB;\n this.BB = new BoundingBox(this.x + 15, this.y, 45, 85);\n if (this.attackWindow) {\n let xOff = 0;\n switch (this.weapon) {\n case 0:\n ASSET_MANAGER.playAsset(\"./audio/kick.mp3\")\n if (this.facing === 0) xOff = 55;\n this.ABB = new BoundingBox(this.x + xOff, this.y + 50, 40, 20);\n break;\n case 1:\n ASSET_MANAGER.playAsset(\"./audio/sword_swing.mp3\");\n this.facing === 0 ? xOff = 40 : xOff = -60;\n this.ABB = new BoundingBox(this.x + xOff, this.y + 30, 85, 60);\n break;\n case 2:\n if (this.bowTime < 0.6 && this.bowTime > .4) {\n if (this.arrowFlag) {\n this.game.addEntity(new Arrow(this.game, this.x, this.y,\n this.facing === 1, true, this.hasIceArrow));\n this.hasIceArrow = false\n ASSET_MANAGER.playAsset(\"./audio/arrow_whoosh.mp3\")\n this.arrowFlag = false;\n }\n } else {\n this.bowTime = 0;\n }\n break;\n }\n } else {\n this.ABB = new BoundingBox(0, 0, 0, 0);\n }\n\n }", "activate(){\n\n let controller_obj = this;\n\n \n //this._cargarReproducciones( controller_obj );\n\n //console.log(this.reproducciones);\n\n // console.log(this.reproducciones)\n }", "function form_velo(){\n $(\"#selection\").attr(\"disabled\",true);\n //console.log(user_pseudo + \" \" + station_emprunt + \" \" + station_depot);\n $(\"main center\").remove();\n $(\"#affiche_emprunt\").text(\"Réserver votre vélo\");\n let recup3 = JSON.parse(httprequest.responseText);\n $(\".main\").append(recup3[6]);\n //console.log(num_depot);\n $(\"#valid_cb\").click(function(){\n let cb1 = $(\"#cb\").val();\n cb = cb1;\n //console.log(cb1);\n valider_ticket();\n \n $(\"#valid_cb\").attr(\"disabled\",true); //desactive la possibilité de réappuyer sur le bouton\n });\n}", "function avancer_reculer(nb_cases, message)\n {\n\tdocument.getElementById(\"jeu\").innerHTML = message ;\n\tvalidation.innerHTML = \"<input type=\\\"button\\\" id=\\\"bouton_validation\\\" value=\\\"\"+((nb_cases > 0) ? \"Avancer\" : \"Reculer\")+\"\\\"/>\";\n\tjoueurs[joueur_actuel].position+=nb_cases;\n\tif(joueurs[joueur_actuel].position < 0)\n\t{\n\t joueurs[joueur_actuel].position = 39;\n\t}\n\tvar bouger = document.getElementById(\"bouton_validation\");\n\tbouger.addEventListener(\"click\", avance, false);\n }", "utlevert() {\n // Går gjennom varene og setter statusen på bestillingen til \"utlevert\" og varene til \"utleid\"\n for (var i = 0; i < this.varer.length; i++) {\n s_statuser.Utlevert(this.varer[i].v_id, this.b_id);\n }\n this.mounted();\n this.hent();\n }", "function sendActividad (){\n\tTi.App.fireEvent(\"actividadSet\", {\n\t\t\tactividad: GLOBAL.actividad\n\t });\n\t}", "function valorBoton(valor){\n trianguloAparienciaInteraccion = true;\n trianguloAparienciaTono = true;\n trianguloAparienciaMirada = true;\n trianguloAparienciaLlanto = true;\n trianguloRespiracion = true;\n trianguloCirculacion = true;\n\n sistemaAlertaTemprana = 0;\n saveChild = 0;\n\n if (valor === 'despierto'){\n if(trianguloAparienciaInteraccion != false){\n trianguloAparienciaInteraccion = true;\n }\n sistemaAlertaTemprana += 0;\n saveChild += 0;\n\n btnConcienciaDespierto.disabled = true;\n btnConcienciaDormido.disabled = true;\n btnConcienciaIrritable.disabled = true;\n btnConcienciaConvulsiones.disabled = true;\n\n }else if(valor === 'dormido'){\n if(trianguloAparienciaInteraccion != false){\n trianguloAparienciaInteraccion = true;\n }\n sistemaAlertaTemprana += 1;\n saveChild += 0;\n\n btnConcienciaDespierto.disabled = true;\n btnConcienciaDormido.disabled = true;\n btnConcienciaIrritable.disabled = true;\n btnConcienciaConvulsiones.disabled = true;\n\n }else if(valor === 'irritable'){\n trianguloAparienciaInteraccion = false;\n sistemaAlertaTemprana += 2;\n saveChild += 3;\n\n btnConcienciaDespierto.disabled = true;\n btnConcienciaDormido.disabled = true;\n btnConcienciaIrritable.disabled = true;\n btnConcienciaConvulsiones.disabled = true;\n\n }else if(valor === 'convulsiones'){\n trianguloAparienciaInteraccion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 9;\n\n btnConcienciaDespierto.disabled = true;\n btnConcienciaDormido.disabled = true;\n btnConcienciaIrritable.disabled = true;\n btnConcienciaConvulsiones.disabled = true;\n\n }else if(valor === 'rosada'){\n if(trianguloCirculacion != false){\n trianguloCirculacion = true;\n }\n sistemaAlertaTemprana += 0;\n saveChild += 0;\n\n btnPielRosa.disabled = true;\n btnPielPalida.disabled = true;\n btnPielCiano.disabled = true;\n btnPielRubi.disabled = true;\n btnPielMarmo.disabled = true;\n btnPielPurpura.disabled = true;\n\n }else if(valor === 'palida'){\n if(trianguloCirculacion != false){\n trianguloCirculacion = true;\n } \n sistemaAlertaTemprana += 1;\n saveChild += 3;\n\n btnPielRosa.disabled = true;\n btnPielPalida.disabled = true;\n btnPielCiano.disabled = true;\n btnPielRubi.disabled = true;\n btnPielMarmo.disabled = true;\n btnPielPurpura.disabled = true;\n \n }else if(valor === 'cianotica'){\n trianguloCirculacion = false;\n sistemaAlertaTemprana += 2;\n saveChild += 9;\n\n btnPielRosa.disabled = true;\n btnPielPalida.disabled = true;\n btnPielCiano.disabled = true;\n btnPielRubi.disabled = true;\n btnPielMarmo.disabled = true;\n btnPielPurpura.disabled = true;\n \n }else if(valor === 'rubicunda'){\n trianguloCirculacion = false;\n sistemaAlertaTemprana += 2;\n saveChild += 9;\n\n btnPielRosa.disabled = true;\n btnPielPalida.disabled = true;\n btnPielCiano.disabled = true;\n btnPielRubi.disabled = true;\n btnPielMarmo.disabled = true;\n btnPielPurpura.disabled = true;\n \n }else if(valor === 'marmorea'){\n trianguloCirculacion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 9;\n\n btnPielRosa.disabled = true;\n btnPielPalida.disabled = true;\n btnPielCiano.disabled = true;\n btnPielRubi.disabled = true;\n btnPielMarmo.disabled = true;\n btnPielPurpura.disabled = true;\n \n }else if(valor === 'purpurica'){\n trianguloCirculacion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 9; \n\n btnPielRosa.disabled = true;\n btnPielPalida.disabled = true;\n btnPielCiano.disabled = true;\n btnPielRubi.disabled = true;\n btnPielMarmo.disabled = true;\n btnPielPurpura.disabled = true;\n \n }else if(valor === 'pielNormal'){\n saveChild += 0;\n btnHidraPielNml.disabled = true;\n btnHidraPielPastosa.disabled = true;\n }else if(valor === 'pielPastosa'){\n saveChild += 1.5;\n btnHidraPielNml.disabled = true;\n btnHidraPielPastosa.disabled = true;\n }else if(valor === 'mucosaNormal'){\n saveChild += 0;\n btnHidraMucosaNml.disabled = true;\n btnHidraMucosaSeca.disabled = true;\n }else if(valor === 'mucosaSeca'){\n saveChild += 1.5;\n btnHidraMucosaNml.disabled = true;\n btnHidraMucosaSeca.disabled = true;\n }else if(valor === 'ojoNormal'){\n saveChild += 0;\n btnHidraOjoNml.disabled = true;\n btnHidraOjoHundido.disabled = true;\n }else if(valor === 'ojoHundido'){\n saveChild += 1.5;\n btnHidraOjoNml.disabled = true;\n btnHidraOjoHundido.disabled = true;\n }else if(valor === 'vomitoPresente'){\n saveChild += 1.5;\n btnHidraVomitoPres.disabled = true;\n btnHidraVomitoAus.disabled = true;\n }else if(valor === 'vomitoAusente'){\n saveChild += 0;\n btnHidraVomitoPres.disabled = true;\n btnHidraVomitoAus.disabled = true;\n }else if(valor === 'toleraVO'){\n saveChild += 0;\n btnHidraTolera.disabled = true;\n btnHidraNoTolera.disabled = true;\n }else if(valor === 'noToleraVO'){\n saveChild += 1.5;\n btnHidraTolera.disabled = true;\n btnHidraNoTolera.disabled = true;\n }else if(valor === 'plieguePositivo'){\n saveChild += 1.5;\n btnHidraPlieguePos.disabled = true;\n btnHidraPliegueNeg.disabled = true;\n }else if(valor === 'pliegueNegativo'){\n saveChild += 0;\n btnHidraPlieguePos.disabled = true;\n btnHidraPliegueNeg.disabled = true;\n }else if(valor === 'actividadJuega'){\n if(trianguloAparienciaInteraccion != false){\n trianguloAparienciaInteraccion = true;\n }\n sistemaAlertaTemprana += 0;\n saveChild += 0;\n\n btnActividadJuega.disabled = true;\n btnActividadConfundido.disabled = true;\n btnActividadLetarg.disabled = true;\n btnActividadIncons.disabled = true;\n\n }else if(valor === 'actividadConfundido'){\n trianguloAparienciaInteraccion = false;\n sistemaAlertaTemprana += 2;\n saveChild += 3;\n\n btnActividadJuega.disabled = true;\n btnActividadConfundido.disabled = true;\n btnActividadLetarg.disabled = true;\n btnActividadIncons.disabled = true;\n\n }else if(valor === 'actividadLetargico'){\n trianguloAparienciaInteraccion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 3;\n\n btnActividadJuega.disabled = true;\n btnActividadConfundido.disabled = true;\n btnActividadLetarg.disabled = true;\n btnActividadIncons.disabled = true;\n\n }else if(valor === 'actividadInconsciente'){\n trianguloAparienciaInteraccion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 9;\n\n btnActividadJuega.disabled = true;\n btnActividadConfundido.disabled = true;\n btnActividadLetarg.disabled = true;\n btnActividadIncons.disabled = true;\n\n }else if(valor === 'eutonico'){\n if(trianguloAparienciaTono != false){\n trianguloAparienciaTono = true;\n }\n\n btnTonoEuto.disabled = true;\n btnTonoHiper.disabled = true;\n btnTonoHipo.disabled = true;\n\n }else if(valor === 'hipotonico' || valor === 'hipertonico'){\n trianguloAparienciaTono = false;\n\n btnTonoEuto.disabled = true;\n btnTonoHiper.disabled = true;\n btnTonoHipo.disabled = true;\n\n }else if(valor === 'mantieneMirada'){\n if(trianguloAparienciaMirada != false){\n trianguloAparienciaMirada = true;\n }\n saveChild += 0;\n\n btnMantieneMira.disabled = true;\n btnNoMantieneMira.disabled = true;\n btnNoDirigeMira.disabled = true;\n\n }else if(valor === 'noMantieneMirada'){\n trianguloAparienciaMirada = false;\n saveChild += 3;\n\n btnMantieneMira.disabled = true;\n btnNoMantieneMira.disabled = true;\n btnNoDirigeMira.disabled = true;\n\n }else if(valor === 'noDirigeMirada'){\n trianguloAparienciaMirada = false;\n saveChild += 9;\n\n btnMantieneMira.disabled = true;\n btnNoMantieneMira.disabled = true;\n btnNoDirigeMira.disabled = true;\n\n }else if(valor === 'llantoFuerte'){\n if(trianguloAparienciaLlanto != false){\n trianguloAparienciaLlanto = true;\n }\n saveChild += 0;\n\n btnLlantoFuerte.disabled = true;\n btnLlantoDebil.disabled = true;\n\n }else if(valor === 'llantoDebil'){\n trianguloAparienciaLlanto = false;\n saveChild += 3;\n\n btnLlantoFuerte.disabled = true;\n btnLlantoDebil.disabled = true;\n\n }else if(valor === 'llantoConsolable'){\n if(trianguloAparienciaLlanto != false){\n trianguloAparienciaLlanto = true;\n }\n saveChild += 0;\n\n btnLlantoConso.disabled = true;\n btnLlantoInconso.disabled = true;\n\n }else if(valor === 'llantoInconsolable'){\n trianguloAparienciaLlanto = false;\n saveChild += 9;\n\n btnLlantoConso.disabled = true;\n btnLlantoInconso.disabled = true;\n \n }else if(valor === 'ruidoAusente'){\n if(trianguloRespiracion != false){\n trianguloRespiracion = true;\n }\n sistemaAlertaTemprana += 0;\n saveChild += 0;\n\n btnRuidoPres.disabled = true;\n btnRuidoAus.disabled = true;\n\n }else if(valor === 'gruñido'){\n trianguloRespiracion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 3;\n }else if(valor === 'estridor | disfonia'){\n trianguloRespiracion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 3;\n }else if(valor === 'quejido'){\n trianguloRespiracion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 3;\n }else if(valor === 'silibancias'){\n trianguloRespiracion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 3;\n }else if(valor === 'dificultadAusente'){\n if(trianguloRespiracion != false){\n trianguloRespiracion = true;\n }\n sistemaAlertaTemprana += 0;\n saveChild += 0;\n\n btnDificultadPres.disabled = true;\n btnDificultadAus.disabled = true;\n\n }else if(valor === 'tiraje intercostal'){\n trianguloRespiracion = false;\n sistemaAlertaTemprana += 1;\n saveChild += 3;\n }else if(valor === 'retraccion xifeoidea'){\n trianguloRespiracion = false;\n sistemaAlertaTemprana += 2\n saveChild += 9;\n }else if(valor === 'aleteo nasal'){\n trianguloRespiracion = false;\n sistemaAlertaTemprana += 2;\n saveChild += 9;\n }else if(valor === 'disosiacion toraco-abdominal'){\n trianguloRespiracion = false;\n sistemaAlertaTemprana += 3;\n saveChild += 9;\n }else if(valor === 'posicionAusente'){\n if(trianguloRespiracion != false){\n trianguloRespiracion = true;\n }\n sistemaAlertaTemprana += 0;\n\n btnPosicionPres.disabled = true;\n btnPosicionAus.disabled = true;\n \n }else if(valor === 'tripode'){\n trianguloRespiracion = false;\n }else if(valor === 'olfateo'){\n trianguloRespiracion = false;\n }else if(valor === 'cabeceo'){\n trianguloRespiracion = false;\n }else if(valor === 'antecedentesPresentes'){\n saveChild += 3;\n\n btnAntecedentesPres.disabled = true;\n btnAntecedentesAus.disabled = true;\n\n }else if(valor === 'antecedentresAusentes'){\n saveChild += 0;\n\n btnAntecedentesPres.disabled = true;\n btnAntecedentesAus.disabled = true;\n\n }else if(valor === 'abusoPresente'){\n saveChild += 3;\n\n btnAbusoPres.disabled = true;\n btnAbusoAus.disabled = true;\n\n }else if(valor === 'abusoAusente'){\n saveChild += 0;\n\n btnAbusoPres.disabled = true;\n btnAbusoAus.disabled = true;\n }\n}", "function ClickDescansar(valor) {\n // Cura letal e nao letal.\n EntradasAdicionarFerimentos(-PersonagemNivel(), false);\n EntradasAdicionarFerimentos(-PersonagemNivel(), true);\n EntradasRenovaSlotsFeiticos();\n AtualizaGeralSemLerEntradas();\n AtualizaGeral();\n}", "function fAppMeteo() {\n $(\"#bokm\").click(fAffMeteo);\n}", "function potActive(value) { \n if (pots[0] == null) {\n pots.push(value); \n } else {\n pots.push(value); \n if (pots[0] < pots[1]) { \n arduino.disableAnalogPin(pots[0]);\n pots[0] = pots[1];\n pots.length = 1;\n } else {\n arduino.disableAnalogPin(pots[0]); \n arduino.disableAnalogPin(pots[1]);\n pots[0] = pots[1];\n pots.length = 1;\n } \n }\n\n arduino.enableAnalogPin(value);\n pot = arduino.getAnalogPin(value);\n pot.clear(); \n currentEq = Scaler.LINEAR;\n smooth = new Convolution(Convolution.MOVING_AVERAGE);\n triggerPoint = new TriggerPoint();\n scalerFilter = new Scaler(0, 1, potMinValue, potMaxValue, Scaler.LINEAR); \n pot.addFilter(smooth);\n pot.addFilter(scalerFilter); \n pot.addEventListener(PinEvent.CHANGE, onPotChange);\n }", "function fl_outToBible_btn ()\n\t\t{\n\t\t\t if(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\t }\n\t\t\n\t\t}", "function onloevha() {\n}", "_updateStateOnClick() {\n const that = this;\n\n that._changeCheckState();\n that.focus();\n }", "function tirer_carte(f)\n{\n document.getElementById(\"jeu\").innerHTML = \"Tirez une carte\" + ((f) ? \"Chance\" : \"Communauté\") + \".\";\n validation.innerHTML = \"<input type=\\\"button\\\" value=\\\"Tirer une carte\\\" id=\\\"bouton_validation\\\"/>\";\n var v = document.getElementById(\"bouton_validation\");\n if(f)\n {\n v.addEventListener(\"click\", chance.bind(this, 1 + (0|Math.random()* 7)), false)\n }\n else\n {\n\tv.addEventListener(\"click\", caisse.bind(this, 1 + (0|Math.random()* 14)), false)\n }\n}" ]
[ "0.62998134", "0.5957227", "0.5834577", "0.5816229", "0.58057374", "0.57961804", "0.57553494", "0.57021916", "0.56724715", "0.56668687", "0.56640667", "0.565835", "0.55882996", "0.55853593", "0.55728674", "0.55620223", "0.5554889", "0.55506456", "0.55473113", "0.55411875", "0.5529066", "0.55113614", "0.5511232", "0.55026424", "0.5486299", "0.54844433", "0.54735875", "0.5465541", "0.5462041", "0.54527146", "0.5450318", "0.5442246", "0.5441958", "0.5429884", "0.5426636", "0.5417776", "0.541512", "0.53928703", "0.5389125", "0.5382309", "0.5355557", "0.53514576", "0.5341349", "0.53356385", "0.5335443", "0.5328157", "0.5317868", "0.53144", "0.5312199", "0.53099525", "0.5309009", "0.53019714", "0.529869", "0.5297249", "0.5292462", "0.528866", "0.5288012", "0.52721363", "0.5267389", "0.52539736", "0.5252857", "0.52401096", "0.5232532", "0.5228404", "0.5225811", "0.521012", "0.5209856", "0.5207816", "0.520639", "0.52033985", "0.5196989", "0.51950455", "0.5177548", "0.5173958", "0.5172049", "0.51717496", "0.5164005", "0.51618564", "0.516143", "0.516143", "0.516143", "0.51609504", "0.5143834", "0.51397073", "0.5134053", "0.51323384", "0.51197594", "0.5118796", "0.51170063", "0.511646", "0.5092586", "0.5091993", "0.5088561", "0.5088047", "0.5082124", "0.50755197", "0.50754154", "0.50749993", "0.50656873", "0.5062199" ]
0.55310214
20
insert valid colors into the database here
async function validColors(){ await pool.query('insert into valid_colors(color_name,count) values($1,$2)') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function populatedColours() {\n for (let i = 0; i < validColors.length; i++) {\n await pool.query('INSERT INTO valid_color (color_name, count) VALUES($1, 0)', [validColours[i]]);\n }\n }", "function insertMasterData() {\n PaintColor.create(paintColors, function (err, paintColors) {\n if (err) {\n throw err;\n }\n\n log.info('Number of PaintColors created: %d', Object.keys(paintColors).length);\n endScript(callback);\n });\n }", "async function getValidColors(intake) {\n const sql = await pool.query(`SELECT * FROM validcolor WHERE popular=$1`, [intake])\n if (sql.rows.lenght == 0) {\n await pool.query(`INSERT INTO validcolor (popular) value ($1)`, [intake])\n }\n }", "function Validate_colour() {\n\tcolour_entry = document.getElementById(\"colour\");\n\tcolour = colour_entry.value;\n\tre = /^#[0-9a-f]{6}$/i;\n\tif ( re.test(colour) ) {\n\t\tdocument.getElementById(\"colour_cell\").style.backgroundColor = colour;\n\t\treturn true;\n\t} else {\n\t\talert(\"Invalid colour. Use syntax '#dddddd'\");\n\t\tcolour_entry.value = '#';\n\t\tcolour_entry.focus();\n\t\tcolour_entry.select();\n\t\treturn false;\n\t}\n}", "function saveForm() {\n var colr = document.getElementById(\"color\").value;\n var num = document.getElementById(\"number\").value;\n db.transaction(function (tx) {\n tx.executeSql('INSERT INTO color_data (color, number) VALUES (' + num + ',\"' + colr + '\")');\n });\n msg = '<p>Log message created and row inserted.</p>';\n document.querySelector('#status').innerHTML = msg;\n}", "function colourNumOnLoad(cols)\n{\n\tfor(i in colorTypes)\n\t{\n\t\tdocument.getElementById(\"colourNum\" + colorTypes[i]).value = cols[i];\n\t\tdocument.getElementById(\"col\" + colorTypes[i]).bgColor=cols[i].replace(/0x/, \"#\");\n\t}\n}", "function setColors(colorArr){ //removed \"[]\"\n let i = 0;\n let len = colorArr.length;\n for(i = 0; i < len; i++){\n colorArr[i] = {red: randomInt(255), green: randomInt(255), blue: randomInt(255)};\n //TODO we will need to add a function that makes sure that no two colors are the same.\n //Maybe use a while loop? (RON)\n }\n}", "function changeColor(){\n\t\tnewColor = $('#color').val();\n\t\tif(validateCssColour(newColor)){\n\t\tmyColor = newColor;\n\t\t}else{\n\t\t\twindow.alert(\"Invalid Color Entry\");\n\t\t}\n}", "set extraColors(colors) {\n const final = [];\n colors.forEach(color => {\n const col = this._validHex(color);\n if (col) {\n final.push(col);\n }\n });\n this.extraColorsInner = final;\n }", "function addGroupColors() {\n\t//---Defines constant for errors and success messages---// \n\tconst confirm = \"<b>Informations : </b> Le groupe de couleurs à été ajouté avec succès !\";\n\tconst error = \"<b>Informations : </b>Tous les champs doivent être remplis\";\n\t//---Create my object---//\n\tlet groupColors = new GroupsColors();\n\tgroupColors.setName(document.getElementById(\"name_group_colors\").value);\n\tgroupColors.setUrl(document.getElementById('form_add_groups_colors').action);\n\n\t//---Use method create for create my color---//\n\tlet result = groupColors.create();\n\n\tif (result.confirm == \"success\") {\n\t\tnotify(\"pe-7s-refresh-2\", confirm, \"info\");\n\t\tdocument.getElementById(\"name_group_colors\").value = \"\";\n\t\t$(\"#tab_groups_colors\").DataTable().ajax.reload();\n\n\t} else {\n\t\tnotify(\"pe-7s-refresh-2\", error, \"danger\");\n\t}\n}", "function colorConverter (string) {\n \n// todo: study the Object.freeze \n const colorCodes = Object.freeze({\n \"blue\":\"rgb(40, 116, 237)\",\n \"brown\":\"rgb(255, 102, 102)\",\n \"brownish-red\":\"rgb(196, 136, 124)\",\n \"coral\":\"rgb(255, 102, 102)\",\n \"cream\":\"rgb(240, 237, 218)\",\n \"creamyWhite\":\"rgb(255, 253, 230)\",\n \"darkBlue\":\"rgb(0, 0, 153)\",\n \"darkPink\":\"rgb(255, 102, 153)\",\n \"darkPurple\":\"rgb(103, 0, 103)\",\n \"deepGreen\":\"rgb(0, 102, 0)\",\n \"deepPink\":\"rgb(212, 30, 90)\",\n \"emeraldGreen\":\"rgb(38, 115, 38)\",\n \"gold\":\"rgb(217, 195, 33)\",//stopped here, finish adding colors\n \"green\":\"rgb(50, 133, 59)\",\n \"greenish-white\":\"rgb(217, 242, 217)\",\n \"greenish-yellow\":\"rgb(230, 255, 179)\",\n \"indigoBlue\":\"rgb(74, 51, 222)\",\n \"lavender\":\"rgb(150, 153, 255)\",\n \"lightBlue\":\"rgb(179, 218, 255)\",\n \"lightGreen\":\"rgb(204, 255, 204)\",\n \"lightPink\":\"rgb(255, 204, 225)\",\n \"lilac\":\"rgb(230, 204, 255)\",\n \"magenta\":\"rgb(255, 0, 255)\",\n \"peach\":\"rgb(253, 217, 181)\",\n \"pink\":\"rgb(255, 102, 153)\",\n \"pinkish-lavender\":\"rgb(242, 211, 227)\",\n// \"purple and yellow\":\"rgba(0,100,0,0.75)\",//todo: need code instead of dark green\n \"purpleRed\":\"rgb(192, 0, 64)\",\n \"purplish-pink\":\"rgb(192, 96, 166)\",\n \"rose\":\"rgb(255, 153, 204)\",\n \"violet\":\"rgb(230, 130, 255)\",\n \"whiteAndPurple\":\"rgb(240, 240, 240)\",//todo: need code instead of dark green\n \"yellowish-green\":\"rgb(198, 210, 98)\", \n \"yellowCenter\":\"rgb(200, 200, 0)\"\n });\n \n //remove i_ (used to make inconspicuous) that might be in a name\n \n\t//if an rgb code is sent, return the color name\n if (string.slice(0,3) === \"rgb\") {\n for(let key in colorCodes) {\n if(colorCodes[key] === string) {\n return key;\n }\n }\n }\n //if a color name that needs to be converted is sent, return rgb\n else if (string in (colorCodes)) {\n return colorCodes[string];\n }\n //otherwise return a color name in camel case when needed\n //this is used when the color isn't listed in colorCodes, but\n //its name is valid as is or if converted to camel case notation\n else {\n return camelCase(string);\n }\n \n}", "function isValidColor(text) {\n return hexColorRegEx.test(text);\n}", "function replace_color() {\n const new_body = parseInt(nes_vals[0], 16)\n const new_feet = parseInt(nes_vals[1], 16)\n const new_border = parseInt(nes_vals[2], 16)\n\n for (var i = 0; i < color_locations.length; i++) {\n var colorAddress = color_locations[i]\n // Palette data is encoded as Body-Feet-Border indices\n rom[colorAddress] = new_body\n rom[colorAddress + 1] = new_feet\n rom[colorAddress + 2] = new_border\n }\n}", "function addcolorform()\n{\n\tcolor_name = $(\"#Color_name\").val();\n\trgbval1 = $(\"input[name=rgbval1]\").val();\n\trgbval2 = $(\"input[name=rgbval2]\").val();\n\trgbval3 = $(\"input[name=rgbval3]\").val();\n\tvar sessionlang = $(\"#languagecode\").val();\n\tvar translator = $('body').translate({t: dict});\n\tif($.trim(color_name)==\"\")\n\t{\n\t\t$(\"#colorerr\").show();\n\t\t$(\"#colorerr\").removeAttr('data-trn-key');\n\t\t$(\"#colorerr\").html(\"Enter color name\");\n\t\ttranslator.lang(sessionlang);\n\t\tsetTimeout(function() {\n\t\t\t $('#colorerr').fadeOut('slow');\n\t\t\t}, 5000);\n\t\t$(\"#Color_name\").val(\"\");\n\t\t$(\"#Color_name\").focus();\n\t\treturn false;\n\t}\n\tif($.trim(rgbval1)==\"\")\n\t{\n\t\t$(\"#colorerr\").show();\n\t\t$(\"#colorerr\").removeAttr('data-trn-key');\n\t\t$(\"#colorerr\").html(\"Enter R value\");\n\t\ttranslator.lang(sessionlang);\n\t\tsetTimeout(function() {\n\t\t\t $('#colorerr').fadeOut('slow');\n\t\t\t}, 5000);\n\t\t$(\"input[name=rgbval1]\").val(\"\");\n\t\t$(\"input[name=rgbval1]\").focus();\n\t\treturn false;\n\t}\n\tif(isNaN(rgbval1))\n\t{\n\t\t$(\"#colorerr\").show();\n\t\t$(\"#colorerr\").removeAttr('data-trn-key');\n\t\t$(\"#colorerr\").html(\"Enter valid R value\");\n\t\ttranslator.lang(sessionlang);\n\t\tsetTimeout(function() {\n\t\t\t $('#colorerr').fadeOut('slow');\n\t\t\t}, 5000);\n\t\t$(\"input[name=rgbval1]\").val(\"\");\n\t\t$(\"input[name=rgbval1]\").focus();\n\t\treturn false;\n\t}\n\tif($.trim(rgbval2)==\"\")\n\t{\n\t\t$(\"#colorerr\").show();\n\t\t$(\"#colorerr\").removeAttr('data-trn-key');\n\t\t$(\"#colorerr\").html(\"Enter G value\");\n\t\ttranslator.lang(sessionlang);\n\t\tsetTimeout(function() {\n\t\t\t $('#colorerr').fadeOut('slow');\n\t\t\t}, 5000);\n\t\t$(\"input[name=rgbval2]\").val(\"\");\n\t\t$(\"input[name=rgbval2]\").focus();\n\t\treturn false;\n\t}\n\tif(isNaN(rgbval2))\n\t{\n\t\t$(\"#colorerr\").show();\n\t\t$(\"#colorerr\").removeAttr('data-trn-key');\n\t\t$(\"#colorerr\").html(\"Enter valid G value\");\n\t\ttranslator.lang(sessionlang);\n\t\tsetTimeout(function() {\n\t\t\t $('#colorerr').fadeOut('slow');\n\t\t\t}, 5000);\n\t\t$(\"input[name=rgbval2]\").val(\"\");\n\t\t$(\"input[name=rgbval2]\").focus();\n\t\treturn false;\n\t}\n\tif($.trim(rgbval3)==\"\")\n\t{\n\t\t$(\"#colorerr\").show();\n\t\t$(\"#colorerr\").removeAttr('data-trn-key');\n\t\t$(\"#colorerr\").html(\"Enter B value\");\n\t\ttranslator.lang(sessionlang);\n\t\tsetTimeout(function() {\n\t\t\t $('#colorerr').fadeOut('slow');\n\t\t\t}, 5000);\n\t\t$(\"input[name=rgbval3]\").val(\"\");\n\t\t$(\"input[name=rgbval3]\").focus();\n\t\treturn false;\n\t}\n\tif(isNaN(rgbval3))\n\t{\n\t\t$(\"#colorerr\").show();\n\t\t$(\"#colorerr\").removeAttr('data-trn-key');\n\t\t$(\"#colorerr\").html(\"Enter valid B value\");\n\t\ttranslator.lang(sessionlang);\n\t\tsetTimeout(function() {\n\t\t\t $('#colorerr').fadeOut('slow');\n\t\t\t}, 5000);\n\t\t$(\"input[name=rgbval3]\").val(\"\");\n\t\t$(\"input[name=rgbval3]\").focus();\n\t\treturn false;\n\t}\n$(\"#colorerr\").html(\"\");\n}", "addColor(){ \n let duplicate = false;\n if (this.state.colors.length > 0){\n for(let i = 0; i < this.state.colors.length; i ++){\n if (this.formatColor(this.state.color) === this.state.colors[i])\n duplicate = true;\n }\n }\n if (!duplicate){\n this.setState({\n colors: this.state.colors.concat(this.formatColor(this.state.color)) \n });\n toast.success(\"Color added!\", {\n position: toast.POSITION.BOTTOM_CENTER,\n autoClose: 1500,\n hideProgressBar: true,\n className: \"toastr-success\"\n });\n } \n }", "set color(value) {}", "function seedDataBase (data, connection, table, callback) {\n var columns = '(id, name, company, colors, price)';\n var queryStart = `INSERT INTO ${table} ${columns} VAlUES `;\n\n for (let i = 0; i < data.length; i++) {\n var colorsJSON = JSON.stringify(data[i].colors);\n var id = i + 1;\n var dataString = `(${id}, '${data[i].name}', '${data[i].company}', '${colorsJSON}', '${data[i].price}');`;\n var query = queryStart + dataString;\n connection.query(query, (err, res) => {\n if (err) {\n callback(err, null);\n } else {\n callback(null, res);\n }\n });\n }\n}", "function checkPaletteValid(name, map) {\n var missingColors = VALID_HUE_VALUES.filter(function(field) {\n return !map[field];\n });\n if (missingColors.length) {\n throw new Error(\"Missing colors %1 in palette %2!\"\n .replace('%1', missingColors.join(', '))\n .replace('%2', name));\n }\n\n return map;\n }", "function setUp() {\n\t// make a table of colors\n\tvar table = document.createElement(\"table\");\n\tfor(var i = 0; i < colors.length; i+=3) {\n\t\tvar row = document.createElement(\"tr\");\n\t\t\n\t\tfor(var j = 0; j < 3; j++) {\n\t\t\tvar data = document.createElement(\"td\");\t\t\n\t\t\tdata.style.backgroundColor = colors[i + j];\t\n\t\t\t//add a click event\n\t\t\tdata.onclick = function() {\n\t\t\t\tdocument.getElementById(\"phrase\").style.color = this.style.backgroundColor;\n\t\t\t}\n\n\t\t\trow.appendChild(data);\n\t\t}\t\t\n\t\ttable.appendChild(row);\n\t}\n\tdocument.getElementById(\"color-selector\").appendChild(table);\t\n}", "newColors(){\n for (let i = 0; i < this.colorCount; i++) {\n this.addColorToObject()\n }\n this.updateGradientString()\n }", "function setBoardRGB(){\n\n var redHex = rgbToHex(document.getElementById(\"BoardRvalue\").value);\n var greenHex = rgbToHex(document.getElementById(\"BoardGvalue\").value);\n var blueHex = rgbToHex(document.getElementById(\"BoardBvalue\").value);\n BoardColor = \"0x\" + redHex + greenHex + blueHex;\n\n if(!BoardCoverBool){\n Boardmaterial.color.setHex(BoardColor);\n }\n}", "function checkPaletteValid(name, map) {\n var missingColors = VALID_HUE_VALUES.filter(function(field) {\n return !map[field];\n });\n if (missingColors.length) {\n throw new Error(\"Missing colors %1 in palette %2!\"\n .replace('%1', missingColors.join(', '))\n .replace('%2', name));\n }\n\n return map;\n }", "function checkPaletteValid(name, map) {\n var missingColors = VALID_HUE_VALUES.filter(function(field) {\n return !map[field];\n });\n if (missingColors.length) {\n throw new Error(\"Missing colors %1 in palette %2!\"\n .replace('%1', missingColors.join(', '))\n .replace('%2', name));\n }\n\n return map;\n }", "function checkPaletteValid(name, map) {\n var missingColors = VALID_HUE_VALUES.filter(function(field) {\n return !map[field];\n });\n if (missingColors.length) {\n throw new Error(\"Missing colors %1 in palette %2!\"\n .replace('%1', missingColors.join(', '))\n .replace('%2', name));\n }\n\n return map;\n }", "function checkPaletteValid(name, map) {\n var missingColors = VALID_HUE_VALUES.filter(function(field) {\n return !map[field];\n });\n if (missingColors.length) {\n throw new Error(\"Missing colors %1 in palette %2!\"\n .replace('%1', missingColors.join(', '))\n .replace('%2', name));\n }\n\n return map;\n }", "function updateFieldColor(color) {\n if (lostRounds > maxLossCount) return;\n if (attempt >= maxAttemptCount) return;\n if (currentField === 'leftField') {\n setLeftFieldStyle({ backgroundColor: color });\n } else {\n setRightFieldStyle({ backgroundColor: color });\n }\n }", "function changeColor() {\n console.log($('#red').val() +\",\" + $('#green').val() + \",\" + $('#blue').val());\n var r = colors.red;\n var g = colors.green;\n // var b = $('#blue').val()\n var b = colors.blue;\n console.log(b)\n $kuler = \"rgb(\" + r + \",\" + g + \",\" + b +\")\";\n $(\"#newColor\").css(\"background-color\", $kuler);\n }", "async function saveColors() {\n // merge the user picked colors with existing custom colors so previously saved values are preserved\n const colorsToSave = Object.assign(customColors, editedCustomColors)\n await saveCustomColors(colorsToSave)\n setShowColorControls(false)\n }", "function setBackgroundOnRange (range) { \n for (i = 7; i < range.getNumRows(); i++) {\n var values = range.getValues();\n colors = values.map(function(obj) {\n var result = findByName(operatorColors, obj[0])\n \n if (result) {\n return [result.color]\n } else {\n return [\"#FFFFFF\"]\n }\n \n })\n }\n \n range.setBackgrounds(colors)\n}", "function colorList(R, G, B) {\n // shapeCol = color(H, S, 100);\n shapeCol = color(\"white\");\n goldCol = color(\"white\");\n // userTypedColor = color(\"green\");\n // txtCol = color(\"beige\");\n introTxtCol = color(\"beige\");\n circleCol = color(\"beige\");\n circleCol.setAlpha(200);\n introTxtCol2 = color(37, 5, 245);\n bkCol = color(0, 0, 17);\n}", "function fixDedColors() {\n const blues = document.querySelectorAll(`[color=\"blue\"]`);\n const reds = document.querySelectorAll(`[color=\"red\"]`);\n\n if(blues.length>0){\n blues.forEach(blue=>{\n blue.removeAttribute(\"blue\");\n blue.classList.add(\"code\");\n });\n }\n\n if(reds.length>0){\n reds.forEach(red=>{\n red.removeAttribute(\"red\");\n red.classList.add(\"high\");\n });\n }\n}", "function setColorValues () {\n // CONVERT RGB AND SET HEXIDECIMAL\n hex = rgbToHex(r, g, b);\n\n // CONVERT RGB AND SET HSL\n var hslvalues = rgbToHsl(r, g, b);\n h = hslvalues[0];\n s = hslvalues[1];\n l = hslvalues[2];\n}", "_validateColor(color) {\n if (\n (color === 'transparent' && this.get('isTransparencyEnabled')) ||\n (color === '' && this.get('canRemoveColor'))\n ) {\n return true;\n } else {\n let noHash = color.split('#').pop();\n return /(^[0-9A-F]{6}$)|(^[0-9A-F]{3}$)/i.test(noHash);\n }\n }", "function colorFieldes() {\n fields.map(field => {\n field.style.backgroundColor =\n colors[Math.floor(Math.random() * colors.length)];\n });\n}", "cleanColor() {\n this.urlInput.color = \"#0A0A0F\"\n }", "constructor(coloring = []){\n this._coloring = coloring;\n }", "function addColorClassToAllInputs(id, col) {\n document.getElementById(id).style.background = col\n}", "function checkColors() {\n for (let i = 0; i < wireAmount; i++) {\n for (let ii = 0; ii < colorArray.length; ii++) {\n if (wireArray[i].style.stroke == colorArray[ii].color) {\n colorArray[ii].amount = colorArray[ii].amount + 1;\n }\n }\n }\n }", "handleColorChange(event) {\n const regExp = /^#(?:[0-9a-f]{3}){1,2}$/i\n const value = event.target.value\n if (regExp.test(value)) {\n this.setState({color: event.target.value});\n this.setState({error: false})\n } else {\n this.setState({error: true})\n } \n }", "function updateColors () {\n // ADJUST COLOR VARIABLES FOR COLOR VALUE\n r = redSlider.value;\n g = greenSlider.value;\n b = blueSlider.value;\n\n // UPDATE ALL COLORS WITH NEW VALUES\n setColors(r, g, b);\n}", "add(color) {\n if(!this.contains(color)){\n this._coloring.push(color);\n }\n }", "function appendsColorsToSelects(color){\r\n\t// actualizar la lista de la tabla agregar\r\n\tvar $tableAddNote = $('.tableAddNote');\r\n\t$tableAddNote.find('.selColors').append($('<option>', {\r\n\t value: color.colorId,\r\n\t text: color.description\r\n\t}));\r\n\t\r\n\t// actualizar la lista de la tabla actualizar\r\n//\tvar $tableUpdateNote = $('.tableUpdateNote');\t\r\n//\t$tableUpdateNote.find('.selColors').empty();\r\n//\t$.each(colors, function(index, value) {\t\r\n//\t\t$tableUpdateNote.find('.selColors').append($('<option>', {\r\n//\t\t value: value.colorId,\r\n//\t\t text: value.description\r\n//\t\t}));\r\n//\t});\t// end for each\r\n}", "function RGBColor(color_string)\r\n{\r\n this.ok = false;\r\n\r\n // strip any leading #\r\n if (color_string.charAt(0) == '#') { // remove # if any\r\n color_string = color_string.substr(1,6);\r\n }\r\n\r\n color_string = color_string.replace(/ /g,'');\r\n color_string = color_string.toLowerCase();\r\n\r\n // before getting into regexps, try simple matches\r\n // and overwrite the input\r\n var simple_colors = {\r\n aliceblue: 'f0f8ff',\r\n antiquewhite: 'faebd7',\r\n aqua: '00ffff',\r\n aquamarine: '7fffd4',\r\n azure: 'f0ffff',\r\n beige: 'f5f5dc',\r\n bisque: 'ffe4c4',\r\n black: '000000',\r\n blanchedalmond: 'ffebcd',\r\n blue: '0000ff',\r\n blueviolet: '8a2be2',\r\n brown: 'a52a2a',\r\n burlywood: 'deb887',\r\n cadetblue: '5f9ea0',\r\n chartreuse: '7fff00',\r\n chocolate: 'd2691e',\r\n coral: 'ff7f50',\r\n cornflowerblue: '6495ed',\r\n cornsilk: 'fff8dc',\r\n crimson: 'dc143c',\r\n cyan: '00ffff',\r\n darkblue: '00008b',\r\n darkcyan: '008b8b',\r\n darkgoldenrod: 'b8860b',\r\n darkgray: 'a9a9a9',\r\n darkgreen: '006400',\r\n darkkhaki: 'bdb76b',\r\n darkmagenta: '8b008b',\r\n darkolivegreen: '556b2f',\r\n darkorange: 'ff8c00',\r\n darkorchid: '9932cc',\r\n darkred: '8b0000',\r\n darksalmon: 'e9967a',\r\n darkseagreen: '8fbc8f',\r\n darkslateblue: '483d8b',\r\n darkslategray: '2f4f4f',\r\n darkturquoise: '00ced1',\r\n darkviolet: '9400d3',\r\n deeppink: 'ff1493',\r\n deepskyblue: '00bfff',\r\n dimgray: '696969',\r\n dodgerblue: '1e90ff',\r\n feldspar: 'd19275',\r\n firebrick: 'b22222',\r\n floralwhite: 'fffaf0',\r\n forestgreen: '228b22',\r\n fuchsia: 'ff00ff',\r\n gainsboro: 'dcdcdc',\r\n ghostwhite: 'f8f8ff',\r\n gold: 'ffd700',\r\n goldenrod: 'daa520',\r\n gray: '808080',\r\n green: '008000',\r\n greenyellow: 'adff2f',\r\n honeydew: 'f0fff0',\r\n hotpink: 'ff69b4',\r\n indianred : 'cd5c5c',\r\n indigo : '4b0082',\r\n ivory: 'fffff0',\r\n khaki: 'f0e68c',\r\n lavender: 'e6e6fa',\r\n lavenderblush: 'fff0f5',\r\n lawngreen: '7cfc00',\r\n lemonchiffon: 'fffacd',\r\n lightblue: 'add8e6',\r\n lightcoral: 'f08080',\r\n lightcyan: 'e0ffff',\r\n lightgoldenrodyellow: 'fafad2',\r\n lightgrey: 'd3d3d3',\r\n lightgreen: '90ee90',\r\n lightpink: 'ffb6c1',\r\n lightsalmon: 'ffa07a',\r\n lightseagreen: '20b2aa',\r\n lightskyblue: '87cefa',\r\n lightslateblue: '8470ff',\r\n lightslategray: '778899',\r\n lightsteelblue: 'b0c4de',\r\n lightyellow: 'ffffe0',\r\n lime: '00ff00',\r\n limegreen: '32cd32',\r\n linen: 'faf0e6',\r\n magenta: 'ff00ff',\r\n maroon: '800000',\r\n mediumaquamarine: '66cdaa',\r\n mediumblue: '0000cd',\r\n mediumorchid: 'ba55d3',\r\n mediumpurple: '9370d8',\r\n mediumseagreen: '3cb371',\r\n mediumslateblue: '7b68ee',\r\n mediumspringgreen: '00fa9a',\r\n mediumturquoise: '48d1cc',\r\n mediumvioletred: 'c71585',\r\n midnightblue: '191970',\r\n mintcream: 'f5fffa',\r\n mistyrose: 'ffe4e1',\r\n moccasin: 'ffe4b5',\r\n navajowhite: 'ffdead',\r\n navy: '000080',\r\n oldlace: 'fdf5e6',\r\n olive: '808000',\r\n olivedrab: '6b8e23',\r\n orange: 'ffa500',\r\n orangered: 'ff4500',\r\n orchid: 'da70d6',\r\n palegoldenrod: 'eee8aa',\r\n palegreen: '98fb98',\r\n paleturquoise: 'afeeee',\r\n palevioletred: 'd87093',\r\n papayawhip: 'ffefd5',\r\n peachpuff: 'ffdab9',\r\n peru: 'cd853f',\r\n pink: 'ffc0cb',\r\n plum: 'dda0dd',\r\n powderblue: 'b0e0e6',\r\n purple: '800080',\r\n red: 'ff0000',\r\n rosybrown: 'bc8f8f',\r\n royalblue: '4169e1',\r\n saddlebrown: '8b4513',\r\n salmon: 'fa8072',\r\n sandybrown: 'f4a460',\r\n seagreen: '2e8b57',\r\n seashell: 'fff5ee',\r\n sienna: 'a0522d',\r\n silver: 'c0c0c0',\r\n skyblue: '87ceeb',\r\n slateblue: '6a5acd',\r\n slategray: '708090',\r\n snow: 'fffafa',\r\n springgreen: '00ff7f',\r\n steelblue: '4682b4',\r\n tan: 'd2b48c',\r\n teal: '008080',\r\n thistle: 'd8bfd8',\r\n tomato: 'ff6347',\r\n turquoise: '40e0d0',\r\n violet: 'ee82ee',\r\n violetred: 'd02090',\r\n wheat: 'f5deb3',\r\n white: 'ffffff',\r\n whitesmoke: 'f5f5f5',\r\n yellow: 'ffff00',\r\n yellowgreen: '9acd32'\r\n };\r\n for (var key in simple_colors) {\r\n if (color_string == key) {\r\n color_string = simple_colors[key];\r\n }\r\n }\r\n // emd of simple type-in colors\r\n\r\n // array of color definition objects\r\n var color_defs = [\r\n {\r\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\r\n example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],\r\n process: function (bits){\r\n return [\r\n parseInt(bits[1]),\r\n parseInt(bits[2]),\r\n parseInt(bits[3])\r\n ];\r\n }\r\n },\r\n {\r\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\r\n example: ['#00ff00', '336699'],\r\n process: function (bits){\r\n return [\r\n parseInt(bits[1], 16),\r\n parseInt(bits[2], 16),\r\n parseInt(bits[3], 16)\r\n ];\r\n }\r\n },\r\n {\r\n re: /^(\\w{1})(\\w{1})(\\w{1})$/,\r\n example: ['#fb0', 'f0f'],\r\n process: function (bits){\r\n return [\r\n parseInt(bits[1] + bits[1], 16),\r\n parseInt(bits[2] + bits[2], 16),\r\n parseInt(bits[3] + bits[3], 16)\r\n ];\r\n }\r\n }\r\n ];\r\n\r\n // search through the definitions to find a match\r\n for (var i = 0; i < color_defs.length; i++) {\r\n var re = color_defs[i].re;\r\n var processor = color_defs[i].process;\r\n var bits = re.exec(color_string);\r\n if (bits) {\r\n channels = processor(bits);\r\n this.r = channels[0];\r\n this.g = channels[1];\r\n this.b = channels[2];\r\n this.ok = true;\r\n }\r\n\r\n }\r\n\r\n // validate/cleanup values\r\n this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);\r\n this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);\r\n this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);\r\n\r\n // some getters\r\n this.toRGB = function () {\r\n return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';\r\n }\r\n this.toHex = function () {\r\n var r = this.r.toString(16);\r\n var g = this.g.toString(16);\r\n var b = this.b.toString(16);\r\n if (r.length == 1) r = '0' + r;\r\n if (g.length == 1) g = '0' + g;\r\n if (b.length == 1) b = '0' + b;\r\n return '#' + r + g + b;\r\n }\r\n\r\n // help\r\n this.getHelpXML = function () {\r\n\r\n var examples = new Array();\r\n // add regexps\r\n for (var i = 0; i < color_defs.length; i++) {\r\n var example = color_defs[i].example;\r\n for (var j = 0; j < example.length; j++) {\r\n examples[examples.length] = example[j];\r\n }\r\n }\r\n // add type-in colors\r\n for (var sc in simple_colors) {\r\n examples[examples.length] = sc;\r\n }\r\n\r\n var xml = document.createElement('ul');\r\n xml.setAttribute('id', 'rgbcolor-examples');\r\n for (var i = 0; i < examples.length; i++) {\r\n try {\r\n var list_item = document.createElement('li');\r\n var list_color = new RGBColor(examples[i]);\r\n var example_div = document.createElement('div');\r\n example_div.style.cssText =\r\n 'margin: 3px; '\r\n + 'border: 1px solid black; '\r\n + 'background:' + list_color.toHex() + '; '\r\n + 'color:' + list_color.toHex()\r\n ;\r\n example_div.appendChild(document.createTextNode('test'));\r\n var list_item_value = document.createTextNode(\r\n ' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex()\r\n );\r\n list_item.appendChild(example_div);\r\n list_item.appendChild(list_item_value);\r\n xml.appendChild(list_item);\r\n\r\n } catch(e){}\r\n }\r\n return xml;\r\n\r\n }\r\n\r\n}", "function RGBColor(color_string)\r\n{\r\n this.ok = false;\r\n\r\n // strip any leading #\r\n if (color_string.charAt(0) == '#') { // remove # if any\r\n color_string = color_string.substr(1,6);\r\n }\r\n\r\n color_string = color_string.replace(/ /g,'');\r\n color_string = color_string.toLowerCase();\r\n\r\n // before getting into regexps, try simple matches\r\n // and overwrite the input\r\n var simple_colors = {\r\n aliceblue: 'f0f8ff',\r\n antiquewhite: 'faebd7',\r\n aqua: '00ffff',\r\n aquamarine: '7fffd4',\r\n azure: 'f0ffff',\r\n beige: 'f5f5dc',\r\n bisque: 'ffe4c4',\r\n black: '000000',\r\n blanchedalmond: 'ffebcd',\r\n blue: '0000ff',\r\n blueviolet: '8a2be2',\r\n brown: 'a52a2a',\r\n burlywood: 'deb887',\r\n cadetblue: '5f9ea0',\r\n chartreuse: '7fff00',\r\n chocolate: 'd2691e',\r\n coral: 'ff7f50',\r\n cornflowerblue: '6495ed',\r\n cornsilk: 'fff8dc',\r\n crimson: 'dc143c',\r\n cyan: '00ffff',\r\n darkblue: '00008b',\r\n darkcyan: '008b8b',\r\n darkgoldenrod: 'b8860b',\r\n darkgray: 'a9a9a9',\r\n darkgreen: '006400',\r\n darkkhaki: 'bdb76b',\r\n darkmagenta: '8b008b',\r\n darkolivegreen: '556b2f',\r\n darkorange: 'ff8c00',\r\n darkorchid: '9932cc',\r\n darkred: '8b0000',\r\n darksalmon: 'e9967a',\r\n darkseagreen: '8fbc8f',\r\n darkslateblue: '483d8b',\r\n darkslategray: '2f4f4f',\r\n darkturquoise: '00ced1',\r\n darkviolet: '9400d3',\r\n deeppink: 'ff1493',\r\n deepskyblue: '00bfff',\r\n dimgray: '696969',\r\n dodgerblue: '1e90ff',\r\n feldspar: 'd19275',\r\n firebrick: 'b22222',\r\n floralwhite: 'fffaf0',\r\n forestgreen: '228b22',\r\n fuchsia: 'ff00ff',\r\n gainsboro: 'dcdcdc',\r\n ghostwhite: 'f8f8ff',\r\n gold: 'ffd700',\r\n goldenrod: 'daa520',\r\n gray: '808080',\r\n green: '008000',\r\n greenyellow: 'adff2f',\r\n honeydew: 'f0fff0',\r\n hotpink: 'ff69b4',\r\n indianred : 'cd5c5c',\r\n indigo : '4b0082',\r\n ivory: 'fffff0',\r\n khaki: 'f0e68c',\r\n lavender: 'e6e6fa',\r\n lavenderblush: 'fff0f5',\r\n lawngreen: '7cfc00',\r\n lemonchiffon: 'fffacd',\r\n lightblue: 'add8e6',\r\n lightcoral: 'f08080',\r\n lightcyan: 'e0ffff',\r\n lightgoldenrodyellow: 'fafad2',\r\n lightgrey: 'd3d3d3',\r\n lightgreen: '90ee90',\r\n lightpink: 'ffb6c1',\r\n lightsalmon: 'ffa07a',\r\n lightseagreen: '20b2aa',\r\n lightskyblue: '87cefa',\r\n lightslateblue: '8470ff',\r\n lightslategray: '778899',\r\n lightsteelblue: 'b0c4de',\r\n lightyellow: 'ffffe0',\r\n lime: '00ff00',\r\n limegreen: '32cd32',\r\n linen: 'faf0e6',\r\n magenta: 'ff00ff',\r\n maroon: '800000',\r\n mediumaquamarine: '66cdaa',\r\n mediumblue: '0000cd',\r\n mediumorchid: 'ba55d3',\r\n mediumpurple: '9370d8',\r\n mediumseagreen: '3cb371',\r\n mediumslateblue: '7b68ee',\r\n mediumspringgreen: '00fa9a',\r\n mediumturquoise: '48d1cc',\r\n mediumvioletred: 'c71585',\r\n midnightblue: '191970',\r\n mintcream: 'f5fffa',\r\n mistyrose: 'ffe4e1',\r\n moccasin: 'ffe4b5',\r\n navajowhite: 'ffdead',\r\n navy: '000080',\r\n oldlace: 'fdf5e6',\r\n olive: '808000',\r\n olivedrab: '6b8e23',\r\n orange: 'ffa500',\r\n orangered: 'ff4500',\r\n orchid: 'da70d6',\r\n palegoldenrod: 'eee8aa',\r\n palegreen: '98fb98',\r\n paleturquoise: 'afeeee',\r\n palevioletred: 'd87093',\r\n papayawhip: 'ffefd5',\r\n peachpuff: 'ffdab9',\r\n peru: 'cd853f',\r\n pink: 'ffc0cb',\r\n plum: 'dda0dd',\r\n powderblue: 'b0e0e6',\r\n purple: '800080',\r\n red: 'ff0000',\r\n rosybrown: 'bc8f8f',\r\n royalblue: '4169e1',\r\n saddlebrown: '8b4513',\r\n salmon: 'fa8072',\r\n sandybrown: 'f4a460',\r\n seagreen: '2e8b57',\r\n seashell: 'fff5ee',\r\n sienna: 'a0522d',\r\n silver: 'c0c0c0',\r\n skyblue: '87ceeb',\r\n slateblue: '6a5acd',\r\n slategray: '708090',\r\n snow: 'fffafa',\r\n springgreen: '00ff7f',\r\n steelblue: '4682b4',\r\n tan: 'd2b48c',\r\n teal: '008080',\r\n thistle: 'd8bfd8',\r\n tomato: 'ff6347',\r\n turquoise: '40e0d0',\r\n violet: 'ee82ee',\r\n violetred: 'd02090',\r\n wheat: 'f5deb3',\r\n white: 'ffffff',\r\n whitesmoke: 'f5f5f5',\r\n yellow: 'ffff00',\r\n yellowgreen: '9acd32'\r\n };\r\n for (var key in simple_colors) {\r\n if (color_string == key) {\r\n color_string = simple_colors[key];\r\n }\r\n }\r\n // emd of simple type-in colors\r\n\r\n // array of color definition objects\r\n var color_defs = [\r\n {\r\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\r\n example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],\r\n process: function (bits){\r\n return [\r\n parseInt(bits[1]),\r\n parseInt(bits[2]),\r\n parseInt(bits[3])\r\n ];\r\n }\r\n },\r\n {\r\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\r\n example: ['#00ff00', '336699'],\r\n process: function (bits){\r\n return [\r\n parseInt(bits[1], 16),\r\n parseInt(bits[2], 16),\r\n parseInt(bits[3], 16)\r\n ];\r\n }\r\n },\r\n {\r\n re: /^(\\w{1})(\\w{1})(\\w{1})$/,\r\n example: ['#fb0', 'f0f'],\r\n process: function (bits){\r\n return [\r\n parseInt(bits[1] + bits[1], 16),\r\n parseInt(bits[2] + bits[2], 16),\r\n parseInt(bits[3] + bits[3], 16)\r\n ];\r\n }\r\n }\r\n ];\r\n\r\n // search through the definitions to find a match\r\n for (var i = 0; i < color_defs.length; i++) {\r\n var re = color_defs[i].re;\r\n var processor = color_defs[i].process;\r\n var bits = re.exec(color_string);\r\n if (bits) {\r\n channels = processor(bits);\r\n this.r = channels[0];\r\n this.g = channels[1];\r\n this.b = channels[2];\r\n this.ok = true;\r\n }\r\n\r\n }\r\n\r\n // validate/cleanup values\r\n this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);\r\n this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);\r\n this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);\r\n\r\n // some getters\r\n this.toRGB = function () {\r\n return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';\r\n }\r\n this.toHex = function () {\r\n var r = this.r.toString(16);\r\n var g = this.g.toString(16);\r\n var b = this.b.toString(16);\r\n if (r.length == 1) r = '0' + r;\r\n if (g.length == 1) g = '0' + g;\r\n if (b.length == 1) b = '0' + b;\r\n return '#' + r + g + b;\r\n }\r\n\r\n // help\r\n this.getHelpXML = function () {\r\n\r\n var examples = new Array();\r\n // add regexps\r\n for (var i = 0; i < color_defs.length; i++) {\r\n var example = color_defs[i].example;\r\n for (var j = 0; j < example.length; j++) {\r\n examples[examples.length] = example[j];\r\n }\r\n }\r\n // add type-in colors\r\n for (var sc in simple_colors) {\r\n examples[examples.length] = sc;\r\n }\r\n\r\n var xml = document.createElement('ul');\r\n xml.setAttribute('id', 'rgbcolor-examples');\r\n for (var i = 0; i < examples.length; i++) {\r\n try {\r\n var list_item = document.createElement('li');\r\n var list_color = new RGBColor(examples[i]);\r\n var example_div = document.createElement('div');\r\n example_div.style.cssText =\r\n 'margin: 3px; '\r\n + 'border: 1px solid black; '\r\n + 'background:' + list_color.toHex() + '; '\r\n + 'color:' + list_color.toHex()\r\n ;\r\n example_div.appendChild(document.createTextNode('test'));\r\n var list_item_value = document.createTextNode(\r\n ' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex()\r\n );\r\n list_item.appendChild(example_div);\r\n list_item.appendChild(list_item_value);\r\n xml.appendChild(list_item);\r\n\r\n } catch(e){}\r\n }\r\n return xml;\r\n\r\n }\r\n\r\n}", "function InsertBBColor(sbID, elm)\n{\n\tvar idx = elm.selectedIndex;\n\tif(idx != 0)\n\t{\n\t\tvar color = elm.options[idx].value;\n\t\tvar aTag = \"[c=\"+ color +\"]\";\n\t\tvar eTag = \"[/c]\";\n\t\tShoutInsert(sbID, aTag, eTag);\n\t\telm.selectedIndex = 0;\n\t}\n}", "function winningcolor(correctcolor) {\n\tfor ( var i=0; i < modeselect ; i++) {\n\t\tsqlist[i].style.backgroundColor = correctcolor;\n\t}\t\n}", "function setupColors(){\n for (var i = 0; i < squares.length; i++) {\n\n squares[i].addEventListener('click', function() {\n var clickedColor = this.style.backgroundColor;\n if (clickedColor === pickedColor) {\n prompt.textContent = \"CORRECT!!\";\n newGame.textContent = \"Play Again?\";\n changeColor(clickedColor);\n } else {\n this.style.backgroundColor = \"#4abdac\";\n prompt.textContent = \"Try again...\";\n }\n });\n }\n}", "function RGBColor(color_string)\n{\n this.ok = false;\n\n // strip any leading #\n if (color_string.charAt(0) == '#') { // remove # if any\n color_string = color_string.substr(1,6);\n }\n\n color_string = color_string.replace(/ /g,'');\n color_string = color_string.toLowerCase();\n\n // before getting into regexps, try simple matches\n // and overwrite the input\n var simple_colors = {\n aliceblue: 'f0f8ff',\n antiquewhite: 'faebd7',\n aqua: '00ffff',\n aquamarine: '7fffd4',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '000000',\n blanchedalmond: 'ffebcd',\n blue: '0000ff',\n blueviolet: '8a2be2',\n brown: 'a52a2a',\n burlywood: 'deb887',\n cadetblue: '5f9ea0',\n chartreuse: '7fff00',\n chocolate: 'd2691e',\n coral: 'ff7f50',\n cornflowerblue: '6495ed',\n cornsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: '00ffff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgoldenrod: 'b8860b',\n darkgray: 'a9a9a9',\n darkgreen: '006400',\n darkkhaki: 'bdb76b',\n darkmagenta: '8b008b',\n darkolivegreen: '556b2f',\n darkorange: 'ff8c00',\n darkorchid: '9932cc',\n darkred: '8b0000',\n darksalmon: 'e9967a',\n darkseagreen: '8fbc8f',\n darkslateblue: '483d8b',\n darkslategray: '2f4f4f',\n darkturquoise: '00ced1',\n darkviolet: '9400d3',\n deeppink: 'ff1493',\n deepskyblue: '00bfff',\n dimgray: '696969',\n dodgerblue: '1e90ff',\n feldspar: 'd19275',\n firebrick: 'b22222',\n floralwhite: 'fffaf0',\n forestgreen: '228b22',\n fuchsia: 'ff00ff',\n gainsboro: 'dcdcdc',\n ghostwhite: 'f8f8ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n honeydew: 'f0fff0',\n hotpink: 'ff69b4',\n indianred : 'cd5c5c',\n indigo : '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lavender: 'e6e6fa',\n lavenderblush: 'fff0f5',\n lawngreen: '7cfc00',\n lemonchiffon: 'fffacd',\n lightblue: 'add8e6',\n lightcoral: 'f08080',\n lightcyan: 'e0ffff',\n lightgoldenrodyellow: 'fafad2',\n lightgrey: 'd3d3d3',\n lightgreen: '90ee90',\n lightpink: 'ffb6c1',\n lightsalmon: 'ffa07a',\n lightseagreen: '20b2aa',\n lightskyblue: '87cefa',\n lightslateblue: '8470ff',\n lightslategray: '778899',\n lightsteelblue: 'b0c4de',\n lightyellow: 'ffffe0',\n lime: '00ff00',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'ff00ff',\n maroon: '800000',\n mediumaquamarine: '66cdaa',\n mediumblue: '0000cd',\n mediumorchid: 'ba55d3',\n mediumpurple: '9370d8',\n mediumseagreen: '3cb371',\n mediumslateblue: '7b68ee',\n mediumspringgreen: '00fa9a',\n mediumturquoise: '48d1cc',\n mediumvioletred: 'c71585',\n midnightblue: '191970',\n mintcream: 'f5fffa',\n mistyrose: 'ffe4e1',\n moccasin: 'ffe4b5',\n navajowhite: 'ffdead',\n navy: '000080',\n oldlace: 'fdf5e6',\n olive: '808000',\n olivedrab: '6b8e23',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n palegoldenrod: 'eee8aa',\n palegreen: '98fb98',\n paleturquoise: 'afeeee',\n palevioletred: 'd87093',\n papayawhip: 'ffefd5',\n peachpuff: 'ffdab9',\n peru: 'cd853f',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n powderblue: 'b0e0e6',\n purple: '800080',\n red: 'ff0000',\n rosybrown: 'bc8f8f',\n royalblue: '4169e1',\n saddlebrown: '8b4513',\n salmon: 'fa8072',\n sandybrown: 'f4a460',\n seagreen: '2e8b57',\n seashell: 'fff5ee',\n sienna: 'a0522d',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n snow: 'fffafa',\n springgreen: '00ff7f',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n thistle: 'd8bfd8',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n violetred: 'd02090',\n wheat: 'f5deb3',\n white: 'ffffff',\n whitesmoke: 'f5f5f5',\n yellow: 'ffff00',\n yellowgreen: '9acd32'\n };\n for (var key in simple_colors) {\n if (color_string == key) {\n color_string = simple_colors[key];\n }\n }\n // emd of simple type-in colors\n\n // array of color definition objects\n var color_defs = [\n {\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\n example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],\n process: function (bits){\n return [\n parseInt(bits[1]),\n parseInt(bits[2]),\n parseInt(bits[3])\n ];\n }\n },\n {\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\n example: ['#00ff00', '336699'],\n process: function (bits){\n return [\n parseInt(bits[1], 16),\n parseInt(bits[2], 16),\n parseInt(bits[3], 16)\n ];\n }\n },\n {\n re: /^(\\w{1})(\\w{1})(\\w{1})$/,\n example: ['#fb0', 'f0f'],\n process: function (bits){\n return [\n parseInt(bits[1] + bits[1], 16),\n parseInt(bits[2] + bits[2], 16),\n parseInt(bits[3] + bits[3], 16)\n ];\n }\n }\n ];\n\n // search through the definitions to find a match\n for (var i = 0; i < color_defs.length; i++) {\n var re = color_defs[i].re;\n var processor = color_defs[i].process;\n var bits = re.exec(color_string);\n if (bits) {\n channels = processor(bits);\n this.r = channels[0];\n this.g = channels[1];\n this.b = channels[2];\n this.ok = true;\n }\n\n }\n\n // validate/cleanup values\n this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);\n this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);\n this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);\n\n // some getters\n this.toRGB = function () {\n return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';\n }\n this.toHex = function () {\n var r = this.r.toString(16);\n var g = this.g.toString(16);\n var b = this.b.toString(16);\n if (r.length == 1) r = '0' + r;\n if (g.length == 1) g = '0' + g;\n if (b.length == 1) b = '0' + b;\n return r + g + b;\n }\n\n // help\n this.getHelpXML = function () {\n\n var examples = new Array();\n // add regexps\n for (var i = 0; i < color_defs.length; i++) {\n var example = color_defs[i].example;\n for (var j = 0; j < example.length; j++) {\n examples[examples.length] = example[j];\n }\n }\n // add type-in colors\n for (var sc in simple_colors) {\n examples[examples.length] = sc;\n }\n\n var xml = document.createElement('ul');\n xml.setAttribute('id', 'rgbcolor-examples');\n for (var i = 0; i < examples.length; i++) {\n try {\n var list_item = document.createElement('li');\n var list_color = new RGBColor(examples[i]);\n var example_div = document.createElement('div');\n example_div.style.cssText =\n 'margin: 3px; '\n + 'border: 1px solid black; '\n + 'background:' + list_color.toHex() + '; '\n + 'color:' + list_color.toHex()\n ;\n example_div.appendChild(document.createTextNode('test'));\n var list_item_value = document.createTextNode(\n ' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex()\n );\n list_item.appendChild(example_div);\n list_item.appendChild(list_item_value);\n xml.appendChild(list_item);\n\n } catch(e){}\n }\n return xml;\n\n }\n\n}", "function saveTable(){\n //Creates the table elements when the user decides to save the color.\n var node1 = document.createTextNode(\"\");\n var node2 = document.createTextNode(colorString);\n var table = document.getElementById(\"colorTable\");\n var row = document.createElement(\"tr\");\n var col1 = document.createElement(\"td\");\n var col2 = document.createElement(\"td\");\n\n col1.style.backgroundColor = colorString;\n col1.appendChild(node1);\n row.appendChild(col1);\n\n col2.appendChild(node2);\n row.appendChild(col2);\n table.appendChild(row);\n}", "function submitColorChannels() {\n var key, value;\n for (var i=0 ; i < document.forms[0].elements.length ; i++) {\n key = document.forms[0].elements[i].id;\n value = document.forms[0].elements[i].value;\n if (key) {\n if (validate(value)) { this.userColor[key] = parseInt(value, 10); }\n else {\n if (value == '') {value = '(empty string)';}\n alert('Field \"' + key + '\" has unacceptable value ' + value);\n return;\n }\n }\n }\n this.userColor = this.colorNames.map(function(n) {\n return this.userColor[n];\n })\n console.log(this.userColor);\n document.forms[0].reset();\n}", "function initTable() {\r\nvar color = [\r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green \r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n]\r\n var symbols = [\r\n { slogan: \"speedDemon.js.\",\r\n icon: \"dashboard\"\r\n },\r\n { slogan: \"Perpetually lost.\",\r\n icon: \"map-marker\"\r\n },\r\n { slogan: \"Rebel without a cause.\",\r\n icon: \"rebel\"\r\n },\r\n { slogan: \"Powered by ESP8266.\",\r\n icon: \"microchip\"\r\n },\r\n { slogan: \"Was it supposed to do that?!\",\r\n icon: \"exclamation-triangle\"\r\n },\r\n { slogan: \"Headed toward the finish line.\",\r\n icon: \"flag-checkered\"\r\n },\r\n { slogan: \"Hang in there, baby.\",\r\n icon: \"heartbeat\"\r\n },\r\n { slogan: \"Really, really, really fast.\",\r\n icon: \"fast-forward\"\r\n },\r\n { slogan: \"Basically priceless.\",\r\n icon: \"diamond\"\r\n },\r\n { slogan: \"Fast as lightning!\",\r\n icon: \"bolt\"\r\n },\r\n { slogan: \"Eye on the prize.\",\r\n icon: \"eye\"\r\n },\r\n { slogan: \"????????\",\r\n icon: \"question-circle\"\r\n },\r\n { slogan: \"Pow-pow-power wheels!\",\r\n icon: \"power-off\"\r\n },\r\n { slogan: \"Uniquely unique.\",\r\n icon: \"snowflake-o\"\r\n },\r\n { slogan: \"Toot, toot! Ahh beep, beep!\",\r\n icon: \"bus\"\r\n },\r\n { slogan: \"A bit of a fixer-upper.\",\r\n icon: \"wrench\"\r\n },\r\n { slogan: \"IoT? Oh my!\",\r\n icon: \"wifi\"\r\n },\r\n { slogan: \"It's not a bug, it's a feature.\",\r\n icon: \"bug\"\r\n },\r\n { slogan: \"Um, no.\",\r\n icon: \"ban\"\r\n },\r\n { slogan: \"It's aliiive!\",\r\n icon: \"cogs\"\r\n },\r\n { slogan: \"Send help.\",\r\n icon: \"life-buoy\"\r\n },\r\n { slogan: \"A bot powered by magic. (And Javascript.)\",\r\n icon: \"magic\"\r\n },\r\n { slogan: \"LUV2CODE\",\r\n icon: \"heart\"\r\n },\r\n { slogan: \"It's not broken. It's... experimental.\",\r\n icon: \"flask\"\r\n },\r\n { slogan: \"Oh, dear.\",\r\n icon: \"frown-o\"\r\n },\r\n { slogan: \"Going places.\",\r\n icon: \"line-chart\"\r\n },\r\n { slogan: \"On fire! (Metaphorically, right?)\",\r\n icon: \"fire-extinguisher\"\r\n },\r\n { slogan: \"speedDemon.js.\",\r\n icon: \"dashboard\"\r\n },\r\n { slogan: \"Perpetually lost.\",\r\n icon: \"map-marker\"\r\n },\r\n { slogan: \"Rebel without a cause.\",\r\n icon: \"rebel\"\r\n },\r\n { slogan: \"Powered by ESP8266.\",\r\n icon: \"microchip\"\r\n },\r\n { slogan: \"Was it supposed to do that?!\",\r\n icon: \"exclamation-triangle\"\r\n },\r\n { slogan: \"Headed toward the finish line.\",\r\n icon: \"flag-checkered\"\r\n },\r\n { slogan: \"Hang in there, baby.\",\r\n icon: \"heartbeat\"\r\n },\r\n { slogan: \"Really, really, really fast.\",\r\n icon: \"fast-forward\"\r\n },\r\n { slogan: \"Basically priceless.\",\r\n icon: \"diamond\"\r\n },\r\n { slogan: \"Fast as lightning!\",\r\n icon: \"bolt\"\r\n },\r\n { slogan: \"Eye on the prize.\",\r\n icon: \"eye\"\r\n },\r\n { slogan: \"????????\",\r\n icon: \"question-circle\"\r\n },\r\n { slogan: \"Pow-pow-power wheels!\",\r\n icon: \"power-off\"\r\n },\r\n { slogan: \"Uniquely unique.\",\r\n icon: \"snowflake-o\"\r\n },\r\n { slogan: \"Toot, toot! Ahh beep, beep!\",\r\n icon: \"bus\"\r\n },\r\n { slogan: \"A bit of a fixer-upper.\",\r\n icon: \"wrench\"\r\n },\r\n { slogan: \"IoT? Oh my!\",\r\n icon: \"wifi\"\r\n },\r\n { slogan: \"It's not a bug, it's a feature.\",\r\n icon: \"bug\"\r\n },\r\n { slogan: \"Um, no.\",\r\n icon: \"ban\"\r\n },\r\n { slogan: \"It's aliiive!\",\r\n icon: \"cogs\"\r\n },\r\n { slogan: \"Send help.\",\r\n icon: \"life-buoy\"\r\n },\r\n { slogan: \"A bot powered by magic. (And Javascript.)\",\r\n icon: \"magic\"\r\n },\r\n { slogan: \"LUV2CODE\",\r\n icon: \"heart\"\r\n },\r\n { slogan: \"It's not broken. It's... experimental.\",\r\n icon: \"flask\"\r\n },\r\n { slogan: \"Oh, dear.\",\r\n icon: \"frown-o\"\r\n },\r\n { slogan: \"Going places.\",\r\n icon: \"line-chart\"\r\n },\r\n { slogan: \"On fire! (Metaphorically, right?)\",\r\n icon: \"fire-extinguisher\"\r\n },\r\n { slogan: \"speedDemon.js.\",\r\n icon: \"dashboard\"\r\n },\r\n { slogan: \"Perpetually lost.\",\r\n icon: \"map-marker\"\r\n },\r\n { slogan: \"Rebel without a cause.\",\r\n icon: \"rebel\"\r\n },\r\n { slogan: \"Powered by ESP8266.\",\r\n icon: \"microchip\"\r\n },\r\n { slogan: \"Was it supposed to do that?!\",\r\n icon: \"exclamation-triangle\"\r\n },\r\n { slogan: \"Headed toward the finish line.\",\r\n icon: \"flag-checkered\"\r\n },\r\n { slogan: \"Hang in there, baby.\",\r\n icon: \"heartbeat\"\r\n },\r\n { slogan: \"Really, really, really fast.\",\r\n icon: \"fast-forward\"\r\n },\r\n { slogan: \"Basically priceless.\",\r\n icon: \"diamond\"\r\n },\r\n { slogan: \"Fast as lightning!\",\r\n icon: \"bolt\"\r\n },\r\n { slogan: \"Eye on the prize.\",\r\n icon: \"eye\"\r\n },\r\n { slogan: \"????????\",\r\n icon: \"question-circle\"\r\n },\r\n { slogan: \"Pow-pow-power wheels!\",\r\n icon: \"power-off\"\r\n },\r\n { slogan: \"Uniquely unique.\",\r\n icon: \"snowflake-o\"\r\n },\r\n { slogan: \"Toot, toot! Ahh beep, beep!\",\r\n icon: \"bus\"\r\n },\r\n { slogan: \"A bit of a fixer-upper.\",\r\n icon: \"wrench\"\r\n },\r\n { slogan: \"IoT? Oh my!\",\r\n icon: \"wifi\"\r\n },\r\n { slogan: \"It's not a bug, it's a feature.\",\r\n icon: \"bug\"\r\n },\r\n { slogan: \"Um, no.\",\r\n icon: \"ban\"\r\n },\r\n { slogan: \"It's aliiive!\",\r\n icon: \"cogs\"\r\n },\r\n { slogan: \"Send help.\",\r\n icon: \"life-buoy\"\r\n },\r\n { slogan: \"A bot powered by magic. (And Javascript.)\",\r\n icon: \"magic\"\r\n },\r\n { slogan: \"LUV2CODE\",\r\n icon: \"heart\"\r\n },\r\n { slogan: \"It's not broken. It's... experimental.\",\r\n icon: \"flask\"\r\n },\r\n { slogan: \"Oh, dear.\",\r\n icon: \"frown-o\"\r\n },\r\n { slogan: \"Going places.\",\r\n icon: \"line-chart\"\r\n },\r\n { slogan: \"On fire! (Metaphorically, right?)\",\r\n icon: \"fire-extinguisher\"\r\n },\r\n { slogan: \"speedDemon.js.\",\r\n icon: \"dashboard\"\r\n },\r\n { slogan: \"Perpetually lost.\",\r\n icon: \"map-marker\"\r\n },\r\n { slogan: \"Rebel without a cause.\",\r\n icon: \"rebel\"\r\n },\r\n { slogan: \"Powered by ESP8266.\",\r\n icon: \"microchip\"\r\n },\r\n { slogan: \"Was it supposed to do that?!\",\r\n icon: \"exclamation-triangle\"\r\n },\r\n { slogan: \"Headed toward the finish line.\",\r\n icon: \"flag-checkered\"\r\n },\r\n { slogan: \"Hang in there, baby.\",\r\n icon: \"heartbeat\"\r\n },\r\n { slogan: \"Really, really, really fast.\",\r\n icon: \"fast-forward\"\r\n },\r\n { slogan: \"Basically priceless.\",\r\n icon: \"diamond\"\r\n },\r\n { slogan: \"Fast as lightning!\",\r\n icon: \"bolt\"\r\n },\r\n { slogan: \"Eye on the prize.\",\r\n icon: \"eye\"\r\n },\r\n { slogan: \"????????\",\r\n icon: \"question-circle\"\r\n },\r\n { slogan: \"Pow-pow-power wheels!\",\r\n icon: \"power-off\"\r\n },\r\n { slogan: \"Uniquely unique.\",\r\n icon: \"snowflake-o\"\r\n },\r\n { slogan: \"Toot, toot! Ahh beep, beep!\",\r\n icon: \"bus\"\r\n },\r\n { slogan: \"A bit of a fixer-upper.\",\r\n icon: \"wrench\"\r\n },\r\n { slogan: \"IoT? Oh my!\",\r\n icon: \"wifi\"\r\n },\r\n { slogan: \"It's not a bug, it's a feature.\",\r\n icon: \"bug\"\r\n },\r\n { slogan: \"Um, no.\",\r\n icon: \"ban\"\r\n },\r\n { slogan: \"It's aliiive!\",\r\n icon: \"cogs\"\r\n },\r\n { slogan: \"Send help.\",\r\n icon: \"life-buoy\"\r\n },\r\n { slogan: \"A bot powered by magic. (And Javascript.)\",\r\n icon: \"magic\"\r\n },\r\n { slogan: \"LUV2CODE\",\r\n icon: \"heart\"\r\n },\r\n { slogan: \"It's not broken. It's... experimental.\",\r\n icon: \"flask\"\r\n },\r\n { slogan: \"Oh, dear.\",\r\n icon: \"frown-o\"\r\n },\r\n { slogan: \"Going places.\",\r\n icon: \"line-chart\"\r\n },\r\n { slogan: \"On fire! (Metaphorically, right?)\",\r\n icon: \"fire-extinguisher\"\r\n }\r\n]\r\n botDirectory = [];\r\n var initQuery = new azure.TableQuery().select(['PartitionKey', 'RowKey', 'command', 'distance'])\r\n //.where('PartitionKey gt ?', lastUpdate);\r\n tableService.queryEntities('outTable', initQuery, null, function (error, result, response) {\r\n if (!error) {\r\n\r\n // For each row of table, check to see if bot is listed in bot directory\r\n for (i = 0; i < result.entries.length; i++) {\r\n\r\n function checkExist(botname) { return botname.botName == result.entries[i].RowKey._; }\r\n\r\n var botIndex = botDirectory.findIndex(checkExist);\r\n\r\n // If bot is already in bot directory, update content\r\n if (botIndex >= 0) {\r\n botDirectory[botIndex].currentCommand = \"\" + botDirectory[botIndex].currentCommand + \".\" + result.entries[i].command._ + \"\";\r\n botDirectory[botIndex].totalDistance = botDirectory[botIndex].totalDistance + parseInt(result.entries[i].distance._);\r\n }\r\n\r\n // If bot is not in bot directory, add an entry for it\r\n else {\r\n botDirectory.push(\r\n {\r\n botName: result.entries[i].RowKey._,\r\n botID: \"bot\" + result.entries[i].PartitionKey._,\r\n currentCommand: result.entries[i].command._,\r\n totalDistance: parseInt(result.entries[i].distance._),\r\n botColor: color[0],\r\n slogan: symbols[0].slogan,\r\n symbol: symbols[0].icon\r\n }\r\n );\r\n color.push(color.shift());\r\n symbols.push(symbols.shift());\r\n }\r\n }\r\n lastUpdate = result.entries[result.entries.length - 1].PartitionKey._;\r\n socket.emit('initData', botDirectory);\r\n console.log('Initial entries sent up to ' + lastUpdate);\r\n console.log(botDirectory);\r\n }\r\n });\r\n }", "function matchColors(color){\n\tfor(var i = 0; i < squares.length; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function parse_lscolors() {\n var lscolors = $('#lscolors').val();\n for (var i=0;i<11;i++) {\n var foreground_char = lscolors.charCodeAt(2*i);\n var background_char = lscolors.charCodeAt(2*i+1);\n\n if ((foreground_char >= 'A'.charCodeAt(0)) && (foreground_char <= 'H'.charCodeAt(0))) {\n selected_foreground_bold[i] = 1;\n selected_foreground_colors[i] = available_colors[foreground_char-'A'.charCodeAt(0)];\n } else if ((foreground_char >= 'a'.charCodeAt(0)) && (foreground_char <= 'h'.charCodeAt(0))) {\n selected_foreground_bold[i] = 0;\n selected_foreground_colors[i] = available_colors[foreground_char-'a'.charCodeAt(0)];\n } else {\n selected_foreground_bold[i] = 0;\n selected_foreground_colors[i] = 'default';\n }\n\n if ((background_char >= 'A'.charCodeAt(0)) && (background_char <= 'H'.charCodeAt(0))) {\n selected_background_bold[i] = 1;\n selected_background_colors[i] = available_colors[background_char-'A'.charCodeAt(0)];\n } else if ((background_char >= 'a'.charCodeAt(0)) && (background_char <= 'h'.charCodeAt(0))) {\n selected_background_bold[i] = 0;\n selected_background_colors[i] = available_colors[background_char-'a'.charCodeAt(0)];\n } else {\n selected_background_bold[i] = 0;\n selected_background_colors[i] = 'default';\n }\n }\n\n update_everything();\n }", "function isColorValid(color) {\n return color === \"blue\" || color === \"green\";\n}", "function isColorValid(color) {\n return color === \"blue\" || color === \"green\";\n}", "function checkColor(color) {\n while ((usedColors.indexOf(color) > -1) && (usedColors.length - 1 <= colors.length - 1)) {\n randColor = randomNumber(first, (colors.length - 1));\n color = colors[randColor];\n if (usedColors.length - 1 >= colors.length - 1) {\n alert(\"You cannot add any more colors. Please delete some before adding more\");\n return null;\n }\n }\n return color;\n}", "function buildPreDefinedColors() {\n\tvar colorArr = [color1, color2, color3, color4];\n\t$('#pre-defined-pat').change(function() {\n\t\tvar k = Number($('#pre-defined-pat').val());\n\t\tif (k >= 0) {\n\t\t\tsetUpOptions();\n\t\t\t$('#custom-color-num').attr('disabled',true);\n\t\t\t$.getJSON('js/data.json', function(data) {\n\t\t\t\t\n\t\t\t\tvar x = data.camoData[k].HEXCOLORS.length;\n\t\t\t\tvar y = colorArr.length - x;\n\t\t\t\t$('#custom-color-num').val(x);\n\t\t\t\t\n\t\t\t\tfor (i=0; i<x; i++) {\n\t\t\t\t\tcolorArr[i].val(data.camoData[k].HEXCOLORS[i]);\n\t\t\t\t\tcolorArr[i].css('background-color',data.camoData[k].HEXCOLORS[i]);\n\t\t\t\t\tcolorArr[i].attr('disabled',false);\n\t\t\t\t\tcolorArr[i].css('text-decoration','none');\n\t\t\t\t}\n\n\t\t\t\tfor (j=0; j<y; j++) {\n\t\t\t\t\tcolorDisable(colorArr[x-j]);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\telse {\n\t\t\t$('#custom-color-num').attr('disabled',false);\n\t\t}\n\t});\n}", "function setColors(rgbList, totalColors) {\n var color = \"\";\n for (let i = 0; i < totalColors; i++) {\n var curr = rgbList[i];\n color = \"rgb(\" + curr[0] + \", \" + curr[1] + \", \" + curr[2] + \")\";\n labelList[i].style.background = color;\n }\n if (totalColors == 3) {\n for (let i = 3; i < 6; i++) {\n labelList[i].classList.add(\".hidden\");\n }\n }\n}", "set healthyColor(value) {}", "function sendColor(){\n //define color variable as the value of the color picker \n var color = document.getElementById(\"color-picker\").value;\n //convert hex color to rgb value\n color = hexToRgb(color);\n console.log(color);\n //set reference of the database to color\n //and set it as the value of color (which has been transformed into an rgb json object)\n firebase.database().ref('color/').set(\n color\n, function(error) {\n if (error) {\n console.error(\"data was not sent\");\n } else {\n console.log(\"data sent\");\n }\n});\n}", "function st_mediaelementplayer_colors(){\r\n\r\n\t\tp('.projects-format-audio-holder, .projects-format-video-holder').each(function(){\r\n\r\n\t\t\tif ( !p(this).is('[id]') && p(this).parent().is('[data-bg-color]') ) {\r\n\r\n\t\t\t\tvar\r\n\t\t\t\t\tid = 'id' + Math.floor( ( Math.random() * 10000 ) + 1 ),\r\n\t\t\t\t\tstyle = '#layout #' + id + ' .mejs-time-loaded { background-color: #' + p(this).parent().attr('data-bg-color') + '; }' + \"\\n\";\r\n\r\n\t\t\t\t\tp(this).attr( 'id', id );\r\n\r\n\t\t\t\t\tp('#st-dynamic-css').append( style );\r\n\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t}", "function convertColor() {\n var colorEntry = document.querySelector(\".convertValue\")\n var entryValue = colorEntry.value\n m\n .request({\n method: 'PUT',\n url: `http://localhost:8001/color/handle`,\n body: {\n \"value\": entryValue\n }\n })\n //should return hex! otherwise error\n .then((response) => {\n if (response) {\n let data = response\n console.log(\"data\", data)\n\n if (response != \"Color not supported\") {\n\n document.querySelector(\".returnText\").innerHTML = `Hex value is ` + data\n let root = document.documentElement\n\n root.style.setProperty('--color', '#' + data)\n return\n }\n document.querySelector(\".returnText\").innerHTML = `Error! ` + data\n \n }\n })\n\n\n }", "function setBoardCoverRGB(){\n var redHex = rgbToHex(document.getElementById(\"CoverRvalue\").value);\n var greenHex = rgbToHex(document.getElementById(\"CoverGvalue\").value);\n var blueHex = rgbToHex(document.getElementById(\"CoverBvalue\").value);\n BoardCoverColor = \"0x\" + redHex + greenHex + blueHex;\n\n if(BoardCoverBool){\n Boardmaterial.color.setHex(BoardCoverColor);\n }\n}", "function updateColors() {\n\tfor (var i=0; i<allTissues.length; i++){\n\t\tchangeFillColor(allTissues[i].tissue, allTissues[i].color);\n\t\t//console.log(allTissues[i].tissue+\" \"+allTissues[i].value+\" \"+allTissues[i].color);\n\t}\n\tif(searchByTable){\n\t\tgenerateSelectionTable();\n\t}\n}", "onSave(hsva, instance) {\n var hex = hsva.toHEX().toString();\n State.Colors.background = hex;\n manipulateImage();\n }", "function generateNewColour() {\n var finished = true;\n for (var key in Colour) {\n if(delta[key] != 0) {\n finished = false;\n }\n }\n\n if (finished) {\n colour = nextColour;\n nextColour = randomColour();\n delta = deltaRgb();\n }\n }", "function isColorValid(color) {\n return color ? color === \"blue\" || color === \"green\" : -1;\n}", "function isValidHexColor(t) {\n return item => {\n var hash = hashbow(item);\n t.is(typeof hash, 'string');\n t.is(hash.charAt(0), '#');\n t.is(hash.length, 7);\n };\n}", "function rectifyColors(colors) {\n $$.replace(colors, function(color) {\n // Trim whitespace\n color = color.replace(/(^\\s+|\\s+$|'|\")/g, \"\");\n // Add a prefix '#' if it needs one\n if (color.indexOf(\"#\") == -1 && color.match(/^[0-9a-fA-F]+$/i) != null) {\n color = \"#\" + color;\n }\n return color;\n });\n return colors;\n}", "function styleguideColors(context, colors) {}", "function changeColor() {\r\n var r = $(\"#red\").val();\r\n var g = $(\"#green\").val();\r\n var b = $(\"#blue\").val();\r\n \r\n $(\"#newColor\").css(\"background-color\", \"rgb(\" + r + \",\" + g + \", \" + b + \")\");\r\n }", "set dryColor(value) {}", "set colorValue(value) {}", "function ColorList() {}", "function action(){\n\t\t//When lick create new color\n\t\t$('#btnAdd').on('click', function (e) {\n\t\t\t\n\t\t\t$(\"#dialogAddColor\").find(\"#txtColorCode\").val('');\n\t\t\t$(\"#dialogAddColor\").find(\"#txtDescription\").val('');\n\t\t\t\n\n\t\t\t$(\"#listColor,#dialogAddColor\").find(\"#errorTxtColorCode\").text(\"\");\n\t\t\t$(\"#listColor,#dialogAddColor\").find(\"#txtColorCode\").css(\"border-color\", \"\");\n\t\t\t\n\t\t\t$(\"#listColor,#dialogAddColor\").find(\"#errorTxtDescription\").text(\"\");\n\t\t\t$(\"#listColor,#dialogAddColor\").find(\"#txtDescription\").css(\"border-color\", \"\");\n\t\t\t\n\t\t\t$(\"#dialogAddColor\").dialog({\n\t\t\t\tmodal: true,\n\t\t\t\tshow:{\n\t\t\t\t\teffect:\"blind\",\n\t\t\t\t\tduration: 500\n\t\t\t\t},\n\t\t\t\ttitle: \"Add New Color\",\n\t\t\t\theight: 350,\n\t\t\t\twidth: 450,\n\t\t\t\tbuttons:{\n\t\t\t\t\t\"Save\": {\n\t\t\t\t\t\ttext: \"Save\",\n\t\t\t\t\t\tid : \"btnSaveColor\",\n\t\t\t\t\t\tclick: function(){\n\t\t\t\t\t\tvar colorcode= $(\"#dialogAddColor\").find(\"#txtColorCode\").val();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!isValidationRequiredFieldAddColor()){\n\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \"Please enter color code!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if(!isValidationOverRangeWhenAddColor()){\n\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \"Color Code or Description only 20 characters long!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($.trim(colorcode) !== colorcode){\n\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \"Not allow to type the space as a first/last character on Color Code!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tvar colorcode= $(\"#dialogAddColor\").find(\"#txtColorCode\").val();\n\t\t\t\t\t\t\tvar description= $(\"#dialogAddDestination\").find(\"#txtDescription\").val();\n\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\tdata:JSON.stringify({\n\t\t\t\t\t\t\t\t\tcolorcode: colorcode\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tcontentType: \"application/json\",\n\t\t\t\t\t\t\t\turl: getAbsolutePath() + \"color/isExist/\",\n\t\t\t\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\t\t\t\tif(data.isExisted==false){\n\t\t\t\t\t\t\t\t\t\tvar colorcode= $(\"#dialogAddColor\").find(\"#txtColorCode\").val();\n\t\t\t\t\t\t\t\t\t\t//alert(colorid);\n\t\t\t\t\t\t\t\t\t\tvar description= $(\"#dialogAddColor\").find(\"#txtDescription\").val();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\t\t\t\ttype : 'POST',\n\t\t\t\t\t\t\t\t\t\t\tdata:\n\t\t\t\t\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolorcode: colorcode,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdescription: description,\n\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\tcontentType: \"application/json\",\n\t\t\t\t\t\t\t\t\t\t\turl: getAbsolutePath() + \"color/add\",\n\t\t\t\t\t\t\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#dialogAddColor\").dialog(\"close\");\n\t\t\t\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \"Add Color successfully !\");\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#listColor\").dataTable().fnDestroy();\n\t\t\t\t\t\t\t\t\t\t\t\t$('#listColor tbody').empty();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tloadData();\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\terror: function(){\n\t\t\t\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \"Add Color unsuccessfully !\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \"Color Code Already Existed!\");\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\terror: function(){\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"Cancel\": function(){\n\t\t\t\t\t\t$(\"#dialogAddColor\").dialog(\"close\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t});\n\t\t//when click Edit\n//\t\t$('.btnEdit').on('click', function (e){\n//\t\t\tvar colorcode= $(this).data('id');\n//\t\t\t\n\t\t\t\n//\t\t\t\n//\t\t\t$.ajax({\n//\t \t\tdataType: \"json\",\n//\t\t\t\ttype: 'GET',\n//\t\t\t\tdata:{},\n//\t\t\t\tcontentType: \"application/json\",\n//\t\t\t\turl: \"/Chori/color/detail/\"+colorcode,\n//\t\t\t\tsuccess: function(data){\n//\t\t\t\t\t//if load detail success, then open edit dialog\n//\t\t\t\t\tif(data.status== \"ok\"){\n//\t\t\t\t\t\t$(\"#dialogEditColor\").find(\"#txtColorCode\").val(data.currentcolor.colorcode);\n//\t\t\t\t\t\t$(\"#dialogEditColor\").find(\"#txtDescription\").val(data.currentcolor.description);\n//\t\t\t\t\t\t\n//\t\t\t\t\t\t\n//\t\t\t\t\t}else{\n//\t\t\t\t\t\talert('This alert should never show!');\n//\t\t\t\t\t}\n//\t\t\t\t},\n//\t\t\t\terror: function(){\n//\t\t\t\t\talert('Cant get role detail!');\n//\t\t\t\t}\n//\t \t});\n//\t\t\t$(\"#dialogEditColor\").dialog({\n//\t\t\t\tshow:{\n//\t\t\t\t\teffect:\"blind\",\n//\t\t\t\t\tduration: 500\n//\t\t\t\t},\n//\t\t\t\ttitle: \"Edit Color\",\n//\t\t\t\theight: 500,\n//\t\t\t\twidth: 700,\n//\t\t\t\tbuttons:{\n//\t\t\t\t\t\"Save\": {\n//\t\t\t\t\t\ttext: \"Save\",\n//\t\t\t\t\t\tid : \"btnSaveColor\",\n//\t\t\t\t\t\tclick: function(){\n//\t\t\t\t\t\tvar colorcode= $(\"#dialogEditColor\").find(\"#txtColorCode\").val();\n//\t\t\t\t\t\tvar description= $(\"#dialogEditColor\").find(\"#txtDescription\").val();\n//\t\t\t\t\t\t\n//\t\t\t\t\t\t if(!isValidationOverRangeWhenEditColor()){\n//\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \" Description only 20 characters long!\");\n//\t\t\t\t\t\t\t }else{\n//\t\t\t\t\t\t\t$.ajax({\n//\t\t\t\t\t \t\tdataType: \"json\",\n//\t\t\t\t\t\t\t\ttype: 'POST',\n//\t\t\t\t\t\t\t\tdata:\n//\t\t\t\t\t\t\t\t\tJSON.stringify({\n//\t\t\t\t\t\t\t\t\t\tcolorcode: colorcode,\n//\t\t\t\t\t\t\t\t\t\tdescription: description,\n//\t\t\t\t\t\t\t\t\t}),\n//\t\t\t\t\t\t\t\tcontentType: \"application/json\",\n//\t\t\t\t\t\t\t\turl: \"/Chori/color/edit\",\n//\t\t\t\t\t\t\t\tsuccess: function(data){\n//\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \"Edit Color successfully!\");\n//\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t$(\"#listColor\").dataTable().fnDestroy();\n//\t\t\t\t\t\t\t\t\t$('#listColor tbody').empty();\n//\t\t\t\t\t\t\t\t\t$(\"#dialogEditColor\").dialog(\"close\");\n//\t\t\t\t\t\t\t\t\tloadData();\n//\t\t\t\t\t\t\t\t},\n//\t\t\t\t\t\t\t\terror: function(){\n//\t\t\t\t\t\t\t\t\talert('Cant get role detail!');\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t \t});\n//\t\t\t\t\t\t\t }\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t//\n//\t\t\t\t\t},\n//\t\t\t\t\t\"Cancel\": function(){\n//\t\t\t\t\t\t$(\"#dialogEditColor\").dialog(\"close\");\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t});\n//\t\t});\n\t\n\n\t\t$('.selectOption').on('change', function (e) {\n\t\t\tvar optionSelected = $(this).find(\"option:selected\");\n\t\t var valueSelected = optionSelected.val();\n\t\t \n\t\t var colorcode= $(this).data('id');//this is RoleID of each record.\n\t\t //alert('You choose '+roleIdSeleted+', and the option is: '+ valueSelected);\n\t\t $(\"#listColor,#dialogEditColor\").find(\"#errorTxtDescription\").text(\"\");\n\t\t\t$(\"#listColor,#dialogEditColor\").find(\"#txtDescription\").css(\"border-color\", \"\");\n\t\t $(\".selectOption\").val(\"Options\");\n\t\t \n\t\t \n\t\t //If user choose edit option\n\t\t if(valueSelected==\"Edit\"){\n\t\t \tvar colorcode= $(this).data('id');\n\t\t\t\t$.ajax({\n\t\t \t\tdataType: \"json\",\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdata:JSON.stringify({\n\t\t\t\t\t\tcolorcode: colorcode\n\t\t\t\t\t}),\n\t\t\t\t\tcontentType: \"application/json\",\n\t\t\t\t\turl: getAbsolutePath() + \"color/detail\",\n\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\n\t\t\t\t\t\t//if load detail success, then open edit dialog\n\t\t\t\t\t\tif(data.status== \"ok\"){\n\t\t\t\t\t\t\t$(\"#dialogEditColor\").find(\"#txtColorCode\").val(data.currentcolor.colorcode);\n\t\t\t\t\t\t\t$(\"#dialogEditColor\").find(\"#txtDescription\").val(data.currentcolor.description);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert('This alert should never show!');\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: function(){\n\t\t\t\t\t\talert('Cant get role detail!');\n\t\t\t\t\t}\n\t\t \t});\n\t\t\t\t$(\"#dialogEditColor\").dialog({\n\t\t\t\t\tmodal: true,\n\t\t\t\t\tshow:{\n\t\t\t\t\t\teffect:\"blind\",\n\t\t\t\t\t\tduration: 500\n\t\t\t\t\t},\n\t\t\t\t\ttitle: \"Edit Color\",\n\t\t\t\t\theight: 350,\n\t\t\t\t\twidth: 450,\n\t\t\t\t\tbuttons:{\n\t\t\t\t\t\t\"Save\": {\n\t\t\t\t\t\t\ttext: \"Save\",\n\t\t\t\t\t\t\tid : \"btnSaveColor\",\n\t\t\t\t\t\t\tclick: function(){\n\t\t\t\t\t\t\tvar colorcode= $(\"#dialogEditColor\").find(\"#txtColorCode\").val();\n\t\t\t\t\t\t\tvar description= $(\"#dialogEditColor\").find(\"#txtDescription\").val();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t if(!isValidationOverRangeWhenEditColor()){\n\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \" Description only 200 characters long!\");\n\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t \t\tdataType: \"json\",\n\t\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\t\tdata:\n\t\t\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\t\t\tcolorcode: colorcode,\n\t\t\t\t\t\t\t\t\t\t\tdescription: description,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\tcontentType: \"application/json\",\n\t\t\t\t\t\t\t\t\turl: getAbsolutePath() + \"color/edit\",\n\t\t\t\t\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \"Edit Color successfully!\");\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$(\"#listColor\").dataTable().fnDestroy();\n\t\t\t\t\t\t\t\t\t\t$('#listColor tbody').empty();\n\t\t\t\t\t\t\t\t\t\t$(\"#dialogEditColor\").dialog(\"close\");\n\t\t\t\t\t\t\t\t\t\tloadData();\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\terror: function(){\n\t\t\t\t\t\t\t\t\t\talert('Cant get role detail!');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t \t});\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"Cancel\": function(){\n\t\t\t\t\t\t\t$(\"#dialogEditColor\").dialog(\"close\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t };\n\t\t \n\t\t //if user choose delete option\n\t\t if(valueSelected==\"Delete\"){\n\t\t \tvar colorcode= $(this).data('id');\n\t\t \t$(\"#deleteColorDialog\").find(\"#messageContent\").text('Are you sure you want to delete Color \"' + colorcode+'\"?');\n\t\t\t\t\n\t\t\t\t$(\"#deleteColorDialog\").dialog({\n\t\t\t\t\tmodal: true,\n\t\t\t\t\tshow:{\n\t\t\t\t\t\teffect:\"blind\",\n\t\t\t\t\t\tduration: 500\n\t\t\t\t\t},\n\t\t\t\t\ttitle: \"Delete Confirm\",\n\t\t\t\t\theight: 200,\n\t\t\t\t\twidth: 400,\n\t\t\t\t\tbuttons:{\n\t\t\t\t\t\t\"YES\": function(){\n\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\tdata:JSON.stringify({\n\t\t\t\t\t\t\t\t\tcolorcode: colorcode\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tcontentType: \"application/json\",\n\t\t\t\t\t\t\t\turl: getAbsolutePath() + \"color/delete/\",\n\t\t\t\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\t\t\t\tif(data.status==\"ok\"){\n\t\t\t\t\t\t\t\t\t\tif(data.deleteColor== true){\n\t\t\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", \"Delete successfully!\");\n\t\t\t\t\t\t\t\t\t\t\t$(\"#listColor\").dataTable().fnDestroy();\n\t\t\t\t\t\t\t\t\t\t\t$('#listColor tbody').empty();\n\t\t\t\t\t\t\t\t\t\t\tloadData();\n\t\t\t\t\t\t\t\t\t\t\t$(\"#deleteColorDialog\").dialog(\"close\");\n\t\t\t\t\t\t\t\t\t\t}else if(data.deleteColor== false){\n\t\t\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", 'Can\\'t Delete Color \"'+ colorcode +'\"!');\n\t\t\t\t\t\t\t\t\t\t\t$(\"#deleteColorDialog\").dialog(\"close\");\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", 'Can\\'t Delete Color \"'+ colorcode +'\"!');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", 'Can\\'t Delete Color \"'+ colorcode +'\"!');\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\terror: function(){\n\t\t\t\t\t\t\t\t\tcallMessageDialog(\"Message\", 'Can\\'t Delete Color \"'+ colorcode +'\"!');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"NO\": function(){\n\t\t\t\t\t\t\t$(\"#deleteColorDialog\").dialog(\"close\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t };\n\t\t //end if user choose delete option\n\t\t \n\t\t});\n\t}", "function parse_ls_colors() {\n var ls_colors = $('#ls_colors').val();\n\n var settings = ls_colors.split(':');\n\n for (i = 0; i < settings.length; ++i) {\n if (settings[i] != \"\") {\n var first_split = settings[i].split('=');\n var filetype_index = filetype_keys.indexOf(first_split[0]);\n if (filetype_index == undefined)\n continue;\n var colors = first_split[1].split(';');\n\n // reset bold & colors\n selected_foreground_bold[filetype_index] = 0;\n selected_foreground_colors[filetype_index] = \"default\";\n selected_background_colors[filetype_index] = \"default\";\n\n // go thru all colors\n for (j = 0; j < colors.length; ++j) {\n switch(colors[j]) {\n case \"0\":\n case \"00\":\n selected_foreground_colors[filetype_index] = \"default\";\n break;\n case \"01\":\n selected_foreground_bold[filetype_index] = 1;\n break;\n case \"31\":\n selected_foreground_colors[filetype_index] = \"red\";\n break;\n case \"32\":\n selected_foreground_colors[filetype_index] = \"green\";\n break;\n case \"33\":\n selected_foreground_colors[filetype_index] = \"brown\";\n break;\n case \"34\":\n selected_foreground_colors[filetype_index] = \"blue\";\n break;\n case \"35\":\n selected_foreground_colors[filetype_index] = \"magenta\";\n break;\n case \"36\":\n selected_foreground_colors[filetype_index] = \"cyan\";\n break;\n case \"37\":\n selected_foreground_colors[filetype_index] = \"grey\";\n break;\n case \"40\":\n selected_background_colors[filetype_index] = \"default\";\n break;\n case \"41\":\n selected_background_colors[filetype_index] = \"red\";\n break;\n case \"42\":\n selected_background_colors[filetype_index] = \"green\";\n break;\n case \"43\":\n selected_background_colors[filetype_index] = \"brown\";\n break;\n case \"44\":\n selected_background_colors[filetype_index] = \"blue\";\n break;\n case \"45\":\n selected_background_colors[filetype_index] = \"magenta\";\n break;\n case \"46\":\n selected_background_colors[filetype_index] = \"cyan\";\n break;\n case \"47\":\n selected_background_colors[filetype_index] = \"grey\";\n break;\n } \n }\n\n }\n }\n\n update_everything();\n }", "function createColorPalette(colors){\n\n\t\t// create a swatch for each color\n\t\tfor (var i = colors.length - 1; i >= 0; i--) {\n\t\t\tvar $swatch = $(\"<div>\").css(\"background-color\", colors[i])\n\t\t\t\t\t\t\t\t.addClass(\"swatch\");\n\t\t\t$swatch.click(function(){\n\t\t\t\t// add color to the color palette history\n\t\t\t\tcp.history.push($(this).css(\"background-color\"));\n\t\t\t\t// $(this).css(\"border\",\"10px solid black\");\n\n\t\t\t});\n\t\t\tcp.$container.append($swatch);\n\t\t}\n\t}", "constructor(white, red, green, blue) {\n this.white = white;\n this.red = red;\n this.green = green;\n this.blue = blue;\n }", "async function clickHandler(event) {\n event.preventDefault();\n setLoading(true)\n try {\n const color = await addColor(generateRandomColor())\n const data = color.data.insert_colors.returning;\n storeData(data[0].uid, data[0].type, data[0].hex)\n } catch (err) {\n console.log(err)\n }\n setLoading(false)\n }", "function addColors() {\n\tvar temp = \"rgb(\" + generateRGB() + \", \" + generateRGB() + \", \" + generateRGB() + \")\";\n\treturn temp;\n}", "function setColors () {\r\n for (let i = 0; i<squares.length; i++) {\r\n squares[i].style.backgroundColor = colors[i];\r\n}}", "function assignColors() {\r\n\t// assign the right color\r\n\trightColor = colors[Math.floor(Math.random()*mode)];\r\n\t// display it\r\n\tcolorDisplay.textContent = rightColor;\r\n\r\n\t// loop through colors array and assign rgb to squares\r\n\tfor(var i = 0; i < colors.length; i++){\r\n\t\tsquares[i].style.backgroundColor = colors[i];\r\n\t} \r\n}", "function checkColor(args){\n\tvar p = args[0];\n\tvar rgb = args[1];\n\tviewerParams.Pcolors[p] = [rgb.r/255., rgb.g/255., rgb.b/255., rgb.a];\n\t//update the octree loading bar if it exists\n\tif (viewerParams.haveOctree[p]){\n\t\td3.select('#' + p + 'octreeLoadingFill').attr('fill','rgb(' + (255*viewerParams.Pcolors[p][0]) + ',' + (255*viewerParams.Pcolors[p][1]) + ',' + (255*viewerParams.Pcolors[p][2]) + ')')\n\t\td3.select('#' + p + 'octreeLoadingText').attr('fill','rgb(' + (255*viewerParams.Pcolors[p][0]) + ',' + (255*viewerParams.Pcolors[p][1]) + ',' + (255*viewerParams.Pcolors[p][2]) + ')')\n\t}\n}", "function create_color_picker() {\n var tablediv = document.getElementById('color-picker');\n var table = document.createElement(\"table\");\n table.className = \"color-picker-table\";\n tablediv.appendChild(table);\n var tr;\n var count = 0;\n var step = 63; // red, green, and blue have 256 values.\n // three for loops step through these values, so for step=63 we have 5*5*5=125 color cells\n for (var r=0; r < 256; r += step) {\n for (var g=0; g < 256; g += step) {\n for (var b = 0; b < 256; b += step) {\n if (count++ % 24 === 0) { // new row after 24 color cells\n tr = document.createElement(\"tr\");\n table.appendChild(tr);\n }\n var td = document.createElement(\"td\");\n td.className = \"picker-pixel\";\n td.style.backgroundColor = \"rgb(\"+r+\",\"+g+\",\"+b+\")\";\n td.addEventListener(\"click\", choosecolor); // the callback function will look a the background color\n tr.appendChild(td);\n }\n }\n }\n}", "function addToDocumentColors(context) {\n\taddToColors(context, \"document\");\n}", "function setColor(colors, color, type, save, alpha) { // color only full range\n\t\tif (typeof color === 'string') {\n\t\t\tvar color = ColorConverter.txt2color(color); // new object\n\t\t\ttype = color.type;\n\t\t\t_colors[type] = color[type];\n\t\t\talpha = alpha !== undefined ? alpha : color.alpha;\n\t\t} else if (color) {\n\t\t\tfor (var n in color) {\n\t\t\t\tcolors[type][n] = limitValue(color[n] / _valueRanges[type][n][1], 0 , 1);\n\t\t\t}\n\t\t}\n\t\tif (alpha !== undefined) {\n\t\t\tcolors.alpha = limitValue(+alpha, 0, 1);\n\t\t}\n\t\treturn convertColors(type, save ? colors : undefined);\n\t}", "setBGColor(row) {\r\n let colorObj = JSON.parse(row[\"ColorCode\"]);\r\n return hexToRgba(colorObj.color, colorObj.alpha);\r\n }", "function addColors() {\n var currentScore = parseInt(document.getElementById(\"current-score\").innerHTML);\n if (currentScore >= 10 && !yellowActivated) {\n yellowActivated = true;\n colorArray.push(\"gold\");\n }\n if (currentScore >= 20 && !greenActivated) {\n greenActivated = true;\n colorArray.push(\"green\");\n }\n if (currentScore >= 50 && !purpleActivated) {\n purpleActivated = true;\n colorArray.push(\"darkmagenta\");\n }\n if (currentScore >= 100 && !orangeActivated) {\n orangeActivated = true;\n colorArray.push(\"darkorange\");\n }\n if (currentScore >= 200 && !pinkActivated) {\n pinkActivated = true;\n colorArray.push(\"deeppink\");\n }\n if (currentScore >= 500 && !tealActivated) {\n tealActivated = true;\n colorArray.push(\"#33ADD6\");\n }\n if (currentScore >= 1000 && !brownActivated) {\n brownActivated = true;\n colorArray.push(\"saddlebrown\");\n }\n if (currentScore >= 2000 && !grayActivated) {\n grayActivated = true;\n colorArray.push(\"dimgrey\");\n }\n if (currentScore >= 5000 && !blackActivated) {\n blackActivated = true;\n colorArray.push(\"black\");\n }\n if (currentScore >= 10000 && !whiteActivated) {\n whiteActivated = true;\n colorArray.push(\"ghostwhite\");\n }\n }", "function isValidationRequiredFieldAddColor(){\n\t\tvar colorCode= $(\"#dialogAddColor\").find(\"#txtColorCode\").val();\n\t\tif(colorCode.trim()== '' || colorCode == null)\n\t\t\treturn false;\n\t\treturn true;\n\t}", "function setElementBGColor(element, red, green, blue) {\n // An array containing the three primary colors\n // .join(',') adds commas between the indices\n let rgbVal = [red, green, blue].join(',');\n // the color box sends the rgb values to the background-color built-in function in the CSS file\n element.style.backgroundColor = \"rgb(\" + rgbVal + \")\";\n}", "function changeEveryColorToRed(colors) {\n}", "onSave(hsva, instance) {\n var hex = hsva.toHEX().toString();\n State.Colors.image = hex;\n manipulateImage();\n }", "function addBlock() {\n randColor = randomNumber(first, (colors.length - 1));\n theColor = colors[randColor];\n //Checks to make sure the color isn't already in use\n theColor = checkColor(theColor);\n //disables add button if there are no more available colors\n ifNull(theColor);\n}", "function colorDemo() {\n\tif (systemState != \"demo\") {\n\t\t//no more\n\t\treturn;\n\t}\n\n\tfor (var id in hue) {\n\t\tvar payload = {\n\t\t\ton : true,\n\t\t\tbri: 255,\n\t\t\thue: hueValue,\n\t\t\tsat: 255\n\t\t};\n\t\t//console.log(JSON.stringify(payload))\n\t\tif (!put('/api/loganrooper/lights/'+hue[id]+'/state', payload)) {\n\t\t\t//errors\n\t\t\tconsole.log('connection to hue has errors');\n\t\t}\n\t}\n\thueValue += 3000*n;\n\tif (hueValue > 65535 || hueValue < 1) {\n\t\tn *= -1;\n\t}\n\n}", "function changeColor() {\n\tvar r = $(\"#red\").val();\n\tvar g = $(\"#green\").val();\n\tvar b = $(\"#blue\").val();\n\t$(\"#newColor\").css(\"background-color\", \"rgb(\" + r + \",\" + g + \",\" + b + \")\");\n}", "function saveColor() {\n //Read current hex value\n const colorValueEl = document.querySelector(\"#colorValue\");\n const color = colorValueEl.innerText;\n\n //Create list item\n const colorList = document.querySelector(\"#colors\");\n const newColor = document.createElement(\"li\");\n\n //Set list item to random color\n newColor.style.backgroundColor = color;\n newColor.textContent = color;\n newColor.setAttribute(\"data-color\", color);\n\n //Add list item to color list\n colorList.appendChild(newColor);\n\n //Duplicate check\n if (!colors.includes(currentColor)) {\n colors.push(currentColor);\n }\n\n //Save colors array to the local storage\n saveColorsToLocalStorage();\n\n //Create delete button\n const deleteButton = document.createElement(\"button\");\n deleteButton.innerHTML = \"Delete\";\n\n //Add delete button\n newColor.appendChild(deleteButton);\n\n //Add event listener to delete button\n deleteButton.addEventListener(\"click\", deleteColor);\n\n //Update status of button for color change\n updateSaveButton();\n}", "function isValidationOverRangeWhenAddColor(){\n\t\tvar colorCodeLength= $(\"#listColor,#dialogAddColor\").find(\"#txtColorCode\").val().length;\n\t\tif(colorCodeLength>20)\n\t\t\treturn false;\n\t\t\n\t\tvar colorDescriptionLength = $(\"#listColor,#dialogAddColor\").find(\"#txtDescription\").val().length;\n\t\tif(colorDescriptionLength>200)\n\t\t\treturn false;\n\t\treturn true;\n\t}", "function changeColors(color)\n{\n\tfor (var i = 0; i < colors.length; i++)\n\t{\n\t\tsqrs[i].style.backgroundColor = color;\n\t}\n}", "function setColours() {\r\n\tfor(var i = 0; i < colours.length; i++) {\r\n\t\tsquares[i].style.backgroundColor = colours[i]\r\n\t}\r\n}", "addValidity(){\n\t\tif(this.isValid()){\n\t\t\t$(this.element).addClass(\"valid\");\n\t\t\t$(this.element).removeClass(\"invalid\");\n\t\t\t$(this.element).css(\"background-color\",\"hsla(87, 70%, 40%,0.4)\");\n\t\t}else{\n\t\t\t$(this.element).addClass(\"invalid\");\n\t\t\t$(this.element).removeClass(\"valid\");\n\t\t\t$(this.element).css(\"background-color\",\"hsla(5, 100%, 40%,0.4)\");\n\t\t}\n\t}" ]
[ "0.74186105", "0.63340425", "0.62619114", "0.62283933", "0.60494375", "0.57800055", "0.57658297", "0.5718206", "0.5692778", "0.56724125", "0.5618062", "0.56137556", "0.56040674", "0.5594785", "0.5590798", "0.55860156", "0.5571974", "0.55610424", "0.5551909", "0.55421746", "0.5532153", "0.5518332", "0.5518332", "0.5518332", "0.5518332", "0.5509682", "0.55067176", "0.5504293", "0.54972076", "0.5492118", "0.54763895", "0.54687446", "0.5460556", "0.5444552", "0.54435265", "0.54407805", "0.5437118", "0.5435855", "0.542001", "0.54195935", "0.54129803", "0.5412061", "0.5411864", "0.5411864", "0.54082507", "0.53953505", "0.5393148", "0.53860855", "0.5380621", "0.5357216", "0.534568", "0.5339575", "0.5339281", "0.5338099", "0.5338099", "0.5333654", "0.5331215", "0.53282076", "0.5323489", "0.5310885", "0.5298936", "0.52989215", "0.5298799", "0.5295134", "0.529366", "0.5286124", "0.52788764", "0.5274925", "0.52747667", "0.52686983", "0.5266946", "0.5263968", "0.526133", "0.5256545", "0.5254198", "0.5250972", "0.52493227", "0.5248661", "0.52483433", "0.5245482", "0.5243949", "0.52436316", "0.52411395", "0.52398425", "0.52391005", "0.5236371", "0.5234001", "0.522899", "0.5225054", "0.5212558", "0.52118015", "0.5208379", "0.52048105", "0.52003294", "0.52000093", "0.5199709", "0.5196994", "0.51920825", "0.51870537", "0.51845515" ]
0.76230925
0
These are all autoadvancing slideshows with a dot interface (no arrows). Several selectors use the same JS config but might have somewhat different CSS styling.
function simpleSlideshow() { $('.slideshow--simple, .slideshow--research').on('init', (e, slick) => { $('.slick-dots, .slick-arrow').on('click', function() { $('.slideshow--simple, .slideshow--research').slick('slickPause'); }); }); $('.slideshow--simple, .slideshow--research').slick({ dots: true, arrows: false, fade: true, lazyLoad: true, autoplay: !reducedMotionState, autoplaySpeed: 7000, focusOnSelect: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSlides(n) {\r\n var i;\r\n var slides = document.getElementsByClassName(\"item\");\r\n var dots = document.getElementsByClassName(\"slider-dots_item\");\r\n if (n > slides.length) {\r\n slideIndex = 1;\r\n }\r\n if (n < 1) {\r\n slideIndex = slides.length\r\n }\r\n for (i = 0; i < slides.length; i++) {\r\n slides[i].style.display = \"none\"; //can use addclass\r\n }\r\n for (i = 0; i < dots.length; i++) {\r\n dots[i].className = dots[i].className.replace(\" active\", \"\");\r\n }\r\n slides[slideIndex - 1].style.display = \"block\"; //can use addclass\r\n dots[slideIndex - 1].className += \" active\";\r\n}", "function showSlides(n) {\r\n var i;\r\n var slides = document.getElementsByClassName(\"mySlides\");\r\n var slidesParagraph = document.getElementsByClassName(\"paragraph\");\r\n var dots = document.getElementsByClassName(\"dot\");\r\n\r\n if (n > slides.length) { slideIndex = 1 }\r\n if (n < 1) { slideIndex = slides.length }\r\n\r\n if (n > slidesParagraph.length) { slideIndex = 1 }\r\n if (n < 1) { slideIndex = slidesParagraph.length }\r\n\r\n for (i = 0; i < slides.length; i++) {\r\n slides[i].style.display = \"none\";\r\n }\r\n for (i = 0; i < dots.length; i++) {\r\n dots[i].className = dots[i].className.replace(\" active\", \"\");\r\n }\r\n for (i = 0; i < slidesParagraph.length; i++) {\r\n slidesParagraph[i].style.display = \"none\";\r\n }\r\n\r\n slidesParagraph[slideIndex - 1].style.display = \"block\";\r\n slides[slideIndex - 1].style.display = \"block\";\r\n dots[slideIndex - 1].className += \" active\";\r\n}", "function showSlides() {//Cusom function - 2%\n let i; //Use local scope variable - 2%\n let slides = document.getElementsByClassName(\"mySlides\");\n let dots = document.getElementsByClassName(\"dot\");\n for (i = 0; i < slides.length; i++) { //Use for statement - 5%\n slides[i].style.display = \"none\"; \n }\n slideIndex++;\n if (slideIndex > slides.length) {slideIndex = 1} \n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\"); //Access an objects method using dot notation - 2% + Access an objects method using dot notation - 2%\n }\n slides[slideIndex-1].style.display = \"block\"; //Use an array - 2%\n dots[slideIndex-1].className += \" active\";\n setTimeout(showSlides, 7500); //Change image every 7,5 seconds\n}", "function showSlides(n) {\r\n var x;\r\n var slides = document.getElementsByClassName(\"slides\");\r\n var dots = document.getElementsByClassName(\"dot\");\r\n if (n > slides.length) {slideInd = 1}\r\n if (n < 1) {slideInd = slides.length}\r\n \r\n for (x = 0; x < slides.length; x++) {\r\n slides[x].style.display = \"none\";\r\n }\r\n for (x = 0; x < dots.length; x++) {\r\n dots[x].className = dots[x].className.replace(\" active\", \"\");\r\n }\r\n if (slideInd > slides.length) {slideInd = 1}\r\n slides[slideInd-1].style.display = \"block\";\r\n dots[slideInd-1].className += \" active\";\r\n slideInd++;\r\n}", "function showSlides(n)\n{\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) \n {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) \n {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n}", "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {\n slideIndex = 1;\n }\n if (n < 1) {\n slideIndex = slides.length;\n }\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className.replace(\" acive\", \"\");\n }\n slides[slideIndex - 1].style.display = \"block\";\n dots[slideIndex - 1].className += \" active\";\n}", "function oneShow(n) {\n const slides = document.getElementsByClassName('main-banner');\n const dots = document.getElementsByClassName('dot');\n // resets all banner display to none\n for (let i = 0; i < slides.length; i++) {\n slides[i].style.display = 'none';\n }\n for (let i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(' active', '');\n }\n slides[n].style.display = 'block';\n}", "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {slideIndex = 1} \n if (n < 1) {slideIndex = slides.length} ;\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\"; \n }\n for (i = 0; i < dots.length; i++) {\n dots[i].classList.remove(\"active\");\n }\n slides[slideIndex-1].style.display = \"block\"; \n dots[slideIndex-1].classList.add(\"active\");\n}", "function showSlides(n) {\n var dotsArr = document.getElementById('dotsHere').children;\n if(n < 1) {slideIndex = slides.length;}\n if(n > slides.length) {slideIndex = 1;}\n\n for(i=0; i < slides.length; i++){\n slides[i].style.display = 'none';\n dotsArr[i].classList.remove('active');\n }\n\n slides[slideIndex - 1].style.display = 'block';\n dotsArr[slideIndex - 1].classList.add('active');\n}", "function showSlides(n) {\r\n var slides = document.querySelectorAll(\".mySlides\");\r\n //var dots = document.querySelectorAll(\".dot\");\r\n\r\n if (n > slides.length) { slideIndex = 1 } //snap to beginning of slideshow\r\n\r\n if (n < 1) { slideIndex = slides.length } //fell off the end, show final slide\r\n\r\n slides.forEach((slide) => {\r\n slide.style.display = \"none\";\r\n })\r\n \r\n slides[slideIndex - 1].style.display = \"block\";\r\n}", "function showSlides(n) {\n let i;\n if (n > slides.length) {\n slideIndex = 1\n }\n if (n < 1) {\n slideIndex = slides.length\n }\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex - 1].style.display = \"block\";\n dots[slideIndex - 1].className += \" active\";\n}", "function slides() {\r\n $(\".dots .dot\").click(function () {\r\n index = ($(this).index());\r\n if (index <= 5) {\r\n $(\".dot\").removeClass(\"active\");\r\n $(\".dots\").children().eq(index).addClass(\"active\");\r\n }\r\n\r\n tuto();\r\n });\r\n }", "function init() {\n\n parents = document.getElementsByClassName('slideshow-container');\n\n for (j = 0; j < parents.length; j++) {\n var slides = parents[j].getElementsByClassName(\"mySlides\");\n var dots = parents[j].getElementsByClassName(\"dot\");\n slides[0].classList.add('active-slide');\n dots[0].classList.add('active');\n }\n}", "function showDivs(n) {\n if (n > mySlides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = mySlides.length} ;\n for (i = 0; i < mySlides.length; i++) {\n mySlides[i].style.display = \"none\";\n }//Gère la boucle de défilement des images et cache les divs mySlides\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\"backgroundWhite\", \"\");\n }//Enlève la classe de colorisation de la puce par défaut\n mySlides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" backgroundWhite\";\n //Colore la puce associée à l'image associée\n}", "function showSlides(){\r\n\t\tlet slides = document.getElementsByClassName(\"eachslide\");\r\n\t\t\tfor (let i=0; i < slides.length; i++){\r\n\t\t\t\tslides[i].style.display = \"none\";\r\n\t\t\t}\r\n\t\t\tslideIndx++;\r\n\t\t\tif (slideIndx > slides.length){\r\n\t\t\t\tslideIndx = 1;\r\n\t\t\t}\r\n\t\t\tslides[slideIndx-1].style.display = \"block\";\r\n\t\t\ttimerSlide = setTimeout(showSlides, 2500); //2.5 seconds\r\n\t}", "function showSlides(n){\n var i;\n var slides = document.getElementsByClassName(\"image\");\n console.log(slides.length)\n var dots = document.getElementsByClassName(\"dot\");\n //if on the fourth slide and next gets pushed go back to first slide\n if(n > slides.length){\n slideIndex = 1\n }\n //if on the first slide and prev gets pushed go to last slide\n if(n < 1){\n slideIndex = slides.length;\n }\n\n for(i = 0 ; i < slides.length ; i++){\n slides[i].style.display = \"none\";\n }\n\n for(i = 0 ; i < dots.length ; i++){\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n console.log(slides[slideIndex-1]);\n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n}", "function showSlides(n) {\n var am;\n var anmeld = document.getElementsByClassName(\"anmeldelse\");\n var prikkerne = document.getElementsByClassName(\"prik\");\n if (n > anmeld.length) {\n anmeldIndex = 1\n }\n if (n < 1) {\n anmeldIndex = anmeld.length\n }\n for (am = 0; am < anmeld.length; am++) {\n anmeld[am].style.display = \"none\";\n }\n for (am = 0; am < prikkerne.length; am++) {\n prikkerne[am].className = prikkerne[am].className.replace(\"aktive\", \"\");\n }\n // display:none i CSS ændres til display: block\n anmeld[anmeldIndex - 1].style.display = \"block\";\n // Giver farve på prikkens respektive slide\n prikkerne[anmeldIndex - 1].className += \" aktive\";\n}", "function showSlide()\r\n{\r\n // create objects\r\n const image1 = {file: \"ocean_beach_2.jpg\", description: \"Ocean Beach\", alt: \"Ocean Beach\"};\r\n const image2 = {file: \"back_beach_sorrento.jpg\", description: \"Sorrento Back Beach\", alt: \"Sorrento Back Beach\"};\r\n const image3 = {file: \"ocean_beach.jpg\", description: \"Ocean Beach\", alt: \"Ocean Beach\"};\r\n \r\n // using an array\r\n const images = [image1, image2, image3];\r\n \r\n // limit slideshow\r\n if (slideIndex >= images.length)\r\n {\r\n slideIndex = 0; // reset to the start\r\n }\r\n if (slideIndex === -1)\r\n {\r\n slideIndex = images.length-1; // reset to last slide \r\n }\r\n\r\n // display the slide\r\n const slideImage = document.querySelector(\".slides img\");\r\n slideImage.src = \"ICTWEB431_AE_Pro_1of2_SR1/\" + images[slideIndex].file;\r\n slideImage.alt = images[slideIndex].alt;\r\n\r\n // slides[slideIndex - 1].style.display = \"block\";\r\n\r\n // display description\r\n const description = document.querySelector(\".description\");\r\n description.innerHTML = images[slideIndex].description;\r\n\r\n // display the slide dot as the current dot\r\n // remove the class active from all dots\r\n const dotsList = document.getElementsByClassName(\"dot\");\r\n\r\n for (let i = 0; i < dotsList.length; i++)\r\n {\r\n dotsList[i].classList.remove(\"active\");\r\n }\r\n \r\n // set the class for the slide as \"active\" \r\n dotsList[slideIndex].classList.add(\"active\");\r\n\r\n}", "function currentSlide(n) {\n // Set slideIndex based on dot clicked and display\n showSlides(slideIndex = n);\n}", "function dotToSlideOne() {\r\n slide1Image.className = slide2Image.className = slide3Image.className = \"hero-image\";\r\n blobBackgrounds.style.opacity = 1;\r\n toOne();\r\n}", "function showNextSlide() {\n\tvar slides = document.getElementsByClassName(\"mySlides\");\n\tvar dots = document.getElementsByClassName(\"dot-slides\");\n\n\t//active class on slides and dots\n\tfor ( var i = 0; i < slides.length; i++ ) {\n\t\tslides[i].classList.remove('active');\n\t\tdots[i].classList.remove('active');\n\t}\n\tslides[slideIndex - 1].classList.add('active');\n\tdots[slideIndex - 1].classList.add('active');\n\n\tslideIndex++;\n\tif (slideIndex > slides.length) {slideIndex = 1} \n}", "function automaticallySlide(){\n\t\tactiveSlideNum++;\n\t\tif(activeSlideNum>3) activeSlideNum=1;\n\t\tactiveDot = \"dot_\" + activeSlideNum;\n\t\tactiveSlide = \"slide_\" + activeSlideNum;\n\n\t\t$(\".find_carousel .slide\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeSlide).addClass(\"active\");\n\n\t\t$(\".find_carousel .dot\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeDot).addClass(\"active\");\n\t}", "function slidetweaks()\n{\n\tvar $ = jQuery;\n\n\t// Because of where this callback function is executed within \n\t// SlidesJS code I don't have access to sjs variable in here :(\n\n\t// put prev & next inside of main slide area so they can be positioned relative to it.\n\t$('.slidesjs-navigation').appendTo('.slidesjs-container');\n\n\t$('.slidesjs-slide').css('display','block');\n\t$('.slidesjs-slide img').each( function(index,element){ centerImage(element); } );\n\t$('.slidesjs-slide').css('display','none');\n\t$('.slidesjs-slide').first().css('display','block');\n}", "function showSlide(n) {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex-1].style.display = \"block\";\n $(\"div:has([style='display: block;'])\").fadeIn(2000);\n dots[slideIndex-1].className += \" active\";\n }", "function slideshow()\n\t{\n\t\tvar x=document.getElementsByClassName(\"slide\");\n\t\tfor(i=0;i<x.length;i++)\n\t\t\t{\n\t\t\t\tx[i].style.display=\"none\";\n\t\t\t}\n\t\t\tsliderindex++;\n\t\t\tif(x.length<sliderindex)\n\t\t\t\t{\n\t\t\t\t\tsliderindex=1;\n\t\t\t\t}\n\t\t\t\tx[sliderindex-1].style.display=\"block\";\n\t\t\t\tsetTimeout(slideshow,5000);\n\n\t}", "function js_startSlide() {\n reset();\n sliderImages[0].style.display = 'block'; // Show image 1.\n temporal[current].innerHTML = current + 1 + \"/\" + sliderImages.length; // Print number image is in current location.\n dots[current].classList.add(\"active\"); // Add class active dot current image.\n}", "function showSlide() {\n // the first slide will be shown when a user clicks right being on the last slide\n if (sliderIndex == slides.length){\n sliderIndex = 0;\n }\n // the last slide will be shown when a user clicks left being on the first slide\n if (sliderIndex < 0){\n sliderIndex = 3;\n }\n\n slides.forEach((item) => item.style.display = 'none');\n slides[sliderIndex].style.display = 'block';\n\n dots.forEach((item) => item.classList.remove('dot-active'));\n dots[sliderIndex].classList.add('dot-active');\n }", "function SlideShow() {\n\n let slideshow = document.getElementsByClassName(\"slideshow\");\n for(let i = 0; i < slideshow.length; i++) {\n slideshow[i].style.display = \"none\";\n }\n\n if(++count > slideshow.length) {\n count = 1;\n }\n\n slideshow[count-1].style.display = \"block\";\n /*\n timerID used to clear the timer.\n */\n timerID = setTimeout(SlideShow, 5000);\n\n }", "function carrousel(){\n\t//el objetivo es establecer inline nuestra imagen con la que queremos jugar.\n var i;\n var x = document.getElementsByClassName(\"slide1\");\n for(i=0; i<x.length; i++){\n x[i].style.display = \"none\";\n }\n myIndex1++;\n if ( myIndex1 > x.length){myIndex1=1};\n x[myIndex1-1].style.display = \"inline\";\n\n x = document.getElementsByClassName(\"slide2\");\n for(i=0; i<x.length; i++){\n x[i].style.display = \"none\";\n }\n myIndex2++;\n if ( myIndex2 > x.length){myIndex2=1};\n x[myIndex2-1].style.display = \"inline\";\n\n x = document.getElementsByClassName(\"slide3\");\n for(i=0; i<x.length; i++){\n x[i].style.dispaly = \"none\";\n }\n myIndex3++;\n if ( myIndex3 > x.length){myIndex3=1};\n x[myIndex3-1].style.display = \"inline\";\n}", "function Initialize2()\n{\n const Slides = document.querySelectorAll('.slides1');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function showSlides() {\n slideIndex++;\n showSlidesByClick(slideIndex);\n}", "function showThisSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n}", "function showSlides(opt_offset) {\n var jSlideWrap = $('#slideWrap'),\n slideIndex = (opt_offset || 0) + jSlideWrap.data('slide-index');\n jSlideWrap.addClass('showing').data('slide-index', slideIndex);\n\n var file = jSlideWrap.data('slide-file'),\n slides = file.vid.slides, \n slide = slides[slideIndex];\n\n jSlideWrap.find('.previous')[slideIndex > 0 ? 'removeClass' : 'addClass']('disabled');\n jSlideWrap.find('.next')[slideIndex + 1 < slides.length ? 'removeClass' : 'addClass']('disabled');\n\n getVideoImage(file.path.replace(/\\?/g, '%3F'), slide.time, function(img, time, event) {\n if (event.type != 'error') {\n maximizeFontSize(\n jSlideWrap.css('background-image', JS.sub(\"url('{}')\", img.src))\n .find('.text').text(slide.text)[0]\n );\n }\n });\n}", "function setDots(dotIncrement) {\n if (dotIncrement !== initialSlideLengthQS) {\n for (let i = 0; i < initialSlideLengthQS; i += dotIncrement) {\n // gives first dot class of active\n if (i === 0) {\n $('#quickSwap .slider-dots').append('<div class=\"slider-dot active\" data-target=\"#slider1\" data-selector=\"' + i + '\"></div>');\n } else {\n $('#quickSwap .slider-dots').append('<div class=\"slider-dot\" data-target=\"#slider1\" data-selector=\"' + i + '\"></div>');\n }\n }\n }\n }", "function showDivs(n, dots, x) {\n slideIndex = n;\n if (n > x.length) {slideIndex = 1}\n if (n < 1) {slideIndex = x.length}\n for (let i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n for (let i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\"active-dot\", \"\");\n }\n x[slideIndex-1].style.display = \"flex\";\n dots[slideIndex-1].className += \" active-dot\";\n}", "function showFirstDot(){\n var dots = document.getElementsByClassName(\"h5p-image-gallery-dot\");\n if (dots.length > 0){\n showContentDot(0);\n }\n}", "function plusSlides(position) {\n slideIndex += position;\n if (slideIndex > slides.length) {slideIndex = 1}\n else if (slideIndex < 1){slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n } \n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n }", "function Initialize()\n{\n const Slides = document.querySelectorAll('.slides');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function showSlides(n) {\n var i;\n var color = [\"rgb(239,73,48)\", \"rgb(4,136,230)\", \"rgb(26,26,26)\"];\n var path = \"https://jiade-tech2020.en.made-in-china.com/product\";\n var paths = [\n \"/odrEBQJksTWL/China-Jd-20A06-1-Fat-Tire-48V-10-4ah-11-6ah-14-5ah-16ah-Lithium-Battery-Power-Folding-Electric-Bicycle.html\",\n \"/vdRmSkEchahH/China-Jd-20A06-2-Fat-Tire-Foldable-500W-750W-1000W-Electric-Bike-Rear-Motor-with-Lithium-Battery.html\",\n \"/xFRnvaEJTGcb/China-Jd-20A06-3-Folding-Fat-Tire-Ebike-48V-500W-Fold-Ebike-Fat-Tire-Adult-Electric-Bicycle.html\",\n ];\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n var action = document.getElementById(\"buy\");\n if (n > slides.length) {\n slideIndex = 1;\n }\n if (n < 1) {\n slideIndex = slides.length;\n }\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex - 1].style.display = \"block\";\n dots[slideIndex - 1].className += \" active\";\n action.style.backgroundColor = color[slideIndex - 1];\n action.href = path + paths[slideIndex - 1];\n}", "function nextSlides() {\n presetStyle()\n visuals[slideIndex].style.zIndex = '100'\n visuals[slideIndex].style.opacity = '1'\n dots[slideIndex].style.backgroundColor = 'black'\n\n if (slideIndex >= dots.length - 1) {\n slideIndex = 0\n } else {\n slideIndex++\n }\n}", "function Slideshow(params) {\n var id = params.idx;\n jqw.JQueryWidget.call(this, \"div\", params);\n this.control = $(tmpl);\n this.control.appendTo(this.element);\n this.button_prev = this.control.find('.prev');\n this.button_next = this.control.find('.next');\n\n this.button_prev.click(function() {\n widget.find(id).prev();\n });\n\n this.button_next.click(function() {\n widget.find(id).next();\n });\n\n var swipeDir = 1;\n // swipe backwards (for comfort sheet music swipe)\n if (params.swipeDir == -1) {\n swipeDir = -1;\n }\n\n $(document).keydown(function(e) {\n if(e.keyCode == 32 || e.keyCode == 39) { widget.find(id).next(); }\n if(e.keyCode == 37) { widget.find(id).prev(); }\n if(e.keyCode == 35) { widget.find(id).last(); }\n if(e.keyCode == 36) { widget.find(id).first(); }\n });\n\n if(params.noSwipe === undefined) {\n $('html').on('swipe', function(e, Dx, Dy) {\n if((Dx * swipeDir) == 1) { widget.find(id).next(); }\n if((Dx * swipeDir) == -1) { widget.find(id).prev(); }\n });\n }\n\n if(params.hideButtons) {\n this.button_next.hide();\n this.button_prev.hide();\n }\n\n window.addEventListener('orientationchange', function() {\n var win = $(window);\n $bg.css(\"height\", win.height() + \"px\");\n $bg.css(\"width\", win.width() + \"px\");\n });\n}", "function currentSlide(n,p) {\r\n showSlides(slideIndex = n,p);\r\n \r\n}", "function plusSlides(n) {\r\n const slides = document.querySelectorAll(\".locSlide\");\r\n slideIndex += n;\r\n if (slideIndex > slides.length) {slideIndex = 1}\r\n else if (slideIndex<1){slideIndex = slides.length}\r\n\r\n for (i = 0; i<slides.length; i++){\r\n slides[i].style.display = \"none\";\r\n }\r\n \r\n slides[slideIndex-1].style.display = \"block\";\r\n}", "function addInternalSelectors(){\r\n container.find(options.sectionSelector).addClass(SECTION);\r\n container.find(options.slideSelector).addClass(SLIDE);\r\n }", "function addInternalSelectors(){\r\n container.find(options.sectionSelector).addClass(SECTION);\r\n container.find(options.slideSelector).addClass(SLIDE);\r\n }", "function addInternalSelectors(){\r\n container.find(options.sectionSelector).addClass(SECTION);\r\n container.find(options.slideSelector).addClass(SLIDE);\r\n }", "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "function showDivs(n) {\n slideDivNbr=n;\n \n if(n>slides.length-1) {\n slideDivNbr=0;\n } \n if (n<0) {\n slideDivNbr=slides.length-1;\n }\n //hide all slides\n var i;\n for(i=0;i<slides.length;i++){\n slides[i].style.display=\"none\";\n }\n //display slide n\n slides[slideDivNbr].style.display = \"block\";\n \n //highlight active dot\n highlightDot(slideDivNbr);\n}", "function nextSlide() {\r\n // hide the currentSlide and remove currentDot class from the dot\r\n slides[currentSlide].className = 'slide';\r\n sliderNavDots[currentSlide].className = 'navigator';\r\n // Update currentSlide to be as Next Slide\r\n currentSlide = (currentSlide + 1) % slides.length;\r\n // Show the nextSlide and update which dot to make it active\r\n slides[currentSlide].className ='slide showSlide';\r\n sliderNavDots[currentSlide].className = 'navigator currentDot';\r\n}", "function Slideshow(slideContainer, options) {\n// private: input fields\n this.slideContainer = slideContainer;\n this.blurringPeriod = options.blurringPeriod; \n this.displayPeriod = options.displayPeriod; \n \n// private: internal variables \n this.slideIndex = 0;\n this.selectorExpression = \"#\"+slideContainer+\" > div\";\n this.slideCount = $(this.selectorExpression).length;\n \n// private: internal methods\n this.fadeIn = ___Slideshow_fadeIn;\n this.fadeOut = ___Slideshow_fadeOut;\n \n// public: exposed operations\n this.play = ___Slideshow_play;\n}", "function activeDot(slideIndex) {\n let prev = $('#quickSwap .slider-dot.active');\n let currentSlideQS = $('#quickSwap .slider-dot[data-selector=\"' + slideIndex + '\"]');\n prev.removeClass('active');\n currentSlideQS.addClass('active');\n }", "function changeDots(dot) {\n slides.forEach((slide) => {\n slide.classList.remove(\"active\");\n });\n dot.classList.add(\"active\");\n }", "function addInternalSelectors(){\r\n addClass($(options.sectionSelector, container), SECTION);\r\n addClass($(options.slideSelector, container), SLIDE);\r\n }", "function addInternalSelectors(){\r\n addClass($(options.sectionSelector, container), SECTION);\r\n addClass($(options.slideSelector, container), SLIDE);\r\n }", "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName('spotlightElement');\n if (n > slides.length) { slideIndex = 1 }\n if (n < 1) { slideIndex = slides.length }\n\n if (slides) {\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = 'none';\n }\n slides[slideIndex - 1].style.display = 'block';\n }\n }", "function addInternalSelectors(){\n addClass($(options.sectionSelector, container), SECTION);\n addClass($(options.slideSelector, container), SLIDE);\n }", "function addInternalSelectors(){\n addClass($(options.sectionSelector, container), SECTION);\n addClass($(options.slideSelector, container), SLIDE);\n }", "function addInternalSelectors(){\n addClass($(options.sectionSelector, container), SECTION);\n addClass($(options.slideSelector, container), SLIDE);\n }", "function showTrending(slideIndex) {\n let trendingGif = document.querySelectorAll(\".mySlides\");\n \n for (let i = 0; i < trendingGif.length; i++) {\n trendingGif[i].style.display = \"none\";\n }\n //To show 3 gif at a time\n trendingGif[slideIndex].style.display = \"flex\"; \n slideIndex++;\n trendingGif[slideIndex].style.display = \"flex\";\n slideIndex++; \n trendingGif[slideIndex].style.display = \"flex\"; \n}", "function showSlides(n) {\r\n let i;\r\n const slides = document.querySelectorAll(\".locSlide\");\r\n \r\n for (i = 0; i < slides.length; i++) {\r\n slides[i].style.display = \"none\";\r\n }\r\n\r\n slideIndex++\r\n if (slideIndex > slides.length) {slideIndex = 1}\r\n slides[slideIndex-1].style.display = \"block\";\r\n setTimeout(showSlides, 4000);\r\n}", "function addDots(){\n\t$(\"#dots\").html(\"\");\n\tvar noDots = $(\".slide\").length;\n\tfor(i = 0; i < noDots; i++){\n\t\t$(\"#dots\").append(\"<div class='dot' id='\"+i+\"''></div>\");\n\t}\n\t// Where does 1.35 come from? Algebra. If you want me to explain I am happy to demo for you :D But for some reason I think you might just trust me - it works\n\t$(\"#dots\").css(\"left\", \"calc(50% - \" + ((1.35*noDots)/2) + \"em)\");\n\t$(\".dot\").click(function(event){\n\t\tvar id = parseInt($(event.target).attr(\"id\"));\n\t\tsetSlide(id);\n\t\tremoveAutoSlide();\n\t})\n}", "function plusSlides(n) { //this will go to the previous or next slide deppening on if you hit the next or prev button\n showSlides(slideIndex += n);\n}", "function show(n)\n{\n var dot = document.getElementsByClassName(\"dot\");\n var i;\n var name = document.getElementsByClassName(\"slider\");\n var size = name.length;\n if(n > size) {\n index = 1;\n }\n if(n < 1) {\n index = size;\n }\n for (i = 0; i < size; i++){\n name[i].style.display = \"none\";\n }\n\n name[index -1].style.display = \"block\";\n\n for (i = 0; i < size; i++) {\n dot[i].classList.remove(\"on\");\n }\n\n dot[index-1].classList.add('on');\n\n\n\n\n}", "function slideshow() {\r\n slideIndex++;\r\n\r\n // Handle wrapping past end of slideshow\r\n if (slideIndex > slideshowElems.length) {slideIndex = 1}\r\n\r\n // Set all slides to hidden\r\n var i;\r\n for (i = 0; i < slideshowElems.length; i++) {\r\n slideshowElems[i].style.display = \"none\";\r\n }\r\n\r\n // Set current slide to visible\r\n slideshowElems[slideIndex-1].style.display = \"block\";\r\n\r\n // Set slide description\r\n document.getElementById(\"slideName\").innerHTML = getDescription(slideshowElems[slideIndex-1].src);\r\n\r\n // Play slideshow if paused\r\n if (slideshowTimeout == null) {\r\n slideshowTimeout = setInterval(slideshow, SLIDESHOW_INTERVAL);\r\n }\r\n}", "showSlides(n){\n var i;//the counter\n var index = this.state.slideIndex; //the state property\n var slides = document.querySelector(\".mySlide\"); //selecting the slide components\n if ( n > slides.length) {index = 1}//if the slide is the last one, go back to first\n if ( n < 1 ) {index = slides.length}//if slide is the first one, you can go to last\n for (i = 0; i < slides.length; i++){//for ever slide\n slides[i].style.display = \"none\";//make it invisible\n }\n slides[index-1].style.display = \"block\";//but for now, make visible\n }", "function createSlideArrows(section){\r\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\r\n\r\n if(options.controlArrowColor!='#fff'){\r\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\r\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n section.find(SLIDES_ARROW_PREV_SEL).hide();\r\n }\r\n }", "function createSlideArrows(section){\r\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\r\n\r\n if(options.controlArrowColor!='#fff'){\r\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\r\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n section.find(SLIDES_ARROW_PREV_SEL).hide();\r\n }\r\n }", "function createSlideArrows(section){\r\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\r\n\r\n if(options.controlArrowColor!='#fff'){\r\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\r\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n section.find(SLIDES_ARROW_PREV_SEL).hide();\r\n }\r\n }", "function showDivs(n) {\n // determine which slide toshow\n var i;\n slideIndex = n;\n var x = checkpix()[1];\n if (n > x.length) {slideIndex = n % x.length}\n if (n < 1) {slideIndex = x.length};\n // show/hide relevant elements\n $('#slideshow').css('display','block'); //show slideshow\n $('figure').css('display','none'); // hide all figures\n x[slideIndex-1].style.display = \"block\"; // just show the one we want to show\n lazyslides(slideIndex-1); // load the actual image for this slide if needed\n }", "function switchDots(dotNumber) {\n const activeDot = document.querySelectorAll(\".slide\")[dotNumber];\n slides.forEach((slide) => {\n slide.classList.remove(\"active\");\n });\n activeDot.classList.add(\"active\");\n }", "function changeSlidesAutomatically() {\n if (indexOfCurrentSlide > maxNumberOfSlides) {\n indexOfCurrentSlide %= maxNumberOfSlides;\n }\n\n removeCurrentClass();\n\n switch (indexOfCurrentSlide) {\n case 1:\n createFirstSlide();\n break;\n case 2:\n createSecondSlide();\n break;\n case 3:\n createThirdSlide();\n break;\n case 4:\n createForthSlide();\n break;\n case 5:\n createFifthSlide();\n break;\n default:\n break;\n }\n\n setCurrentClass();\n indexOfCurrentSlide += 1;\n // resetTimer();\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function showSlides(n) {\n let slides = document.getElementsByClassName(\"slider__image\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (let i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n slides[slideIndex-1].style.display = \"flex\";\n \n \n}", "function showSlides() {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n slideIndex++;\n if (slideIndex > slides.length) {slideIndex = 1}\n slides[slideIndex-1].style.display = \"block\";\n setTimeout(showSlides, 2000); // Change image every 2 seconds\n}", "function constrolSlides(ele) {\n // select controls ul element\n const ul=controls.children;\n // select ul chidren li element\n const li=ul[0].children;\n var active;\n for(let i=0;i<li.length;i++){\n if(li[i].className==\"active\"){\n // find who is now active\n active=i;\n // remove active class from all li element\n li[i].className=\"\";\n }\n }\n // add active class ro current slide\n ele.className=\"active\";\n\n var numb=(ele.id-1)-active;\n jumpSlideWidth=jumpSlideWidth+(slicktrackWidth*numb);\n slicktrack.style.marginLeft=-jumpSlideWidth + \"px\";\n}", "function createSlideArrows(section) {\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if (options.controlArrowColor != '#fff') {\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent ' + options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent ' + options.controlArrowColor + ' transparent transparent');\n }\n\n if (!options.loopHorizontal) {\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function createSlideArrows(section){\n \t\t\tsection.find('.fp-slides').after('<div class=\"fp-controlArrow fp-prev\"></div><div class=\"fp-controlArrow fp-next\"></div>');\n\n \t\t\tif(options.controlArrowColor!='#fff'){\n \t\t\t\tsection.find('.fp-controlArrow.fp-next').css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n \t\t\t\tsection.find('.fp-controlArrow.fp-prev').css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n \t\t\t}\n\n \t\t\tif(!options.loopHorizontal){\n \t\t\t\tsection.find('.fp-controlArrow.fp-prev').hide();\n \t\t\t}\n \t\t}", "function accessibleSliderAdjustments(el) {\n // console.log('motion pref:' + lowMotionPreference.matches);\n //if no motion preference, or not upported\n if (!lowMotionPreference.matches) {\n var $this = $(el);\n //if autoplay is set to true, add pause button\n if($this.slick('slickGetOption', 'autoplay') === true){\n $this.append(\"<button class='playpause play' title='Toggle autoplay'><i class='fa fa-pause'></i></button>\");\n $this.find('.playpause').on('click', function () {\n if ($(this).hasClass('play')) {\n $this.slick('slickSetOption', 'autoplay', false).slick('slickPause');\n $(this).addClass(\"pause\").removeClass(\"play\").html(\"<i class='fa fa-play'></i>\");\n } else {\n $this.slick('slickSetOption', 'autoplay', true).slick('slickPlay');\n $(this).addClass(\"play\").removeClass(\"pause\").html(\"<i class='fa fa-pause'></i>\");\n }\n });\n }\n //if motion preference, turn off autoplay\n } else {\n $(el).each(function () {\n var $this = $(this);\n $this.slick('slickSetOption', 'autoplay', false).slick('slickPause');\n });\n }\n\n }", "function addInternalSelectors() {\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "function showSlides(n) {\n\t\tif (n > slidelength - 1) {\n\t\t\tn -= slidelength;\n\t\t}\n\t\tif (n < 0) {\n\t\t\tn += slidelength;\n\t\t}\n\t\t\n\t\tfor (i = 0; i < slidelength; i++) {\n\t\t\t$(\".archive-item\").removeClass(\"js-active\");\n\t\t}\n\n\t\t// var slides = $(\".archive-item\").removeClass(\"js-active\");\n\n\t\tvar slides = $(\".archive-item\");\n\t\tvar newSlide = slides.eq(n);\n\t\tnewSlide.addClass(\"js-active\");\n\t\tslideContent();\n\t\tslideIndex = n;\n\t}", "function setupAuto() {\n\t\t\tself.playSlides = setInterval(function carouselPlaySlidesInterval() {\n\t\t\t\tif (currentPane === (paneCount - 1)) {\n\t\t\t\t\tself.showPane(0, true);\n\t\t\t\t} else {\n\t\t\t\t\tself.next();\n\t\t\t\t}\n\t\t\t}, slideTimer);\n\t\t}", "function showHideArrow() {\n\t\t\tif (options.SlideNum === options.NumberOfSlides - 1) {\n\t\t\t\t$NextSlideButton.addClass('disable-btn');\n\t\t\t} else {\n\t\t\t\t$NextSlideButton.removeClass('disable-btn');\n\t\t\t}\n\n\t\t\tif (options.SlideNum === 0) {\n\t\t\t\t$PrevSlideButton.addClass('disable-btn');\n\t\t\t} else {\n\t\t\t\t$PrevSlideButton.removeClass('disable-btn');\n\t\t\t}\n\t\t}", "function showSlides(item_type, slideIndex) {\n var i;\n // var trend_items = document.getElementsByClassName(\"item-trending\");\n // console.log({\"item_type\": item_type});\n var trend_items = document.getElementsByClassName(item_type);\n\n // var trend_itemset = document.getElementsById(\"trending\");\n // var trend_items = trend_itemset.getElementsByClassName(\"movie_item\");\n for (i = 0; i < trend_items.length; i++) {\n var test = trend_items[i].innerText;\n // console.log({\"Current item\" : test})\n trend_items[i].style.display = \"none\"; \n }\n slideIndex++;\n\n //Repeat over-and-over\n if (slideIndex > trend_items.length) {slideIndex = 1}\n\n trend_items[slideIndex-1].style.display = \"block\";\n // setTimeout(showSlides, 2000); // Change image every 2 secs\n setTimeout(showSlides.bind(null, item_type, slideIndex), 5000);\n\n // trend_items[0].style.display = \"block\";\n}", "function createSlideArrows(section){\r\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\r\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\r\n\r\n if(options.controlArrowColor !== '#fff'){\r\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\r\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n hide($(SLIDES_ARROW_PREV_SEL, section));\r\n }\r\n }", "function createSlideArrows(section){\r\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\r\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\r\n\r\n if(options.controlArrowColor !== '#fff'){\r\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\r\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n hide($(SLIDES_ARROW_PREV_SEL, section));\r\n }\r\n }", "function createSlideArrows(section){\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n if(options.controlArrowColor !== '#fff'){\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\n }\n\n if(!options.loopHorizontal){\n hide($(SLIDES_ARROW_PREV_SEL, section));\n }\n }", "function createSlideArrows(section){\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n if(options.controlArrowColor !== '#fff'){\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\n }\n\n if(!options.loopHorizontal){\n hide($(SLIDES_ARROW_PREV_SEL, section));\n }\n }", "function createSlideArrows(section){\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n if(options.controlArrowColor !== '#fff'){\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\n }\n\n if(!options.loopHorizontal){\n hide($(SLIDES_ARROW_PREV_SEL, section));\n }\n }", "function dots_slider() {\t\r\n\t\tchceked_dot = document.getElementsByClassName(\"one_dot\");\r\n\t\tfor (i=0; i < chceked_dot.length; i++ ) {\t\r\n\t\t\tif (chceked_dot[i].checked) {\t\r\n\t\t\t\tdocument.querySelector(\".active\").classList.remove(\"active\");\r\n\t\t\t\tall_slide[i].classList.add(\"active\");\r\n\t\t\t\tactive = document.querySelector(\".active\");\r\n\t\t}} \r\n\t}", "function navSlide(n) {\n // Calculate index of visible slide\n var idx = slideIndex + n;\n // Set all slides invisible\n setAllInvisible(slides);\n // Set all progBar images invisible\n setAllInvisible(progBars);\n // Display slide at index \"idx\"\n slides[idx - 1].style.display = \"block\";\n // Display progBar image at index \"idx\"\n progBars[idx - 1].style.display = \"block\";\n // Check if idx is greater than 0\n if ((idx - 1) <= 0) {\n slideIndex = 1;\n // Hide prevButton\n document.getElementById(\"prevButton\").style.display = \"none\";\n }\n else if ((idx) >= slides.length) {\n slideIndex = slides.length;\n // Show prevButton and hide nextButton\n document.getElementById(\"prevButton\").style.display = \"block\";\n document.getElementById(\"nextButton\").style.display = \"none\";\n }\n else {\n slideIndex = idx;\n // Show both buttons\n document.getElementById(\"prevButton\").style.display = \"block\";\n document.getElementById(\"nextButton\").style.display = \"block\";\n }\n}", "function showHideArrow() {\n\t\t\tif (options.slideNum === options.numberOfSlides - 1) {\n\t\t\t\t$NextSlideButton.addClass('disable-btn');\n\t\t\t} else {\n\t\t\t\t$NextSlideButton.removeClass('disable-btn');\n\t\t\t}\n\n\t\t\tif (options.slideNum === 0) {\n\t\t\t\t$PrevSlideButton.addClass('disable-btn');\n\t\t\t} else {\n\t\t\t\t$PrevSlideButton.removeClass('disable-btn');\n\t\t\t}\n\t\t}", "function showSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n updateNav();\n}", "initSlides () {\n let i = 0,\n sections = document.getElementsByClassName(\"slide__section\");\n for ( let section of sections ) {\n let slide = new Slide(section, this)\n this.slides.push(slide)\n\n let control = this.controls[i]\n slide.control = control\n control.slideIndex = i\n\n this.bindEventToControl(control)\n\n i++\n }\n this.controls[this.current].classList.add(\"current\")\n this.len = this.slides.length\n }", "function showContentDot(dotNumber){\n\n var dots = document.getElementsByClassName(\"h5p-image-gallery-dot\");\n\n // start rowindex of images showing\n var start = dotNumber*maximumNumberofRows;\n\n // end rowindex of images showing\n var end = start+maximumNumberofRows;\n\n // if dots exists - show only content of dot with index dotNumber\n if (dots.length > 1){\n images.forEach(function(element, index){\n var imageElement = document.getElementById('h5p-image-gallery-image-'+index);\n\n if (element.image.row >= start && element.image.row < end){\n imageElement.style.display = 'inline-block';\n }\n else{\n imageElement.style.display = 'none';\n }\n });\n\n for (var i = 0; i < dots.length; i++){\n dots[i].classList.remove('h5p-image-gallery-dotCurrent');\n }\n\n // add color to current dot\n var dotOn = document.getElementById('h5p-image-gallery-dot-'+dotNumber);\n dotOn.classList.add('h5p-image-gallery-dotCurrent');\n\n // keep track of current dot index\n currentDot(dotNumber);\n }\n}", "function initSlideshows ()\n{\n var slideshows = document.getElementsByClassName('slideshow');\n\n window.setInterval(function () { for (var i = 0; i < slideshows.length; i++)\n changeSlide (slideshows[i]); }, delay);\n}" ]
[ "0.66771805", "0.6642597", "0.6585317", "0.65111977", "0.65019935", "0.64967835", "0.64787585", "0.6424", "0.641578", "0.6347684", "0.6342151", "0.6338555", "0.6324641", "0.63232696", "0.62713134", "0.62050897", "0.62006515", "0.6182053", "0.61611027", "0.61393267", "0.6122658", "0.6073537", "0.6071531", "0.60641426", "0.601147", "0.59843355", "0.59691197", "0.5966512", "0.5953751", "0.5941892", "0.5935199", "0.5932144", "0.59296185", "0.5927295", "0.5914224", "0.5913524", "0.5908706", "0.58910024", "0.5872996", "0.58710676", "0.58627635", "0.585581", "0.58367634", "0.58249176", "0.58249176", "0.58249176", "0.5814786", "0.5814786", "0.5811681", "0.5798792", "0.57813704", "0.57775664", "0.5773055", "0.5767176", "0.5767176", "0.5761832", "0.5754014", "0.5754014", "0.5754014", "0.5753112", "0.57519495", "0.5742526", "0.5741288", "0.5732143", "0.57295775", "0.57245815", "0.5724093", "0.5724093", "0.5724093", "0.57212", "0.5719204", "0.5714311", "0.57140744", "0.57140744", "0.57140744", "0.57140744", "0.57140744", "0.57051677", "0.5704553", "0.5701522", "0.5696366", "0.5686213", "0.5674592", "0.56590873", "0.5656197", "0.5652053", "0.5649101", "0.5647184", "0.56436527", "0.56436527", "0.564124", "0.564124", "0.564124", "0.5640173", "0.5637753", "0.56301415", "0.5627916", "0.56200224", "0.56195784", "0.56070656" ]
0.61827606
17
1: Declare a function fullName and it takes firstName, lastName as a parameter and it returns your full name.
function fullName(firstName, lastName) { return `${firstName} ${lastName}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fullName(firstName, lastName) {\n return firstName + \" \" + lastName;\n}", "function fullName(firstName, lastName) {\n return firstName + lastName;\n}", "function fullName(firstName, lastName){\n\treturn firstName + ' ' + lastName;\n}", "function fullName(firstName,lastName){\n return firstName + ' ' + lastName;\n}", "function fullName(firstName, lastName) {\n\treturn firstName + \" \" + lastName;\n}", "function fullName (firstName, lastName){\n return fullName.firstName;\n return fullName.lastName;\n}", "function fullName(firstName, lastName) {\n return \"Hello \" + firstName + \" \" + lastName;\n}", "function fullName(firstName,lastName){\r\n return firstName +\" \"+lastName;\r\n}", "function getFullName(firstName, lastName) {\r\n return firstName + \" \" + lastName;\r\n}", "function full(firstName,lastName,fullName){\r\n firstName = \"Abdul\";\r\n lastName = \"Qadeer\"\r\n fullName = firstName + lastName;\r\n return fullName;\r\n}", "function returnFullName(firstName, LastName){\r\n return firstName + \" \" + LastName\r\n}", "function getFullName(firstName, lastName) {\n return firstName + ' ' + lastName;\n}", "function fullName(firstName, lastName) {\n\t return `${firstName} ${lastName}`;\n\t}", "function getFullName(firstName, lastName){\n return firstName+\" \"+ lastName\n }", "function getFullName(firstName, lastName) {\n\treturn firstName + ' ' + lastName;\n}", "function getFullName(firstName, lastName) {\n\treturn firstName + ' ' + lastName;\n}", "function fullName (firstName,lastName) {\n\treturn `${firstName} ${lastName}`;\n}", "function getFullName(firstName, lastName) {\r\n\r\n // -------------------- Your Code Here --------------------\r\n\r\n\r\n return firstName + \" \" + lastName;\r\n\r\n\r\n // --------------------- End Code Area --------------------\r\n}", "function getfullName (firstname, lastname){\nreturn firstname +' '+ lastname\n}", "function fullName(firstName, lastName) {\n\treturn `${firstName} ${lastName}`;\n}", "function getFullName(firstName,lastName){\n return firstName+' '+lastName\n}", "function fullName(firstName, lastName) {\n return firstName.toLocaleUpperCase() + ' ' + lastName;\n}", "function getFullName(firstName, secondName, familyName) {\r\n return firstName + \" \" + secondName;\r\n\r\n return firstName + \" \" + secondName + \" \" + familyName;\r\n\r\n}", "function fullName(first, last){\r\n var name = first + \"\" + last;\r\n return name;\r\n}", "function getFullName(firstName, lastName) {\n return `${firstName} ${lastName}`;\n}", "function fullName2(first, last) {\n return first + \" \" + last;\n}", "function getFullName (firstName, lastName) {\n return `${firstName} ${lastName}`\n}", "function getFullName(firstName, lastName, middleName = \"\") {\n //return firstName + \" \" + middleName + \" \" + lastName;\n return `${firstName} ${middleName} ${lastName}`;\n}", "function getFullName(firstName, lastName) {\n return `${firstName} {lastName}`\n}", "function fullName(firstName, lastName) {\r\n return console.log(`${firstName} ${lastName}`);\r\n}", "function getFullName(firstname,lastname){\n\n return firstname + ' '+lastname\n\n}", "function myFullName() {\n return myFirstName('Srujan');\n }", "function getFullName(firstName, lastName) {\n\n\treturn(`${firstName} ${lastName}`);\n}", "function fullName(first, lastname) {\n return first + ' ' + (lastname || ''); //safety\n}", "function getFullName() {\n return firstName + \" \" + lastName;\n }", "function getFullName() {\n return firstName + \" \" + lastName;\n }", "function showName (firstName, lastName) {\n\tlet myName = \"Hello, my name is\"\n\n\tfunction makeFullName () {\n\t\treturn myName + firstName + \" \" + lastName;\n\t};\n\treturn makeFullName;\n}", "function getFullName() {\n return firstName + \" \" + lastName;\n }", "function createFullName(firstName, lastName) {\n return(firstName +' '+ lastName);\n}", "function fullName (first, last)\n{\n console.log( `Hi my name is ${first} ${last}`);\n}", "function makeFullName () { \n return nameIntro + firstName + \" \" + lastName; \n }", "function fullName (fName, lName) { \n console.log(`${lName}, ${fName}`);\n}", "function displayName(firstName, lastName) {
\n ​var nameStartTag = \"Full Name is \";\n // this inner function has access to the outer function's variables, including the parameter​\n ​function createFullName() {
 \n ​ return nameStartTag + firstName + \" \" + lastName;
 \n }\n ​\n ​ return createFullName();
\n }", "function fullName() {\n return \"Hello, this is \" + this.first + \" \" + this.last;\n}", "function fullName(firstName, lastName) {\r\n myName.joann = \"Joann\";\r\n myName.saeou = \"Saeou\";\r\n return 'firstName.joann', 'lastName.saeou';\r\n}", "function getFullname(student){\n //var fullName;\n \n\n return student.lastName + \", \" + student.firstName;\n\n //return fullName;\n}", "function makeFullName(){\n\n\t\treturn nameIntro+firstName+\" \"+lastName;\n\t}", "function makeFullName () {
 \n return nameIntro + firstName + \" \" + lastName;
\n }", "function getName(firstName, lastName) {\n if (lastName == undefined)\n return firstName;\n return firstName + \" \" + lastName;\n}", "function getName(firstName, lastName) {\n if (lastName == undefined) {\n return firstName;\n }\n return firstName + \" \" + lastName;\n}", "function getFirstName1(fullName) {\n return fullName.split(\" \")[0];\n}", "function fullName (fName, lName) { \n console.log(`${lName}, ${fName}`);\n }", "function makeFullName() {\n return `${nameIntro} ${firstName} ${lastName}`;\n }", "function fullName1(person) {\n console.log(person.firstName + \" \" + person.lastName);\n}", "function fullName(fn1,fn2){\n let first = \"Harish\";\n let last = \"Mehra\";\n\n return fn1(first) +\" \"+ fn2(last);\n}", "function inName() {\n\tnames = bio.name.split(\" \");\n\tfirstName = names[0].slice(0,1).toUpperCase() + names[0].slice(1).toLowerCase();\n\tlastName = names[1].toUpperCase()\n\tfullName = firstName + \" \" + lastName\n return fullName\n}", "function name(firstName, lastName) {\n var userName = firstName + \" \" + lastName;\n return userName;\n}", "function fullName(first, last) {\n const nameArr = [first, last];\n return nameArr.join(\" \");\n}", "function getFullName(a, b){\n return a + ' ' + b;\n}", "function getFullName(a, b){\n return a + ' ' + b;\n }", "function userName(firstName,lastName) {\n var result= firstName + \" \" + lastName;\n return result;\n}", "function giveName (lastName) {\n return = firstName + \" \" + lastName;\n}", "function fullNameOptional(firstName, lastName, middleName) {\n if (middleName === undefined) {\n return firstName + lastName;\n }\n else {\n return firstName + middleName + lastName;\n }\n}", "function makeName(firstName, lastName) {\n return firstName + \" \" + lastName;\n}", "function fullName(fName,lName) {\n let myFullName = fName + ' ' + lName\n //let myFullName = `${fName} ${myFullName}`;\n\n console.log(`Hello my name is ${myFullName}`);\n\n}", "fullname() { return this._firstname + \" \" + this._lastname; }", "getFullName(){\n\n return this.firstName + \" \" + this.lastName;\n\n //return arguments[0]+\" \"+arguments[1];\n\n }", "function returnNames(firstName, lastName) {\n return `Welcome ${firstName} ${lastName}!`;\n}", "function concatName(firstName, lastName) {\n return lastName + \", \" + firstName;\n}", "function getFullName(user) {\n const { firstName, lastName } = user;\n return `${firstName} ${lastName}`;\n }", "function greetUser(fullName) {\n return `Good day, ${fullName}`\n}", "function Person(first_name, last_name){\n this.first_name = first_name\n this.last_name = last_name\n this.full_name = function(){\n if (first_name != \"undefined\" && last_name != \"undefined\") {\n return first_name + \" \" + last_name; \n } else{\n return \"Not a complete name\" \n };\n }\n}", "function fullName(person) {\n firstName: String;\n lastName: String;\n console.log(person.firstName + \",\" + person.lastName);\n}", "function getFullName(user) {\n return user.firstName + \" \" + user.lastName;\n}", "fullName() {\n return `${this.firstName} ${this.lastName}`\n }", "function yourName(firstName = \"Please enter your first name.\", lastName = \"Please enter your last name.\"){\n return firstName + \" \" + lastName;\n }", "function firstName(first) {\n return (\"Hi \" + first);\n}", "function concatName(firstName, lastName) {\n console.info(firstName + ' ' + lastName);\n}", "function combineName(firstName, lastName){\r\n var fullName = firstName + \" \" + lastName;\r\n document.getElementById(\"fullName\").innerHTML = fullName;\r\n }", "fullName() {\n return `Your full name is ${this.fName} ${this.lName}.`;\n }", "fullName() {\n return this.firstName + \" \" + this.lastName;\n }", "function buildName(firstName, lastName) {\n return firstName + lastName; // because we returned a string here, TS inferred. Hover over definition to see.\n}", "fullName() {\n return `${this.firstName} ${this.lastName}`;\n }", "get fullName2 () {\n\t\tvar fullName = this.firstName + ' ' + this.lastName;\n\t\tmobx.whyRun();\n\t\treturn fullName;\n\t}", "function lastName(theLastName) {\n return nameIntro + firstName + \" \" theLastName;\n }", "fullName() {\n return `${this.firstName} ${this.lastName}`;\n }", "function getFullNames(/* CODE HERE */) {\n /* CODE HERE */\n}", "fullName() {\n return `Your full name is ${this.firstName} ${this.lastName}`\n }", "function printDetails (firstName,lastName,mood){\n return `The person ${getFullName(\"Filip\",\"Janev\")} is feeling ${mood}`\n\n}", "fullName() {\n return this.firstName + \" \" + this.lastName\n }", "function fullName(person) {\n if (!person.lastName) {\n person.lastName = \"\";\n }\n else {\n person.lastName += \"y\";\n }\n console.log(person.firstName + \" \" + person.lastName);\n}", "getLastName() {}", "function getFirstAndLastName( fullName ) {\n let employee = fullName.split(\" \");\n if(employee.length == 2) {\n return employee;\n }\n//\n const last_name = employee[employee.length-1];\n let first_name = \" \";\n for(let i=0; i<employee.length-1; i++) {\n first_name = first_name + employee[i] + \" \";\n }\n return [first_name.trim(), last_name];\n}", "function getFirstName(fullname){\n let firstName = fullname.trim();\n // If fullname includes a space, firstname is what comes before that first space\n if (fullname.includes(\" \")) {\n firstName = firstName.substring(0, firstName.indexOf(\" \"));\n firstName = firstName.substring(0,1).toUpperCase() + firstName.substring(1).toLowerCase();\n } else {\n // if fullname only has one name - no space\n firstName = firstName;\n }\n return firstName;\n}", "function getFirstName(fullName){\n //Steve Rogers\n //Split Function\n fullName = fullName.split(\" \"); //Split whenever there is split in fullname\n return fullName[0];\n //[\"Steve\", \"Rogers\"]; this will happen after split\n}", "function nameInfo(){\n let firstName = document.getElementById('firstName').value;\n let middleName = document.getElementById('middleName').value;\n let lastName = document.getElementById('lastName').value;\n \n let fullName = firstName + ' ' + middleName + ' ' + lastName;\n \n document.getElementById(\"fullName\").innerHTML = fullName;\n }", "fullname() {\n return `${this.firstname} ${this.lastname}`;\n }", "getFullName() {\n return `${this.firstName} ${this.lastName}`;\n }", "function lastName (theLastName) {\n return nameIntro + firstName + \" \" + theLastName;\n }", "function partnerName(firstname, lastname) {\nreturn firstname + ' ' + lastname; \n\n }" ]
[ "0.8881458", "0.88737214", "0.88322276", "0.8826729", "0.8772284", "0.87502325", "0.8748245", "0.8719939", "0.8715858", "0.8714357", "0.87116116", "0.8666644", "0.8573065", "0.85386944", "0.8527971", "0.8527971", "0.85206133", "0.847364", "0.8464109", "0.8445292", "0.8434827", "0.84235394", "0.8422233", "0.84168315", "0.83787966", "0.8314999", "0.8300765", "0.82999253", "0.82701474", "0.8263302", "0.82352257", "0.8215112", "0.8178511", "0.8171131", "0.8169183", "0.81096476", "0.80391693", "0.8019775", "0.8007496", "0.79894984", "0.7983856", "0.7946944", "0.79392254", "0.7937691", "0.79296356", "0.7916599", "0.785563", "0.78369904", "0.78133243", "0.7801194", "0.7745573", "0.77417916", "0.7733242", "0.77331555", "0.77053726", "0.7673841", "0.76577497", "0.7657001", "0.7635283", "0.7492174", "0.7488244", "0.74605906", "0.7450843", "0.7410015", "0.7408029", "0.7397763", "0.73906475", "0.738883", "0.7379862", "0.73576945", "0.734129", "0.7333523", "0.7298225", "0.7296492", "0.7292529", "0.72773385", "0.7264198", "0.72453135", "0.72444266", "0.7233839", "0.72331655", "0.72236884", "0.71994406", "0.7184297", "0.717029", "0.7164025", "0.71573573", "0.714153", "0.7134473", "0.71265906", "0.71102506", "0.7103905", "0.70997596", "0.70893186", "0.7088221", "0.7087032", "0.7080355", "0.7079797", "0.70725226", "0.707038" ]
0.8542763
13
2: Declare a function addNumbers and it takes two two parameters and it returns sum.
function addNumbers(a, b) { return a + b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNumbers(number1, number2) {\n return number1 + number2\n}", "function addNumbers(number1, number2) {\r\n return number1 + number2;\r\n}", "function addNumbers(number1, number2){\r\n return number1 + number2;\r\n}", "function addNumbers (num1, num2) {\n return num1 + num2;\n}", "function addNumbers(num1, num2) {\n return num1 + num2;\n}", "function addNumbers(num1, num2) {\n return num1 + num2;\n}", "function addNumbers(num1, num2) { //create the function with 2 num arguments\n return num1 + num2 //add the two numbers and return the result\n}", "function addNumbers(numOne, numTwo) {\n return numOne + numTwo;\n}", "function addNumbers(firstNumber, secondNumber) {\n // return firstNumber + secondNumber;\n return firstNumber + secondNumber;\n}", "function addNumbers(numberOne, numberTwo) {\n return numberOne + numberTwo;\n}", "function addNumbers(a, b) {\n\t/* Within the addNumbers() function, we will create a variable that will add the two above arguments together. */\n\tvar sum = a + b;\n\n\t/* Use a function \"return\" to send the \"sum\" variable outside of the function for other elements to use. */\n\treturn sum;\n}", "function sumNumbers(number1, number2) {\n return number1 + number2;\n}", "function sumNumbers(num1,num2){\n return num1 + num2\n\n}", "function sumOfNumbers (number1, number2) {\n return number1 + number2;\n}", "function addNums(firstNum, secondNum) {\n return firstNum + secondNum;\n}", "static addNumbers(a, b){\n return a + b;\n }", "function addTwoNumbers(firstNumber, secondNumber){\n return firstNumber + secondNumber;\n}", "function addNumbers(x, y) {\n return x+y;\n}", "function addNums(num1, num2) {\n return num1 + num2\n}", "function AddNumbers(a,b)\r\n{\r\n var sum = a+b;\r\n return sum;\r\n}", "function addNums(num1, num2) {\n return num1 + num2;\n}", "function addNums(num1, num2) {\n return num1 + num2;\n}", "function addNumbers(num1=0,num2=0){\n return num1 + num2;\n}", "function addNumbers(num1, num2, num3){\n return num1 + num2 + num3;\n }", "function addNumbers(num1, num2){\n console.log(num1 + num2);\n}", "function add2Numbers(num1, num2){\n return num1+num2\n}", "function sumNumbers(num1, num2){\n var result = num1 + num2;\n return result\n}", "function addTwoNumbers(num1, num2) {\n return num1 + num2;\n}", "function addNumber(a, b) {\n return a + b;\n}", "function add2Numbers(a, b) {\n var addition = a + b;\n return addition;\n}", "function add2Numbers(num1, num2) {\n return num1 + num2;\n}", "function addNumbers(num1, num2){\n var result = num1 + num2;\n // returns the value to the function call\n return result;\n}", "function addNumbers(numberA, numberB) {\n console.log(numberA + numberB);\n}", "function add(firstNum, secondNum) {\n return firstNum + secondNum\n}", "function addTwoNums(a,b){\n\treturn a + b;\n}", "function add (firstNum, secondNum) {\n\n return firstNum + secondNum;\n\n}", "function add(a, b) {\n // add numbers and return the result\n}", "function sumOfTwoNumbers() {}", "function addNumbers(a, b) {\r\n var c = a+b;\r\n return c;\r\n}", "function addNums2(num1, num2){\n return num1 + num2\n}", "function addTwoNumbers(num1, num2) {\n\treturn num1 + num2;\n}", "function sumNumbers(num1, num2) {\n var result = num1 + num2;\n return 10;\n}", "function addNum(a, b) {\n return a + b;\n}", "function sum(firstNumber, secondNumber) {\n return (firstNumber + secondNumber)\n}", "function addNums(p1, p2)\r\n{\r\n //p1 and p2 are sent to addNums... to do this:\r\n return p1+p2;\r\n}", "function addNumbers(a,b) {\n\tconsole.log(a+b);\n}", "function numAdd (num, number) {\nreturn num + number;\n}", "function add(number1, number2) {\n return number1 + number2\n}", "function sumNumbers (num1, num2) {\n var result = num1 + num2;\n console.log(result);\n}", "function sumNum(num1, num2) {\n return num1 + num2;\n}", "function sumNumbers(num1 , num2) {\n\tvar result = num1 + num2;\n\tconsole.log(result);\n}", "function addNums2(num, num2){\n return num + num2\n}", "function addTwoNumbers(arg1, arg2){\n return arg1 + arg2;\n}", "function addTwoNumbers(firstNumber, secondNumber) {\n var total = firstNumber + secondNumber;\n\n console.log(total);\n}", "function addTwoNumbers(firstNumber, secondNumber) {\n var total = firstNumber + secondNumber;\n\n console.log(total);\n}", "function sumNumbers(num1, num2) {\n var result = num1 + num2;\n console.log(result);\n}", "function sumNumbers(num1, num2) {\n var result = num1 + num2;\n console.log(result);\n}", "function sumNumbers(num1, num2) {\n var result = num1 + num2;\n console.log(result);\n}", "function add(number1, number2) {\n return number1 + number2;\n}", "function addNums(n1,n2) {\n alert(n1+n2)\n}", "function sumNumbers(a, b) {\n var result = a + b\n console.log(result)\n}", "function sum(num1, num2) {\n num1 + num2;\n}", "function addNumbers( firstNumber, secondNumber) {\n let answer = (firstNumber + secondNumber);\n return answer\n // return firstNumber + secondNumber;\n}", "function add(number1, number2) {\n\treturn number1 + number2;\n}", "function add(number1, number2){\n return number1 + number2;\n}", "function addNumbers( firstNumber, secondNumber ) {\n // return firstNumber + secondNumber;\nlet solution = firstNumber + secondNumber;\nreturn solution;\n}", "function sum (num1,num2){\n return num1 + num2\n}", "function sum(num1, num2) {\n return num1 + num2;\n}", "function sum(num1, num2) {\n return num1 + num2;\n}", "function add(num1, num2) {\n return num1 + num2;\n }", "function addingNumbers (a, b) {\n\tvar answer = a + b;\n\talert(answer);\n}", "function add(firstNumber, secondNumber){\n\n // Explicitly\n return firstNumber + secondNumber\n}", "function add(num1, num2) {\n return num1 + num2\n}", "function sumNumbers(a, b) {\n var result = a + b;\n\n console.log(result)\n}", "function add(num1, num2){\n     console.log(\"Summing Numbers!\");\n     console.log(\"num1 is: \" + num1);\n console.log(\"num2 is: \" + num2);\n     var sum = num1 + num2;\n     return sum;\n }", "function sumNumbers(x, y) {\n return x + y;\n}", "function add(num1, num2) {\n return num1 + num2;\n }", "function add (num1, num2) {\n return num1 + num2\n}", "function sum(num1, num2) {\n return num1 + num2;\n}", "function sum(num1, num2) {\n return num1 + num2;\n}", "function sum(num1, num2) {\n return num1 + num2;\n}", "function sumOfTwoNumbers(num1, num2) {\n return num1 + num2; //returns sum of two given numbers\n}", "function add(num1, num2) {\n return num1 + num2;\n\n}", "function add(num1, num2) {\n return num1 + num2;\n\n}", "function sum (num1,num2) {\n return num1 + num2;\n}", "function sum (num1, num2) {\n return num1 + num2;\n}", "function add(num1, num2) {\n return num1 + num2;\n}", "function add(num1, num2) {\n return num1 + num2;\n}", "function add(num1, num2) {\n return num1 + num2;\n}", "function add(num1, num2) {\n return num1 + num2;\n}", "function add(num1, num2){\n return num1 + num2;\n}", "function add(num1,num2){\n return num1 + num2;\n}", "function addition(number1, number2) {\n return number1 + number2;\n}", "function add(num1, num2){\n return num1 +num2;\n}", "function sumTwoNums(num1,num2){\n return num1 + num2\n}", "function addValues(num1,num2){\r\n return num1 + num2;\r\n}", "function sumNumbers(num1, num2) {\r\n var result = num1 + num2;\r\n console.log(num1 + num2);\r\n}", "function addNums(num1, num2) {\n console.log(num1 + num2);\n}", "function add(num1, num2){\n\tvar sum = num1 + num2;\n\treturn sum;\n}" ]
[ "0.88294387", "0.87762517", "0.8746095", "0.8743836", "0.8731216", "0.8708869", "0.86807096", "0.8645056", "0.86405414", "0.8606762", "0.85920876", "0.8515729", "0.84760696", "0.8412499", "0.8396251", "0.83880335", "0.83538747", "0.8340948", "0.83117884", "0.82913226", "0.82809645", "0.82809645", "0.8260128", "0.82572675", "0.825253", "0.82251346", "0.82118386", "0.8208337", "0.8191838", "0.8184586", "0.81749284", "0.8168405", "0.8162222", "0.8154819", "0.81540644", "0.81378937", "0.8126877", "0.8122649", "0.8112033", "0.80833286", "0.80783385", "0.80447894", "0.80263966", "0.8026052", "0.8010127", "0.7982634", "0.7979956", "0.79717577", "0.7965138", "0.7951751", "0.7950694", "0.7939757", "0.7936326", "0.7934272", "0.7934272", "0.7930443", "0.7930443", "0.7930443", "0.79270035", "0.7918337", "0.7909578", "0.7902419", "0.7897292", "0.78813297", "0.787144", "0.78558666", "0.78523475", "0.78372216", "0.78372216", "0.7836027", "0.78324187", "0.7829693", "0.7828901", "0.7822145", "0.7820561", "0.7819584", "0.7816806", "0.7815745", "0.78156245", "0.78156245", "0.78156245", "0.78110963", "0.7811071", "0.7811071", "0.78096664", "0.7805615", "0.78036475", "0.78036475", "0.78036475", "0.78036475", "0.7800722", "0.7797898", "0.7787563", "0.7783946", "0.77833796", "0.77816373", "0.77808917", "0.7779696", "0.77786535" ]
0.8775269
3
4: Temperature in oC can be converted to oF using this formula: oF = (oC x 9/5) + 32. Write a function which convert oC to oF convertCelciusToFahrenheit.
function convertCelciusToFahrenheit(number) { return oC * 1.8 + 32; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function celsiusToFahrenheit (c) {\n var fahrenheit = ( c * ( 9 / 5) ) + 32;\n return fahrenheit;\n }", "function celsiusToFahrenheit(temperature)\n{\n return (temperature *9/5) +32;\n\n}", "function celsiusToFahrenheit(temperature){\n return (temperature*9/5)+32;\n}", "function celsiusToFahrenheit(temperature){\n return(temperature * 9/5)+32;\n}", "function celsiusToFahrenheit(temperature){\n return(temperature *9/5) + 32;\n}", "function celsiusToFahrenheit(temp){\n return ((9/5) * temp) + 32;\n}", "function celsiusToFahrenheit(temperature){\n return (temperature * 9/5) + 32;\n}", "function celsiusTOFahrenheit(temperature) {\n return (temperature * 9 / 5) + 32;\n}", "function CtoF(temperature) {\r\n return (temperature * 9) / 5 + 32;\r\n}", "function convertToFahrenheit(tempC) {\n const tempF = tempC * 1.8 + 32;\n return `${Math.round(tempF)} °F`;\n}", "function celsiusToFahrenheit(c) {\n var f = c * 9 / 5 + 32;\n console.log(c + \"°C is \" + f + \"°F.\");\n}", "function celciusToFarenheit(C){\n return 1.8*C + 32;\n \n}", "function celsiusToFahrenheit(temperature){\n\treturn (temperature * 9/5) + 32;\n}", "function celciusToFarenhite(temperature){\n return (temperature*9/5)+32;\n \n}", "function celsiusToFah(temp_c) {\n\tvar temp_f = (9 * temp_c / 5) + 32;\n\treturn temp_f\n}", "function convertFahrenheiTtoCelsius(F) {\n\treturn (F - 32) / 1.8;\n}", "function convertToF(celsius) { //1\n let fahrenheit = celsius * 9/5 + 32; //2\n\n return fahrenheit; //3\n}", "function celsiusToFahrenheit(temperature) {\n return (temperature * 9 / 5) + 32;\n}", "function celsiusToFahrenheit(temp){\n var tempInCelsius = temp;\n var tempInFahrenheit = (tempInCelsius * 9/5 + 32);\n return tempInCelsius + \"°C is \" + tempInFahrenheit+ \"°F\";\n }", "function celsiusToFahrenheit(temperature) {\n return (temperature * 9) / 5 + 32;\n}", "function c2f(celsius) {\n return celsius * 1.8 + 32;\n}", "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit = (celsius * 9 /5) +32;\n return fahrenheit; \n }", "function FahrenheitConversion(f,c,t) {\n return c = (f - c)/ t;\n}", "function temperatureCtoF(tempC) {\n return round((tempC * 1.8) + 32, 2);\n }", "function fahrenheitToCelsius(f) {\n var celsius = ( f - 32 ) * ( 9 / 5) ;\n return celsius;\n }", "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit = celsius * (9/5) + 32;\n return fahrenheit;\n}", "function celsiusToFahrenheit(celsiusTemp) {\n return (celsiusTemp * 9 / 5) + 32;\n }", "function cToF(celsius) \n{\n var cTemp = celsius;\n var cToFahr = cTemp * 9 / 5 + 32;\n //var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';\n return cToFahr.toFixed(2);\n}", "function convertToF(celsius) {\n\tlet fahrenheit = celsius * (9 / 5) + 32;\n\treturn fahrenheit;\n}", "function convertCtoF(cTemp)\n{\n var fTemp = cTemp * 1.8 + 32;\n return fTemp;\n}", "function CtoF(temp) {\n return (temp * 9/5) + 32;\n}", "function convertToF(celsius) {\n let fahrenheit = celsius * 9/5 + 32;\n return fahrenheit;\n}", "function fahrenheitTocelsius(temp){\n var tempInFahrenheit = temp;\n var tempInCelsius = (tempInFahrenheit - 32) * 5/9;\n return tempInFahrenheit + \"°F is \" + tempInCelsius+ \"°C\";\n }", "function convertFahrenheitToCelsius(temp) {\n return ((temp - 32) * 5) / 9;\n}", "function convertCtoF(celsius) {\n return (celsius * 9/5) + 32;\n}", "function convertToF(celsius) {\n let fahrenheit = ((celsius * (9/5)) + 32);\n return fahrenheit;\n}", "function temp_converter(celsius_value){\n let F = celsius_value + 32/1.8\n console.log(celsius_value+\"C\"+ \" = \"+ F+\"F\")\n}", "function convertToF(celsius) {\n let fahrenheit = celsius * (9 / 5) + 32;\n return fahrenheit;\n}", "function convertCelsius(fahrTemp) {\n return ((5/9) * (fahrTemp - 32)).toFixed(2);\n} // end convertCelsius()", "function convertToF(celsius) { \n \n return( 9*celsius/5 + 32);\n}", "function celsiusToFahrenheit(num){\n return (9/5)*num+32\n}", "function convertToFahrenheit(temp){\n let fahr = temp *9/5 +32;\n console.log(`${temp} degrees in C is ${fahr} degrees in F`);\n}", "function celsiusToFahrenheit(celsius) {\n var ctof = (celsius * 9)/5 + 32;\n console.log(\"\" + celsius + \"°C is \" + ctof + \"°F.\");\n}", "function toCelsius(f){\n\treturn (f-32) * (5/9);\n}", "function fToC(fahrenheit) \n{\n var fTemp = fahrenheit;\n var fToCel = (fTemp - 32) * 5 / 9;\n //var message = fTemp+'\\xB0F is ' + fToCel + '\\xB0C.';\n return fToCel.toFixed(2);\n}", "temp(celsius, fahrenheit)\n\n {\n const cTemp = celsius;\n const cToFahr = cTemp * 9 / 5 + 32;\n console.log(\"Celsius to Fahrenheit:\" + celsius + \"to\" + cToFahr); // (°C × 9/5) + 32 = °F\n const fTemp = fahrenheit;\n const fToCel = (fTemp - 32) * 5 / 9;\n console.log(\"Fahrenheit to Celsius:\" + fahrenheit + \"to\" + celsius);\n\n\n }", "function convertFtoC(fahrenheit) {\n return (fahrenheit - 32) * 5/9\n}", "function convertToCelsius(fahrenheit){\n let temp = (Number(fahrenheit)-32) * 5/9;\n return temp.toFixed(2);\n }", "function convertToF(celsius) {\n let fahrenheit = celsius * (9/5) + 32;\n return fahrenheit;\n }", "function convertFahr (celsiusTemp) {\n return (((9/5) * celsiusTemp) + 32).toFixed(2);\n} // end convertFahr()", "function CTempToF(val)\r\n{\r\n var CeltoFaren = val * 9 / 5 + 32;\r\n return CeltoFaren; \r\n}", "function convertToF(celsius) {\n let fahrenheit = celsius * 9 / 5 + 32;\n return fahrenheit;\n }", "function FtoC(temperature) {\n let celcius = Math.floor(((temperature - 32) * 5) / 9);\n return celcius;\n}", "function toFahrenheit(celcius){\n var fahrenheit = celcius * 1.8 + 32\n console.log(`${celcius} degrees celcius is ${fahrenheit} degrees fahrenheit`)\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n}", "function toCelsius(f) {\n let celsius = ((f-32)/9)*5;\n console.log(celsius);\n}", "convertToF (celTemp) {\n return (celTemp * (9 / 5)) + 32;\n }", "function CtoF(temp){\n return Math.round((temp * 9)/5 +32);\n}", "function convertToF(celsius) {\n\treturn celsius * 9 / 5 + 32;\n}", "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit = (celsius * 9 / 5) + 32\n return `${celsius}°C is ${fahrenheit}°F.`;\n}", "function celsiusToFahrenheit(cDegrees){\n var fahrenheit = (9/5 * cDegrees) + 32\n return fahrenheit\n}", "function celsToFahr(celsTemp) {\n // your code here\n return celsTemp * 9/5 + 32;\n}", "function convertirFAHaCelsius(gradoFah){\n let celsius = (gradoFah - 32) * 5 / 9;\n return celsius;\n}", "function celsiusToFarenheit(c) {\n var farenheit = Math.round((c * 1.8) + 32);\n return (c + \" grados ceslsius son en farenheit \"+ farenheit);\n}", "function tempKtoF(temp){\n//convert Kelvin to Fahrenheit by using this equation (K − 273.15) × 9/5 + 32 = F\nlet fahrenheit = (temp - 273.15) * 9/5 + 32;\n//assigns fahrenheit to go to 2 decimal places\nfahrenheit = fahrenheit.toFixed(2);\n//returns temperature in Fahrenheit\nreturn fahrenheit;\n}", "function toCelcius(fahrenheit) {\n\treturn (fahrenheit - 32) * 5 /9;\n}", "function toCelsius (fahrenheit) {\r\n var convertedTemp = (fahrenheit - 32) * .5556;\r\n return convertedTemp;\r\n}", "function celciusToFahreneit(celcius){\n const temperatureInFahreneit = celcius * (9/5) + 32; // in Fahreneit\n console.log(\"Temperature in Fahreneit:\", temperatureInFahreneit);\n\n}", "function FtoC(temp){\n return Math.round(((temp-32)*5)/9);\n}", "function C2F(c){\r\n if (c == null) { return null; }\r\n else { return (c*9/5+32).toFixed(2); }\r\n}", "function fToC (fahrenheit) {\n return Math.floor((fahrenheit - 32) * 5 / 9);\n}", "function toCelsius(fahrenheit) {\n\treturn (fahrenheit - 32) * 5 / 9;\n}", "celsiusToFehrenheit(celsius){\n var f = (celsius * 9/5)+32;\n return f;\n }", "function celsiusToFahrenheit(cDegrees) \n{\n return Math.round(((9/5) * cDegrees) + 32);\n}", "function celsiusToFahrenheit(celsius){\n let fahrenheit = (celsius * (9/5)) + 32;\n return celsius + \" degrees Celsius is \" + fahrenheit + \" degrees Fahrenheit\";\n}", "function cToF(celsius)\n {\n var cTemp = celsius;\n var cToFahr = cTemp * 9 / 5 + 32;\n var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';//for testing only\n console.log(message);//for testing only\n\n return cToFahr;\n }", "function toCelsius(fahrenheit) {\n\n var c = (5 / 9) * (fahrenheit - 32);\n\n gs.info(c);\n}", "function tempConvert(){\n\nlet celciusTemp = document.querySelector('input').value;\nlet C = parseInt(celciusTemp);\nlet F= (1.8 * C) + 32;\nalert(\"Temperature in Farenheit is \" + (F));\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n }", "function ctoF(degreeCelsius) {\n let degreesFar = degreeCelsius * 1.8 + 32;\n return degreesFar.toFixed(1);\n}", "function fToC(fTemp) {\n return (fTemp - 32) * 5 / 9;\n}", "function fahrenheitToCelsius(fahrenheitTemp) {\n return (fahrenheitTemp - 32) * 5 / 9;\n }", "function FahrenheitToCelsius(fDegree){\n var celsius = (fDegree - 32)*5 / 9;\n console.log(celsius);\n }", "function convertCelsiustoFahrenheit(degreesC) {\n return (degreesC*9/5)+32;\n }", "function convertToCelcius(fahrenheit) {\n return Math.round((fahrenheit - 32) * 5 / 9);\n}", "function celsiusToFahrenheit(fahrenheit){\n\n\tfahrenheit = fahrenheit * 9/5;\n\tfahrenheit = fahrenheit + 32;\n\n\tconsole.log(\"Degrees in fahrenheit: \" +fahrenheit);\n\treturn fahrenheit;\n\n\t}", "function celsiusToFarenheit(f){\n var celsius = 20;\n var celsiusToFarenheit = celsius * 9 / 5 + 32;\n \n var farenheit = 68;\n var farenheiToCelsius = (farenheit - 32) * 5 / 9;\n \n alert(<br/>+' + celsius + '+'º Celsius a Farenheit: ' + celsiusToFarenheit);\n alert('<br/>' + farenheit + 'º Farenheit a Celsius: '+ farenheitToCelsius);\n \n}", "function celsiusToFahrenheit(celsius) {\n\tvar celsfahr = celsius * (9/5) + 32;\n\talert(celsius + \"°C is \" + celsfahr + \"°F\");\n}", "function celciusToFahrenheitAndKelvin(){/*click veya input:Birisi her tikladiginda hello ve hi yazacak konsola*/\n const cTemp = parseFloat(celciusInput.value);/*parseFloat:converts the string into a floating number*/\n const fTemp = (cTemp * (9/5)) + 32;\n const kTemp = cTemp + 273.15;\n fahrenheitInput.value = roundNum(fTemp);/*Konsola yazdirmak yerine ekranda ilgili yere yazdiriyoruz*/ \n kelvinInput.value = roundNum(kTemp);\n}", "function convert (celsius){\n var fahrenheit = ((celsius * 9/5) +32);\n console.log(celsius +\" degrees celsius equates to: \"+fahrenheit + \" \"+ \"fahrenheit\");\n }", "function convertFromFahrenheit(currentFahrenheit) {\n console.log(\"It is currently \" + (currentCelsius = (currentFahrenheit - 32) * (5 / 9)) + \" degrees Celsius.\");\n}", "function toFarenheit(temp) {\r\n const celcius = temp - 273.15\r\n const farenheit = (celcius * 1.8) + 32\r\n return Math.floor(farenheit)\r\n}", "function celciusToFarenheit(celcius) {\n const result = (celcius * 1.8)+32;\n return result;\n}", "function fahrenheitToCelsius(num){\n return (num-32)*5/9\n}", "function F2C(f) {\r\n if (f == null) { return null; }\r\n else { return ((f-32)*5/9).toFixed(2); }\r\n}", "function celsiusToFahrenheit(celsius) {\n if (typeof celsius !== 'number') {\n throw {\n 'name': 'TypeError',\n 'message': 'Function requires ' +\n 'a single number argument'\n };\n }\n return ((celsius * 9) / 5) + 32;\n}", "function farenheitToCelsius(f) {\n var celsius = Math.round((f - 32) / 1.8);\n return (f + \" grados Farenheit son \" + celsius +\" en Celsius\");\n}", "function celcius(fvalue)\n{\n //Kelvin to Celcius\n var cvalue_unrounded = fvalue - 273.15;\n //shows 2 decimal places only\n cvalue = cvalue_unrounded.toFixed(2);\n //Returns results as \"cvalue\" outside of this function\n return cvalue;\n}", "function convertToCelsius(fahrenheit){\n if(typeof(fahrenheit)=='string'||typeof(fahrenheit)=='undefined'||typeof(fahrenheit)=='object'){\n return 'Technical Error!';\n } \n return (5/9) * (fahrenheit-32);\n \n}" ]
[ "0.7840106", "0.78061855", "0.78042555", "0.77826196", "0.7770678", "0.7755724", "0.7750259", "0.77181304", "0.7676519", "0.7673072", "0.7663598", "0.7657139", "0.7649349", "0.7644979", "0.76303184", "0.760765", "0.76003414", "0.7569199", "0.7535723", "0.7534968", "0.7526583", "0.7524302", "0.7518661", "0.7503215", "0.7502558", "0.74834645", "0.7462788", "0.7458715", "0.7440259", "0.7439609", "0.743727", "0.7431488", "0.7419535", "0.7419093", "0.74173504", "0.74161655", "0.738755", "0.7374445", "0.73692155", "0.7353093", "0.7349162", "0.7342029", "0.7335143", "0.7333164", "0.7331471", "0.73233086", "0.7309832", "0.73095167", "0.7288817", "0.72883666", "0.7280756", "0.7278367", "0.72667545", "0.7256093", "0.7253243", "0.7253243", "0.72528315", "0.72513545", "0.7246709", "0.7230771", "0.7229212", "0.7228897", "0.72230846", "0.7214993", "0.7199486", "0.71868074", "0.7178704", "0.71709394", "0.7150422", "0.71370053", "0.71256775", "0.71189827", "0.71174175", "0.7108539", "0.71074885", "0.71037686", "0.7087121", "0.7077058", "0.7054096", "0.7046594", "0.70451725", "0.70336765", "0.7029536", "0.70036846", "0.6997517", "0.6997339", "0.6991782", "0.6989741", "0.6982709", "0.69733983", "0.6972107", "0.69505507", "0.6939892", "0.69287735", "0.69232804", "0.68997115", "0.68948734", "0.6888315", "0.6870909", "0.6855918" ]
0.81132466
0